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.

classification
Title: Windows raises ValueError for file:///file/not/exists instead of URLError
Type: behavior Stage: resolved
Components: Versions: Python 3.2, Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: orsenthil, python-dev
Priority: normal Keywords: easy

Created on 2012-10-22 14:11 by orsenthil, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg173522 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-10-22 14:11
From the Buildbot failure - http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/7573/steps/test/logs/stdio

I remember that we restricted the access for file:// scheme to localhost only for Windows/Cygwin. In terms of exception raised it could either be consistent with other platforms and raise URLError or it could be for good reasons, the tests may need to be tweaked for windows.
msg173535 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-10-22 15:57
The problem is here:

if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
    raise ValueError("file:// scheme is supported only on localhost")

On Unix like systems url[2:3] == '/', that is path starts with '/' and this ValueError is escaped.
msg173543 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-22 16:43
New changeset 49de26395d1a by Senthil Kumaran in branch 'default':
Issue #16301: Fix the localhost verification in urllib/request.py for file://. Modify tests to use localhost for local temp files, which could make Windows Buildbot (#16300) happy
http://hg.python.org/cpython/rev/49de26395d1a
msg173625 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-23 16:41
New changeset 00e5e963b7d8 by Senthil Kumaran in branch 'default':
Fix issue16300: addressing the buildbot failures on windows
http://hg.python.org/cpython/rev/00e5e963b7d8
msg173920 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-10-27 10:54
Buildbot issues are taken care. They are green for while. Tests have been backported 3.3 and 3.2 as well.

3.2 5e71f2712076
3.3 30547e2cd04d
History
Date User Action Args
2022-04-11 14:57:37adminsetgithub: 60504
2012-10-27 10:54:13orsenthilsetstatus: open -> closed
resolution: fixed
messages: + msg173920

stage: resolved
2012-10-23 16:41:00python-devsetmessages: + msg173625
2012-10-22 16:43:50python-devsetnosy: + python-dev
messages: + msg173543
2012-10-22 15:57:20orsenthilsetmessages: + msg173535
2012-10-22 14:11:46orsenthilcreate