Message362767
Easiest to demonstrate as such:
```shell
#!/bin/bash
mkdir bug
touch bug/__init__.py
mkdir bug/foo
touch bug/foo/__init__.py
touch bug/foo/bar.py
python3 -m compileall -d "<prefix>" bug
python2 -m compileall -d "<prefix>" bug
echo "prefix embedded in PY3 pyc code object for lib.foo.bar:"
strings bug/foo/__pycache__/bar.cpython-3*.pyc | grep prefix
echo "prefix embedded in PY2 pyc code object for lib.foo.bar:"
strings bug/foo/bar.pyc | grep prefix
```
Run that script and you'll see:
Listing 'bug'...
Compiling 'bug/__init__.py'...
Listing 'bug/foo'...
Compiling 'bug/foo/__init__.py'...
Compiling 'bug/foo/bar.py'...
Listing bug ...
Compiling bug/__init__.py ...
Listing bug/__pycache__ ...
Listing bug/foo ...
Compiling bug/foo/__init__.py ...
Listing bug/foo/__pycache__ ...
Compiling bug/foo/bar.py ...
prefix embedded in PY3 pyc code object for lib.foo.bar:
<prefix>/bar.py
prefix embedded in PY2 pyc code object for lib.foo.bar:
<prefix>/foo/bar.pyt
Notice that the Python 3 pyc file contains a code.co_filename of "<prefix>/bar.py" instead of the correct value (that Python 2 inserts) of "<prefix>/foo/bar.py". |
|
Date |
User |
Action |
Args |
2020-02-27 05:18:06 | gregory.p.smith | set | recipients:
+ gregory.p.smith |
2020-02-27 05:18:05 | gregory.p.smith | set | messageid: <1582780685.98.0.127631905646.issue39769@roundup.psfhosted.org> |
2020-02-27 05:18:05 | gregory.p.smith | link | issue39769 messages |
2020-02-27 05:18:05 | gregory.p.smith | create | |
|