Skip to content

Incorrect detection of module as local #49126

Closed

Description

@loewis
mannequin
BPO 4876
Nosy @loewis, @benjaminp

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 = 'https://github.com/benjaminp'
closed_at = <Date 2009-01-09.02:01:20.723>
created_at = <Date 2009-01-08.02:26:51.986>
labels = ['expert-2to3']
title = 'Incorrect detection of module as local'
updated_at = <Date 2009-01-09.02:01:20.710>
user = 'https://github.com/loewis'

bugs.python.org fields:

activity = <Date 2009-01-09.02:01:20.710>
actor = 'benjamin.peterson'
assignee = 'benjamin.peterson'
closed = True
closed_date = <Date 2009-01-09.02:01:20.723>
closer = 'benjamin.peterson'
components = ['2to3 (2.x to 3.x conversion tool)']
creation = <Date 2009-01-08.02:26:51.986>
creator = 'loewis'
dependencies = []
files = []
hgrepos = []
issue_num = 4876
keywords = []
message_count = 4.0
messages = ['79395', '79396', '79401', '79451']
nosy_count = 2.0
nosy_names = ['loewis', 'benjamin.peterson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4876'
versions = []

Activity

  1. loewis commented on Jan 8, 2009

    loewismannequin
    MannequinAuthor

    There is an unfortunate interaction of two fixers to be observed in
    django. django.util.text.py contains

    from htmlentitydefs import name2codepoint

    This gets fixed to

    from .html.entities import name2codepoint

    because there is also a local module django.util.html. This is
    incorrect; it should have converted it to

    from html.entities import name2codepoint

    As a workaround, I now run

       name2codepoint = __import__('html.entities').entities.name2codepoint

    on ImportError of the (converted) import statement. Is there a better
    work-around?

  2. benjaminp commented on Jan 8, 2009

    @benjaminp
    Contributor

    Should we just run the import fixer (fixes stdlib module names) after
    the import fixer (fixes sibling imports)?

  3. self-assigned this
    on Jan 8, 2009
  4. loewis commented on Jan 8, 2009

    loewismannequin
    MannequinAuthor

    That should work, yes.

  5. benjaminp commented on Jan 9, 2009

    @benjaminp
    Contributor

    Fixed in r68422.

  6. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions