[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2022-01-07 Thread Petr Viktorin
Petr Viktorin added the comment: Here's a patch, but testing it would require putting a file in the root directory. I don't dare do that from the test suite. Is one-time manual testing OK here? -- ___ Python tracker

[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2022-01-07 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch nosy: +petr.viktorin nosy_count: 2.0 -> 3.0 pull_requests: +28660 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30456 ___ Python tracker

[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2019-11-07 Thread STINNER Victor
STINNER Victor added the comment: The bug occurs on this line: if sys.pycache_prefix is not None: if not _path_isabs(head): head = _path_join(_os.getcwd(), head) if head[1] == ':' and head[0] not in path_separators: # < HERE head = head[2:]

[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2019-11-07 Thread Ned Batchelder
New submission from Ned Batchelder : On the manylinux docker images, the current directory is "/". If I create a file there and try to import it with PYTHONPYCACHEPREFIX set, I get a stack trace: $ docker run -it --init --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 bash [root@29d75403d7d1