Forum: Ruby-core [ruby-trunk - Bug #7940][Open] Mistaken use of inline rescues in stdlib

Posted by Mon Ouïe (mon_ouie)
on 2013-02-24 13:39
(Received via mailing list)
Issue #7940 has been reported by Mon_Ouie (Mon ouïe).

----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940

Author: Mon_Ouie (Mon ouïe)
Status: Open
Priority: Low
Assignee:
Category: lib
Target version:
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 19:27
(Received via mailing list)
Issue #7940 has been updated by drbrain (Eric Hodel).

Assignee set to xibbar (Takeyuki Fujioka)
Priority changed from Low to Normal
Target version set to 2.1.0


----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-36953

Author: Mon_Ouie (Mon ouïe)
Status: Open
Priority: Normal
Assignee: xibbar (Takeyuki Fujioka)
Category: lib
Target version: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 19:28
(Received via mailing list)
Issue #7940 has been updated by drbrain (Eric Hodel).

Status changed from Open to Assigned


----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-36954

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: xibbar (Takeyuki Fujioka)
Category: lib
Target version: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by xibbar (Takeyuki FUJIOKA) (Guest)
on 2013-04-19 05:19
(Received via mailing list)
Issue #7940 has been updated by xibbar (Takeyuki FUJIOKA).


I am maintainer of cgi* but not maintainer of lib/scanf.rb

May I commit with lib/scanf.rb ?
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38727

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: xibbar (Takeyuki FUJIOKA)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by naruse (Yui NARUSE) (Guest)
on 2013-04-19 05:24
(Received via mailing list)
Issue #7940 has been updated by naruse (Yui NARUSE).


xibbar (Takeyuki FUJIOKA) wrote:
> I am maintainer of cgi* but not maintainer of lib/scanf.rb
>
> May I commit with lib/scanf.rb ?

Commit your part and assign this to dblack.
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38728

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: xibbar (Takeyuki FUJIOKA)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by xibbar (Takeyuki FUJIOKA) (Guest)
on 2013-04-19 06:51
(Received via mailing list)
Issue #7940 has been updated by xibbar (Takeyuki FUJIOKA).


Sorry I was misunderstanding that lib/scanf.rb does not have a 
maintainer.
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38733

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: xibbar (Takeyuki FUJIOKA)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by xibbar (Takeyuki FUJIOKA) (Guest)
on 2013-04-19 07:28
(Received via mailing list)
Issue #7940 has been updated by xibbar (Takeyuki FUJIOKA).

Status changed from Closed to Assigned
Assignee changed from xibbar (Takeyuki FUJIOKA) to dblack (David Black)

update only my part.
please consider your part > dblack.
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38735

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: dblack (David Black)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by xibbar (Takeyuki FUJIOKA) (Guest)
on 2013-04-19 07:29
(Received via mailing list)
Issue #7940 has been updated by xibbar (Takeyuki FUJIOKA).

% Done changed from 100 to 50


----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38736

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: dblack (David Black)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by Eregon (Benoit Daloze) (Guest)
on 2013-04-19 16:29
(Received via mailing list)
Issue #7940 has been updated by Eregon (Benoit Daloze).


Related issue for the C counterpart: #7688.
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38753

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: dblack (David Black)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Posted by zzak (Zachary Scott) (Guest)
on 2013-04-19 22:45
(Received via mailing list)
Issue #7940 has been updated by zzak (Zachary Scott).


I've tweeted @david_a_black asking him to check this ticket.

He has been inactive for a long time, though.
----------------------------------------
Bug #7940: Mistaken use of inline rescues in stdlib
https://bugs.ruby-lang.org/issues/7940#change-38775

Author: Mon_Ouie (Mon ouïe)
Status: Assigned
Priority: Normal
Assignee: dblack (David Black)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
Backport:


Hey,

There are two uses of inline rescues in stdlib that look dubious. They 
are unlikely to ever cause any harm, but still. They've been there for a 
while now, and are still in trunk. I attached a patch that changes both 
of them.

In cgi/session.rb:

      def delete
        File::unlink @path+".lock" rescue nil
        File::unlink @path+".new" rescue nil
        File::unlink @path rescue Errno::ENOENT
      end

The ``rescue`` part should be on the next line (this has been introduced 
in a commit that changed indentation).

In scanf.rb:660:

   seek(start_position + matched_so_far, IO::SEEK_SET) rescue 
Errno::ESPIPE

was more likely meant to just silence Errno::ESPIPE exceptions.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.