操作系统: Windows 10 python版本: 3.8.5 pyarmor版本: 6.4.2
树:
│ .gitignore
│ main.py
│ README.md
│ requirements.txt
│
├───cogs
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │ somefile.py
│ │
│ └───__pycache__
│ pyc files
│
└───__pycache__
main.cpython-38.pyc我想要混淆我文件夹中的每个python文件。我在VS代码中将编码设置为utf-8,并且在每个python文件的开头添加了# -*- coding: utf-8 -*-。我从main.py运行pyarmor -d obfuscate --recursive main.py,它给我提供了这样的回溯:
Traceback (most recent call last):
File "c:\users\User\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\User\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\User\AppData\Local\Programs\Python\Python38-32\Scripts\pyarmor.exe\__main__.py", line 7, in <module>
File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pyarmor\pyarmor.py", line 1447, in main_entry
main(sys.argv[1:])
File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pyarmor\pyarmor.py", line 1439, in main
args.func(args)
File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pyarmor\pyarmor.py", line 694, in _obfuscate
encrypt_script(prokey, a, b, wrap_mode=args.wrap_mode,
File "c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pyarmor\utils.py", line 933, in encrypt_script
f.write(''.join(lines))
File "c:\users\User\appdata\local\programs\python\python38-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 177-178: character maps to <undefined>在pyarmor文档中,他们给了this可能的修复。我已经这样做了,但错误仍然存在。
发布于 2020-09-29 20:37:03
编辑:我已经通过使用pyarmor webui修复了这个问题
https://stackoverflow.com/questions/64118666
复制相似问题