Project

General

Profile

Actions

Bug #11738

closed

ARGF.readpartial raises a wrong exception

Added by shugo (Shugo Maeda) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-11-09 trunk 52500) [x86_64-linux]
[ruby-core:71668]

Description

ARGF.readpartial raises a RuntimeError when EOF is detected more than twice:

lexington:ruby$ cat t.rb
p ARGF.readpartial(16) rescue nil
p ARGF.readpartial(16)
lexington:ruby$ ruby t.rb /dev/null
t.rb:2:in `readpartial': can't modify frozen NilClass (RuntimeError)
	from t.rb:2:in `<main>'
lexington:ruby$

An EOFError is expected.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0