overflow error when reading file from external drive

80 Views Asked by At

I'm seeing an Overflow Error when trying to read a binary stream from an external SSD:

with open(self.path, "rb") as input_file:
  input_file.seek(offset)
  data = input_file.read(chunk_bytes)

the read method call sporadically results in the following exception:

OSError: [Errno 34] Result too large

The error is supposed to signify the number being too large, but chunk_bytes is only 8 MB, so I can't see how that can be the issue.

A couple of things to note:

  1. if I copy the contents from the external drive onto my local drive, I never run into this error
  2. when reading from external drive, this error happens sometimes but not others, it's indeterministic

What could be causing the issue?

Edit: I'm using Mac OS Monterey, the SSD is formatted with HFS+

0

There are 0 best solutions below