[New-bugs-announce] [issue18477] fix_import (2to3 fixer) is not case-sensitive

ProgVal report at bugs.python.org
Tue Jul 16 23:10:50 CEST 2013


New submission from ProgVal:

In a project, I have a package with a module named Socket.py, and the __init__.py imports the "socket" module (from the standard Python lib).
However, when fix_import went over it _on Windows_, it converted "import socket" to "from . import Socket".
I also had this issue from a package containing a subpackage named "Math", and a __init__.py importing "math" (from the standard Python lib).

This issue is caused by using os.path.exists(), which is case-insensitive on Windows. However, PEP 235 says imports are case-sensitive.

I'm including a patch I have wrote for this.

----------
components: 2to3 (2.x to 3.x conversion tool), Windows
files: fix_case-sensitivity_of_fix-import.patch
keywords: patch
messages: 193193
nosy: Valentin.Lorentz
priority: normal
severity: normal
status: open
title: fix_import (2to3 fixer) is not case-sensitive
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file30942/fix_case-sensitivity_of_fix-import.patch

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


More information about the New-bugs-announce mailing list