Title: traceback.print_last behaving differently across python versions · Issue #130250 · python/cpython · GitHub
Open Graph Title: traceback.print_last behaving differently across python versions · Issue #130250 · python/cpython
X Title: traceback.print_last behaving differently across python versions · Issue #130250 · python/cpython
Description: Bug report Bug description: traceback.print_last() correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it prints NoneType: None for 3.12.9 and 3.13.2 See also ipython/ipython#14744, I originally thought it was an ipy...
Open Graph Description: Bug report Bug description: traceback.print_last() correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it prints NoneType: None for 3.12.9 and 3.13.2 See also ipython/ipython#1...
X Description: Bug report Bug description: traceback.print_last() correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it prints NoneType: None for 3.12.9 and 3.13.2 See also ipython/ipython#1...
Opengraph URL: https://github.com/python/cpython/issues/130250
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"traceback.print_last behaving differently across python versions","articleBody":"# Bug report\n\n### Bug description:\n\n`traceback.print_last()` correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it prints `NoneType: None` for 3.12.9 and 3.13.2\n\nSee also https://github.com/ipython/ipython/issues/14744, I originally thought it was an ipython issue\n\n```\nPython 3.10.16 (main, Feb 13 2025, 14:32:36) [GCC 11.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e 1/0\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n\u003e\u003e\u003e import traceback\n\u003e\u003e\u003e traceback.print_last()\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n```\n\n```\nPython 3.11.9 (main, Feb 13 2025, 14:34:41) [GCC 11.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e 1/0\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n\u003e\u003e\u003e import traceback\n\u003e\u003e\u003e traceback.print_last()\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n```\n\n```\nPython 3.12.9 (main, Feb 13 2025, 13:23:03) [GCC 11.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e 1/0\nTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nZeroDivisionError: division by zero\n\u003e\u003e\u003e import traceback\n\u003e\u003e\u003e traceback.print_last()\nNoneType: None\n```\n\n```\nPython 3.13.2 (main, Feb 13 2025, 11:10:27) [GCC 11.4.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e 1/0\nTraceback (most recent call last):\n File \"\u003cpython-input-0\u003e\", line 1, in \u003cmodule\u003e\n 1/0\n ~^~\nZeroDivisionError: division by zero\n\u003e\u003e\u003e import traceback\n\u003e\u003e\u003e traceback.print_last()\nNoneType: None\n```\n\n\n### CPython versions tested on:\n\n3.10, 3.11, 3.12, 3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-130318\n* gh-130325\n* gh-130326\n* gh-130329\n* gh-130330\n* gh-130331\n* gh-130342\n* gh-130344\n* gh-130345\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/mironleon","@type":"Person","name":"mironleon"},"datePublished":"2025-02-18T08:42:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/130250/cpython/issues/130250"}
| 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:f86ca44b-ffa8-cf20-099a-9cd25f2d6052 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C654:33952:7C6BB9:A8BE3C:6A4EC44A |
| html-safe-nonce | f86b26e7c02cfe4512c18f7c1b79e31e89e6b2046581698757b82033595257ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjU0OjMzOTUyOjdDNkJCOTpBOEJFM0M6NkE0RUM0NEEiLCJ2aXNpdG9yX2lkIjoiMzcxNjY2Nzk1NTg4MDA1MTc4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8161cd25b1166e7eb9785617cc56861835c63634859acfb7dc9efada589553b3 |
| hovercard-subject-tag | issue:2859722356 |
| 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/130250/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b455b89de733bbf771a5913f1fc869c97dcc106c893e9065a63ff7ddf516140/python/cpython/issues/130250 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b455b89de733bbf771a5913f1fc869c97dcc106c893e9065a63ff7ddf516140/python/cpython/issues/130250 |
| og:image:alt | Bug report Bug description: traceback.print_last() correctly prints the latest traceback for python 3.10.16 and 3.11.9, but it prints NoneType: None for 3.12.9 and 3.13.2 See also ipython/ipython#1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mironleon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width