Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.6
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Standard Library
-
Labels:None
-
Environment:OS X 10.7.3
-
Number of attachments :
Description
require 'tempfile'
Tempfile.open 'test' do |io|
io.unlink
io.write "hi"
io.rewind # flush
p io.stat.size
end
When run with ruby 1.8:
$ ruby -v t.rb
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
2
When run with jruby:
$ jruby -v t.rb
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...
jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
RubyFileStat.java:115:in `setup': java.lang.NullPointerException
from RubyFileStat.java:92:in `newFileStat'
from Ruby.java:2894:in `newFileStat'
from RubyFile.java:834:in `stat'
from RubyFile$i$0$0$stat.gen:65535:in `call'
from CachingCallSite.java:292:in `cacheAndCall'
from CachingCallSite.java:135:in `call'
from t.rb:9:in `block_0$RUBY$_file_'
from t$block_0$RUBY$_file_:65535:in `call'
from CompiledBlock.java:112:in `yield'
from CompiledBlock.java:95:in `yield'
from Block.java:130:in `yield'
from RubyTempfile.java:265:in `open'
from RubyTempfile$s$0$1$open.gen:65535:in `call'
from DynamicMethod.java:211:in `call'
from CachingCallSite.java:322:in `cacheAndCall'
from CachingCallSite.java:178:in `callBlock'
from CachingCallSite.java:187:in `callIter'
from t.rb:3:in `_file_'
from t.rb:-1:in `load'
from Ruby.java:695:in `runScript'
from Ruby.java:688:in `runScript'
from Ruby.java:595:in `runNormally'
from Ruby.java:444:in `runFromMain'
from Main.java:344:in `doRunFromMain'
from Main.java:256:in `internalRun'
from Main.java:222:in `run'
from Main.java:206:in `run'
from Main.java:186:in `main'
Issue Links
- is related to
-
JRUBY-6688
Tempfile#{unlink,delete} should warn or actualy do something
-
Confirmed on master.