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
Title: fix_import (2to3 fixer) is not case-sensitive
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool), Windows Versions: Python 3.4, Python 3.5
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.
History
Date User Action Args
2022-04-11 14:57:48adminsetgithub: 62677
2021-10-20 22:59:08iritkatrielsetstatus: open -> closed
superseder: Close 2to3 issues and list them here
resolution: wont fix
stage: test needed -> resolved
2019-04-26 20:16:15BreamoreBoysetnosy: - BreamoreBoy
2014-07-30 22:33:11ezio.melottisetstage: test needed
2014-07-30 22:27:11BreamoreBoysetnosy: + BreamoreBoy

messages: + msg224357
versions: + Python 3.4, Python 3.5, - Python 3.3
2013-07-16 21:12:09vstinnersetnosy: + benjamin.peterson
2013-07-16 21:10:50Valentin.Lorentzcreate