]> git.lizzy.rs Git - torbrowser-launcher.git/commitdiff
Force download URLs to be strings and not unicode (#205)
authorMicah Lee <micah@micahflee.com>
Mon, 9 Nov 2015 00:23:30 +0000 (16:23 -0800)
committerMicah Lee <micah@micahflee.com>
Mon, 9 Nov 2015 00:23:30 +0000 (16:23 -0800)
torbrowser_launcher/launcher.py

index d057410a82895827fab2a758a2937e4c651d1eb7..671bee747ce6d7c797fc2111dafac4de908e3257 100644 (file)
@@ -26,7 +26,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 """
 
-import os, subprocess, time, json, tarfile, hashlib, lzma, threading, re
+import os, subprocess, time, json, tarfile, hashlib, lzma, threading, re, unicodedata
 from twisted.internet import reactor
 from twisted.web.client import Agent, RedirectAgent, ResponseDone, ResponseFailed
 from twisted.web.http_headers import Headers
@@ -446,8 +446,10 @@ class Launcher:
         self.current_download_path = path
         self.current_download_url = url
 
-        # initialize the progress bar
         mirror_url = url.format(self.common.settings['mirror'])
+        mirror_url = unicodedata.normalize('NFKD', mirror_url).encode('ascii','ignore') # fix for #205
+
+        # initialize the progress bar
         self.progressbar.set_fraction(0)
         self.progressbar.set_text(_('Downloading {0}').format(name))
         self.progressbar.show()