Bug #1687: ARGF.lineno Always Returns 0 for ARGF.chars and ARGF.bytes http://redmine.ruby-lang.org/issues/show/1687 Author: Run Paint Run Run Status: Open, Priority: Normal Category: core ruby -v: ruby 1.9.2dev (2009-06-21 trunk 23774) [i686-linux] The ARGF.chars and ARGF.bytes iterators (along with their aliases) don't set ARGF.lineno. It always returns 0, irrespective of the actual line number. While the case could be made that line numbers don't make much sense when dealing with bytes, they certainly do for characters. 1.8 HEAD appears to return the number of the file descriptor instead... $ ruby -v ruby 1.9.2dev (2009-06-21 trunk 23774) [i686-linux] ARGF.chars { print ARGF.lineno } #=> 0000..000 $ ruby8 -v ruby 1.8.8dev (2009-06-17) [i686-linux] ARGF.bytes { print ARGF.lineno } #=> 333....333 ---------------------------------------- http://redmine.ruby-lang.org