This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cgohlke
Recipients cgohlke
Date 2010-01-21.22:55:22
SpamBayes Score 9.992007e-16
Marked as misclassified No
Message-id <1264114525.88.0.153808488744.issue7751@psf.upfronthosting.co.za>
In-reply-to
Content
On Windows 7, Python 2.6 raises an IOError when opening a valid file URL with urllib.urlopen(). A patch to the nturl2path.url2pathname function is attached. It replaces '%7C' by '|' in the url at the top of the url2pathname function.

Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, urllib
>>> fname = sys.executable
>>> fname
'x:\\python26\\python.exe'
>>> fname = "file:///" + fname.replace('\\', '/').replace(':', '|')
>>> fname
'file:///x|/python26/python.exe'
>>> urllib.urlopen(fname)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "x:\python26\lib\urllib.py", line 87, in urlopen
    return opener.open(url)
  File "x:\python26\lib\urllib.py", line 206, in open
    return getattr(self, name)(url)
  File "x:\python26\lib\urllib.py", line 468, in open_file
    return self.open_local_file(url)
  File "x:\python26\lib\urllib.py", line 482, in open_local_file
    raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 22] The filename, directory name, or volume label syntax is incorrect: '\\x|\\python26\\python.exe'
History
Date User Action Args
2010-01-21 22:55:26cgohlkesetrecipients: + cgohlke
2010-01-21 22:55:25cgohlkesetmessageid: <1264114525.88.0.153808488744.issue7751@psf.upfronthosting.co.za>
2010-01-21 22:55:23cgohlkelinkissue7751 messages
2010-01-21 22:55:23cgohlkecreate