CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=0, private, must-revalidate
content-type: text/html; charset=utf-8
etag: W/"9416e4fc1c938fc01b0a7df08a23aae4"
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=V3oEWOnTybG8j3JK1XVfkZVvzrcAAM6VkKrATpLZozQ%3D\u0026sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d\u0026ts=1753365579"}],"max_age":3600}
reporting-endpoints: heroku-nel="https://nel.heroku.com/reports?s=V3oEWOnTybG8j3JK1XVfkZVvzrcAAM6VkKrATpLZozQ%3D&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&ts=1753365579"
server: Heroku
set-cookie: _redmine_session=TTF1SzZWVHBYclgxdS9DYktNSmo5MFhxbnZIM3VrdnZIa2oxVHFiSG9TTXJ6L1FNMFk4enBkS0JQMWRLZGlGNjU1Uzg2ZmpqTHMrVXhaY0ZVVGl6UnlUWjNlazhUZktrS29KZitvQmMvS2NyL29XOFZxRHlGTG9xS21MRzlySTRvVEd2SWozTE81WjBZUmx2Z0JuT0p0eHFwbkdnczJZd2NsUkNkZCtVcG1rblRYMGloS01vQm9LQWVCNEhSRXlELS1keWd4OHFxQWlTYjQ2d2IxbjR0L0hRPT0%3D--dd1188001cf3892486856219c6591fc09c36b825; 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: 197d077f-2e1f-9450-f8ab-98e6f0c9dd03
x-runtime: 0.088346
x-xss-protection: 1; mode=block
content-length: 26475
date: Thu, 24 Jul 2025 13:59:39 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) 6 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...