MCPcopy Index your code
hub / github.com/python/cpython / get_child_details

Method get_child_details

Lib/test/test_c_locale_coercion.py:139–160  ·  view source on GitHub ↗

Retrieves fsencoding and standard stream details from a child process Returns (encoding_details, stderr_lines): - encoding_details: EncodingDetails for eager decoding - stderr_lines: result of calling splitlines() on the stderr output The child is run in isolated m

(cls, env_vars)

Source from the content-addressed store, hash-verified

137
138 @classmethod
139 def get_child_details(cls, env_vars):
140 """Retrieves fsencoding and standard stream details from a child process
141
142 Returns (encoding_details, stderr_lines):
143
144 - encoding_details: EncodingDetails for eager decoding
145 - stderr_lines: result of calling splitlines() on the stderr output
146
147 The child is run in isolated mode if the current interpreter supports
148 that.
149 """
150 result, py_cmd = run_python_until_end(
151 "-X", "utf8=0", "-c", cls.CHILD_PROCESS_SCRIPT,
152 **env_vars
153 )
154 if not result.rc == 0:
155 result.fail(py_cmd)
156 # All subprocess outputs in this test case should be pure ASCII
157 stdout_lines = result.out.decode("ascii").splitlines()
158 child_encoding_details = dict(cls(*stdout_lines)._asdict())
159 stderr_lines = result.err.decode("ascii").rstrip().splitlines()
160 return child_encoding_details, stderr_lines
161
162
163# Details of the shared library warning emitted at runtime

Callers 1

Calls 6

run_python_until_endFunction · 0.90
clsClass · 0.50
failMethod · 0.45
splitlinesMethod · 0.45
decodeMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected