CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=0, private, must-revalidate
content-type: text/html; charset=utf-8
etag: W/"a8b70d846cc5656454948f8046ad6dfa"
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=KTx%2FDuCdmhPAKz8L1u7nYeV3ipFqy9J2832D50N4kGA%3D\u0026sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d\u0026ts=1753756997"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=KTx%2FDuCdmhPAKz8L1u7nYeV3ipFqy9J2832D50N4kGA%3D&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&ts=1753756997"
server: Heroku
set-cookie: _redmine_session=Zk12TjBWejVSM281WVpLNkg5N05QSHZoQnhIRUJDZ20zdmVBNkdHSFUzeUpIQ0tDczE1V0drTysyd3Fnd2xhRVFGSEhxOWcwdWpJSXBSMkZiTENBN1VxczFQSEJ5b3FDMGVXOHNRTDNDYnFmaWg0Rkc5c1dnQWl4Y3F0UFdCMHNxckxnaDc3dW1jSjNuY0pJNXFlK2xoYVErYlNNNmozSnJicGs3TjZPK25UY0RzL1l4dXBCdnV4cUNlcDBtOVk2LS1ZR3dzSDVIZGdWem1kWk5pVUVRRFZnPT0%3D--8bea3ac0eb636cae3d317e43ee36d05bbedb8d92; 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: dbbb55eb-689b-d437-0bdc-b67b37e3fa66
x-runtime: 0.083967
x-xss-protection: 1; mode=block
content-length: 26492
date: Tue, 29 Jul 2025 02:43:17 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...