[New-bugs-announce] [issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

Manuel Jacob report at bugs.python.org
Thu Mar 16 18:35:12 EDT 2017


New submission from Manuel Jacob:

The same applies to pyexpat.model.

It seems like pyexpat is the only builtin module which has submodules (errors, model).

Normally, as I understand it, the module gets imported given a spec and the import machinery ensures that this spec ends up in the __spec__ attribute of the module.  But in this case only pyexpat gets imported by importlib.  The submodules are added when initializing the module.

Also, importlib's BuiltinImporter assumes that a builtin module is never a package.  Is this reasonable in this case?

----------
messages: 289737
nosy: mjacob
priority: normal
severity: normal
status: open
title: pyexpat.errors doesn't have __spec__ and __loader__ set

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29830>
_______________________________________


More information about the New-bugs-announce mailing list