-
Notifications
You must be signed in to change notification settings - Fork 55
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
readinto() fails #76
Comments
Hi, I can confirm the problem. A minimal example for reproducing this bug would be to run the following in Python 3.8: import pickle
import datetime as dt
from fs_s3fs import S3FS
timestamp = dt.datetime(2020, 11, 20)
filesystem = S3FS(
bucket_name='<your bucket>',
dir_path='<your path>'
)
with filesystem.openbin('timestamp.pkl', 'w') as fp:
pickle.dump(timestamp, fp, protocol=3) # Saves with lower pickle protocol version
with filesystem.openbin('timestamp.pkl', 'r') as fp:
pickle.load(fp) A more natural way for obtaining this bug is that someone pickles a certain object to an s3 bucket using Python 3.7 and then someone else tries to load it using Python 3.8. A stack trace for the error raised by the code above is:
The attribute According to this the solution of the bug seems to be passing the parameter
This solves the problem for the above example. @willmcgugan could this be fixed? Let us know if you need any help. |
Yes, definitely a mistake. Happy to accept a PR. |
@willmcgugan Any chance this could be merged and a new version released? |
Hi,
It looks like the buffer argument that's passed in isn't being passed into the underlying
readinto()
call. This causes aTypeError
when Python tries to invoke the function:s3fs/fs_s3fs/_s3fs.py
Line 154 in 7f95af6
(this gets exposed when you're using Pickle protocol 5, and right now it fails)
Thanks!
The text was updated successfully, but these errors were encountered: