Using python 3.3, if I try to run __main__ I see this error: Traceback (most recent call last): File "/usr/local/lib/python3.3/runpy.py", line 140, in _run_module_as_main mod_name, loader, code, fname = _get_module_details(mod_name) File "/usr/local/lib/python3.3/runpy.py", line 105, in _get_module_details if loader.is_package(mod_name): AttributeError: 'NamespaceLoader' object has no attribute 'is_package' My directory structure is: > tree . . ├── README.md ├── src │ └── simplessl │ ├── ca.py │ ├── __main__.py │ ├── req.py │ └── utils.py └── ssl.iml i assume this is related to http://bugs.python.org/issue18058 but don't understand why this is not a bugfix that can be back-ported. this appears to be a bug to me...
The solution from issue #18058 can't be backported because it would expose a new public API on the NamespaceLoader class. It would also introduce new functionality which would differ between Python 3.3.2 and Python 3.3.3 which can't really be classified as a bugfix since it's new functionality that didn't exist previously. You're also not losing any abilities by not having this in Python 3.3. All it means is that the status quo holds compared to Python 3.2 in that normal packages are the only way to execute a package with __main__ defined, while Python 3.4 gains the ability to also support namespace packages. Because of all of these points, I'm closing this issue as rejected (sorry; I know it would be handy to have but I just can't justify it).
in case anyone else ends up here through google... the problem described here is not related to the linked issue. it was just a missing `__init__.py` in the module (plus sucky error messages). the following works fine: . ├── README.md ├── src │ └── simplessl │ ├── ca.py │ ├── __init__.py │ ├── __main__.py │ ├── req.py │ └── utils.py └── ssl.iml