huajun07 / codesketcher

Visualise your code in action!
https://main.d1fr5et3wgts3j.amplifyapp.com/
MIT License
0 stars 0 forks source link

[Bug] Executor: Cloning certain variables causes "cannot pickle" error #66

Closed limanjun99 closed 1 year ago

limanjun99 commented 1 year ago

Bug (Executor)

Currently, we create a copy of all variables at every step, so that we can compare it against future iterations and check if the variable changed. However, some objects cannot be copy.deepcopyed, leading to the error "cannot pickle ___ object" being thrown.

Example code that fails:

import threading
def worker():
    print('Worker thread')
threads = []
for _ in range(5):
    t = threading.Thread(target=worker)
    threads.append(t)
    t.start()
for t in threads:
    t.join()