Skip to content

Commit a7a7598

Browse files
committed
Merge branch 'mbtamuli-fix_update_command' into develop
2 parents 14051b7 + 9ae5d7d commit a7a7598

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ee/core/download.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ def download(self, packages):
2222
if not os.path.exists(directory):
2323
os.makedirs(directory)
2424
Log.info(self, "Downloading {0:20}".format(pkg_name), end=' ')
25-
urllib.request.urlretrieve(url, filename)
25+
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
26+
with urllib.request.urlopen(req) as response, open(filename, 'wb') as out_file:
27+
out_file.write(response.read())
2628
Log.info(self, "{0}".format("[" + Log.ENDC + "Done"
2729
+ Log.OKBLUE + "]"))
2830
except urllib.error.URLError as e:

0 commit comments

Comments
 (0)