[Distutils] Round 6 - PEP 440 - Version Identification and Dependency Specification Version

Paul Moore p.f.moore at gmail.com
Sat Aug 9 19:41:07 CEST 2014


On 9 August 2014 17:02, Donald Stufft <donald at stufft.io> wrote:
> To be clear, the direct reference is mostly for use in the install_requires.
> On the CLI pip can still just take a path to a file or whatever. This feature
> is intended to replace dependency_links in a way that people can use
> them for private packages but that they won't be allowed on PyPI or the
> like.

Understood. I'd still like an explicit pointer to the canonical URL
details tools should (or must?) use. See
http://en.wikipedia.org/wiki/File_URI_scheme (specifically the
"Windows" sections) for why I'm bothered - specifically the quote
"Here are *some* examples which *may* be accepted by some
applications" (emphasis mine).

I'd be more than happy if the spec was just "tools will use XXX from
the Python standard library. But note (the first 4 are the supposedly
acceptable URLs from that Wikipedia article):

>py
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import url2pathname
>>> url2pathname("file://localhost/c|/WINDOWS/clock.avi")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Apps\Python34\lib\nturl2path.py", line 26, in url2pathname
    raise OSError(error)
OSError: Bad URL: file|//localhost/c|/WINDOWS/clock.avi
>>> url2pathname("file:///c|/WINDOWS/clock.avi")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Apps\Python34\lib\nturl2path.py", line 26, in url2pathname
    raise OSError(error)
OSError: Bad URL: file|///c|/WINDOWS/clock.avi
>>> url2pathname("file://localhost/c:/WINDOWS/clock.avi")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Apps\Python34\lib\nturl2path.py", line 26, in url2pathname
    raise OSError(error)
OSError: Bad URL: file|//localhost/c|/WINDOWS/clock.avi
>>> url2pathname("file:///c:/WINDOWS/clock.avi")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Apps\Python34\lib\nturl2path.py", line 26, in url2pathname
    raise OSError(error)
OSError: Bad URL: file|///c|/WINDOWS/clock.avi
>>> url2pathname("file:////WINDOWS/clock.avi")
'E:\\WINDOWS\\clock.avi'
>>> url2pathname("file:///WINDOWS/clock.avi")
'E:\\WINDOWS\\clock.avi'
>>> url2pathname("file://WINDOWS/clock.avi")
'E:\\WINDOWS\\clock.avi'
>>> url2pathname("file:/WINDOWS/clock.avi")
'E:\\WINDOWS\\clock.avi'
>>>

I have no idea where Python got that E drive from - my current drive is C:.

At this point in time, I have no idea how to correctly write a file
URL for the file C:\Windows\clock.avi on my PC. While it's very
definitely a corner case in the PEP, and it's clearly not the PEP's
responsibility to explain the file URL spec, I do think it's relevant
to the usability of the PEP.

Paul


More information about the Distutils-SIG mailing list