gh-118331: Handle errors in _PyObject_SetManagedDict#118334
Conversation
When detaching a dict, the copy_values call may fail due to out-of-memory errors. This can be triggered by test_no_memory in test_repl.
|
Running this on this branch: make clean
git clean -fdx .
./configure --with-pydebug && make -j10
./python.exe Lib/test/test_repl.pyI still get the error: .....F.
======================================================================
FAIL: test_no_memory (__main__.TestInteractiveInterpreter.test_no_memory)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/private/tmp/cpython/Lib/test/test_repl.py", line 86, in test_no_memory
self.assertIn(p.returncode, (1, 120))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: -6 not found in (1, 120)
----------------------------------------------------------------------
Ran 7 tests in 0.331s
FAILED (failures=1) |
Sorry, something went wrong.
|
Hmmm... maybe there are multiple unhandled exceptions? I haven't yet been able to reproduce additional failures with this PR. |
Sorry, something went wrong.
|
My experience is the same as @colesbury:
I tested on both fedora and MacOS. |
Sorry, something went wrong.
|
It's really strange, I can repro on I can also repro with this branch and #118336. |
Sorry, something went wrong.
|
gh-118331 fixes it for me, and also with that merged into this. Thanks! |
Sorry, something went wrong.
DinoV
left a comment
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
When detaching a dict, the copy_values call may fail due to out-of-memory errors. This can be triggered by
test_no_memoryintest_repl.