[Python-Dev] Non-stable pyc results on python 3.6

Nick Coghlan ncoghlan at gmail.com
Thu Jul 27 11:08:53 EDT 2017


On 28 Jul 2017 00:54, "Nick Coghlan" <ncoghlan at gmail.com> wrote:

The fact that disorderfs makes a difference does make me a little
suspicious, as there's an early exit from the FLAG_REF setting code
related to objects having exactly one live reference. Courtesy of
string interning and other immutable object caches, order of code
compilation can affect how many live references there are to strings
and other constants, and hence there may be cases where marshal
*won't* flag an immutable object if *only* that particular code object
has been compiled, but *will* flag it if some other code object has
been created first. That check has been there since version 3 of the
marshal format was defined, so if it *is* the culprit, then you'll see
this misbehaviour with 3.4 as well.


It occurs to me that it would likely be easier for you to just test that
theory directly: the check that now seems suspicious to me is the one that
calls "Py_REFCNT" (and is the only reference to that API  in the file), so
if you comment that out, and the problem goes away, it is most likely the
cause of the currently variable behaviour.

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170728/564f5522/attachment.html>


More information about the Python-Dev mailing list