Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 cannot load object saved with 3.10 #564

Open
ryandgoldenberg opened this issue Mar 31, 2025 · 0 comments
Open

Python 3.11 cannot load object saved with 3.10 #564

ryandgoldenberg opened this issue Mar 31, 2025 · 0 comments

Comments

@ryandgoldenberg
Copy link

Objects that are serialized using Python 3.10 produce an error when attempting to load with Python 3.11

Version: cloudpickle==3.1.1

Steps to reproduce:

Save object using Python 3.10

import cloudpickle
squared = lambda x: x ** 2
with open('squared.pkl', 'wb') as f:
  cloudpickle.dump(squared, f)

Load object using Python 3.11

import cloudpickle
with open('squared.pkl', 'rb') as f:
  squared = cloudpickle.load(f)

...

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: code() argument 13 must be str, not int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant