Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b75e7f52
Commit
b75e7f52
authored
Oct 24, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue21160: Correct comments in nturl2path. Patch by Jurko Gospodnetić.
parents
97a763d1
0a467d1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Lib/nturl2path.py
Lib/nturl2path.py
+7
-5
No files found.
Lib/nturl2path.py
View file @
b75e7f52
...
...
@@ -4,9 +4,11 @@ def url2pathname(url):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
# e.g.
# ///C|/foo/bar/spam.foo
# becomes
# C:\foo\bar\spam.foo
# ///C|/foo/bar/spam.foo
# and
# ///C:/foo/bar/spam.foo
# become
# C:\foo\bar\spam.foo
import
string
,
urllib
.
parse
# Windows itself uses ":" even in URLs.
url
=
url
.
replace
(
':'
,
'|'
)
...
...
@@ -39,9 +41,9 @@ def pathname2url(p):
"""OS-specific conversion from a file system path to a relative URL
of the 'file' scheme; not recommended for general use."""
# e.g.
# C:\foo\bar\spam.foo
#
C:\foo\bar\spam.foo
# becomes
#
///C|
/foo/bar/spam.foo
#
///C:
/foo/bar/spam.foo
import
urllib.parse
if
not
':'
in
p
:
# No drive specifier, just convert slashes and quote the name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment