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.

classification
Title: typo in pkgutil.py
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Wrong name in Lib/pkgutil.py:iter_importers
View: 16163
Assigned To: Nosy List: berker.peksag, scoder
Priority: normal Keywords:

Created on 2012-11-03 13:20 by scoder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg174615 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2012-11-03 13:20
My guess is that line 454 in pkgutil.py should pass "pkg_name" into the import_module() function, not "pkg". I get the following error when compiling it with Cython:

Error compiling Cython file:
------------------------------------------------------------
...
        msg = "Relative module name {!r} not supported".format(fullname)
        raise ImportError(msg)
    if '.' in fullname:
        # Get the containing package's __path__
        pkg_name = fullname.rpartition(".")[0]
        pkg = importlib.import_module(pkg)
                                        ^
------------------------------------------------------------
pkgutil.py:454:41: local variable 'pkg' referenced before assignment
msg174625 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2012-11-03 14:14
Duplicate of issue 16163.
History
Date User Action Args
2022-04-11 14:57:38adminsetgithub: 60597
2012-11-03 14:27:01ezio.melottisetstatus: open -> closed
superseder: Wrong name in Lib/pkgutil.py:iter_importers
resolution: duplicate
stage: resolved
2012-11-03 14:14:34berker.peksagsetnosy: + berker.peksag
messages: + msg174625
2012-11-03 13:20:21scodercreate