[Pkg-privacy-commits] [torbrowser-launcher] 05/15: Only convert unicode URLs to strings if they are actually unicode (#205)

Holger Levsen holger at moszumanska.debian.org
Fri Nov 13 17:54:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag debian/0.2.2-1
in repository torbrowser-launcher.

commit 94d184a26bb77f46e8256c23246fe68fa49552b0
Author: Micah Lee <micah at micahflee.com>
Date:   Sun Nov 8 16:27:03 2015 -0800

    Only convert unicode URLs to strings if they are actually unicode (#205)
---
 torbrowser_launcher/launcher.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index 671bee7..ff4adcd 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -447,7 +447,10 @@ class Launcher:
         self.current_download_url = url
 
         mirror_url = url.format(self.common.settings['mirror'])
-        mirror_url = unicodedata.normalize('NFKD', mirror_url).encode('ascii','ignore') # fix for #205
+
+        # convert mirror_url from unicode to string, if needed (#205)
+        if isinstance(mirror_url, unicode):
+            mirror_url = unicodedata.normalize('NFKD', mirror_url).encode('ascii','ignore')
 
         # initialize the progress bar
         self.progressbar.set_fraction(0)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list