-
- Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Labels
Description
Bug report
Bug description:
So I am not entirely sure whether this is unintended behaviour, but it is definitely a noticeable change between 3.11 and 3.12 that is rather unintuitive
import pickle from io import BytesIO, TextIOWrapper class EncodedFile(TextIOWrapper): def __getstate__(self): return "string" def __setstate__(self, state): pass file = EncodedFile(BytesIO(b"string")) pickle.dumps(file)This works in Python 3.11 and 3.10, but fails in 3.12 with
pickle.dumps(file) TypeError: cannot pickle 'EncodedFile' instancesCPython versions tested on:
3.10, 3.11, 3.12
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done