[New-bugs-announce] [issue8608] fix_import prefixes "." to already relative imports

Torsten Marek report at bugs.python.org
Tue May 4 10:58:07 CEST 2010


New submission from Torsten Marek <shlomme at gmx.net>:

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.

----------
components: 2to3 (2.x to 3.0 conversion tool)
files: fix-no-prefix-relative-import.diff
keywords: patch
messages: 104914
nosy: shlomme
priority: normal
severity: normal
status: open
title: fix_import prefixes "." to already relative imports
type: behavior
Added file: http://bugs.python.org/file17196/fix-no-prefix-relative-import.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8608>
_______________________________________


More information about the New-bugs-announce mailing list