◐ Shell
clean mode source ↗

Message 287521 - Python tracker

Serhiy Storchaka: "Check that pickling/unpickling the windows object doesn't cause crash or undefined behaviour. Currently the pickling fails because the name of the class is not true name."

Ah, good idea.

I tested with curses_fix_window_class_name.patch: window objects cannot be pickled. Hopefully! IMHO it doesn't make sense to serialize such "live" object.

haypo@selma$ cat > x.py
import curses
w = curses.initscr()
curses.endwin()
print(type(w))
^D

haypo@selma$ ./python -i x.py
<class '_curses.window'>
>>> import pickle
>>> pickle.dumps(w)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't pickle _curses.window objects