s3fs icon indicating copy to clipboard operation
s3fs copied to clipboard

Problems with pickle.load(f) when `f = filesystem.open(path) `

Open matschreiner opened this issue 5 years ago • 0 comments

I can do the following just fine:

with file_system.open("/testing/blob", "rb") as f:
    byte_string = f.read()
    blob = pickle.loads(byte_string)

But if I do

with file_system.open("/testing/blob", "rb") as f:
    blob = pickle.load(f)

I get

Traceback (most recent call last):
  File "/programming/desupervised/mathias-playground/.venv/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3319, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-e3e05a84eaca>", line 2, in <module>
    blob = pickle.load(f)
  File "/programming/desupervised/mathias-playground/.venv/lib/python3.8/site-packages/fs/iotools.py", line 116, in readinto
    return self._f.readinto(b)
  File "/programming/desupervised/mathias-playground/.venv/lib/python3.8/site-packages/fs_s3fs/_s3fs.py", line 154, in readinto
    return self._f.readinto()
TypeError: readinto() takes exactly one argument (0 given)

matschreiner avatar Jan 27 '20 10:01 matschreiner