Skip to content

Allow nil output buffers for reader methods#3002

Merged
soutaro merged 2 commits into
ruby:masterfrom
Strech:allow-nil-output-buffer-for-reader-methods
Jun 20, 2026
Merged

Allow nil output buffers for reader methods#3002
soutaro merged 2 commits into
ruby:masterfrom
Strech:allow-nil-output-buffer-for-reader-methods

Conversation

@Strech

@Strech Strech commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Ruby accepts explicit nil for output buffer arguments on reader methods and allocates a new String in that case. Update signatures and stdlib tests to match.

Updated signatures:

  • _Reader#read
  • _ReaderPartial#readpartial
  • IO#{pread,read_nonblock,readpartial,sysread}
  • ARGF#{read,read_nonblock,readpartial}
  • StringIO#{read,pread,read_nonblock,readpartial,sysread}
  • Zlib::GzipReader#read,readpartial
  • OpenSSL::Buffering#{read,read_nonblock,readpartial}
  • OpenSSL::SSL::SSLSocket#sysread

Strech and others added 2 commits June 17, 2026 12:54
Ruby accepts explicit nil for output buffer arguments and allocates a
new String in that case. Update signatures and stdlib tests to match.

Updated signatures:

* _Reader#read
* _ReaderPartial#readpartial
* IO#{pread,read_nonblock,readpartial,sysread}
* ARGF#{read,read_nonblock,readpartial}
* StringIO#{read,pread,read_nonblock,readpartial,sysread}
* Zlib::GzipReader#read,readpartial
* OpenSSL::Buffering#{read,read_nonblock,readpartial}
* OpenSSL::SSL::SSLSocket#sysread
@Strech

Strech commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@soutaro Not sure how can I make those 2 failing actions to be green as one of them require a label and another one is failing on bundle install with

An error occurred while installing strscan (3.1.8), and Bundler cannot continue.

In Gemfile:
  steep was resolved to 2.1.0.dev, which depends on
    strscan

@soutaro soutaro added this to the RBS 4.1 milestone Jun 19, 2026

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@soutaro soutaro merged commit adacd4e into ruby:master Jun 20, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants