Issue 4876: Incorrect detection of module as local (original) (raw)

Issue4876

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/49126

classification

Title: Incorrect detection of module as local
Type: Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions:

process

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. 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?
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.
History
Date User Action Args
2022-04-11 14:56:43 admin set github: 49126
2009-01-09 02:01:20 benjamin.peterson set status: open -> closedresolution: fixedmessages: +
2009-01-08 07:17:00 loewis set messages: +
2009-01-08 03:02:41 benjamin.peterson set assignee: benjamin.petersonmessages: + nosy: + benjamin.peterson
2009-01-08 02:26:52 loewis create

Supported by The Python Software Foundation,
Powered by Roundup

Copyright © 1990-2022, Python Software Foundation
Legal Statements