Message307353
ImpImporter.find_modules calls os.path.real on the path used:
https://github.com/python/cpython/blob/be6b74c0795b709c7a04e2187a7e32d08f5155f6/Lib/pkgutil.py#L181
This means if there is a submodule (foo.bar) which first appears on the path involving a symlink that
pkgutil.find_loader('foo').get_filename()
has the path with the symlinks removed whereas
import foo
foo.__file__
does have the symlinks. Note that is in the absence of any PEP302 import hooks.
This behaviour comes up in pytest test/plugin collection in virtual environments in Py2.7 on linux where they have a symlinked venv/local/lib before venv/lib on the path and creates problems.
There might very well be a good reason the path is made absolute here, however the test suite passes when it is reverted to path = [self.path]. |
|
Date |
User |
Action |
Args |
2017-12-01 00:10:50 | cryvate | set | recipients:
+ cryvate |
2017-12-01 00:10:50 | cryvate | set | messageid: <1512087050.24.0.213398074469.issue32188@psf.upfronthosting.co.za> |
2017-12-01 00:10:50 | cryvate | link | issue32188 messages |
2017-12-01 00:10:50 | cryvate | create | |
|