summaryrefslogtreecommitdiff
path: root/django/utils/encoding.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/encoding.py')
-rw-r--r--django/utils/encoding.py2
1 files changed, 1 insertions, 1 deletions
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