René's URL Explorer Experiment


Title: `test_file` failed on Windows with a longer repo path in `test_urllib2` · Issue #133448 · python/cpython · GitHub

Open Graph Title: `test_file` failed on Windows with a longer repo path in `test_urllib2` · Issue #133448 · python/cpython

X Title: `test_file` failed on Windows with a longer repo path in `test_urllib2` · Issue #133448 · python/cpython

Description: On Windows, when the CPython repository is cloned to a slightly longer path, for example, C:\Users\xxxxx\Source\cpython — this test case will fail: ERROR: test_file (test.test_urllib2.HandlerTests.test_file) -----------------------------...

Open Graph Description: On Windows, when the CPython repository is cloned to a slightly longer path, for example, C:\Users\xxxxx\Source\cpython — this test case will fail: ERROR: test_file (test.test_urllib2.HandlerTests....

X Description: On Windows, when the CPython repository is cloned to a slightly longer path, for example, C:\Users\xxxxx\Source\cpython — this test case will fail: ERROR: test_file (test.test_urllib2.HandlerTests....

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`test_file` failed on Windows with a longer repo path in `test_urllib2`","articleBody":"On Windows, when the CPython repository is cloned to a slightly longer path, for example, `C:\\Users\\xxxxx\\Source\\cpython` — this test case will fail:\n\n```\nERROR: test_file (test.test_urllib2.HandlerTests.test_file)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\encodings\\idna.py\", line 219, in encode\n    result.extend(ToASCII(label))\n                  ~~~~~~~^^^^^^^\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\encodings\\idna.py\", line 115, in ToASCII\n    raise UnicodeEncodeError(\"idna\", label, 0, len(label), \"label too long\")\nUnicodeEncodeError: 'idna' codec can't encode characters in position 0-64: label too long\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\test\\test_urllib2.py\", line 872, in test_file\n    self.assertRaises(urllib.error.URLError,\n    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^\n                      h.file_open, Request(url))\n                      ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\unittest\\case.py\", line 813, in assertRaises\n    return context.handle('assertRaises', args, kwargs)\n           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\unittest\\case.py\", line 247, in handle\n    callable_obj(*args, **kwargs)\n    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\urllib\\request.py\", line 1469, in open_local_file\n    localfile = url2pathname(req.full_url, require_scheme=True)\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\urllib\\request.py\", line 1658, in url2pathname\n    if not _is_local_authority(authority):\n           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\urllib\\request.py\", line 1498, in _is_local_authority\n    address = socket.gethostbyname(authority)\n  File \"C:\\Users\\xxxxx\\Source\\cpython\\Lib\\encodings\\idna.py\", line 222, in encode\n    raise UnicodeEncodeError(\n    ...\u003c5 lines>...\n    )\nUnicodeEncodeError: 'idna' codec can't encode characters in position 8-72: label too long\nencoding with 'idna' codec failed\n```\n\nSee:\n[https://github.com/python/cpython/blob/c336f1c3126203fd6c38050df94e9fe8c0d7f2e2/Lib/test/test\\_urllib2.py#L857-L860](https://github.com/python/cpython/blob/c336f1c3126203fd6c38050df94e9fe8c0d7f2e2/Lib/test/test_urllib2.py#L857-L860)\n\nThese two URLs will become:\n\n* `file://127.0.0.1:80C:\\Users\\xxxxx\\Source\\cpython\\build\\test_python_worker_17208æ/@test_17208_tmpæ`\n* `file://somerandomhost.ontheinternet.comC:\\Users\\xxxxx\\Source\\cpython\\build\\test_python_worker_4676æ/@test_4676_tmpæ`\n\nHere, `127.0.0.1:80C:\\Users\\xxxxx\\Source\\cpython\\build\\test_python_worker_17208æ` is treated as the domain and passed to `socket.gethostbyname`. However, the part `1:80C:\\Users\\xxxxx\\Source\\cpython\\build\\test_python_worker_17208æ` is too long to be a valid domain label. As a result, the `idna` codec raises an exception, indicating the label is too long.\n\nA patch is on the way.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-133449\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/aisk","@type":"Person","name":"aisk"},"datePublished":"2025-05-05T15:15:43Z","url":"https://github.com/python/cpython/issues/133448"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fc32467a-979d-f5fc-24a0-698844ec0294
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id93A2:2E9831:1E5C783:2808C88:6B022F3A
html-safe-nonceff378aaf19d3ce90c24ef30fb40f686683ac30cfe2f6e21208302f33e58caaa6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0EyOjJFOTgzMToxRTVDNzgzOjI4MDhDODg6NkIwMjJGM0EiLCJ2aXNpdG9yX2lkIjoiNzM5ODMxMjQ1MzE0NDE5NDg3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb46c9424fe51017ddbedc6d522441b1e7e6c5e4a4272d83fe4b8653f2917cdfc
hovercard-subject-tagissue:3040004742
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/133448/issue_layout
twitter:imagehttps://opengraph.githubassets.com/134d2d4e1fee0e69f375252a5f03e0f3f4049584c23771702efba0e95f88587c/python/cpython/issues/133448
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/134d2d4e1fee0e69f375252a5f03e0f3f4049584c23771702efba0e95f88587c/python/cpython/issues/133448
og:image:altOn Windows, when the CPython repository is cloned to a slightly longer path, for example, C:\Users\xxxxx\Source\cpython — this test case will fail: ERROR: test_file (test.test_urllib2.HandlerTests....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaisk
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/133448#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F133448
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F133448
Sign uphttps://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/133448
Reloadhttps://github.com/python/cpython/issues/133448
Reloadhttps://github.com/python/cpython/issues/133448
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/133448
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/133448
test_file failed on Windows with a longer repo path in test_urllib2https://github.com/python/cpython/issues/133448#top
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/aisk
aiskhttps://github.com/aisk
on May 5, 2025https://github.com/python/cpython/issues/133448#issue-3040004742
cpython/Lib/test/test_urllib2.pyhttps://github.com/python/cpython/blob/c336f1c3126203fd6c38050df94e9fe8c0d7f2e2/Lib/test/test_urllib2.py#L857-L860
c336f1chttps://github.com/python/cpython/commit/c336f1c3126203fd6c38050df94e9fe8c0d7f2e2
gh-133448: Fix test_file in test_urllib2 on Windows with a longer repo path #133449https://github.com/python/cpython/pull/133449
aiskhttps://github.com/aisk
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
on May 5, 2025https://github.com/python/cpython/issues/133448#event-17521510119
https://github.com/zooba
zoobahttps://github.com/zooba
on May 5, 2025https://github.com/python/cpython/issues/133448#issuecomment-2851568898
picnixzhttps://github.com/picnixz
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on May 5, 2025https://github.com/python/cpython/issues/133448#event-17522726397
https://github.com/barneygale
barneygalehttps://github.com/barneygale
on May 5, 2025https://github.com/python/cpython/issues/133448#issuecomment-2851654204
#132610https://github.com/python/cpython/pull/132610
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/133448
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/133448
OS-windowshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-windows%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
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.