You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2020/01/24 18:59:01 UTC

[allura] 08/13: [#7878] quote in py2 should always work on bytes, and it does internal caching so very weird distant code can get errors if safe param is unicode

This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 9632f6fbc8cc9f4a332adf9e541a2901cc0942a6
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Thu Jan 16 22:50:21 2020 +0000

    [#7878] quote in py2 should always work on bytes, and it does internal caching so very weird distant code can get errors if safe param is unicode
---
 Allura/allura/lib/helpers.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 2ded70d..6c35dcb 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -164,14 +164,14 @@ def monkeypatch(*objs):
     return patchem
 
 
-def urlquote(url, safe="/"):
+def urlquote(url, safe=b"/"):
     try:
         return urllib.quote(str(url), safe=safe)
     except UnicodeEncodeError:
         return urllib.quote(url.encode('utf-8'), safe=safe)
 
 
-def urlquoteplus(url, safe=""):
+def urlquoteplus(url, safe=b""):
     try:
         return urllib.quote_plus(str(url), safe=safe)
     except UnicodeEncodeError: