diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-08-28 00:20:46 -0700 |
---|---|---|
committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-08-28 09:20:46 +0200 |
commit | 1e6b9e29e64fc9f13d4680be141c64d24eb92cc9 (patch) | |
tree | 63beeb3234ad0606017738f2c5e11671620b58ce /django/utils/encoding.py | |
parent | 29adcd215f80383f00d9f837311e857142319722 (diff) | |
download | django-1e6b9e29e64fc9f13d4680be141c64d24eb92cc9.tar.gz |
Refs #27795 -- Removed an unnecessary force_bytes() call in uri_to_iri().
The value returned from urllib.parse.quote() is always a string, so can
safely call .encode().
Diffstat (limited to 'django/utils/encoding.py')
-rw-r--r-- | django/utils/encoding.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 0721d516c4..8f6f6024ca 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -236,7 +236,7 @@ def repercent_broken_unicode(path): # CVE-2019-14235: A recursion shouldn't be used since the exception # handling uses massive amounts of memory repercent = quote(path[e.start:e.end], safe=b"/#%[]=:;$&()+,!?*@'~") - path = path[:e.start] + force_bytes(repercent) + path[e.end:] + path = path[:e.start] + repercent.encode() + path[e.end:] else: return path |