JRuby

File.open improperly locates files when using the file URI scheme in windows

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.2
  • Fix Version/s: None
  • Component/s: Windows
  • Labels:
    None
  • Environment:
    MS Windows XP
  • Number of attachments :
    0

Description

For a given file URI:
file_path = file://c:/foo

create a URI:
file_uri = URI.parse(file_path)

read the file:
File.open(file_uri.path).read

Get:
Errno::EACCESS exception, looking for "/foo"

In both mri and jruby, the file_uri.path equates to "/foo", but only in JRuby does the File open fail.

test case requires that you are on windows and have a file at c:\foo
>> File.open(URI.parse("file://c:/foo").path).read

Activity

Hide
Charles Oliver Nutter added a comment -

I'm going to call this fixed as of an unknown release because I can't immediately test it on Windows myself, but I know similar bugs have been resolved a few times over by others on Windows.

If it's still broken, reopen (or open a new bug, if you want to get more attention than you would with an old bug )

Show
Charles Oliver Nutter added a comment - I'm going to call this fixed as of an unknown release because I can't immediately test it on Windows myself, but I know similar bugs have been resolved a few times over by others on Windows. If it's still broken, reopen (or open a new bug, if you want to get more attention than you would with an old bug )

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: