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

Holger Levsen holger at moszumanska.debian.org
Sat Dec 5 14:30:46 UTC 2015


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

holger pushed a commit to branch debian/sid
in repository torbrowser-launcher.

commit 513b3a95061523c4f9c7bae0b7178e685107a507
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