Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyInstaller versions prior to 3.2 do not pre-compile ARCHIVE_ITEM_PYSOURCE #45

Open
ncaklovic opened this issue May 11, 2022 · 1 comment

Comments

@ncaklovic
Copy link

Under the same typeCmprsData ('s') PyInstaller versions prior to 3.2 store Python source files (see issue 1847). They shouldn't be prefixed with pyc header.

I didn't (yet) find any way to detect if 's' file is compiled or not (PyInstaller version is unknown from file) - other than reading the first byte to check if it is marshalled code object ('c').

@ncaklovic ncaklovic changed the title PyInstaller version prior to 3.2 do not pre-compile ARCHIVE_ITEM_PYSOURCE PyInstaller versions prior to 3.2 do not pre-compile ARCHIVE_ITEM_PYSOURCE May 11, 2022
@extremecoders-re
Copy link
Owner

extremecoders-re commented May 11, 2022

That's correct. Old versions of pyinstaller store the code as-is. As there doesn't seem to have a definite way to find the exact version of PyInstaller, one workaround can be to use some heuristics to differentiate between text vs binary data and save as a .pyc or .py accordingly.

Also pyinstaller 3.2 was released back in 2016. Maybe we can keep the current code and save as .pyc with a warning when finding files of type ARCHIVE_ITEM_PYSOURCE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants