[BUG] `RuntimeError: co_info inner error` when obfuscating scripts
hi @jondy , i tried with the following command: pyarmor gen -r C:/Users/Giuseppe/Dropbox/PROGETTI_PYCHARM/FormulariTools/app.py C:/Users/Giuseppe/Dropbox/PROGETTI_PYCHARM/FormulariTools
but the following error is returned in the pyarmor.error.log file:
18088 MainProcess 2023-04-01 11:26:50,522 Traceback (most recent call last): File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 629, in main main_entry(sys.argv[1:]) File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 617, in main_entry args.func(ctx, args) File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 179, in cmd_gen builder.process(options, pack=args.pack) File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli\generate.py", line 153, in process self._obfuscate_scripts() File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli\generate.py", line 118, in obfuscate_scripts code = Pytransform3.generate_obfuscated_script(self.ctx, r) File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli\core_init.py", line 48, in generate_obfuscated_script return m.generate_obfuscated_script(ctx, res) File "
This is some code can't handled by pyarmor v8.
Check the log, it will show last handle script, a quick workaround is ignore this script, do not obfuscate it, only obfuscate all the others, the copy plain script to final output path.
In next version, when this error occurs, pyarmor will report which script and function results in this problem.
thanks for the answer @jondy, how do I set the path of a script to ignore ? and in this case which script is it?
if you explain how to do it I could exclude the venv folder from obfuscation. they are libraries that are found on the net so obfuscating them would only make the code heavier
Upgrade Pyarmor to 8.1.dev2, exclude a script mypkg.name.py like this
pyarmor gen --exclude mypkg.name.py mypkg/
16624 MainProcess 2023-04-03 14:11:22,835
Traceback (most recent call last):
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 627, in main
main_entry(sys.argv[1:])
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 615, in main_entry
args.func(ctx, args)
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli_main_.py", line 179, in cmd_gen
builder.process(options, pack=args.pack)
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli\generate.py", line 145, in process
Pytransform3.pre_build(self.ctx)
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\cli\core_init_.py", line 63, in pre_build
return m.pre_build(ctx)
File "
If it's caused by wrong usage, please read man page to understand each options of pyarmor. https://pyarmor.readthedocs.io/en/latest/reference/man.html#pyarmor-gen
The man page is complete and show how to use all the options
If your report bug, please provide more information. Here is good example, #1068
If it's a bug, I'll fix it.
There is no private support. Pyarmor is a small tool, if you understand all the options, it's easy to use.
you don't provide private support even for a fee?
No. I'm busy on building new platforms, full test and bug fix for Pyarmor 8.
OK thanks anyway. I ask you for one kindness. could you give me a practical example of how to obfuscate multiple scripts at the same time: example pyarmor gen app.py, router.py
This is in the description of command gen in the man page
pyarmor gen foo.py
pyarmor gen src/mypkg
pyarmor gen -r src/mypkg
pyarmor gen -r src/pkg1 src/pkg2 libs/dbpkg
pyarmor gen -r main.py src/*.py libs/utils.py libs/dbpkg
when i try to obfuscate multiple scripts in my flask project i get this error if i try to start the app Process finished with exit code -1073741819 (0xC0000005) if instead I obfuscate a single script it works without problems