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
However, there's a slight difference in how it treats the edge case of reading zero bytes from an empty file
File.open("empty_file").pread(0,0)# => ""StringIO.new(File.read("empty_file")).pread(0,0)# => raises `end of file reached (EOFError)`
In our case, this is almost certainly a bug in the application logic where it ought to bail out early rather than trying to read zero bytes from the io, but thought it was worth highlighting the discrepancy.
Activity
byroot commentedon Oct 4, 2023
Thanks. I'm busy for the next couple days but I'll make sure to have a look next week.
StringIO#pread: handle 0 length like IO#pread (#67)
[ruby/stringio] StringIO#pread: handle 0 length like IO#pread