René's URL Explorer Experiment


Title: bpo-40612: Fix SyntaxError edge cases in traceback formatting by gvanrossum · Pull Request #20072 · python/cpython · GitHub

Open Graph Title: bpo-40612: Fix SyntaxError edge cases in traceback formatting by gvanrossum · Pull Request #20072 · python/cpython

X Title: bpo-40612: Fix SyntaxError edge cases in traceback formatting by gvanrossum · Pull Request #20072 · python/cpython

Description: This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: Suppress caret if it points left of text Allow caret pointing just past end of line If caret points past end of line, clip to just past end of line The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c. There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice. https://bugs.python.org/issue40612 Automerge-Triggered-By: @gvanrossum

Open Graph Description: This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: Suppress caret if it points left of text A...

X Description: This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: Suppress caret if it points left of text A...

Opengraph URL: https://github.com/python/cpython/pull/20072

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:47623fe1-35ea-2831-faba-715d0bd74e36
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB0B8:117B82:442AA6:5FCBFA:696A4692
html-safe-nonce1773302ea9a2324741766e6e8e3665b1eb2cb77153391b3e3b107c2ecd28b7c7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEI4OjExN0I4Mjo0NDJBQTY6NUZDQkZBOjY5NkE0NjkyIiwidmlzaXRvcl9pZCI6IjM0NDA0NzIzODczMTQ0MDI5NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca276b690a6e8f20799a17fb9b21b1aa4ec0771639a0bfa6ac545872802b9a4b9
hovercard-subject-tagpull_request:417498081
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/20072/files
twitter:imagehttps://avatars.githubusercontent.com/u/2894642?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2894642?s=400&v=4
og:image:altThis fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: Suppress caret if it points left of text A...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/20072/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F20072%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F20072%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/20072/files
Reloadhttps://github.com/python/cpython/pull/20072/files
Reloadhttps://github.com/python/cpython/pull/20072/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
miss-islingtonhttps://github.com/miss-islington
masterhttps://github.com/python/cpython/tree/master
fix-traceback-syntax-errorhttps://github.com/python/cpython/tree/fix-traceback-syntax-error
Conversation 18 https://github.com/python/cpython/pull/20072
Commits 8 https://github.com/python/cpython/pull/20072/commits
Checks 0 https://github.com/python/cpython/pull/20072/checks
Files changed https://github.com/python/cpython/pull/20072/files
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
bpo-40612: Fix SyntaxError edge cases in traceback formatting https://github.com/python/cpython/pull/20072/files#top
Show all changes 8 commits https://github.com/python/cpython/pull/20072/files
87e78b5 bpo-40612: Fix SyntaxError edge cases in traceback module gvanrossum May 13, 2020 https://github.com/python/cpython/pull/20072/commits/87e78b517b22bd5a7e2d55313a67585924c1d80b
b951b0f Misc/NEWS blurb gvanrossum May 13, 2020 https://github.com/python/cpython/pull/20072/commits/b951b0f15b2497f3e254fff5fd1f4980750a237b
ea1c6f2 Refactor print_error_text() gvanrossum May 13, 2020 https://github.com/python/cpython/pull/20072/commits/ea1c6f23492ea2baad8cefe7a47d07c0c7807579
72e5b93 Fix test (and rebase) gvanrossum May 13, 2020 https://github.com/python/cpython/pull/20072/commits/72e5b93e2447a3f6ccf1ac0a6797156e7cb61579
6df7662 Add thorough test, and fix found issues in traceback.py gvanrossum May 14, 2020 https://github.com/python/cpython/pull/20072/commits/6df7662ca5f0fa63d31986f56b3d7dd33889be0e
1c7e6bb Remove debug print() calls gvanrossum May 14, 2020 https://github.com/python/cpython/pull/20072/commits/1c7e6bb160e3f25117ee3f13f9b751b46b477233
31641ff Apply PEP 7 suggestions from code review gvanrossum May 15, 2020 https://github.com/python/cpython/pull/20072/commits/31641ff0e4b18c8d002d019f4506f0e8fb446983
f93a54c Merge branch 'master' into fix-traceback-syntax-error gvanrossum May 15, 2020 https://github.com/python/cpython/pull/20072/commits/f93a54c48fc1644012aa0d4ee3887c1d121ac40e
Clear filters https://github.com/python/cpython/pull/20072/files
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
test_cmd_line_script.py https://github.com/python/cpython/pull/20072/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
test_traceback.py https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
traceback.py https://github.com/python/cpython/pull/20072/files#diff-96634ca56022c201d0ff677e922810a97e4ad8a55de53258cf0cbc22bd7c9be1
2020-05-13-10-23-29.bpo-40612.gOIreM.rst https://github.com/python/cpython/pull/20072/files#diff-4b28fa72b27202a4736d18423b8b62caf23696b06b433247697e8cbf97ce0487
pythonrun.c https://github.com/python/cpython/pull/20072/files#diff-2ecd9b536bc387479d824dc4b53f89679d6978d25c6b8a28ab21ed03e745e46e
Lib/test/test_cmd_line_script.pyhttps://github.com/python/cpython/pull/20072/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
View file https://github.com/python/cpython/blob/f93a54c48fc1644012aa0d4ee3887c1d121ac40e/Lib/test/test_cmd_line_script.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/20072/{{ revealButtonHref }}
https://github.com/python/cpython/pull/20072/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
https://github.com/python/cpython/pull/20072/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
Lib/test/test_traceback.pyhttps://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
View file https://github.com/python/cpython/blob/f93a54c48fc1644012aa0d4ee3887c1d121ac40e/Lib/test/test_traceback.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/20072/{{ revealButtonHref }}
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
https://github.com/python/cpython/pull/20072/files#diff-8a52124ffceebd98f91bf96caa0f341ae109f79e190cd5acc1c56c8968d75252
Lib/traceback.pyhttps://github.com/python/cpython/pull/20072/files#diff-96634ca56022c201d0ff677e922810a97e4ad8a55de53258cf0cbc22bd7c9be1
View file https://github.com/python/cpython/blob/f93a54c48fc1644012aa0d4ee3887c1d121ac40e/Lib/traceback.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/20072/{{ revealButtonHref }}
https://github.com/python/cpython/pull/20072/files#diff-96634ca56022c201d0ff677e922810a97e4ad8a55de53258cf0cbc22bd7c9be1
https://github.com/python/cpython/pull/20072/files#diff-96634ca56022c201d0ff677e922810a97e4ad8a55de53258cf0cbc22bd7c9be1
Misc/NEWS.d/next/Library/2020-05-13-10-23-29.bpo-40612.gOIreM.rsthttps://github.com/python/cpython/pull/20072/files#diff-4b28fa72b27202a4736d18423b8b62caf23696b06b433247697e8cbf97ce0487
View file https://github.com/python/cpython/blob/f93a54c48fc1644012aa0d4ee3887c1d121ac40e/Misc/NEWS.d/next/Library/2020-05-13-10-23-29.bpo-40612.gOIreM.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/20072/{{ revealButtonHref }}
Python/pythonrun.chttps://github.com/python/cpython/pull/20072/files#diff-2ecd9b536bc387479d824dc4b53f89679d6978d25c6b8a28ab21ed03e745e46e
View file https://github.com/python/cpython/blob/f93a54c48fc1644012aa0d4ee3887c1d121ac40e/Python/pythonrun.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/20072/{{ revealButtonHref }}
https://github.com/python/cpython/pull/20072/files#diff-2ecd9b536bc387479d824dc4b53f89679d6978d25c6b8a28ab21ed03e745e46e
ammaraskarhttps://github.com/ammaraskar
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425527746
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
we-like-parsers#121 (comment)https://github.com/we-like-parsers/cpython/issues/121#issuecomment-619775376
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
gvanrossumhttps://github.com/gvanrossum
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425564541
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
ammaraskarhttps://github.com/ammaraskar
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425570716
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
cpython/Parser/parsetok.chttps://github.com/python/cpython/blob/4a12d121860fb60d56cdcc212817577cac2356d0/Parser/parsetok.c#L425-L431
4a12d12https://github.com/python/cpython/commit/4a12d121860fb60d56cdcc212817577cac2356d0
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
gvanrossumhttps://github.com/gvanrossum
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425573331
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
gvanrossumhttps://github.com/gvanrossum
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425575354
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
ammaraskarhttps://github.com/ammaraskar
May 15, 2020https://github.com/python/cpython/pull/20072/files#r425584788
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
gvanrossumhttps://github.com/gvanrossum
May 15, 2020https://github.com/python/cpython/pull/20072/files#r426081145
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/20072/files
https://github.com/python/cpython/pull/20072/files#diff-2ecd9b536bc387479d824dc4b53f89679d6978d25c6b8a28ab21ed03e745e46e
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.