Commit 9875e180 authored by John Budorick's avatar John Budorick Committed by Commit Bot

subprocess2: cache the string-escape codec at load time.

This is a speculative fix for subprocess being unable to find
string-escape later in execution; the theory being that something
(unclear what) is interfering w/ codecs' lookup logic and that calling
lookup earlier would allow string-escape to be cached before any such
interference. See crbug.com/912292#c2 for more.

Bug: 912292
Change-Id: I0abdd394253c9a4984db7c6c81d044087edc68fd
Reviewed-on: https://chromium-review.googlesource.com/c/1363753Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
parent 19238fc3
......@@ -8,6 +8,7 @@ In theory you shouldn't need anything else in subprocess, or this module failed.
"""
import cStringIO
import codecs
import errno
import logging
import os
......@@ -17,6 +18,9 @@ import sys
import time
import threading
# Cache the string-escape codec to ensure subprocess can find it later.
# See crbug.com/912292#c2 for context.
codecs.lookup('string-escape')
# Constants forwarded from subprocess.
PIPE = subprocess.PIPE
......
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