Skip to content

Allow nil output buffers for reader methods#3002

Open
Strech wants to merge 2 commits into
ruby:masterfrom
Strech:allow-nil-output-buffer-for-reader-methods
Open

Allow nil output buffers for reader methods#3002
Strech wants to merge 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

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
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
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