New submission from Paul Moore <p.f.mo...@gmail.com>:

I am trying to write a meta path finder that "redirects" module loads to a 
different part of the filesystem. There's not much information in the importlib 
documentation, but PEP 451 says "find_spec() must return a spec with "loader" 
set to None (a.k.a. not set) and with submodule_search_locations set to the 
same portions as would have been provided by find_loader()".

I have done that, and it does work as long as all parts of the namespace 
package are handled by the *same* metapath loader. But if I have (for instance) 
one portion of the namespace package handled by my finder, and want to leave 
the filesystem finder to handle other parts, that doesn't work.

Is there a supported way to set up a finder on sys.meta_path which will expose 
just one "portion" of a namespace package?

----------
assignee: brett.cannon
components: Documentation
messages: 389997
nosy: brett.cannon, paul.moore
priority: normal
severity: normal
status: open
title: Importlib documentation does not cover how meta path finders should 
handle namespace packages
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43697>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to