urllib.error.HTTPError: HTTP Error 401: Unauthorized when setting .pyarmor_config file to advanced_mode: 5
hi, I'm trying to obfuscate my flask app but when in advanced_mode I set a parameter other than 0 I get the following error: urllib.error.HTTPError: HTTP Error 401: Unauthorized I bought the pro license! please help me i have to deliver this software and i can't deliver it without obfuscating the code
Could you provide the full traceback to give more context?
I suggest making a very simple "Hello World" Flask application and trying to obfuscate that. If that works, go through the application you're having problems with and comment out possible culprits.
(venv) PS C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools> pyarmor-7 build INFO PyArmor Version 8.0.21 INFO Python 3.7.0 INFO Build project ... INFO Check project INFO Use capsule: C:\Users\Giuseppe.pyarmor.pyarmor_capsule.zip INFO Output path is: C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\dist INFO Taget platforms: [] INFO Getting remote file: https://pyarmor.dashingsoft.com/files/r52.6/index.json Traceback (most recent call last): File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\lib\site-packages\pyarmor\utils.py", line 1685, in _urlopen return urlopen(*args, **kwargs) File "C:\Python37\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Python37\lib\urllib\request.py", line 531, in open response = meth(req, response) File "C:\Python37\lib\urllib\request.py", line 641, in http_response 'http', request, response, code, msg, hdrs) File "C:\Python37\lib\urllib\request.py", line 569, in error return self._call_chain(*args) File "C:\Python37\lib\urllib\request.py", line 503, in _call_chain result = func(*args) File "C:\Python37\lib\urllib\request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 401: Unauthorized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Giuseppe\Dropbox\PROGETTI_PYCHARM\FormulariTools\venv\Scripts\pyarmor-7.exe_main.py", line 7, in
@ddi98 which platform you used? pyarmor-7 is old pyarmor, the new license could not work with it.
Please check Pyarmor 8 documentation and use command gen to obfuscate the scripts.
I would like to use version 8 but with the documentation found I can only obfuscate a single file.
what are the analogous commands of pyarmor8 to perform these two operations: pyarmor-7 init --entry:app.py pyarmor-7 build Thanks in advance
I kindly await your reply as I explained to you before I have to deliver this program and I can't without obfuscating the code.. but would it be possible to enable the advanced_mode functions on version 7 given that today version 8 is unusable?
if I can do the same things with version 8 all the better, but at least put us in a position to work. Thank you @jondy help me please
I would like to use version 8 but with the documentation found I can only obfuscate a single file.
List all the scripts and packages in the command line, gen command is designed to obfuscate package and list scripts.
For example
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
Also check man page of command gen in Pyarmor documentation 8.0
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 "<maker>", line 719, in generate_obfuscated_script
File "<maker>", line 522, in process
File "<maker>", line 522, in <listcomp>
File "<maker>", line 1812, in handle
File "<maker>", line 1807, in visit
File "<maker>", line 1804, in visit
File "<maker>", line 1771, in patch_co_object
File "<maker>", line 1756, in _check_co_info
RuntimeError: co_info inner error
Please report new issue if it's a new bug.