[New-bugs-announce] [issue4664] import urlparse, cStringIO breaks

Lennart Regebro report at bugs.python.org
Sun Dec 14 20:07:21 CET 2008

New submission from Lennart Regebro <regebro at gmail.com>:

If you have urlparse before cStringIO in an import line, 2to3 will not
convert the cStringIO to io. However, reverse the order, and urlparse
will not get translated.

So this file:
import urlparse, cStringIO
import cStringIO, urlparse

will with 2to3 return the following diff:

--- test3.py (original)
+++ test3.py (refactored)
@@ -1,3 +1,3 @@
-import urlparse, cStringIO
-import cStringIO, urlparse
+import urllib.parse, cStringIO
+import io, urlparse

components: 2to3 (2.x to 3.0 conversion tool)
messages: 77815
nosy: lregebro
severity: normal
status: open
title: import urlparse, cStringIO breaks
type: behavior
versions: Python 3.0

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list