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.
Created on 2010年03月24日 15:06 by Robert.Kern, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg101636 - (view) | Author: Robert Kern (Robert.Kern) | Date: 2010年03月24日 15:06 | |
When a module inside a package imports StringIO from cStringIO, it should change that to "from io import StringIO". However, if there is a module inside the package named io.py, 2to3 changes it to "from .io import StringIO". [bug23]$ tree . `-- package |-- __init__.py |-- helper.py `-- io.py 1 directory, 3 files [bug23]$ cat package/helper.py from cStringIO import StringIO [bug23]$ 2to3 package RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma --- package/helper.py (original) +++ package/helper.py (refactored) @@ -1,1 +1,1 @@ -from cStringIO import StringIO +from .io import StringIO RefactoringTool: Files that need to be modified: RefactoringTool: package/helper.py |
|||
| msg101653 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2010年03月24日 20:42 | |
This should be fixed in the latest versions of 2to3. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:59 | admin | set | github: 52468 |
| 2010年03月24日 20:42:36 | benjamin.peterson | set | status: open -> closed nosy: + benjamin.peterson messages: + msg101653 resolution: out of date |
| 2010年03月24日 15:06:17 | Robert.Kern | create | |