Issue 18477: fix_import (2to3 fixer) is not case-sensitive - Python tracker

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.

classification
process
Status: closed Resolution: wont fix
Dependencies: Superseder: Close 2to3 issues and list them here
View: 45544
Assigned To: Nosy List: Valentin.Lorentz, benjamin.peterson
Priority: normal Keywords: patch

Created on 2013-07-16 21:10 by Valentin.Lorentz, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_case-sensitivity_of_fix-import.patch Valentin.Lorentz, 2013-07-16 21:10 Patch to fix case-sentitivity of fix_import on Windows
Messages (2)
msg193193 - (view) Author: ProgVal (Valentin.Lorentz) Date: 2013-07-16 21:10
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.
msg224357 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-30 22:27
Can we set the stage to patch review please.