You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pydoc for namespace packages indicates FILE as built-in #68441
All's in the title: the output of "pydoc foo" where foo is a namespace package (... e.g. any directory in the cwd) says that the package is defined as a builtin (under the FILE entry) -- which is certainly incorrect.
A directory with no __init__.py imports as a namespace package (PEP 420), which has no __file__.
pydoc then hits its TypeError fallback and prints "(built-in)".
The 3.9–3.11 labels can be dropped (no bug fixes there now).
I'm happy to open a PR.
Activity
anntzer commentedon May 21, 2015
All's in the title: the output of "pydoc foo" where foo is a namespace package (... e.g. any directory in the cwd) says that the package is defined as a builtin (under the FILE entry) -- which is certainly incorrect.
iritkatriel commentedon Dec 7, 2021
Reproduce on 3.11.
vasiliyk commentedon Oct 24, 2026
This still reproduces on 3.16.0a1+dev.
A directory with no
__init__.pyimports as a namespace package (PEP 420), which has no__file__.pydoc then hits its
TypeErrorfallback and prints "(built-in)".The 3.9–3.11 labels can be dropped (no bug fixes there now).
I'm happy to open a PR.
pythongh-68441: Distinguish virtual packages from namespace packages