SystemCallError.new does not create Errno

SystemCallError.new is supposed to create a new instance of the
appropriate Errno class based on the errno given. However, there seems
to be some problem:

irb(main):001:0> Errno::EACCES.new.errno
=> 13
irb(main):002:0> SystemCallError.new 13
=> #<SystemCallError: Unknown error 13>

This is with jruby 1.4.0RC1 (ruby 1.8.7 patchlevel 174) (2009-09-30
80c263b) (OpenJDK Client VM 1.6.0_0) [i386-java]

Compare to MRI:

irb(main):001:0> Errno::EACCES.new.errno
=> 13
irb(main):002:0> SystemCallError.new 13
=> #<Errno::EACCES: Permission denied>

-Justin

On Wed, Oct 7, 2009 at 1:11 PM, Justin C. [email protected]
wrote:

SystemCallError.new is supposed to create a new instance of the
appropriate Errno class based on the errno given. However, there seems
to be some problem:

irb(main):001:0> Errno::EACCES.new.errno
=> 13
irb(main):002:0> SystemCallError.new 13
=> #<SystemCallError: Unknown error 13>

Yup, looks like our SystemCallError is only accepting strings. You
should file a bug, and see if there’s a spec for this you can add to
Rubyspec (www.rubyspec.org).

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Justin, Charlie,

On Thu, Oct 8, 2009 at 10:43 PM, Charles Oliver N.
[email protected] wrote:

Yup, looks like our SystemCallError is only accepting strings. You
should file a bug, and see if there’s a spec for this you can add to
Rubyspec (www.rubyspec.org).

Actually, SystemCallError does accept string and numeric values. What
it doesn’t do it doesn’t convert bare SystemCallError to proper Errno
when it should. I’ll take a look and see what we can do here. I think
we have everything in place, including the platform-dependent
errno-values from Constantine project (which was a big problem in the
past), so we just need to wire this stuff up.

Justin, could you please file a JIRA issue for this, if you can?

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Justin, could you please file a JIRA issue for this, if you can?

áh, sorry, you’ve already filed:
http://jira.codehaus.org/browse/JRUBY-4071
Will fix.

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Justin, folks,

On Wed, Oct 7, 2009 at 9:11 PM, Justin C. [email protected]
wrote:

SystemCallError.new is supposed to create a new instance of the
appropriate Errno class based on the errno given.

The issue has been fixed in 10e567b on master (1.5dev) branch.
Please take a look and verify. :wink: Small Rubyspec test also has been
added.

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Vladimir S. wrote:

Hi Justin, folks,

On Wed, Oct 7, 2009 at 9:11 PM, Justin C. [email protected]
wrote:

SystemCallError.new is supposed to create a new instance of the
appropriate Errno class based on the errno given.

The issue has been fixed in 10e567b on master (1.5dev) branch.
Please take a look and verify. :wink: Small Rubyspec test also has been
added.

Thanks,
–Vladimir

Looks like it is working to me. Thanks, now my lib passes all the tests
:slight_smile:

-Justin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs