Falldog / pyconcrete

Protect your python script, encrypt it as .pye and decrypt when import it
Apache License 2.0
702 stars 150 forks source link

Python 3.7 support #41

Closed pohmelie closed 6 years ago

pohmelie commented 6 years ago

It looks like pyconcrete do not support python 3.7, which is newest stable version of cpython. foo.py:

print("hello")
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/env/lib/python3.7/site-packages/pyconcrete/__init__.py", line 76, in load_module
    code = marshal.loads(data[magic:])
ValueError: bad marshal data (unknown type code)
Falldog commented 6 years ago

It seems python3.7 change .pyc header format, add new WORD hash value. I had modified in pyconcrete, but there is another issue on compile cflags by gcc, I need more time to figure it out.

Falldog commented 6 years ago

@pohmelie please reference README https://github.com/Falldog/pyconcrete#python-37---fix-build-error if you want to build pyconcrete on Linux

pohmelie commented 6 years ago

Awesome! :+1: