diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/nturl2path.py | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/nturl2path.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/nturl2path.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/tools/python3/src/Lib/nturl2path.py b/contrib/tools/python3/src/Lib/nturl2path.py index 61852aff58..90c95a26ff 100644 --- a/contrib/tools/python3/src/Lib/nturl2path.py +++ b/contrib/tools/python3/src/Lib/nturl2path.py @@ -50,14 +50,14 @@ def pathname2url(p): # becomes # ///C:/foo/bar/spam.foo import urllib.parse - # First, clean up some special forms. We are going to sacrifice - # the additional information anyway - if p[:4] == '\\\\?\\': - p = p[4:] - if p[:4].upper() == 'UNC\\': - p = '\\' + p[4:] - elif p[1:2] != ':': - raise OSError('Bad path: ' + p) + # First, clean up some special forms. We are going to sacrifice + # the additional information anyway + if p[:4] == '\\\\?\\': + p = p[4:] + if p[:4].upper() == 'UNC\\': + p = '\\' + p[4:] + elif p[1:2] != ':': + raise OSError('Bad path: ' + p) if not ':' in p: # No drive specifier, just convert slashes and quote the name if p[:2] == '\\\\': @@ -67,7 +67,7 @@ def pathname2url(p): p = '\\\\' + p components = p.split('\\') return urllib.parse.quote('/'.join(components)) - comp = p.split(':', maxsplit=2) + comp = p.split(':', maxsplit=2) if len(comp) != 2 or len(comp[0]) > 1: error = 'Bad path: ' + p raise OSError(error) |