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
It's a somewhat little known feature of contextlib.contextmanager and contextlib.asynccontextmanager that you can use the decorated functions not only as context managers, but also as function decorators:
Thanks for the report, I confirm I can reproduce with master.
The problem is weird because it is raised by the parent class of our pickler which should precisely be the pickle.Pickler class used internally by pickle.dumps...
>>>importio>>>buffer=io.BytesIO()
>>>pickle.Pickler(buffer, protocol=5).dump(f)
# does not raise
It's a somewhat little known feature of
contextlib.contextmanager
andcontextlib.asynccontextmanager
that you can use the decorated functions not only as context managers, but also as function decorators:cloudpickle 2.2.1 fails to serialize functions decorated this way:
The text was updated successfully, but these errors were encountered: