mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
download_from_google_storage: Do not call decode() on a string twice
This throws an exception when running with Python 3:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/rakuco/src/depot_tools/download_from_google_storage.py", line 259, in _downloader_worker_thread
file_url = '%s/%s' % (base_url, input_sha1_sum.decode())
AttributeError: 'str' object has no attribute 'decode'
We are already calling bytes.decode() in enumerate_input(), whose output
is passed to _downloader_worker_thread().
Bug: 984182, 1007872
Change-Id: I55c4835192caf69a8dee9e89ae1bb5531f4bacae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1844832
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
107c97c837
commit
e225ef6ac5
@@ -256,7 +256,7 @@ def _downloader_worker_thread(thread_num, q, force, base_url,
|
||||
if get_sha1(output_filename) == input_sha1_sum:
|
||||
continue
|
||||
# Check if file exists.
|
||||
file_url = '%s/%s' % (base_url, input_sha1_sum.decode())
|
||||
file_url = '%s/%s' % (base_url, input_sha1_sum)
|
||||
(code, _, err) = gsutil.check_call('ls', file_url)
|
||||
if code != 0:
|
||||
if code == 404:
|
||||
|
||||
Reference in New Issue
Block a user