diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index f38e48baad..08d92ed08e 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -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