Title: The REPL hangs under no memory on 3.13 · Issue #134163 · python/cpython · GitHub
Open Graph Title: The REPL hangs under no memory on 3.13 · Issue #134163 · python/cpython
X Title: The REPL hangs under no memory on 3.13 · Issue #134163 · python/cpython
Description: Bug report Bug description: In the new REPL, failing allocations seem to cause the prompt to get stuck: >>> import _testcapi >>> _testcapi.set_nomemory(0) # Now wait forever I don't expect it to be able to work under no memory, but I do ...
Open Graph Description: Bug report Bug description: In the new REPL, failing allocations seem to cause the prompt to get stuck: >>> import _testcapi >>> _testcapi.set_nomemory(0) # Now wait forever I don't expect it to be...
X Description: Bug report Bug description: In the new REPL, failing allocations seem to cause the prompt to get stuck: >>> import _testcapi >>> _testcapi.set_nomemory(0) # Now wait forever I don...
Opengraph URL: https://github.com/python/cpython/issues/134163
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The REPL hangs under no memory on 3.13","articleBody":"# Bug report\n\n### Bug description:\n\nIn the new REPL, failing allocations seem to cause the prompt to get stuck:\n\n```python\n\u003e\u003e\u003e import _testcapi\n\u003e\u003e\u003e _testcapi.set_nomemory(0) # Now wait forever\n```\n\nI 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:\n\n```\nobject address : 0x7f02f532d180\nobject refcount : 3\nobject type : 0x7f02f5ec7780\nobject type name: MemoryError\nobject repr : \nlost sys.stderr\n```\n\nIdeally, 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.\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-138491\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ZeroIntensity","@type":"Person","name":"ZeroIntensity"},"datePublished":"2025-05-17T23:46:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/134163/cpython/issues/134163"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e9855848-ab12-7d63-bf41-abc60381df97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C5E8:31006B:1F9DB8C:29DAD1D:696B09BF |
| html-safe-nonce | 4a526bb1742cd1af886d13f13ab07c2b82946dc53e0e716a130157585cb62fd4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUU4OjMxMDA2QjoxRjlEQjhDOjI5REFEMUQ6Njk2QjA5QkYiLCJ2aXNpdG9yX2lkIjoiNTkyMDk3MTc1MjE4NjIwODYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 31973cd6951f0dd83cc7c73fb03fa235fc6b5d0f5f27ab7c1c79a86c61d35b84 |
| hovercard-subject-tag | issue:3071159488 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/134163/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb64543638c4d3c8428435730f59293dd9fbbe2be167cec9f5470afb5a38ae75/python/cpython/issues/134163 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb64543638c4d3c8428435730f59293dd9fbbe2be167cec9f5470afb5a38ae75/python/cpython/issues/134163 |
| og:image:alt | Bug report Bug description: In the new REPL, failing allocations seem to cause the prompt to get stuck: >>> import _testcapi >>> _testcapi.set_nomemory(0) # Now wait forever I don't expect it to be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ZeroIntensity |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width