Title: Incorrect syntax error · Issue #133999 · python/cpython · GitHub
Open Graph Title: Incorrect syntax error · Issue #133999 · python/cpython
X Title: Incorrect syntax error · Issue #133999 · python/cpython
Description: Bug report Bug description: >>> try: 1/0 ... except Exception as exc: raise from exc ... File "
Open Graph Description: Bug report Bug description: >>> try: 1/0 ... except Exception as exc: raise from exc ... File "
X Description: Bug report Bug description: >>> try: 1/0 ... except Exception as exc: raise from exc ... File "<python-input-0>", line 2 except Exception as exc: raise from exc ^^^ SyntaxE...
Opengraph URL: https://github.com/python/cpython/issues/133999
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect syntax error","articleBody":"# Bug report\n\n### Bug description:\n\n```python\n\u003e\u003e\u003e try: 1/0\n... except Exception as exc: raise from exc\n... \n File \"\u003cpython-input-0\u003e\", line 2\n except Exception as exc: raise from exc\n ^^^\nSyntaxError: cannot use except statement with name\n```\nShould be:\n```py\n\u003e\u003e\u003e try: 1/0\n... except: raise from ValueError()\n... \n File \"\u003cpython-input-2\u003e\", line 2\n except: raise from ValueError()\n ^^^^\nSyntaxError: invalid syntax\n```\n\n### CPython versions tested on:\n\nCPython main branch, 3.14\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-134035\n* gh-134206\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/tom-pytel","@type":"Person","name":"tom-pytel"},"datePublished":"2025-05-14T11:17:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/133999/cpython/issues/133999"}
| 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:fa234efd-d950-e825-7fcb-28b61da45377 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C32C:53BBD:C08B25:F97185:696B26B2 |
| html-safe-nonce | d679c7e74a279e05f4fc0d9cca176003a81aeeffbb85c4b5c847dae36c770461 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzJDOjUzQkJEOkMwOEIyNTpGOTcxODU6Njk2QjI2QjIiLCJ2aXNpdG9yX2lkIjoiNTE2MTExMjQ0MDE1NzE4NTcxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b453a5a4f4bf322b77a492753b65fa82eed3bee032b2929a297fa79f5fd430e2 |
| hovercard-subject-tag | issue:3062761823 |
| 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/133999/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87de2957a1ea345353478c399d1b64f19456f4546aa43a4c83856bfb82488bee/python/cpython/issues/133999 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87de2957a1ea345353478c399d1b64f19456f4546aa43a4c83856bfb82488bee/python/cpython/issues/133999 |
| og:image:alt | Bug report Bug description: >>> try: 1/0 ... except Exception as exc: raise from exc ... File " |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tom-pytel |
| 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