Hey Brénainn,

Thanks for looking into this issue. I tried replying earlier but it hasn't 
showed up for some reason so I'm re-answering.

I had followed that same path into the flag variable and the macro that 
raises the error but didn't get past that.

I'll try asking the user to run that command to check for an incompatible 
copy of the dll. They also mentioned that the same executable worked on 
their computer but failed on the more restrictive windows environment they 
would be using for production.

Here's a link to the simple app built in `--onedir` mode to just print 
hello: 
https://drive.google.com/file/d/1523gS8W7bJIqApzAXk_4W9gRevwbfZs9/view?usp=sharing

Regards,

Ryan

On Thursday, November 5, 2020 at 7:12:33 AM UTC-8 bwoodsend wrote:

> 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/61130707-55f0-4a55-9fa8-87ac09f0af49n%40googlegroups.com.

Reply via email to