dashingsoft / pyarmor

A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

Home Page:http://pyarmor.dashingsoft.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] TypeError: argument of type 'NoneType' is not iterable

17Reset opened this issue · comments

Source Code

def demo1():
    print('This is a test')

if __name__ == '__main__':
    demo1()
    

Using Commands

D:\Download\pyarmor_test>pyarmor cfg check_debugger=1 check_interp=1
INFO     Python 3.12.4
INFO     Pyarmor 8.5.9 (group), 006040, non-profits
INFO     Platform windows.x86_64
INFO     change option "check_debugger" to new value "1"
INFO     change option "check_interp" to new value "1"

------------------------------------------------------------
Section: builder

Current settings
no option "check_debugger"

Global settings

Local settings
  check_debugger = 1

------------------------------------------------------------
Section: builder

Current settings
no option "check_interp"

Global settings

Local settings
  check_interp = 1

D:\Download\pyarmor_test>pyarmor gen --mix-str --assert-call --assert-import --private --pack onedir test_py.py
INFO     Python 3.12.4
INFO     Pyarmor 8.5.9 (group), 006040, non-profits
INFO     Platform windows.x86_64
INFO     implicitly save obfuscated scripts to ".pyarmor\pack\dist"
INFO     search inputs ...
INFO     find script test_py.py
INFO     find 1 top resources
INFO     call PyInstaller to generate specfile
INFO     call PyInstaller to analysis, it may take several minutes ...
INFO     find extra resources: []
ERROR    argument of type 'NoneType' is not iterable
ERROR    something is wrong
*=============================================================*
*  Please enable debug option `-d` to run it again            *
*    pyarmor -d gen options ...                               *
*                                                             *
*  Then check console log to find more information            *
*                                                             *
*  Please also check                                          *
*    https://pyarmor.readthedocs.io/en/latest/questions.html  *
*  or run `pyarmor man` to find solutions quickly             *
*=============================================================*

pyarmor.error.log

17480 MainProcess 2024-06-17 14:08:02,708
Traceback (most recent call last):
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\__main__.py", line 764, in main
    main_entry(sys.argv[1:])
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\__main__.py", line 752, in main_entry
    return args.func(ctx, args)
           ^^^^^^^^^^^^^^^^^^^^
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\__main__.py", line 240, in cmd_gen
    builder.process(options, packer=packer)
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\generate.py", line 184, in process
    self.ctx.runtime_key = self.generate_runtime_key()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\generate.py", line 95, in generate_runtime_key
    return Pytransform3.generate_runtime_key(self.ctx, outer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\App\Python\Lib\site-packages\pyarmor\cli\core\__init__.py", line 99, in generate_runtime_key
    return m.generate_runtime_key(ctx, outer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<maker>", line 723, in generate_runtime_key
  File "<maker>", line 258, in build
  File "<maker>", line 220, in _pack_runtime_key
  File "<maker>", line 108, in _pack_interp_line
  File "<maker>", line 22, in pyarmor_core_4
  File "D:\App\Python\Lib\ctypes\__init__.py", line 369, in __init__
    if '/' in name or '\\' in name:
       ^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
commented

This should be check_interp=1 problem, it will be fixed in next release.

commented

There is one thing missed, if you set wrong configurtation item interps, it may failed.

So what's the output of pyarmor cfg interps? Make sure it's in right format.

This issue may be caused by incorrect interps configuration

commented

Delete wrong comment