Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/nturl2path.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def url2pathname(url):
if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
error = 'Bad URL: ' + url
raise OSError(error)
if len(comp[0]) > 1 and comp[0][-2] not in {"/", "\\"}:
error = 'Bad URL (too many drive letters [before the first | ]): ' + url
raise OSError(error)
drive = comp[0][-1].upper()
components = comp[1].split('/')
path = drive + ':'
Expand Down