Issue #15861 has been updated by deivid (David Rodr=EDguez).


This is definitely intentional behavior, by the way. This is how the curren=
t tests look:

```
  u =3D URI("file:///c:/path/to/file")
  assert_equal "/c:/path/to/file", u.path

  # this form is not supported
  u =3D URI("file:c:/path/to/file")
  assert_equal "c:/path/to/file", u.opaque
```

I just wished working with file URIs on Windows was a bit easier.

----------------------------------------
Feature #15861: Correctly parse `file:c:/path/to/file` URIs
https://bugs.ruby-lang.org/issues/15861#change-78072

* Author: deivid (David Rodr=EDguez)
* Status: Open
* Priority: Normal
* Assignee: =

* Target version: =

----------------------------------------
Recently ruby has getting better at parsing URIs using the "file" scheme, w=
ith the addition of "URI::File". Still, some Windows edge cases are not imp=
lemented, and it would be nice to have them. For example, while the [addres=
sable gem](https://github.com/sporkmonger/addressable) can correct parse "f=
ile:c:/path/to/file", the builtin library is not that smart yet:

``` =

irb(main):001:0> URI.parse("file:c:/path/to/file").path
=3D> nil
irb(main):002:0> require 'addressable'
=3D> true
irb(main):003:0> Addressable::URI.parse("file:c:/path/to/file").path
=3D> "c:/path/to/file"
```

I think this would be a matter of implementing https://tools.ietf.org/html/=
rfc8089#appendix-E.2, which is not normative but it would be certainly nice=
 to have.



-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>