Project

General

Profile

Bug #9285

Exception message of Errno::ENOENT contains strings @ rb_sysopen and @ dir_initialize in Ruby 2.1

Added by Andrei Botalov about 3 years ago. Updated about 1 month ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-12-20 trunk 44301) [x86_64-linux]
Backport:
[ruby-core:59268]

Description

Exception message of Errno::ENOENT exception contains strings "@ rb_sysopen" or "@ dir_initialize" in Ruby 2.1.0-rc1. It doesn't contain them in Ruby 2.0. I would expect exception message not to contain those strings.

Example in Ruby 2.1:
$ irb

2.1.0dev :001 > File.new('/path/to/not/existent/file')
Errno::ENOENT: No such file or directory @ rb_sysopen - /path/to/not/existent/file
from (irb):1:in initialize'
from (irb):1:in
new'
from (irb):1
from /home/andrey/.rvm/rubies/ruby-2.1.0-rc1/bin/irb:11:in <main>'
2.1.0dev :002 > Dir.open('/path/to/not/existent/folder')
Errno::ENOENT: No such file or directory @ dir_initialize - /path/to/not/existent/folder
from (irb):2:in
open'
from (irb):2
from /home/andrey/.rvm/rubies/ruby-2.1.0-rc1/bin/irb:11:in `'
2.1.0dev :003 >

Version: ruby 2.1.0dev (2013-12-20 trunk 44301) [x86_64-linux]
It's installed via RVM.
Ubuntu 13.04


Related issues

Duplicated by Backport21 - Backport #9284: Exception message of Errno::ENOENT contains strings Rejected 12/22/2013

History

#1 [ruby-core:59278] Updated by Yui NARUSE about 3 years ago

At first, I say what it is.
It is the C function name where the exception is raised.
Therefore you can't the name from Ruby.

The background is that IO-related exceptions may be raised many places.
If I encounter an unexpected exception, only errno is not sufficient information.
I cannot debug without where the error is generated.
The string gives us the information.

Anyway normal ruby users don't need such information.
Therefore it may be hidden on release build.

#2 [ruby-core:60060] Updated by Motohiro KOSAKI about 3 years ago

I don't like just turning hidden because I can't agree release build doesn't need debug.
But I agree current format is a little confusable and C function name is less important.
String format could be improved if someone propose better idea.

#3 [ruby-core:79199] Updated by Vit Ondruch about 1 month ago

  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN)

Is this worth of keeping open? It does not look it will be reverted. And seeing "temporary" workarounds such as 1 does not make the situation any better.

#4 [ruby-core:79201] Updated by Yui NARUSE about 1 month ago

  • Status changed from Open to Rejected

Through the experience in this three years, this error message sometimes help us to debug.
It is useful and kept as is.

Also available in: Atom PDF