Commit 2f6c7fd2 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Cache the string-escape codec at bot_update start

It looks the following speculative fix for string-escape codec worked
for depot_tools subprocess2: https://crbug.com/912292#c2.

Using the same approach for bot_update.

R=gavinmak@google.com

Bug: 1255228
Change-Id: I3244d34abad23f9fdbf648e24fc8a565df1474cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3210521Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 3ed476b8
......@@ -35,6 +35,12 @@ try:
except ImportError: # pragma: no cover
import urllib.parse as urlparse
# Cache the string-escape codec to ensure subprocess can find it later.
# See crbug.com/912292#c2 for context.
# TODO(crbug.com/1227140): Clean up when py2 is no longer supported.
if sys.version_info.major == 2:
codecs.lookup('string-escape')
# How many bytes at a time to read from pipes.
BUF_SIZE = 256
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment