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] `Can't change error message`

ChangjunDAI opened this issue · comments

I followed the steps in the doc(v.8.5.3) 1.3.8:
mkdir .pyarmor
vim .pyarmor/message.cfg

write new error messages in message.cfg:

[runtime.message]

  error_1 = e1
  error_2 = e2
  error_3 = e3
  error_4 = e4
  error_5 = e5
  error_6 = e6
  error_7 = e7
  error_8 = e8

Then, I tried to obfuscate the script

(software) mac@macdeMacBook-Pro encryption % pyarmor gen -e 2023-12-12 test.py
INFO     Python 3.10.14
INFO     Pyarmor 8.5.3 (group), 1111111, xxx
INFO     Platform darwin.x86_64
INFO     search inputs ...
INFO     find script test.py
INFO     find 1 top resources
INFO     start to generate runtime files
INFO     target platforms {'darwin.x86_64'}
INFO     write dist/xx/xx.so
INFO     generate runtime files OK
INFO     start to obfuscate scripts
INFO     process resource "test"
INFO     obfuscating file test.py
INFO     write dist/test.py
INFO     obfuscate scripts OK

In this case, the error message should be: e1. However, I got the origin error message:

(software) mac@macdeMacBook-Pro encryption % python dist/test.py              
Traceback (most recent call last):
  File "/Users/mac/PycharmProjects/encryption/dist/test.py", line 2, in <module>
    from xxx import __pyarmor__
  File "/Users/mac/PycharmProjects/encryption/dist/HDTech2024/__init__.py", line 2, in <module>
    from .pyarmor_runtime import __pyarmor__
RuntimeError: 脚本许可证已经过期 (1:11086)
commented

在仔细看看文档,缺少语言设置,检查一下环境变了 LANG

和语言设置没关系哦,文档里的示例写错了。
#1830