[issue6193] urllib: ... IOError: ... unknown url type: 'c'
Sridhar Ratnakumar
report at bugs.python.org
Thu Jun 4 21:05:28 CEST 2009
New submission from Sridhar Ratnakumar <sridharr at activestate.com>:
On Windows, urllib fails to open local files:
> python -c "import urllib; urllib.urlopen(r'C:\test.txt').read()"
Traceback (most recent call last):
File "C:\HOME\as\pypm\bin\python-script.py", line 33, in <module>
exec _val
File "<string>", line 1, in <module>
File "C:\Python26\lib\urllib.py", line 87, in urlopen
return opener.open(url)
File "C:\Python26\lib\urllib.py", line 200, in open
return self.open_unknown(fullurl, data)
File "C:\Python26\lib\urllib.py", line 212, in open_unknown
raise IOError, ('url error', 'unknown url type', type)
IOError: [Errno url error] unknown url type: 'c'
However, on Unix this is not an issue:
$ python -c "import urllib; print urllib.urlopen('/tmp/test.txt').read()"
Foo
$
----------
components: Library (Lib)
messages: 88894
nosy: srid
severity: normal
status: open
title: urllib: ... IOError: ... unknown url type: 'c'
type: behavior
versions: Python 2.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6193>
_______________________________________
More information about the Python-bugs-list
mailing list