[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-12 Thread Wolfgang Richter
Wolfgang Richter added the comment: Ah, sorry Brett! Thanks for spotting this. The import machinery is *really* awesome. -- ___ Python tracker ___ _

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon
Brett Cannon added the comment: I found the problem: you have a bug in your code at line 45 (the first line of WolfPathFinder.find_spec()). When you try and import a top-level package the path will always be None since __path__ doesn't exist for a top-level package. You only end up with a `pat

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Changes by Wolfgang Richter : -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Wolfgang Richter added the comment: Here's the file, before I experimented with find_loader. If you take out all my print's, it's quite short. -- Added file: http://bugs.python.org/file41905/main.py ___ Python tracker

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Wolfgang Richter added the comment: Sure Brett I'll upload the code separately in an hour or two. I've overridden all the publicly exposed functions (including find_spec). I wanted to initially see if anything was passing through my finder in the first position of the meta_path. -- _

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon
Brett Cannon added the comment: As I said, I can't look at your code unless you upload the file separately so I don't know how much help I can be. Did you check sys.modules to make sure the directory had not already been imported or sys.path_importer_cache to make sure the directory didn't alr

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
Wolfgang Richter added the comment: Brett thanks for the very quick response. I've inserted my finder as the first element in sys.meta_path. I also overrode the @classmethod find_loader, but it doesn't appear that it's being called. -- ___ Python t

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Brett Cannon
Brett Cannon added the comment: I'm at work and so I don't have access to tar on this machine ATM, so I can't look at your code example. But sys.meta_path might be one level above what you want; you might be looking for sys.path_hooks since https://docs.python.org/3/library/importlib.html#impo

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +brett.cannon, eric.smith, eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26344] `sys.meta_path` Skipped for Packages with Non-Standard Suffixed `__init__` Files

2016-02-11 Thread Wolfgang Richter
New submission from Wolfgang Richter: My understanding of `sys.meta_path` is that it is supposed to allow customized loading of Python modules and packages. In fact the `importlib` machinery appears to have support for identifying packages with `__init__` files with non-standard suffixes: htt