Skip to content

Commit 4ab8356

Browse files
committed
Escape url elements for cache location
1 parent 5205c87 commit 4ab8356

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mbed/mbed.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import ctypes
3131
from itertools import chain, izip, repeat
3232
from urlparse import urlparse
33+
import urllib
3334
import urllib2
3435
import zipfile
3536
import argparse
@@ -1277,8 +1278,8 @@ def rm_untracked(self):
12771278

12781279
def get_cache(self, url, scm):
12791280
up = urlparse(formaturl(url, 'https'))
1280-
if self.cache and up and up.netloc and os.path.isdir(os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path), '.'+scm)):
1281-
return os.path.join(self.cache, up.netloc, re.sub(r'^/', '', up.path))
1281+
if self.cache and up and up.netloc and os.path.isdir(os.path.join(self.cache, urllib.quote(up.netloc), urllib.quote(re.sub(r'^/', '', up.path), '.'+scm))):
1282+
return os.path.join(self.cache, urllib.quote(up.netloc), urllib.quote(re.sub(r'^/', '', up.path)))
12821283

12831284
def set_cache(self, url):
12841285
up = urlparse(formaturl(url, 'https'))

0 commit comments

Comments
 (0)