René's URL Explorer Experiment


Title: "Consistent AST position" crashes pytest: "ValueError: line 22-0 is not a valid range" · Issue #93387 · python/cpython · GitHub

Open Graph Title: "Consistent AST position" crashes pytest: "ValueError: line 22-0 is not a valid range" · Issue #93387 · python/cpython

X Title: "Consistent AST position" crashes pytest: "ValueError: line 22-0 is not a valid range" · Issue #93387 · python/cpython

Description: Bug report The coverage.py test suite fails to even start on 3.11.0b2, because of a crash inside pytest related to code positions. This is the error from a nightly build: py311 run-test: commands[3] | python igor.py test_with_tracer c -r...

Open Graph Description: Bug report The coverage.py test suite fails to even start on 3.11.0b2, because of a crash inside pytest related to code positions. This is the error from a nightly build: py311 run-test: commands[3...

X Description: Bug report The coverage.py test suite fails to even start on 3.11.0b2, because of a crash inside pytest related to code positions. This is the error from a nightly build: py311 run-test: commands[3...

Opengraph URL: https://github.com/python/cpython/issues/93387

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Consistent AST position\" crashes pytest: \"ValueError: line 22-0 is not a valid range\"","articleBody":"**Bug report**\r\n\r\nThe coverage.py test suite fails to even start on 3.11.0b2, because of a crash inside pytest related to code positions. This is the error from a [nightly build](https://github.com/nedbat/coveragepy/runs/6675064815?check_suite_focus=true#step:7:84):\r\n```\r\npy311 run-test: commands[3] | python igor.py test_with_tracer c -rfsEX\r\n  === CPython 3.11.0b1+ with C tracer (.tox/py311/bin/python) ===\r\n  Traceback (most recent call last):\r\n    File \"/home/runner/work/coveragepy/coveragepy/igor.py\", line 474, in \u003cmodule\u003e\r\n      sys.exit(main(sys.argv[1:]))\r\n               ^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/igor.py\", line 466, in main\r\n      ret = handler(*handler_args)\r\n            ^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/igor.py\", line 239, in do_test_with_tracer\r\n      return run_tests(tracer, *runner_args)\r\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/igor.py\", line 152, in run_tests\r\n      return pytest.main(list(runner_args))\r\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py\", line 145, in main\r\n      config = _prepareconfig(args, plugins)\r\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py\", line 324, in _prepareconfig\r\n      config = pluginmanager.hook.pytest_cmdline_parse(\r\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_hooks.py\", line 265, in __call__\r\n      return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)\r\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_manager.py\", line 80, in _hookexec\r\n      return self._inner_hookexec(hook_name, methods, kwargs, firstresult)\r\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_callers.py\", line 55, in _multicall\r\n      gen.send(outcome)\r\n      ^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/helpconfig.py\", line 102, in pytest_cmdline_parse\r\n      config: Config = outcome.get_result()\r\n                       ^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_result.py\", line 60, in get_result\r\n      raise ex[1].with_traceback(ex[2])\r\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_callers.py\", line 39, in _multicall\r\n      res = hook_impl.function(*args)\r\n            ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py\", line 1016, in pytest_cmdline_parse\r\n      self.parse(args)\r\n      ^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py\", line 1304, in parse\r\n      self._preparse(args, addopts=addopts)\r\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/config/__init__.py\", line 1187, in _preparse\r\n      self.pluginmanager.load_setuptools_entrypoints(\"pytest11\")\r\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/pluggy/_manager.py\", line 287, in load_setuptools_entrypoints\r\n      plugin = ep.load()\r\n               ^^^^^^^^^\r\n    File \"/usr/lib/python3.11/importlib/metadata/__init__.py\", line 198, in load\r\n      module = import_module(match.group('module'))\r\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/usr/lib/python3.11/importlib/__init__.py\", line 126, in import_module\r\n      return _bootstrap._gcd_import(name[level:], package, level)\r\n             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"\u003cfrozen importlib._bootstrap\u003e\", line 1206, in _gcd_import\r\n    File \"\u003cfrozen importlib._bootstrap\u003e\", line 1178, in _find_and_load\r\n    File \"\u003cfrozen importlib._bootstrap\u003e\", line 1149, in _find_and_load_unlocked\r\n    File \"\u003cfrozen importlib._bootstrap\u003e\", line 690, in _load_unlocked\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/assertion/rewrite.py\", line 159, in exec_module\r\n      source_stat, co = _rewrite_test(fn, self.config)\r\n                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n    File \"/home/runner/work/coveragepy/coveragepy/.tox/py311/lib/python3.11/site-packages/_pytest/assertion/rewrite.py\", line 361, in _rewrite_test\r\n      co = compile(tree, strfn, \"exec\", dont_inherit=True)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  ValueError: line 22-0 is not a valid range\r\n```\r\nWhen I run the test suite locally with 3.11.0b2, I get the same traceback, but the message is \"line 1-0 is not a valid range\".\r\n\r\nRunning pytest directly, rather than through my helper doesn't fail.\r\n\r\nI git bisected: the first bad commit was:\r\n```\r\n7f6e6abdc43d9b61d81eb26b9fb2073dccf6a3cb is the first bad commit\r\ncommit 7f6e6abdc43d9b61d81eb26b9fb2073dccf6a3cb\r\nAuthor: Miss Islington (bot) \u003c31488909+miss-islington@users.noreply.github.com\u003e\r\nDate:   Mon May 30 11:52:36 2022 -0700\r\n\r\n    gh-93351: Ensure the position information in AST nodes created by the parser is always consistent (GH-93352)\r\n\r\n    (cherry picked from commit 5893b5db98b38b17750c0572c7209774a5034898)\r\n\r\n    Co-authored-by: Pablo Galindo Salgado \u003cPablogsal@gmail.com\u003e\r\n\r\n Lib/test/test_ast.py | 27 +++++++++++++++++++++++++++\r\n Python/ast.c         | 26 ++++++++++++++++++++++++++\r\n 2 files changed, 53 insertions(+)\r\n```\r\n\r\n**Your environment**\r\n\r\n- CPython versions tested on:  3.11.0b1 works, 3.11.0b2 fails.\r\n- Operating system and architecture: Mac OS 10.15.7\r\n\r\n**To reproduce**\r\n\r\n```\r\n$ mktmpenv -p python3.10    # or some other way to create an environment\r\n$ git clone https://github.com/nedbat/coveragepy\r\n$ cd coveragepy\r\n$ pip install tox\r\n$ tox -e py311\r\n```","author":{"url":"https://github.com/nedbat","@type":"Person","name":"nedbat"},"datePublished":"2022-05-31T18:37:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/93387/cpython/issues/93387"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:39ab972c-036c-c887-687e-6d3e7b775679
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9416:24A0FE:F95A0:14E11B:6969C810
html-safe-nonceb08d074b7c4cc2c16ab72b74fd810173fff70f2e64b211128d1f24e95b1e7814
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDE2OjI0QTBGRTpGOTVBMDoxNEUxMUI6Njk2OUM4MTAiLCJ2aXNpdG9yX2lkIjoiMTA5NDMzMDE2ODExMzc0Mzg4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7c0084a9ca6d81430b639d6b4a269fa756831782c895c98dbef0efea490cf6f1
hovercard-subject-tagissue:1254267909
github-keyboard-shortcutsrepository,issues,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/python/cpython/93387/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1909beac28681b46a58d39c7382397d6701b7d21df5220eaee8ea24e64eb83d6/python/cpython/issues/93387
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1909beac28681b46a58d39c7382397d6701b7d21df5220eaee8ea24e64eb83d6/python/cpython/issues/93387
og:image:altBug report The coverage.py test suite fails to even start on 3.11.0b2, because of a crash inside pytest related to code positions. This is the error from a nightly build: py311 run-test: commands[3...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenedbat
hostnamegithub.com
expected-hostnamegithub.com
Noneacedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release83c08c21cdda978090dc44364b71aa5bc6dcea79
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/93387#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F93387
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%2Fissues%2F93387
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=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/93387
Reloadhttps://github.com/python/cpython/issues/93387
Reloadhttps://github.com/python/cpython/issues/93387
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/93387
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/issues/93387
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
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/93387
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/93387
"Consistent AST position" crashes pytest: "ValueError: line 22-0 is not a valid range"https://github.com/python/cpython/issues/93387#top
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/nedbat
https://github.com/nedbat
nedbathttps://github.com/nedbat
on May 31, 2022https://github.com/python/cpython/issues/93387#issue-1254267909
nightly buildhttps://github.com/nedbat/coveragepy/runs/6675064815?check_suite_focus=true#step:7:84
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.