René's URL Explorer Experiment


Title: Tests: error "tests may fail, unable to create temporary directory (...): [WinError 3] The system cannot find the path specified" on Windows · Issue #146202 · python/cpython · GitHub

Open Graph Title: Tests: error "tests may fail, unable to create temporary directory (...): [WinError 3] The system cannot find the path specified" on Windows · Issue #146202 · python/cpython

X Title: Tests: error "tests may fail, unable to create temporary directory (...): [WinError 3] The system cannot find the path specified" on Windows · Issue #146202 · python/cpython

Description: Windows CI failure: test_itertools corrupts Unicode temp directory name under mbcs encoding, breaks subsequent tests Summary On Windows (official Azure CI), the CPython 3.15 test suite produces cascading failures originating from test_it...

Open Graph Description: Windows CI failure: test_itertools corrupts Unicode temp directory name under mbcs encoding, breaks subsequent tests Summary On Windows (official Azure CI), the CPython 3.15 test suite produces cas...

X Description: Windows CI failure: test_itertools corrupts Unicode temp directory name under mbcs encoding, breaks subsequent tests Summary On Windows (official Azure CI), the CPython 3.15 test suite produces cas...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tests: error \"tests may fail, unable to create temporary directory (...): [WinError 3] The system cannot find the path specified\" on Windows","articleBody":"# Windows CI failure: `test_itertools` corrupts Unicode temp directory name under `mbcs` encoding, breaks subsequent tests\n\n## Summary\n\nOn Windows (official Azure CI), the CPython 3.15 test suite produces cascading failures originating from `test_itertools`. The test creates a temporary directory whose name contains a non-ASCII character. Because the Windows default filesystem encoding is `mbcs`, the Unicode byte sequence is misinterpreted and the directory name becomes corrupted on disk. The directory is never cleaned up, which causes all subsequent tests that create temporary directories to fail with `FileNotFoundError`.\n\n---\n\n## CPython Version\n\n```\nPython 3.15.0a7 (main branch)\n```\n\n## Operating System / Platform\n\n```\nWindows (Azure Pipelines Microsoft-hosted runner)\n```\n\n## Filesystem Encoding\n\n```python\n\u003e\u003e\u003e import sys\n\u003e\u003e\u003e sys.getfilesystemencoding()\n'mbcs'\n```\n\n---\n\n## CI Pipeline Context\n\n**Build step:**\n```\nPCbuild\\build.bat -e $(buildOpt)\n```\n\n**Test step:**\n```\nPCbuild\\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 \\\n  --junit-xml=\"$(Build.BinariesDirectory)\\test-results.xml\" \\\n  --tempdir=\"$(Build.BinariesDirectory)\\test\"\n```\n\n**Azure DevOps build log:**\nhttps://dev.azure.com/Python/cpython/_build/results?buildId=168864\u0026view=logs\u0026j=c8a71634-e5ec-54a0-3958-760f4148b765\u0026t=ddcdae4e-111a-5c2a-2289-6b784c553924\n\n---\n\n## Steps to Reproduce\n\n1. Check out the CPython `main` branch.\n2. Build on Windows:\n   ```\n   PCbuild\\build.bat -e \u003cbuildOpt\u003e\n   ```\n3. Run the test suite:\n   ```\n   PCbuild\\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 ^\n       -j0 --tempdir=\"%TEMP%\"\n   ```\n4. Observe a directory with a corrupted name (e.g. `packageæ/`) left behind in the temp directory.\n5. Observe that subsequent tests fail with `FileNotFoundError`.\n\n---\n\n## Expected Behavior\n\n- All tests pass cleanly on Windows during CI builds.\n- No test leaves behind artifacts that interfere with other tests.\n- Test isolation is preserved — temporary directories are created and removed correctly.\n- Unicode filenames are handled consistently regardless of platform filesystem encoding.\n\n---\n\n## Actual Behavior\n\n- `test_itertools` creates a directory whose name contains a non-ASCII character (e.g. `æ`).\n- Under the Windows default codepage (`mbcs`), the Unicode name is misinterpreted: `æ` (U+00E6) is stored as `æ`.\n- The corrupted directory is **not removed** after `test_itertools` completes.\n- Subsequent tests (e.g. `test_class`, `test_pdb`) fail when attempting to create temporary directories because the corrupted entry causes `os_helper.temp_dir` to raise `FileNotFoundError`.\n- The runner reports a warning for `test_itertools` and marks unrelated tests as failed, significantly increasing triage cost.\n\n---\n\n## Relevant Log Excerpt\n\nFrom Azure build 168864:\n\n```\nWarning -- files was modified by test_itertools\nAfter: ... 'packageæ/'\n\ntest_class failed (env changed)\nFileNotFoundError: [WinError 3] unable to create temporary directory:\n'D:\\a\\1\\s\\build\\test_python_9140æ'\n```\n\n---\n\n## Root Cause (Analysis)\n\nTwo independent problems combine to produce this failure:\n\n**1. Encoding mismatch in `test_itertools`**\n\nThe test constructs or receives a directory name containing a non-ASCII character. On Windows, `sys.getfilesystemencoding()` returns `'mbcs'` rather than `'utf-8'`. The UTF-8 byte sequence for `æ` (`0xC3 0xA6`) is reinterpreted under the ANSI code page as two separate characters, producing the visible corruption `æ`. This is a violation of cross-platform Unicode path handling requirements.\n\n**2. Missing cleanup in `test_itertools`**\n\nThe test creates the directory but does not register it for cleanup (e.g. via `addCleanup`, `self.addCleanup`, or a context manager such as `tempfile.TemporaryDirectory`). The corrupted directory persists in the shared `--tempdir` location for the duration of the entire test run, causing every subsequent call to `os_helper.temp_dir` to fail with `WinError 3`.\n\n---\n\n## Impact\n\n| Area | Description | Severity |\n|---|---|---|\n| CI pipeline stability | All Windows builds fail after `test_itertools` runs | **High** |\n| Test isolation | Subsequent tests inherit corrupted filesystem state | **High** |\n| Unicode correctness | Non-ASCII filenames silently corrupted on Windows | **Medium** |\n| Triage cost | Unrelated failures obscure the root cause | **Medium** |\n| Local Windows dev | Developers running the full suite locally may be affected | **Low** |\n\n---\n\n## Files Involved\n\n- `Lib/test/test_itertools.py` — primary location of the encoding issue and missing cleanup\n- `Lib/test/support/os_helper.py` — secondary impact point (`temp_dir` context manager)\n\n---\n\n## Linked Resources\n\n- Azure DevOps build 168864: https://dev.azure.com/Python/cpython/_build/results?buildId=168864\n- PEP 529 — Change Windows filesystem encoding to UTF-8: https://peps.python.org/pep-0529/\n- `sys.getfilesystemencoding()` docs: https://docs.python.org/3/library/sys.html#sys.getfilesystemencoding\n- `os.fsencode()` docs: https://docs.python.org/3/library/os.html#os.fsencode\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146347\n* gh-146349\n* gh-146350\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Aasyaco","@type":"Person","name":"Aasyaco"},"datePublished":"2026-03-20T11:15:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/146202/cpython/issues/146202"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e1ecb12e-8241-f03a-2cd4-32ed8583dce6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED9C:287EA1:1E7FA67:2B7E41D:6A50E6EA
html-safe-nonce65811decb7ba49ae844df149c5ed6400f2b10c99b804f0be2b8d7b0f40413a89
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDlDOjI4N0VBMToxRTdGQTY3OjJCN0U0MUQ6NkE1MEU2RUEiLCJ2aXNpdG9yX2lkIjoiNjY4OTE2NDQ3NTgzNTE0ODAxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca06f961ce4c76802d2df04fa8ad062c7a77a74dd4ce2ef56d3de86879bc688b3
hovercard-subject-tagissue:4107288910
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/146202/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ab7d4b020696575c382100848ea67dc6d246b989452684e5c6156f23c3baa847/python/cpython/issues/146202
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ab7d4b020696575c382100848ea67dc6d246b989452684e5c6156f23c3baa847/python/cpython/issues/146202
og:image:altWindows CI failure: test_itertools corrupts Unicode temp directory name under mbcs encoding, breaks subsequent tests Summary On Windows (official Azure CI), the CPython 3.15 test suite produces cas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAasyaco
hostnamegithub.com
expected-hostnamegithub.com
None72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0
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
releasefb19d617b534959801b4b7453938ecf1dfa22131
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/146202#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F146202
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2F146202
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/146202
Reloadhttps://github.com/python/cpython/issues/146202
Reloadhttps://github.com/python/cpython/issues/146202
Please reload this pagehttps://github.com/python/cpython/issues/146202
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/146202
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k 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.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
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 and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Tests: error "tests may fail, unable to create temporary directory (...): [WinError 3] The system cannot find the path specified" on Windowshttps://github.com/python/cpython/issues/146202#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/Aasyaco
Aasyacohttps://github.com/Aasyaco
on Mar 20, 2026https://github.com/python/cpython/issues/146202#issue-4107288910
https://dev.azure.com/Python/cpython/_build/results?buildId=168864&view=logs&j=c8a71634-e5ec-54a0-3958-760f4148b765&t=ddcdae4e-111a-5c2a-2289-6b784c553924https://dev.azure.com/Python/cpython/_build/results?buildId=168864&view=logs&j=c8a71634-e5ec-54a0-3958-760f4148b765&t=ddcdae4e-111a-5c2a-2289-6b784c553924
https://dev.azure.com/Python/cpython/_build/results?buildId=168864https://dev.azure.com/Python/cpython/_build/results?buildId=168864
https://peps.python.org/pep-0529/https://peps.python.org/pep-0529/
https://docs.python.org/3/library/sys.html#sys.getfilesystemencodinghttps://docs.python.org/3/library/sys.html#sys.getfilesystemencoding
https://docs.python.org/3/library/os.html#os.fsencodehttps://docs.python.org/3/library/os.html#os.fsencode
gh-146202: Create tmp_dir in regrtest worker #146347https://github.com/python/cpython/pull/146347
[3.14] gh-146202: Create tmp_dir in regrtest worker (GH-146347) #146349https://github.com/python/cpython/pull/146349
[3.13] gh-146202: Create tmp_dir in regrtest worker (GH-146347) #146350https://github.com/python/cpython/pull/146350
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.