René's URL Explorer Experiment


Title: Python 3.11 improved tracebacks break the tests · Issue #2451 · pre-commit/pre-commit · GitHub

Open Graph Title: Python 3.11 improved tracebacks break the tests · Issue #2451 · pre-commit/pre-commit

X Title: Python 3.11 improved tracebacks break the tests · Issue #2451 · pre-commit/pre-commit

Description: search tried in the issue tracker 3.11 describe your issue When we rebuild pre-commit in Fedora 37 with Python 3.11, we see the following failures: =================================== FAILURES =================================== ________...

Open Graph Description: search tried in the issue tracker 3.11 describe your issue When we rebuild pre-commit in Fedora 37 with Python 3.11, we see the following failures: =================================== FAILURES ====...

X Description: search tried in the issue tracker 3.11 describe your issue When we rebuild pre-commit in Fedora 37 with Python 3.11, we see the following failures: =================================== FAILURES ====...

Opengraph URL: https://github.com/pre-commit/pre-commit/issues/2451

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.11 improved tracebacks break the tests","articleBody":"### search tried in the issue tracker\n\n3.11\n\n### describe your issue\n\nWhen we rebuild pre-commit in Fedora 37 with Python 3.11, we see the following failures:\r\n\r\n```\r\n=================================== FAILURES ===================================\r\n________________________ test_error_handler_fatal_error ________________________\r\nmocked_log_and_exit = \u003cMagicMock name='_log_and_exit' id='140736176514768'\u003e\r\n    def test_error_handler_fatal_error(mocked_log_and_exit):\r\n        exc = FatalError('just a test')\r\n        with error_handler.error_handler():\r\n            raise exc\r\n    \r\n        mocked_log_and_exit.assert_called_once_with(\r\n            'An error has occurred',\r\n            1,\r\n            exc,\r\n            # Tested below\r\n            mock.ANY,\r\n        )\r\n    \r\n        pattern = re_assert.Matches(\r\n            r'Traceback \\(most recent call last\\):\\n'\r\n            r'  File \".+pre_commit.error_handler.py\", line \\d+, in error_handler\\n'\r\n            r'    yield\\n'\r\n            r'  File \".+tests.error_handler_test.py\", line \\d+, '\r\n            r'in test_error_handler_fatal_error\\n'\r\n            r'    raise exc\\n'\r\n            r'(pre_commit\\.errors\\.)?FatalError: just a test\\n',\r\n        )\r\n\u003e       pattern.assert_matches(mocked_log_and_exit.call_args[0][3])\r\ntests/error_handler_test.py:53: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nself = Matches('Traceback \\\\(most recent call last\\\\):\\\\n  File \".+pre_commit.error_handler.py\", line \\\\d+, in error_handler\\...st_error_handler_fatal_error\r\n    #\u003e     raise exc\r\n    #\u003e     ^^^^^^^^^\r\n    #\u003e pre_commit.errors.FatalError: just a test\r\ns = 'Traceback (most recent call last):\\n  File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", lin... line 34, in test_error_handler_fatal_error\\n    raise exc\\n    ^^^^^^^^^\\npre_commit.errors.FatalError: just a test\\n'\r\n    def assert_matches(self, s: str) -\u003e None:\r\n\u003e       assert self == s, self._fail\r\nE       AssertionError:  regex failed to match at:\r\nE       \r\nE       \u003e Traceback (most recent call last):\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", line 73, in error_handler\r\nE       \u003e     yield\r\nE       \u003e     ^^^^^\r\nE           ^\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/tests/error_handler_test.py\", line 34, in test_error_handler_fatal_error\r\nE       \u003e     raise exc\r\nE       \u003e     ^^^^^^^^^\r\nE       \u003e pre_commit.errors.FatalError: just a test\r\n/usr/lib/python3.11/site-packages/re_assert.py:63: AssertionError\r\n______________________ test_error_handler_uncaught_error _______________________\r\nmocked_log_and_exit = \u003cMagicMock name='_log_and_exit' id='140736174639952'\u003e\r\n    def test_error_handler_uncaught_error(mocked_log_and_exit):\r\n        exc = ValueError('another test')\r\n        with error_handler.error_handler():\r\n            raise exc\r\n    \r\n        mocked_log_and_exit.assert_called_once_with(\r\n            'An unexpected error has occurred',\r\n            3,\r\n            exc,\r\n            # Tested below\r\n            mock.ANY,\r\n        )\r\n        pattern = re_assert.Matches(\r\n            r'Traceback \\(most recent call last\\):\\n'\r\n            r'  File \".+pre_commit.error_handler.py\", line \\d+, in error_handler\\n'\r\n            r'    yield\\n'\r\n            r'  File \".+tests.error_handler_test.py\", line \\d+, '\r\n            r'in test_error_handler_uncaught_error\\n'\r\n            r'    raise exc\\n'\r\n            r'ValueError: another test\\n',\r\n        )\r\n\u003e       pattern.assert_matches(mocked_log_and_exit.call_args[0][3])\r\ntests/error_handler_test.py:77: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nself = Matches('Traceback \\\\(most recent call last\\\\):\\\\n  File \".+pre_commit.error_handler.py\", line \\\\d+, in error_handler\\...line 59, in test_error_handler_uncaught_error\r\n    #\u003e     raise exc\r\n    #\u003e     ^^^^^^^^^\r\n    #\u003e ValueError: another test\r\ns = 'Traceback (most recent call last):\\n  File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", lin...dler_test.py\", line 59, in test_error_handler_uncaught_error\\n    raise exc\\n    ^^^^^^^^^\\nValueError: another test\\n'\r\n    def assert_matches(self, s: str) -\u003e None:\r\n\u003e       assert self == s, self._fail\r\nE       AssertionError:  regex failed to match at:\r\nE       \r\nE       \u003e Traceback (most recent call last):\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", line 73, in error_handler\r\nE       \u003e     yield\r\nE       \u003e     ^^^^^\r\nE           ^\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/tests/error_handler_test.py\", line 59, in test_error_handler_uncaught_error\r\nE       \u003e     raise exc\r\nE       \u003e     ^^^^^^^^^\r\nE       \u003e ValueError: another test\r\n/usr/lib/python3.11/site-packages/re_assert.py:63: AssertionError\r\n_____________________ test_error_handler_keyboardinterrupt _____________________\r\nmocked_log_and_exit = \u003cMagicMock name='_log_and_exit' id='140736174647248'\u003e\r\n    def test_error_handler_keyboardinterrupt(mocked_log_and_exit):\r\n        exc = KeyboardInterrupt()\r\n        with error_handler.error_handler():\r\n            raise exc\r\n    \r\n        mocked_log_and_exit.assert_called_once_with(\r\n            'Interrupted (^C)',\r\n            130,\r\n            exc,\r\n            # Tested below\r\n            mock.ANY,\r\n        )\r\n        pattern = re_assert.Matches(\r\n            r'Traceback \\(most recent call last\\):\\n'\r\n            r'  File \".+pre_commit.error_handler.py\", line \\d+, in error_handler\\n'\r\n            r'    yield\\n'\r\n            r'  File \".+tests.error_handler_test.py\", line \\d+, '\r\n            r'in test_error_handler_keyboardinterrupt\\n'\r\n            r'    raise exc\\n'\r\n            r'KeyboardInterrupt\\n',\r\n        )\r\n\u003e       pattern.assert_matches(mocked_log_and_exit.call_args[0][3])\r\ntests/error_handler_test.py:101: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\nself = Matches('Traceback \\\\(most recent call last\\\\):\\\\n  File \".+pre_commit.error_handler.py\", line \\\\d+, in error_handler\\...y\", line 83, in test_error_handler_keyboardinterrupt\r\n    #\u003e     raise exc\r\n    #\u003e     ^^^^^^^^^\r\n    #\u003e KeyboardInterrupt\r\ns = 'Traceback (most recent call last):\\n  File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", lin..._handler_test.py\", line 83, in test_error_handler_keyboardinterrupt\\n    raise exc\\n    ^^^^^^^^^\\nKeyboardInterrupt\\n'\r\n    def assert_matches(self, s: str) -\u003e None:\r\n\u003e       assert self == s, self._fail\r\nE       AssertionError:  regex failed to match at:\r\nE       \r\nE       \u003e Traceback (most recent call last):\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/error_handler.py\", line 73, in error_handler\r\nE       \u003e     yield\r\nE       \u003e     ^^^^^\r\nE           ^\r\nE       \u003e   File \"/builddir/build/BUILD/pre-commit-2.19.0/tests/error_handler_test.py\", line 83, in test_error_handler_keyboardinterrupt\r\nE       \u003e     raise exc\r\nE       \u003e     ^^^^^^^^^\r\nE       \u003e KeyboardInterrupt\r\n/usr/lib/python3.11/site-packages/re_assert.py:63: AssertionError\r\n```\r\n\r\nI believe all of them are caused by extra `^^^^^^^^^` in the tracebacks.\r\n\r\nI might be able to submit a PR for this if you are interested.\n\n### pre-commit --version\n\n2.19.0\n\n### .pre-commit-config.yaml\n\n```yaml\nnot relevant\n```\n\n\n### ~/.cache/pre-commit/pre-commit.log (if present)\n\n_No response_","author":{"url":"https://github.com/hroncok","@type":"Person","name":"hroncok"},"datePublished":"2022-07-09T18:01:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2451/pre-commit/issues/2451"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d9cc7504-0865-b369-d6d2-be198811c248
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCBAE:2010FD:F58882:13DCDCE:6990C4E0
html-safe-nonceb717e0690522ff586101d91209dbda3881a882f30a6b3d42b1b36e168a0af815
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQkFFOjIwMTBGRDpGNTg4ODI6MTNEQ0RDRTo2OTkwQzRFMCIsInZpc2l0b3JfaWQiOiI0NzkyODc2ODQzNDQyMTYwODY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac71cf4f26766e98f33cca68c08e9bedce2bd6a35aa49270e28f69e5f358b382e8
hovercard-subject-tagissue:1299735279
github-keyboard-shortcutsrepository,issues,commits,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/2451/issue_layout
twitter:imagehttps://opengraph.githubassets.com/61ad676e8be14ad31db112ad1e471c696a1fd4d485f043bd8d991c7dc0589ac5/pre-commit/pre-commit/issues/2451
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/61ad676e8be14ad31db112ad1e471c696a1fd4d485f043bd8d991c7dc0589ac5/pre-commit/pre-commit/issues/2451
og:image:altsearch tried in the issue tracker 3.11 describe your issue When we rebuild pre-commit in Fedora 37 with Python 3.11, we see the following failures: =================================== FAILURES ====...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehroncok
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git
octolytics-dimension-user_id6943086
octolytics-dimension-user_loginpre-commit
octolytics-dimension-repository_id17689377
octolytics-dimension-repository_nwopre-commit/pre-commit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17689377
octolytics-dimension-repository_network_root_nwopre-commit/pre-commit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pre-commit/pre-commit/issues/2451#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit%2Fissues%2F2451
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%2Fpre-commit%2Fpre-commit%2Fissues%2F2451
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pre-commit%2Fpre-commit
Reloadhttps://github.com/pre-commit/pre-commit/issues/2451
Reloadhttps://github.com/pre-commit/pre-commit/issues/2451
Reloadhttps://github.com/pre-commit/pre-commit/issues/2451
pre-commit https://github.com/pre-commit
pre-commithttps://github.com/pre-commit/pre-commit
Please reload this pagehttps://github.com/pre-commit/pre-commit/issues/2451
Notifications https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Fork 928 https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Star 15k https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Code https://github.com/pre-commit/pre-commit
Issues 20 https://github.com/pre-commit/pre-commit/issues
Pull requests 11 https://github.com/pre-commit/pre-commit/pulls
Actions https://github.com/pre-commit/pre-commit/actions
Security 0 https://github.com/pre-commit/pre-commit/security
Insights https://github.com/pre-commit/pre-commit/pulse
Code https://github.com/pre-commit/pre-commit
Issues https://github.com/pre-commit/pre-commit/issues
Pull requests https://github.com/pre-commit/pre-commit/pulls
Actions https://github.com/pre-commit/pre-commit/actions
Security https://github.com/pre-commit/pre-commit/security
Insights https://github.com/pre-commit/pre-commit/pulse
New issuehttps://github.com/login?return_to=https://github.com/pre-commit/pre-commit/issues/2451
New issuehttps://github.com/login?return_to=https://github.com/pre-commit/pre-commit/issues/2451
#2453https://github.com/pre-commit/pre-commit/pull/2453
Python 3.11 improved tracebacks break the testshttps://github.com/pre-commit/pre-commit/issues/2451#top
#2453https://github.com/pre-commit/pre-commit/pull/2453
https://github.com/hroncok
https://github.com/hroncok
hroncokhttps://github.com/hroncok
on Jul 9, 2022https://github.com/pre-commit/pre-commit/issues/2451#issue-1299735279
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.