MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_child_details

Method get_child_details

Lib/test/test_c_locale_coercion.py:133–154  ·  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

131
132 @classmethod
133 def get_child_details(cls, env_vars):
134 """Retrieves fsencoding and standard stream details from a child process
135
136 Returns (encoding_details, stderr_lines):
137
138 - encoding_details: EncodingDetails for eager decoding
139 - stderr_lines: result of calling splitlines() on the stderr output
140
141 The child is run in isolated mode if the current interpreter supports
142 that.
143 """
144 result, py_cmd = run_python_until_end(
145 "-X", "utf8=0", "-c", cls.CHILD_PROCESS_SCRIPT,
146 **env_vars
147 )
148 if not result.rc == 0:
149 result.fail(py_cmd)
150 # All subprocess outputs in this test case should be pure ASCII
151 stdout_lines = result.out.decode("ascii").splitlines()
152 child_encoding_details = dict(cls(*stdout_lines)._asdict())
153 stderr_lines = result.err.decode("ascii").rstrip().splitlines()
154 return child_encoding_details, stderr_lines
155
156
157# 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