Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_import (2to3 fixer) is not case-sensitive #62677

Closed
progval mannequin opened this issue Jul 16, 2013 · 2 comments
Closed

fix_import (2to3 fixer) is not case-sensitive #62677

progval mannequin opened this issue Jul 16, 2013 · 2 comments
Labels
OS-windows topic-2to3 type-bug An unexpected behavior, bug, or error

Comments

@progval
Copy link
Mannequin

progval mannequin commented Jul 16, 2013

BPO 18477
Nosy @benjaminp, @progval
Superseder
  • bpo-45544: Close 2to3 issues and list them here
  • Files
  • fix_case-sensitivity_of_fix-import.patch: Patch to fix case-sentitivity of fix_import on Windows
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-10-20.22:59:08.762>
    created_at = <Date 2013-07-16.21:10:50.155>
    labels = ['type-bug', 'expert-2to3', 'OS-windows']
    title = 'fix_import (2to3 fixer) is not case-sensitive'
    updated_at = <Date 2021-10-20.22:59:08.762>
    user = 'https://github.com/ProgVal'

    bugs.python.org fields:

    activity = <Date 2021-10-20.22:59:08.762>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-20.22:59:08.762>
    closer = 'iritkatriel'
    components = ['Windows', '2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2013-07-16.21:10:50.155>
    creator = 'Valentin.Lorentz'
    dependencies = []
    files = ['30942']
    hgrepos = []
    issue_num = 18477
    keywords = ['patch']
    message_count = 2.0
    messages = ['193193', '224357']
    nosy_count = 2.0
    nosy_names = ['benjamin.peterson', 'Valentin.Lorentz']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = '45544'
    type = 'behavior'
    url = 'https://bugs.python.org/issue18477'
    versions = ['Python 3.4', 'Python 3.5']

    @progval
    Copy link
    Mannequin Author

    progval mannequin commented Jul 16, 2013

    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.

    @progval progval mannequin added OS-windows topic-2to3 type-bug An unexpected behavior, bug, or error labels Jul 16, 2013
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 30, 2014

    Can we set the stage to patch review please.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows topic-2to3 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant