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

Incorrect detection of module as local #49126

Closed
loewis mannequin opened this issue Jan 8, 2009 · 4 comments
Closed

Incorrect detection of module as local #49126

loewis mannequin opened this issue Jan 8, 2009 · 4 comments
Assignees

Comments

@loewis
Copy link
Mannequin

loewis mannequin commented Jan 8, 2009

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 = []

@loewis
Copy link
Mannequin Author

loewis mannequin commented Jan 8, 2009

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?

@loewis loewis mannequin added the topic-2to3 label Jan 8, 2009
@benjaminp
Copy link
Contributor

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

@benjaminp benjaminp self-assigned this Jan 8, 2009
@loewis
Copy link
Mannequin Author

loewis mannequin commented Jan 8, 2009

That should work, yes.

@benjaminp
Copy link
Contributor

Fixed in r68422.

@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
Projects
None yet
Development

No branches or pull requests

1 participant