Falldog / pyconcrete

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

pyconcrete and multiprocessing #53

Open deatinor opened 5 years ago

deatinor commented 5 years ago

Hello,

I am trying to use pyconcrete to encrypt a python code using multiprocessing. This is the code:

from math import sqrt
from joblib import Parallel, delayed
Parallel(n_jobs=2)(delayed(sqrt)(i ** 2) for i in range(10))

The compilation works fine, but at execution time the program crashes with the following message:

Exception ignored in: <module 'threading' from '/Users/stefanosavare/anaconda3/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/Users/stefanosavare/anaconda3/lib/python3.6/threading.py", line 1289, in _shutdown
    assert tlock.locked()
SystemError: <built-in method locked of _thread.lock object at 0x1051e83c8> returned a result with an error set

Is there a way to fix it?

Thank you a lot!

Falldog commented 5 years ago

Hi,

It seems happened when the script use threading https://stackoverflow.com/questions/27844676/assertionerror-3-x-only-when-calling-py-finalize-with-threads

Because pyconcrete doesn't initialize threading in CPython, but joblib did Need sometime to investigate how to deal with it

NachoJuanDev commented 5 years ago

Hi!,

I had the same error using PyQt5 with some QtWidgets

Exception ignored in: <module 'threading' from '/usr/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 1289, in _shutdown
    assert tlock.locked()
SystemError: <built-in method locked of _thread.lock object at 0x7f0442904f58> returned a result with an error set

Had you something progress with this? it would be fantastic.

Thank you a lot!

MyraBaba commented 4 years ago

@Falldog

is this problem solved ?

Falldog commented 2 years ago

threading error should be same with #71