You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error is repeated when attempting to unpickle (using dill) an object with a sys.stdout reference. (for example, spawning a process with a reference to a logger.)
>>> import dill
>>> from colorama.ansitowin32 import StreamWrapper
>>> dill.loads(dill.dumps(StreamWrapper(None, None)))
File "C:\...\lib\site-packages\colorama\ansitowin32.py", line 33, in __getattr__
return getattr(self.__wrapped, name)
File "C:\...\lib\site-packages\colorama\ansitowin32.py", line 33, in __getattr__
return getattr(self.__wrapped, name)
File "C:\...\lib\site-packages\colorama\ansitowin32.py", line 33, in __getattr__
return getattr(self.__wrapped, name)
RuntimeError: maximum recursion depth exceeded
It appears simply adding setstate and getstate to StreamWrapper fixes the issue:
def __setstate__(self, state):
self.__dict__ = state
def __getstate__(self):
return self.__dict__
The text was updated successfully, but these errors were encountered:
The following error is repeated when attempting to unpickle (using dill) an object with a sys.stdout reference. (for example, spawning a process with a reference to a logger.)
It appears simply adding setstate and getstate to StreamWrapper fixes the issue:
The text was updated successfully, but these errors were encountered: