Commit 0d207fd8 authored by Gregory P. Smith's avatar Gregory P. Smith

Fixes issue #26083: Workaround a subprocess bug that raised an incorrect

"ValueError: insecure string pickle" exception instead of the actual exception
on some platforms such as Mac OS X when an exception raised in the forked child
process prior to the exec() was large enough that it overflowed the internal
errpipe_read pipe buffer.
parent 167c3367
...@@ -1313,8 +1313,12 @@ class Popen(object): ...@@ -1313,8 +1313,12 @@ class Popen(object):
os.close(errpipe_write) os.close(errpipe_write)
# Wait for exec to fail or succeed; possibly raising exception # Wait for exec to fail or succeed; possibly raising exception
# Exception limited to 1M
data = _eintr_retry_call(os.read, errpipe_read, 1048576) data = _eintr_retry_call(os.read, errpipe_read, 1048576)
pickle_bits = [data]
while data:
pickle_bits.append(data)
data = _eintr_retry_call(os.read, errpipe_read, 1048576)
data = "".join(pickle_bits)
finally: finally:
if p2cread is not None and p2cwrite is not None: if p2cread is not None and p2cwrite is not None:
_close_in_parent(p2cread) _close_in_parent(p2cread)
......
...@@ -39,6 +39,12 @@ Core and Builtins ...@@ -39,6 +39,12 @@ Core and Builtins
Library Library
------- -------
- Issue #26083: Workaround a subprocess bug that raises an incorrect
"ValueError: insecure string pickle" exception instead of the actual
exception on some platforms such as Mac OS X when an exception raised
in the forked child process prior to the exec() was large enough that
it overflowed the internal errpipe_read pipe buffer.
- Issue #24103: Fixed possible use after free in ElementTree.iterparse(). - Issue #24103: Fixed possible use after free in ElementTree.iterparse().
- Issue #20954: _args_from_interpreter_flags used by multiprocessing and some - Issue #20954: _args_from_interpreter_flags used by multiprocessing and some
......
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