Author gregory.p.smith
Recipients gregory.p.smith
Date 2020-02-27.05:18:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Easiest to demonstrate as such:


mkdir bug
touch bug/
mkdir bug/foo
touch bug/foo/
touch bug/foo/

python3 -m compileall -d "<prefix>" bug
python2 -m compileall -d "<prefix>" bug

echo "prefix embedded in PY3 pyc code object for"
strings bug/foo/__pycache__/bar.cpython-3*.pyc | grep prefix
echo "prefix embedded in PY2 pyc code object for"
strings bug/foo/bar.pyc | grep prefix

Run that script and you'll see:
Listing 'bug'...
Compiling 'bug/'...
Listing 'bug/foo'...
Compiling 'bug/foo/'...
Compiling 'bug/foo/'...
Listing bug ...
Compiling bug/ ...
Listing bug/__pycache__ ...
Listing bug/foo ...
Compiling bug/foo/ ...
Listing bug/foo/__pycache__ ...
Compiling bug/foo/ ...
prefix embedded in PY3 pyc code object for
prefix embedded in PY2 pyc code object for

Notice that the Python 3 pyc file contains a code.co_filename of "<prefix>/" instead of the correct value (that Python 2 inserts) of "<prefix>/foo/".
Date User Action Args
2020-02-27 05:18:06gregory.p.smithsetrecipients: + gregory.p.smith
2020-02-27 05:18:05gregory.p.smithsetmessageid: <>
2020-02-27 05:18:05gregory.p.smithlinkissue39769 messages
2020-02-27 05:18:05gregory.p.smithcreate