mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Marked bytestrings with b prefix. Refs #18269
This is a preparation for unicode literals general usage in Django (Python 3 compatibility).
This commit is contained in:
@@ -154,7 +154,7 @@ def iri_to_uri(iri):
|
||||
# converted.
|
||||
if iri is None:
|
||||
return iri
|
||||
return urllib.quote(smart_str(iri), safe="/#%[]=:;$&()+,!?*@'~")
|
||||
return urllib.quote(smart_str(iri), safe=b"/#%[]=:;$&()+,!?*@'~")
|
||||
|
||||
def filepath_to_uri(path):
|
||||
"""Convert an file system path to a URI portion that is suitable for
|
||||
@@ -173,7 +173,7 @@ def filepath_to_uri(path):
|
||||
return path
|
||||
# I know about `os.sep` and `os.altsep` but I want to leave
|
||||
# some flexibility for hardcoding separators.
|
||||
return urllib.quote(smart_str(path).replace("\\", "/"), safe="/~!*()'")
|
||||
return urllib.quote(smart_str(path).replace("\\", "/"), safe=b"/~!*()'")
|
||||
|
||||
# The encoding of the default system locale but falls back to the
|
||||
# given fallback encoding if the encoding is unsupported by python or could
|
||||
|
||||
Reference in New Issue
Block a user