Issue 8608: fix_import prefixes "." to already relative imports (original) (raw)

Created on 2010-05-04 08:58 by shlomme, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix-no-prefix-relative-import.diff shlomme,2010-05-04 08:58 Patch for bug
fix-no-prefix-relative-import.bundle shlomme,2010-05-04 09:01 HG bundle with revision
Messages (4)
msg104914 - (view) Author: Torsten Marek (shlomme) Date: 2010-05-04 08:58
The fixer for absolute -> relative imports prefixes "." to already relative imports, i.e. from . import something will be converted into from .. import something if something.py exists. This of course will raise an exception on import or introduce subtle bugs if something exists in .. I've attached a patch against 2to3 head which addresses this problem.
msg104915 - (view) Author: Torsten Marek (shlomme) Date: 2010-05-04 09:00
This file contains the same patch, but as a mercurial revision bundle.
msg104916 - (view) Author: Torsten Marek (shlomme) Date: 2010-05-04 09:01
Forgot the file name last time.
msg104926 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-05-04 12:12
Thanks, but this is a duplicate of issue 8553, which has already been fixed.
History
Date User Action Args
2022-04-11 14:57:00 admin set github: 52854
2010-05-04 12:12:49 r.david.murray set status: open -> closedsuperseder: 2to3 breaks relative importsnosy: + r.david.murraymessages: + resolution: duplicatestage: resolved
2010-05-04 09:01:47 shlomme set files: + fix-no-prefix-relative-import.bundlemessages: +
2010-05-04 09:00:16 shlomme set messages: +
2010-05-04 08:58:05 shlomme create