You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/01/21 16:03:30 UTC

[allura] 08/12: [#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.

brondsem pushed a commit to branch db/7878
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 6fb573fd7f95c326757dcc6184502743865a6e5c
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: