JRuby

Attempting File.open('foo', 'w') when './foo' is a directory raises Errno:ERNOENT, but should raise Errno:EISDIR

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
  • Component/s: Miscellaneous
  • Labels:
    None
  • Environment:
    JRuby rev 4334
  • Number of attachments :
    2

Description

  • MRI *
    alexeyv@alexeyv-laptop:~$ ruby -e "File.open('./foo', 'w') { |f| 1000.time f.puts 'quick brown fox' }"
    -e:1: warning: parenthesize argument(s) for future version
    -e:1:in `initialize': Is a directory - ./foo (Errno::EISDIR)
    from -e:1:in `open'
    from -e:1


    *JRuby *
    alexeyv@alexeyv-laptop:~$ jruby -e "File.open('./foo', 'w') { |f| 1000.time f.puts 'quick brown fox' }"
    -e:1 warning: parenthesize argument(s) for future version
    -e:1:in `open': File not found (Errno::ENOENT)

Note the wrong error (file not found makes no sense for File.open with 'w' flag)

  1. jruby-1368.jruby-1_0.patch
    27/Oct/07 6:12 PM
    4 kB
    Riley Lynch
  2. jruby-1368.patch
    19/Oct/07 9:15 PM
    4 kB
    Charles Oliver Nutter

Activity

Hide
Charles Oliver Nutter added a comment -

I'll fix it if you provide a neat test case for it....

Show
Charles Oliver Nutter added a comment - I'll fix it if you provide a neat test case for it....
Hide
Charles Oliver Nutter added a comment -

Enebo fixed this on trunk, but the patch won't cleanly apply to 1.0 branch. How badly do you want it?

Show
Charles Oliver Nutter added a comment - Enebo fixed this on trunk, but the patch won't cleanly apply to 1.0 branch. How badly do you want it?
Hide
Riley Lynch added a comment -

Patch cleaned up for jruby-1_0 branch

Show
Riley Lynch added a comment - Patch cleaned up for jruby-1_0 branch
Hide
Thomas E Enebo added a comment -

Patch applied on 1.0 branch in commit 4781. Already fixed on trunk.

Show
Thomas E Enebo added a comment - Patch applied on 1.0 branch in commit 4781. Already fixed on trunk.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: