MCPcopy Create free account
hub / github.com/numpy/numpy / filepath_from_subprocess_output

Function filepath_from_subprocess_output

numpy/distutils/exec_command.py:63–77  ·  view source on GitHub ↗

Convert `bytes` in the encoding used by a subprocess into a filesystem-appropriate `str`. Inherited from `exec_command`, and possibly incorrect.

(output)

Source from the content-addressed store, hash-verified

61from numpy.distutils import log
62
63def filepath_from_subprocess_output(output):
64 """
65 Convert `bytes` in the encoding used by a subprocess into a filesystem-appropriate `str`.
66
67 Inherited from `exec_command`, and possibly incorrect.
68 """
69 mylocale = locale.getpreferredencoding(False)
70 if mylocale is None:
71 mylocale = 'ascii'
72 output = output.decode(mylocale, errors='replace')
73 output = output.replace('\r\n', '\n')
74 # Another historical oddity
75 if output[-1:] == '\n':
76 output = output[:-1]
77 return output
78
79
80def forward_bytes_to_stdout(val):

Callers 8

CCompiler_get_versionFunction · 0.90
get_config_outputMethod · 0.90
get_libgcc_dirMethod · 0.90
get_libgfortran_dirMethod · 0.90
get_targetMethod · 0.90
_linkMethod · 0.90
get_outputMethod · 0.90

Calls 2

decodeMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected