GeezerVison is showing github.com — gh-157048: check for buffer errors before mutating in BytesIO.__init__ by ngoldbaum · Pull Request #157049 · python/cpython
Conversation
ngoldbaum
commented
Sep 6, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks, I'll let you merge this :)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Uh oh!
There was an error while loading. Please reload this page.
|
@kumaraditya303 thanks for the review! Can you help with my intuition: do you think this should be backported?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit d125f00.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/345/builds/15281) and take a look at the build logs.
- Check if the failure is related to this commit (d125f00) or if it is a false positive.
- If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.
You can take a look at the buildbot page here:
https://buildbot.python.org/#/builders/345/builds/15281
Failed tests:
- test.test_multiprocessing_spawn.test_misc
- test.test_multiprocessing_fork.test_misc
Failed subtests:
- test_large_pool - test.test_multiprocessing_fork.test_misc.MiscTestCase.test_large_pool
- test_large_pool - test.test_multiprocessing_spawn.test_misc.MiscTestCase.test_large_pool
Summary of the results of the build (if available):
==
Click to see traceback logs
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/_test_multiprocessing.py", line 7633, in test_large_pool
rc, out, err = script_helper.assert_python_ok(testfn)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 182, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 167, in _assert_python
res.fail(cmd_line)
~~~~~~~~^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 80, in fail
raise AssertionError(f"Process return code is {exitcode}\n"
...<10 lines>...
f"---")
AssertionError: Process return code is 1
command line: ['/root/buildarea/3.x.angelico-debian-amd64/build/python', '-X', 'faulthandler', '-I', '@test_2432591_tmpæ']
Traceback (most recent call last):
File "<string>", line 1, in <module>
import sys; from multiprocessing.forkserver import main; main(10, 11, ['__main__'], sys_argv=sys.argv[1:], **{'sys_path': ['/root/buildarea/3.x.angelico-debian-amd64/build/target/lib/python316.zip', '/root/buildarea/3.x.angelico-debian-amd64/build/Lib', '/root/buildarea/3.x.angelico-debian-amd64/build/build/lib.linux-x86_64-3.16'], 'main_path': '/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2432591æ/@test_2432591_tmpæ', 'authkey_r': 13})
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 406, in main
pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2432591æ/@test_2432591_tmpæ", line 4, in <module>
with multiprocessing.Pool(200) as p:
~~~~~~~~~~~~~~~~~~~~^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 120, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 220, in __init__
self._repopulate_pool()
~~~~~~~~~~~~~~~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 312, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
self._processes,
^^^^^^^^^^^^^^^^
...<3 lines>...
self._maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^
self._wrap_exception)
^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 335, in _repopulate_pool_static
w.start()
~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
~~~~~~~~~~~^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 310, in _Popen
return Popen(process_obj)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 35, in __init__
super().__init__(process_obj)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_fork.py", line 20, in __init__
self._launch(process_obj)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 59, in _launch
self.pid = forkserver.read_signed(self.sentinel)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 472, in read_signed
raise EOFError('unexpected EOF')
EOFError: unexpected EOF
---
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/_test_multiprocessing.py", line 7633, in test_large_pool
rc, out, err = script_helper.assert_python_ok(testfn)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 182, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 167, in _assert_python
res.fail(cmd_line)
~~~~~~~~^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 80, in fail
raise AssertionError(f"Process return code is {exitcode}\n"
...<10 lines>...
f"---")
AssertionError: Process return code is 1
command line: ['/root/buildarea/3.x.angelico-debian-amd64/build/python', '-X', 'faulthandler', '-I', '@test_2400747_tmpæ']
Traceback (most recent call last):
File "<string>", line 1, in <module>
import sys; from multiprocessing.forkserver import main; main(10, 11, ['__main__'], sys_argv=sys.argv[1:], **{'sys_path': ['/root/buildarea/3.x.angelico-debian-amd64/build/target/lib/python316.zip', '/root/buildarea/3.x.angelico-debian-amd64/build/Lib', '/root/buildarea/3.x.angelico-debian-amd64/build/build/lib.linux-x86_64-3.16'], 'main_path': '/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2410098æ/@test_2410098_tmpæ', 'authkey_r': 13})
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 406, in main
pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2410098æ/@test_2410098_tmpæ", line 4, in <module>
with multiprocessing.Pool(200) as p:
~~~~~~~~~~~~~~~~~~~~^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 120, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 220, in __init__
self._repopulate_pool()
~~~~~~~~~~~~~~~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 312, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
self._processes,
^^^^^^^^^^^^^^^^
...<3 lines>...
self._maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^
self._wrap_exception)
^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 335, in _repopulate_pool_static
w.start()
~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
~~~~~~~~~~~^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 310, in _Popen
return Popen(process_obj)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 35, in __init__
super().__init__(process_obj)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_fork.py", line 20, in __init__
self._launch(process_obj)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 59, in _launch
self.pid = forkserver.read_signed(self.sentinel)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 472, in read_signed
raise EOFError('unexpected EOF')
EOFError: unexpected EOF
---
Traceback (most recent call last):
File "<string>", line 1, in <module>
import sys; from multiprocessing.forkserver import main; main(10, 11, ['__main__'], sys_argv=sys.argv[1:], **{'sys_path': ['/root/buildarea/3.x.angelico-debian-amd64/build/target/lib/python316.zip', '/root/buildarea/3.x.angelico-debian-amd64/build/Lib', '/root/buildarea/3.x.angelico-debian-amd64/build/build/lib.linux-x86_64-3.16'], 'main_path': '/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2400747æ/@test_2400747_tmpæ', 'authkey_r': 13})
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 406, in main
pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/build/test_python_2400747æ/@test_2400747_tmpæ", line 4, in <module>
with multiprocessing.Pool(200) as p:
~~~~~~~~~~~~~~~~~~~~^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 120, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 220, in __init__
self._repopulate_pool()
~~~~~~~~~~~~~~~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 312, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
self._processes,
^^^^^^^^^^^^^^^^
...<3 lines>...
self._maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^
self._wrap_exception)
^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/pool.py", line 335, in _repopulate_pool_static
w.start()
~~~~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
~~~~~~~~~~~^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/context.py", line 310, in _Popen
return Popen(process_obj)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 35, in __init__
super().__init__(process_obj)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_fork.py", line 20, in __init__
self._launch(process_obj)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/popen_forkserver.py", line 59, in _launch
self.pid = forkserver.read_signed(self.sentinel)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/forkserver.py", line 472, in read_signed
raise EOFError('unexpected EOF')
EOFError: unexpected EOF
---
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/_test_multiprocessing.py", line 7633, in test_large_pool
rc, out, err = script_helper.assert_python_ok(testfn)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 182, in assert_python_ok
return _assert_python(True, *args, **env_vars)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 167, in _assert_python
res.fail(cmd_line)
~~~~~~~~^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/script_helper.py", line 80, in fail
raise AssertionError(f"Process return code is {exitcode}\n"
...<10 lines>...
f"---")
AssertionError: Process return code is 1
command line: ['/root/buildarea/3.x.angelico-debian-amd64/build/python', '-X', 'faulthandler', '-I', '@test_2410098_tmpæ']
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
do you think this should be backported?
Yes, seems fine to backport
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @ngoldbaum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @ngoldbaum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @ngoldbaum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry, @ngoldbaum, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker d125f009dc2a698de62deb11a0c50d3ef8e33d62 3.13
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|