We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There is a difference in StringIO#read behaviour between ruby 3.3.x and 3.4.x.
StringIO#read
The difference is illustrated by this:
Ruby 3.3.7:
irb(main):001> RUBY_VERSION => "3.3.7" irb(main):002> binary_io = StringIO.new("\x00".b) => #<StringIO:0x00007f50541b8518> irb(main):003> buf = '' => "" irb(main):004> buf.encoding => #<Encoding:UTF-8> irb(main):005> binary_io.read(1, buf) => "\x00" irb(main):006> buf.encoding => #<Encoding:ASCII-8BIT>
Ruby 3.4.0:
irb(main):001> RUBY_VERSION => "3.4.0" irb(main):002> binary_io = StringIO.new("\x00".b) => #<StringIO:0x000071c808fafab8> irb(main):003> buf = '' => "" irb(main):004> buf.encoding => #<Encoding:UTF-8> irb(main):005> binary_io.read(1, buf) => "\u0000" irb(main):006> buf.encoding => #<Encoding:UTF-8>
I experience that this new beahaviour affects httpclient when using StringIO as body on PUT requests:
httpclient/lib/httpclient/http.rb
Line 580 in d57cc6d
This may very well also affect other http methods. I have not tried.
The workaround is not to upgrade ruby to 3.4.x
The text was updated successfully, but these errors were encountered:
No branches or pull requests
There is a difference in
StringIO#read
behaviour between ruby 3.3.x and 3.4.x.The difference is illustrated by this:
Ruby 3.3.7:
Ruby 3.4.0:
I experience that this new beahaviour affects httpclient when using StringIO as body on PUT requests:
httpclient/lib/httpclient/http.rb
Line 580 in d57cc6d
This may very well also affect other http methods. I have not tried.
The workaround is not to upgrade ruby to 3.4.x
The text was updated successfully, but these errors were encountered: