From 00d2fe8e73c9ab4294f66e3e1414fb817552e756 Mon Sep 17 00:00:00 2001 From: Nathan Woodrow Date: Thu, 27 Sep 2018 16:10:46 +1000 Subject: [PATCH] [FIX] - Quote url with space --- src/roam/updater.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/roam/updater.py b/src/roam/updater.py index e61ea9e67..b6c8d2017 100644 --- a/src/roam/updater.py +++ b/src/roam/updater.py @@ -4,6 +4,7 @@ import re import zipfile import urlparse +import urllib import urllib2 import Queue import logging @@ -27,6 +28,10 @@ class UpdateExpection(Exception): pass +def quote_url(url): + return urllib.quote(url, safe="%/:=&?~#+!$,;'@()*[]") + + def add_slash(url): if not url.endswith("/"): url += "/" @@ -106,6 +111,8 @@ def download_file(url, fileout): Will open and write to fileout """ + url = quote_url(url) + roam.utils.debug("Opening URL: {}".format(url)) try: result = urllib2.urlopen(url) @@ -198,6 +205,7 @@ def __init__(self, basefolder): self.projectUpdateStatus.connect(self.status_updated) def check_url_found(self, url): + url = quote_url(url) try: result = urllib2.urlopen(url) return result.code == 200