mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
download_from_google_storage: Decode string passed to re.search()
The code in _downloader_worker_thread() does not work 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 343, in _downloader_worker_thread
elif re.search(r'executable:\s*1', out):
File "/usr/lib/python3.7/re.py", line 183, in search
return _compile(pattern, flags).search(string)
TypeError: cannot use a string pattern on a bytes-like object
Bug: 984182, 1007872
Change-Id: I09df8169d802b010596ac4f34501b4bda805e6f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1844833
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
e225ef6ac5
commit
5189047f97
@@ -340,7 +340,7 @@ def _downloader_worker_thread(thread_num, q, force, base_url,
|
||||
if code != 0:
|
||||
out_q.put('%d> %s' % (thread_num, err.decode()))
|
||||
ret_codes.put((code, err.decode()))
|
||||
elif re.search(r'executable:\s*1', out):
|
||||
elif re.search(r'executable:\s*1', out.decode()):
|
||||
st = os.stat(output_filename)
|
||||
os.chmod(output_filename, st.st_mode | stat.S_IEXEC)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user