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/11/05 22:09:08 UTC

[allura] 04/04: [#8379] use unicode for tarball_url building

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

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

commit 438045424923f74c12e4ab350ecf5ebd4872a63d
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Thu Nov 5 17:08:35 2020 -0500

    [#8379] use unicode for tarball_url building
---
 Allura/allura/controllers/repository.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 7ee5e95..53a64e5 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -779,10 +779,10 @@ class TreeBrowser(BaseController, DispatchIndex):
         tool_subscribed = M.Mailbox.subscribed()
         tarball_url = None
         if asbool(tg.config.get('scm.repos.tarball.enable', False)):
-            cutout = len(b'tree' + self._path.encode('utf8'))
+            cutout = len('tree' + self._path)
             if request.path.endswith('/') and not self._path.endswith('/'):
                 cutout += 1
-            tarball_url = h.urlquote('%starball' % unquote(request.path)[:-cutout])
+            tarball_url = h.urlquote(request.path_info[:-cutout] + 'tarball')
         return dict(
             repo=c.app.repo,
             commit=self._commit,