Echo function with a child Python process Pickle the input data into a buffer, send it to a subprocess via stdin, expect the subprocess to unpickle, re-pickle that data back and send it back to the parent process via stdout for final unpickling. >>> subprocess_pickle_echo([1, 'a', No
(input_data, protocol=None, timeout=TIMEOUT, add_env=None)
| 81 | |
| 82 | |
| 83 | def subprocess_pickle_echo(input_data, protocol=None, timeout=TIMEOUT, add_env=None): |
| 84 | """Echo function with a child Python process |
| 85 | Pickle the input data into a buffer, send it to a subprocess via |
| 86 | stdin, expect the subprocess to unpickle, re-pickle that data back |
| 87 | and send it back to the parent process via stdout for final unpickling. |
| 88 | >>> subprocess_pickle_echo([1, 'a', None]) |
| 89 | [1, 'a', None] |
| 90 | """ |
| 91 | out = subprocess_pickle_string( |
| 92 | input_data, protocol=protocol, timeout=timeout, add_env=add_env |
| 93 | ) |
| 94 | return loads(out) |
| 95 | |
| 96 | |
| 97 | def _read_all_bytes(stream_in, chunk_size=4096): |
no test coverage detected
searching dependent graphs…