[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [ruby-core:68700] [Ruby trunk - Bug #11015] IO.copy_stream does not advance Tempfile destination
From:       headius () headius ! com
Date:       2015-03-30 21:30:14
Message-ID: redmine.journal-51987.20150330213013.ee44e5bfb11bd358 () ruby-lang ! org
[Download RAW message or body]

Issue #11015 has been updated by Charles Nutter.


Closing the loop on one detail...

This didn't affect JRuby because JRuby's Tempfile actually subclasses IO, rather than \
wrapping and delegating.

----------------------------------------
Bug #11015: IO.copy_stream does not advance Tempfile destination
https://bugs.ruby-lang.org/issues/11015#change-51987

* Author: Charles Nutter
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following script, reported to JRuby in \
https://github.com/jruby/jruby/issues/2762, shows that MRI does not advance the \
position of a `Tempfile` when using `copy_stream`:

~~~ruby
require "stringio"
require "tempfile"
file = Tempfile.new('foo')
IO.copy_stream(StringIO.new('foo'), file)
file.eof? #=> false (it's on the beginning)
~~~

Other types of streams leave the destination where it is after the copy, so I believe \
this is a bug.



-- 
https://bugs.ruby-lang.org/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic