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
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=Noneclosed_at=Nonecreated_at=<Date2016-03-17.18:20:00.045>labels= ['type-bug', 'library']
title='pyclbr module needs to be more flexible on loader support'updated_at=<Date2020-11-05.00:38:28.143>user='https://github.com/ericsnowcurrently'
The pyclbr module is showing its age (born 1995). It assumes there are only 2 module types (builtin and source-based), particularly in readmodule() and readmodule_ex(). Really it should be source-based and "everything else".
For instance, it does not handle namespace packages correctly, since the spec.loader is set to None there. It also doesn't handle frozen modules (e.g. "./python Lib/pyclbr.py _frozen_importlib"). This is likewise a problem for other/custom loaders that don't match the expectations of pyclbr.
Here are some things that should be done:
replace custom introspection code with newer tools like importlib.util.module_from_spec()
special-case namespace modules (since their spec.loader is None); this is probably a moot point if module_from_spec() gets used
ignore more than just builtins; explicitly check for importlib.abc.SourceLoader?
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: