Issue 32303: Namespace packages have inconsistent loader and spec.loader (original) (raw)

Let's say I have a namespace package:

importlib_resources.tests.data03.namespace <module 'importlib_resources.tests.data03.namespace' (namespace)>

This package has a non-None loader but a None spec.loader:

importlib_resources.tests.data03.namespace.loader <_frozen_importlib_external._NamespaceLoader object at 0x1043c1588> importlib_resources.tests.data03.namespace.spec.loader

That seems inconsistent and broken. I suspect it's just an oversight that the spec.loader for a namespace package isn't getting set. It's probably been this way forever.

See also Issue31554