You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a bug while trying to stream a fairly large line of data from a gzipped S3 file. Basically:
if len(self.unused_buffer) > size:
return self.read_from_buffer()
is an incorrect call of read_from_buffer, which needs to have the argument size. I think the correct fix is as simple as:
if len(self.unused_buffer) > size:
return self.read_from_buffer(size)
This seems to work in my particular case. Not 100% sure this is the generally correct solution, which if why I'm posting this issue rather than making a PR.
The text was updated successfully, but these errors were encountered:
@jfoster17 I can see that the problem is that the statement returns the full contents of the buffer, meaning the read function could theoretically return more bytes than requested. Your proposed solution seems reasonable, but could you be a bit more specific: how did the bug manifest itself in your case? Was it an exception of some sort?
The reason I ask is that I'm trying to reproduce the problem in a unit test, and haven't been able to trigger the problem condition so far.
I ran into a bug while trying to stream a fairly large line of data from a gzipped S3 file. Basically:
is an incorrect call of
read_from_buffer
, which needs to have the argumentsize
. I think the correct fix is as simple as:This seems to work in my particular case. Not 100% sure this is the generally correct solution, which if why I'm posting this issue rather than making a PR.
The text was updated successfully, but these errors were encountered: