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
SeekableBufferedInputBase.read(0) returns data #171
Comments
CC: @mpenkov |
A quick workaround is to subclass from smart_open.s3 import SeekableBufferedInputBase
class S3SeekableInput(SeekableBufferedInputBase):
def read(self, size=-1):
if size == 0:
return b''
else:
return super(S3SeekableInput, self).read(size) |
@janpom I think that fixing the superclass' method is preferable to the override. Are you able to submit a PR? If not, I'll look into it during the week. |
@mpenkov I wasn't suggesting the workaround as a fix. I was merely pointing out that users can work around the problem (outside of The fix should definitely be be in the |
That's OK, I understand. Thanks for pointing this out. I'll take it from
here.
…On Wed, Feb 14, 2018 at 1:25 AM Jan Pomikálek ***@***.***> wrote:
@mpenkov <https://github.com/mpenkov> I wasn't suggesting the workaround
as a fix. I was merely pointing out that users can work around the problem
(outside of smart_open code).
The fix should definitely be be in the BufferedInputBase. Some more
investigation would be worthwhile. The size < 0 is just my wild guess. I
don't really have time for delivering a proper fix, sorry.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABDOVF4CBt1K9MPYROxglxClIMmF4RtQks5tUbdygaJpZM4SDas9>
.
|
Steps to reproduce:
I quickly investigated the problem. It seems the bug is in the
read()
method in the parentBufferedInputBase
class:if size < 0
maybe?The text was updated successfully, but these errors were encountered: