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.

Title: Incorrect detection of module as local
Type: Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: benjamin.peterson, loewis
Priority: normal Keywords:

Created on 2009-01-08 02:26 by loewis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg79395 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-08 02:26
There is an unfortunate interaction of two fixers to be observed in
django. 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
msg79396 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-01-08 03:02
Should we just run the import fixer (fixes stdlib module names) after
the import fixer (fixes sibling imports)?
msg79401 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-01-08 07:17
That should work, yes.
msg79451 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-01-09 02:01
Fixed in r68422.
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 49126
2009-01-09 02:01:20benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg79451
2009-01-08 07:17:00loewissetmessages: + msg79401
2009-01-08 03:02:41benjamin.petersonsetassignee: benjamin.peterson
messages: + msg79396
nosy: + benjamin.peterson
2009-01-08 02:26:52loewiscreate