From deec020bf5927abbdd667912f80794c32c03e609 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 22 Mar 2013 17:55:12 +0100 Subject: [1.5.x] 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. Backport of 164528acc8 from master. --- django/utils/encoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/utils/encoding.py') diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 15215849b2..f08d417e93 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -232,7 +232,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"/~!*()'") # The encoding of the default system locale but falls back to the # given fallback encoding if the encoding is unsupported by python or could -- cgit v1.3