Hmm, gross.

I can see exactly where in PyInstaller’s code this error is being raised. 
Here 
<https://github.com/pyinstaller/pyinstaller/blob/59883973838a09c9a55eceb2c4ba466d90786bd4/bootloader/src/pyi_python.c#L35>
 
it tries to locate this Py_DontWriteBytecodeFlag configuration variable, 
and following through to the definition of the DECLVAR() macro here 
<https://github.com/pyinstaller/pyinstaller/blob/59883973838a09c9a55eceb2c4ba466d90786bd4/bootloader/src/pyi_python.h#L206-L213>
 
you can see the error being raised. I notice the docs for the flag 
<https://docs.python.org/3.8/c-api/init.html#c.Py_DontWriteBytecodeFlag> 
disappears if you rewind back to Python 3.6 but that flag must still be 
there or everyone would be experiencing issues with Python 3.6. And I can 
confirm that it’s still present in my python36.dll using:

import ctypes
print(ctypes.POINTER(ctypes.c_int).from_address(ctypes.addressof(ctypes.pythonapi.Py_DontWriteBytecodeFlag)).contents)

which would raise an AttributeError if it didn’t exist (otherwise prints 1 
if running Python with the -B option). 

What I really don’t understand is why only this one user is seeing it. The 
only thing I can think of is said user has another incompatible copy of 
python36.dll in PATH which is being read instead. Could you ask them to run 
where 
python* in the command prompt and tell you if there’s anything else there? 
Could you also build a simple print("hello") app in --onedir mode using 
your environment and upload it somewhere I can inspect it?

Brénainn

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/47fe2a63-5408-44df-b47f-94beed3bb2c1n%40googlegroups.com.

Reply via email to