[New-bugs-announce] [issue6496] 2to3 generates "from urllib.parse import pathname2url"

Sridhar Ratnakumar report at bugs.python.org
Thu Jul 16 22:59:47 CEST 2009

New submission from Sridhar Ratnakumar <sridharr at activestate.com>:

Both pathname2url and url2pathname are in the urllib.request module, 
but 2to3 thinks they are in urllib.parse module.

sridharr at double:~/tmp/eric1$ cat foo.py 
from urllib import pathname2url, url2pathname

sridharr at double:~/tmp/eric1$ /opt/ActivePython-3.1/bin/2to3 foo.py 
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
--- foo.py (original)
+++ foo.py (refactored)
@@ -1,2 +1,2 @@
-from urllib import pathname2url, url2pathname
+from urllib.parse import pathname2url, url2pathname
RefactoringTool: Files that need to be modified:
RefactoringTool: foo.py
sridharr at double:~/tmp/eric1$

components: 2to3 (2.x to 3.0 conversion tool)
messages: 90585
nosy: srid
severity: normal
status: open
title: 2to3 generates "from urllib.parse import pathname2url"
type: behavior
versions: Python 3.1

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list