Author nedbat
Recipients nedbat
Date 2019-11-07.12:06:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573128363.33.0.885325437125.issue38735@roundup.psfhosted.org>
In-reply-to
Content
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
[29d75403d7d1">root@29d75403d7d1 /]# cat > foo.py
a = 1
[29d75403d7d1">root@29d75403d7d1 /]# /opt/python/cp38-cp38/bin/python
Python 3.8.0 (default, Oct 30 2019, 22:13:22)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
>>> foo.a
1
>>>
[29d75403d7d1">root@29d75403d7d1 /]# PYTHONPYCACHEPREFIX=/opt/pyc /opt/python/cp38-cp38/bin/python
Python 3.8.0 (default, Oct 30 2019, 22:13:22)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 562, in module_from_spec
  File "<frozen importlib._bootstrap>", line 541, in _init_module_attrs
  File "<frozen importlib._bootstrap>", line 382, in cached
  File "<frozen importlib._bootstrap_external>", line 427, in _get_cached
  File "<frozen importlib._bootstrap_external>", line 352, in cache_from_source
IndexError: string index out of range
>>>
History
Date User Action Args
2019-11-07 12:06:03nedbatsetrecipients: + nedbat
2019-11-07 12:06:03nedbatsetmessageid: <1573128363.33.0.885325437125.issue38735@roundup.psfhosted.org>
2019-11-07 12:06:03nedbatlinkissue38735 messages
2019-11-07 12:06:02nedbatcreate