mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Whitespace normalization.
This commit is contained in:
parent
88869f9787
commit
07e99cb774
18 changed files with 1933 additions and 1936 deletions
|
@ -16,7 +16,7 @@ def url2pathname(pathname):
|
|||
raise RuntimeError, 'Cannot convert non-local URL to pathname'
|
||||
# Turn starting /// into /, an empty hostname means current host
|
||||
if pathname[:3] == '///':
|
||||
pathname = pathname[2:]
|
||||
pathname = pathname[2:]
|
||||
elif pathname[:2] == '//':
|
||||
raise RuntimeError, 'Cannot convert non-local URL to pathname'
|
||||
components = string.split(pathname, '/')
|
||||
|
@ -68,11 +68,11 @@ def pathname2url(pathname):
|
|||
return '/' + string.join(components, '/')
|
||||
else:
|
||||
return string.join(components, '/')
|
||||
|
||||
|
||||
def _pncomp2url(component):
|
||||
component = urllib.quote(component[:31], safe='') # We want to quote slashes
|
||||
return component
|
||||
|
||||
component = urllib.quote(component[:31], safe='') # We want to quote slashes
|
||||
return component
|
||||
|
||||
def test():
|
||||
for url in ["index.html",
|
||||
"bar/index.html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue