This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ysj.ray
Recipients benjamin.peterson, dmalcolm, eric.araujo, ysj.ray
Date 2010-07-28.11:14:23
SpamBayes Score 0.0395826
Marked as misclassified No
Message-id <1280315665.86.0.597776535006.issue9386@psf.upfronthosting.co.za>
In-reply-to
Content
I guess it's the problem with lib2to3/fixes/fix_urllib.py. Indentation is not taken into consideration when fix "import". Fix it with indentation taken into consideration maybe a little complex, but here is a simple and ugly fix: when one import statement was transformed to two or more statement, use semicolon(';') instead of '\n' as separator, between many import statements. In this case, the 
"""
def fun():
    from urllib import urlopen, urlencode
"""

is transformed in to:

"""
def fun():
    from urllib.request import urlopen;from urllib.parse import urlencode
"""

It will takes time to work out a better fix.
History
Date User Action Args
2010-07-28 11:14:26ysj.raysetrecipients: + ysj.ray, benjamin.peterson, eric.araujo, dmalcolm
2010-07-28 11:14:25ysj.raysetmessageid: <1280315665.86.0.597776535006.issue9386@psf.upfronthosting.co.za>
2010-07-28 11:14:23ysj.raylinkissue9386 messages
2010-07-28 11:14:23ysj.raycreate