Skip to content

[BUG] pyarmor 9 + py3.12 bad output TypeError: 'str' object is not callable / protection exception #2064

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

Closed
cjavad opened this issue Feb 16, 2025 · 4 comments
Labels

Comments

@cjavad
Copy link

cjavad commented Feb 16, 2025

I noticed a certain subset of builds were compiling perfectly fine, but produced output that failed when run, this was particular noticeable since it was a file that exported some constant dicts that another file simply imported.

This issue happened exclusively on python 3.12.9 and 3.12.8 (i have not tested any other versions) but not on 3.13 or 3.11 (latest patch releases) all with pyarmor 9.0.7.

I was able to produce a minimal reproducible example by cutting things away while still conversing the issue. Certain modifications to the source file led to other messages such as TypeError: 'bytes' object is not callable instead of str and the general protection exception. But the current state of the repo gives the original str error message which was the file i tracked down. This happened with the most minimal setting --obf-code 1 but not 0, both with Trial, Pro and CI license. The log file attached is performed in a reproducable enviroment (docker python3.12-bookworm) with only pyarmor and the source file.

bad_file.py.txt
pyarmor.debug.log

docker run --rm -it -v "$(pwd):/app" python:3.12-bookworm bash   
pip install pyarmor
cd app
mv bad_file.py.txt bad_file.py
# Works without pyarmor
python bad_file.py
# Pyarmor completes successfully
pyarmor gen bad_file.py
# Fails after pyarmor step
pushd dist/; python bad_file.py; popd

It is expected that the file (which is just a single dictionary) should work fine under pyarmor, and it does except for with python 3.12.

Let me know if any additional information is required. If required i can provide the file (with the exact same issue) that i derived the minimal test file from.

@cjavad cjavad added the bug label Feb 16, 2025
@jondy
Copy link
Contributor

jondy commented Feb 17, 2025

Reproduced, I'll check it.

@jondy
Copy link
Contributor

jondy commented Feb 17, 2025

This bug will be fixed in next release

The pre-release version could be downloaded from
https://pyarmor.dashingsoft.com/downloads/temp/pyarmor-9.0.8.tar.gz

@cjavad
Copy link
Author

cjavad commented Feb 17, 2025

Confirmed fixed with that pre-release.

@jondy
Copy link
Contributor

jondy commented Feb 18, 2025

v9.0.8 is released

@jondy jondy closed this as completed Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants