Message167630
The new importlib shows a regression w.r.t. previous CPython versions. It no longer recognises an "__init__.so" file as a package. All previous CPython versions have always tested first for an extension file before testing for a .py/.pyc file. The new importlib explicitly excludes the ExtensionFileLoader from loading packages. See importlib/_bootstrap.py, line 1579 onwards:
1579 def _get_supported_file_loaders():
1580 """Returns a list of file-based module loaders.
1581
1582 Each item is a tuple (loader, suffixes, allow_packages).
1583 """
1584 extensions = ExtensionFileLoader, _imp.extension_suffixes(), False # <== bug here
1585 source = SourceFileLoader, SOURCE_SUFFIXES, True
1586 bytecode = SourcelessFileLoader, BYTECODE_SUFFIXES, True
1587 return [extensions, source, bytecode]
(BTW, I'm not sure what to file this bug against - "Interpreter Core" or "Library"?) |
|
Date |
User |
Action |
Args |
2012-08-07 18:35:50 | scoder | set | recipients:
+ scoder |
2012-08-07 18:35:50 | scoder | set | messageid: <1344364550.12.0.263881849199.issue15576@psf.upfronthosting.co.za> |
2012-08-07 18:35:49 | scoder | link | issue15576 messages |
2012-08-07 18:35:48 | scoder | create | |
|