pycdc icon indicating copy to clipboard operation
pycdc copied to clipboard

Not supported non ascii character?

Open suifengpiaoyang opened this issue 1 year ago • 2 comments

If the .py file has some non ascii characters, the pycdc can not decompile successfully.

Windows 10 python 3.10.11

Code(just for example):

# hello.py. This line not included in hello.py

import os

try:
    print('Hello World!')
except:
    pass

print('任务结束!')
os.system('pause')

Run:

$ python -m py_compile hello.py
$ cd __pycache__
$ pycdc.exe hello.cpython-310.pyc

Result:

# Source Generated with Decompyle++
# File: hello.cpython-310.pyc (Python 3.10)

Warning: block stack is not empty!
import os

try:
    print('Hello World!')
finally:
    pass
print('浠诲姟缁撴潫锛?

Am I the only one experiencing this issue?

suifengpiaoyang avatar Jun 25 '23 14:06 suifengpiaoyang

Yes, u r the only one.

JennrCheng avatar Jul 20 '23 11:07 JennrCheng

@suifengpiaoyang in Python 3.12 there is another issue on your sample above: but сhinese characters are just great

# File: china1.cpython-312.pyc (Python 3.12)

import os
print('Hello World!')
print('任务结束!')
os.system('pause')
return None
continue

greenozon avatar Dec 09 '23 10:12 greenozon