Message225955
When Python is built from source, the "Modules/" subdirectory is added to sys.path on UNIX. I don't understand why: it does not contain .py files nor .so dynamic modules. Dynamic modules are built in "build/lib.linux-x86_64-3.5-pydebug".
A side effect of adding Modules/ subdirectory to sys.path is that Modules subdirectories (ex: _sqlite, _ctypes, _io, _decimal, etc.) can be used as packages.
For example, when the _decimal module cannot be compiled, Lib/decimal.py uses Modules/_decimal as a Python package which is wrong. The decimal becomes an empty module (no symbol, because Modules/_decimal does not contain an __init__.py nor any .so file) because decimal.py uses "import _decimal" at the end (see decimal.py).
Attached patch removes Modules/ from sys.path on UNIX.
Maybe adding Modules/ to sys.path was useful before the introduction of pybuildir.txt? See issue #9589 and the changeset 4742e7aea2f5 (and the issue #586680). |
|
Date |
User |
Action |
Args |
2014-08-27 10:07:47 | vstinner | set | recipients:
+ vstinner, pitrou |
2014-08-27 10:07:47 | vstinner | set | messageid: <1409134067.89.0.764298356643.issue22285@psf.upfronthosting.co.za> |
2014-08-27 10:07:47 | vstinner | link | issue22285 messages |
2014-08-27 10:07:47 | vstinner | create | |
|