1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Fixed #20108 -- Fixed filepath_to_uri decoding error

This was a regression due to unicode_literals usage. Thanks Ivan
Virabyan for the report and the initial patch.
This commit is contained in:
Claude Paroz
2013-03-22 17:55:12 +01:00
parent 829dc3c5a6
commit 164528acc8
2 changed files with 8 additions and 2 deletions

View File

@@ -234,7 +234,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 quote(force_bytes(path.replace("\\", "/")), safe=b"/~!*()'")
return quote(force_bytes(path).replace(b"\\", b"/"), safe=b"/~!*()'")
def get_system_encoding():
"""