[#4522] Undefined Errno::EPROTO and the like raises NameError — "Florian Frank" <flori@...>
Hi,
[#4533] giving acces readline to rl_line_buffer — "Cs. Henk" <csaba-ml@...>
Hi!
[#4548] Ruby 1.8.2 array of hash entries functions incorrectly — noreply@...
Bugs item #1613, was opened at 2005-03-09 19:49
[#4561] rb_reg_quote weirdness — Nikolai Weibull <mailing-lists.ruby-core@...>
(Two weirdnesses in one day.)
Hi,
[#4567] Immutable Ropes — Nikolai Weibull <mailing-lists.ruby-core@...>
Note how I didn't write "Immutable Strings" in the subject.
[#4575] Allowing "?" in struct members — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4587] 0**0==1? — Bertram Scharpf <lists@...>
Hi,
[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>
I'm really sorry if this isn't the place to talk about this. I've
Daniel Amelang wrote:
Hi --
On Monday 21 March 2005 16:17, David A. Black wrote:
Hi --
Hey David, I think that we've had some misunderstandings due to
Hi --
On Wednesday 30 March 2005 20:55, David A. Black wrote:
On Sunday 20 March 2005 21:31, Daniel Amelang wrote:
[#4601] Re: New block syntax — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#4611] want_object? - possible? — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4619] Re: want_object? - possible? — Daniel Berger <djberg96@...>
--- nobu.nokada@softhome.net wrote:
Hi --
On 3/24/05, David A. Black <dblack@wobblini.net> wrote:
Hi --
On 4/14/05, David A. Black <dblack@wobblini.net> wrote:
On 14 Apr 2005, at 22:20, Mark Hubbart wrote:
On 4/15/05, Eric Hodel <drbrain@segment7.net> wrote:
[#4622] tempfile.rb — Tilman Sauerbeck <tilman@...>
Hi,
[#4648] about REXML::Encoding — speakillof <speakillof@...>
Hi.
On Thursday 31 March 2005 09:44, speakillof wrote:
Hi.
I've tested, applied, and committed your Encoding patch, Nobu.
Hi,
[PATCH] tempfile.rb
Hi,
there's a bug in Ruby 1.8.2 that breaks the following code:
require "tempfile"
Tempfile.open("foo.rb") do |f|
# do stuff with tf
# make sure the file gets removed as soon as the block
# terminates:
f.unlink # this leads to an exception
end
/usr/lib/ruby/1.8/tempfile.rb:84:in `_close': undefined method `[]=' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/tempfile.rb:97:in `close'
from /usr/lib/ruby/1.8/tempfile.rb:174:in `open'
This was then fixed in CVS by making Tempfile#_close only set @data[1]
to nil if @data isn't nil.
I suspect that this isn't the right way to fix it, maybe it's better to
only set @data[1] to nil instead of @data in #unlink (and #close!)?
Attached a diff against CVS HEAD.
--
Regards,
Tilman
Attachments (1)
Index: lib/tempfile.rb
===================================================================
RCS file: /src/ruby/lib/tempfile.rb,v
retrieving revision 1.27
diff -u -r1.27 tempfile.rb
--- lib/tempfile.rb 15 Nov 2004 16:45:02 -0000 1.27
+++ lib/tempfile.rb 26 Mar 2005 17:41:17 -0000
@@ -81,8 +81,7 @@
def _close # :nodoc:
@tmpfile.close if @tmpfile
- @tmpfile = nil
- @data[1] = nil if @data
+ @data[1] = @tmpfile = nil
end
protected :_close
@@ -104,7 +103,7 @@
_close
@clean_proc.call
ObjectSpace.undefine_finalizer(self)
- @data = @tmpname = nil
+ @data[1] = @tmpname = nil
end
# Unlinks the file. On UNIX-like systems, it is often a good idea
@@ -116,7 +115,7 @@
begin
File.unlink(@tmpname) if File.exist?(@tmpname)
@@cleanlist.delete(@tmpname)
- @data = @tmpname = nil
+ @data[1] = @tmpname = nil
ObjectSpace.undefine_finalizer(self)
rescue Errno::EACCESS
# may not be able to unlink on Windows; just ignore