-
Notifications
You must be signed in to change notification settings - Fork 3.4k
IO.binstream/2 drops bytes in some cases for line_or_bytes as :line #13717
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
Comments
byte differs somewhere in the middle: char 35538, line 158 / out of 409 and reproducible on mac m1 and linux |
Can you check if there is "\r\n" in the file? |
@josevalim thanks, you are right. The update to the docs are great :) and hopefully helps the next person. |
Fantastic! Thanks for opening the issue! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
Elixir 1.17.1 (compiled with Erlang/OTP 27)
Operating system
GNU/Linux
Current behavior
When running the following code
The the assert fails with a byte difference of ~ 3 bytes ( in our cases ).
When we change line_or_bytes from
:line
to a number like1000
, the assert passes.Unfortunately the files we test have PSI data so cannot share, but busy trying to replicate the issue ( it does not happen often and seems somewhat random ).
Expected behavior
We would expect the byte_size to not change when specifying :line as chunk size for IO.binstream/2, or there being some comment on why :line cannot be used, as it was quite unexpected. ( some of this code is in a library and we extracted it in the above example for debugging the issues ).
The text was updated successfully, but these errors were encountered: