Repository navigation
The REPL hangs under no memory on 3.13 #134163
Copy link
Copy link
Closed
Labels
3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixestopic-replRelated to the interactive shellRelated to the interactive shell3.15bugs and security fixesbugs and security fixes
on May 17, 2025 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on May 17, 2025 On windows 11 it works as expected (virtual terminal support on)
[2025-05-18 15:21:11] [D:\Sources\_pythonish\cpython\main] [main ≡ +17 ~10 -0 !] [ 1:56.656] ➜ .\python.bat Running Release|x64 interpreter... Python 3.15.0a0 (heads/main-dirty:0a160bf14c4, May 18 2025, 15:19:49) [MSC v.1943 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import _testcapi >>> _testcapi.set_nomemory(0) object address : 00000269B229DF00 object refcount : 3 object type : 00007FF8887AFDF0 object type name: MemoryError object repr : lost sys.stderrOn windows 11 it works as expected (virtual terminal support on)
I also didn't get any hangs either using
./configure --with-pydebug && makeon Linux (I tested on gcc and clang):>>> _testcapi.set_nomemory(0) object address : 0x79d5e61a42f0 object refcount : 3 object type : 0x591fb1b34f40 object type name: MemoryError object repr : lost sys.stderr
Ah, I screwed up when testing. 3.14 and 3.15 do exhibit the correct behavior, but not 3.13. My bad!
- removed3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes
on May 18, 2025 - changed the title
[-]The REPL hangs under no memory[/-][+]The REPL hangs under no memory on 3.13[/+]on May 18, 2025 - added a commit that references this issue
on Sep 10, 2025 Thanks @yihong0618 for the fix!
Reacted by yihong
Metadata
Metadata
Assignees
Labels
3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
In the new REPL, failing allocations seem to cause the prompt to get stuck:
I don't expect it to be able to work under no memory, but I do expect it to at least crash gracefully. The basic REPL spits this out before exiting:
Ideally, the new REPL should do something similar. This isn't at all a priority, but something fun for anyone bored and willing to take a stab at it.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs