CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=0, private, must-revalidate
content-type: text/html; charset=utf-8
etag: W/"d5b33ed270324ec84623d21f6ae491e9"
nel: {"report_to":"heroku-nel","response_headers":["Via"],"max_age":3600,"success_fraction":0.01,"failure_fraction":0.1}
referrer-policy: strict-origin-when-cross-origin
report-to: {"group":"heroku-nel","endpoints":[{"url":"https://nel.heroku.com/reports?s=o1VmdMiIEyVBXQERSJU5g7AlikYV27PRtyfOeDORdG8%3D\u0026sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d\u0026ts=1753755791"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=o1VmdMiIEyVBXQERSJU5g7AlikYV27PRtyfOeDORdG8%3D&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&ts=1753755791"
server: Heroku
set-cookie: _redmine_session=T2JOdjhUVVozcW16NldDSHk4SHVZeDJGZG4vbWFBS1hsREVqSTUwQjNOOEJRb0ZoWExjNTZjN1VJUEVmSnlLeEwwSG05RE52V2pzUzNVT1JtNXRaVTFDSDVKSGlnQWVZakU1bGJzcnBYdFFVMkRsTEpYK0lZWlN4WkZKdktPMndHYjRNMkx2Q2YyUkl2bHRENmhoeGZiSjJ5Y3VEZ0FKdTZ1NHptSHY0U3RIdzdBNFZhdC9mMURSU2RBYiswSkxpLS02R0lGWDgzbXFiVWptaXJnOTZCN3ZBPT0%3D--b61b488893cd624928ffb5e96ddfc734900ce51c; path=/; secure; httponly; samesite=lax
strict-transport-security: max-age=63072000; includeSubDomains
vary: Accept
via: 2.0 heroku-router
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-request-id: e825168a-4d10-2747-f4a9-e2bcedec09d8
x-runtime: 0.083643
x-xss-protection: 1; mode=block
content-length: 26492
date: Tue, 29 Jul 2025 02:23:11 GMT
Bug #21517: Behaviour of StringIO#readpartial with multibyte differs from IO#readpartial - Ruby - Ruby Issue Tracking System
[ruby-core:122817]
Project
General
Profile
Tags
Custom queries
Actions
Bug #21517
openBehaviour of StringIO#readpartial with multibyte differs from IO#readpartial
Added by herwin (Herwin W) 10 days ago.
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux] (+ others)
Description
The specs for IO#readpartial
have the following test (https://github.com/ruby/spec/blob/ed254bae321221f5cd24280beb37e5bddaff6bb6/core/io/readpartial_spec.rb#L41-L47):
before :each do
@rd, @wr = IO.pipe
@rd.binmode
@wr.binmode
end
it "reads after ungetc with multibyte characters in the buffer" do
@wr.write("∂φ/∂x = gaîté")
c = @rd.getc
@rd.ungetc(c)
@rd.readpartial(3).should == "\xE2\x88\x82"
@rd.readpartial(3).should == "\xCF\x86/"
end
This behaviour is different in StringIO#readpartial
. If I add this as a spec:
it "reads after ungetc with multibyte characters in the buffer" do
@string = StringIO.new(+"∂φ/∂x = gaîté")
c = @string.getc
@string.ungetc(c)
@string.readpartial(3).should == "\xE2\x88\x82"
@string.readpartial(3).should == "\xCF\x86/"
end
it fails with every supported Ruby version, and even with 3.5-dev of today, with the message Expected "\xE2\x88\x82" == "∂"
The getc
+ ungetc
can be removed, but this does not change the behaviour.
No data to display
Actions
Like0
Powered by Redmine © 2006-2025 Jean-Philippe Lang
Loading...