mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-16 15:08:58 +00:00
Rewrite doctest to pass on Python 2+3.
This commit is contained in:
parent
ebbe645cb6
commit
2fb603e603
@ -277,10 +277,11 @@ def escape_path(path):
|
||||
Return path quoted to US-ASCII.
|
||||
|
||||
>>> path = u'/føö/bar/☃'
|
||||
>>> escape_path(path)
|
||||
>>> escaped = escape_path(path)
|
||||
>>> str(escaped)
|
||||
'/f%C3%B8%C3%B6/bar/%E2%98%83'
|
||||
>>> escape_path(path).encode('ascii')
|
||||
b'/f%C3%B8%C3%B6/bar/%E2%98%83'
|
||||
>>> escaped.encode('ascii').decode('ascii') == escaped
|
||||
True
|
||||
"""
|
||||
# this always returns bytes, specifically US-ASCII, valid URL characters
|
||||
segments = path.split("/")
|
||||
|
Loading…
x
Reference in New Issue
Block a user