Title: REPL shows source code from `_pyrepl.__main__.py` · Issue #129098 · python/cpython · GitHub
Open Graph Title: REPL shows source code from `_pyrepl.__main__.py` · Issue #129098 · python/cpython
X Title: REPL shows source code from `_pyrepl.__main__.py` · Issue #129098 · python/cpython
Description: Bug report Bug description: When using compile built-in function and providing non-existing filename, REPL shows source lines from _pyrepl.__main__.py if exception occurs. Reproducer: Python 3.14.0a4+ (heads/main-dirty:ed6934e71e5, Jan 2...
Open Graph Description: Bug report Bug description: When using compile built-in function and providing non-existing filename, REPL shows source lines from _pyrepl.__main__.py if exception occurs. Reproducer: Python 3.14.0...
X Description: Bug report Bug description: When using compile built-in function and providing non-existing filename, REPL shows source lines from _pyrepl.__main__.py if exception occurs. Reproducer: Python 3.14.0...
Opengraph URL: https://github.com/python/cpython/issues/129098
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"REPL shows source code from `_pyrepl.__main__.py`","articleBody":"# Bug report\n\n### Bug description:\n\nWhen using `compile` built-in function and providing non-existing filename, REPL shows source lines from `_pyrepl.__main__.py` if exception occurs. Reproducer:\n\n```bash\nPython 3.14.0a4+ (heads/main-dirty:ed6934e71e5, Jan 20 2025, 18:59:25) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e eval(compile(\"val\", \"non-existing-file\", \"eval\"))\n```\nResults in:\n```bash\nTraceback (most recent call last):\n File \"\u003cpython-input-0\u003e\", line 1, in \u003cmodule\u003e\n eval(compile(\"val\", \"non-existing-file\", \"eval\"))\n ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"non-existing-file\", line 1, in \u003cmodule\u003e\n # Important: don't add things to this module, as they will end up in the REPL's\nNameError: name 'val' is not defined. Did you mean: 'eval'?\n\u003e\u003e\u003e \n```\ntraceback with following line: `# Important: don't add things to this module, as they will end up in the REPL's`. This is first line from `Lib/_pyrepl/__main__.py`.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-129099\n* gh-130721\n* gh-132755\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/WolframAlph","@type":"Person","name":"WolframAlph"},"datePublished":"2025-01-20T19:29:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/129098/cpython/issues/129098"}
| 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:def94ee1-f777-be6d-f151-89c1ca694fb3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9936:193CDB:7535A6:9A9B4A:696AEA11 |
| html-safe-nonce | 3fd6259f6497aa0e4122c0f17a3c549368403bc097603a147829d11933422c72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTM2OjE5M0NEQjo3NTM1QTY6OUE5QjRBOjY5NkFFQTExIiwidmlzaXRvcl9pZCI6IjgwOTY4MTE5Njk1Mzc1NjcyNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7b805c499262b42f3cdf53444a6dd6a48be7434e840227adcb760b0d2aa2907f |
| hovercard-subject-tag | issue:2800150567 |
| 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/129098/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa8852e458c258da9527f8894036274a6bfbdf959833da6979dd26a23bc5097b/python/cpython/issues/129098 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa8852e458c258da9527f8894036274a6bfbdf959833da6979dd26a23bc5097b/python/cpython/issues/129098 |
| og:image:alt | Bug report Bug description: When using compile built-in function and providing non-existing filename, REPL shows source lines from _pyrepl.__main__.py if exception occurs. Reproducer: Python 3.14.0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | WolframAlph |
| 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