René's URL Explorer Experiment


Title: gh-139352: prevent altering `PYTHON_HISTORY` file when running REPL tests by picnixz · Pull Request #139380 · python/cpython · GitHub

Open Graph Title: gh-139352: prevent altering `PYTHON_HISTORY` file when running REPL tests by picnixz · Pull Request #139380 · python/cpython

X Title: gh-139352: prevent altering `PYTHON_HISTORY` file when running REPL tests by picnixz · Pull Request #139380 · python/cpython

Description: The issue with the tests is that those that don't specify an environment actually use -I and the current environment. Even if the latter is modified with a different PYTHON_HISTORY, because of -I, it will be ignored by gethistoryfile(). I decided that it was cleaner to assume that None environment means "use a copy of the current one" and that the it shouldn't be possible to specify -I at the same time if we internally add PYTHON_HISTORY ourselves. I believe that we need a better mechanism, but for now, I want to prevent the test suite to overwrite ~/.python_history (this could be especially annoying for those who actually want to install python system-wide; alternatively, we could make sure to restore the history file at the end of the test). Issue: gh-139352

Open Graph Description: The issue with the tests is that those that don't specify an environment actually use -I and the current environment. Even if the latter is modified with a different PYTHON_HISTORY, because of ...

X Description: The issue with the tests is that those that don't specify an environment actually use -I and the current environment. Even if the latter is modified with a different PYTHON_HISTORY, because...

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

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e3ce6911-f1d1-faea-47b2-b67e9a1de9f2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA68C:3A8E64:1AB53BE:234AA09:6B021E35
html-safe-nonce9d7653313f2a1c1d8268d43c0ddb8d8e940e296c93183f7529435a21503a5e7d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjhDOjNBOEU2NDoxQUI1M0JFOjIzNEFBMDk6NkIwMjFFMzUiLCJ2aXNpdG9yX2lkIjoiMzg0NTAzNDMxNDkzNzAxNTg2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9560d1de883a60817164e31a76b0af88346d5f4c8869f024100f38333eb5cd43
hovercard-subject-tagpull_request:2866338737
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/139380/files
twitter:imagehttps://avatars.githubusercontent.com/u/10796600?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10796600?s=400&v=4
og:image:altThe issue with the tests is that those that don't specify an environment actually use -I and the current environment. Even if the latter is modified with a different PYTHON_HISTORY, because of ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/139380/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F139380%2Ffiles
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%2Fpull%2F139380%2Ffiles
Sign uphttps://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/139380/files
Reloadhttps://github.com/python/cpython/pull/139380/files
Reloadhttps://github.com/python/cpython/pull/139380/files
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
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
picnixzhttps://github.com/picnixz
python:mainhttps://github.com/python/cpython/tree/main
picnixz:fix/repl/history-alteration-139352https://github.com/picnixz/cpython/tree/fix/repl/history-alteration-139352
Conversation 43 https://github.com/python/cpython/pull/139380
Commits 12 https://github.com/python/cpython/pull/139380/commits
Checks 0 https://github.com/python/cpython/pull/139380/checks
Files changed https://github.com/python/cpython/pull/139380/files
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
gh-139352: prevent altering PYTHON_HISTORY file when running REPL tests https://github.com/python/cpython/pull/139380/files#top
Show all changes 12 commits https://github.com/python/cpython/pull/139380/files
ef22044 prevent altering `PYTHON_HISTORY` file when running REPL tests picnixz Sep 27, 2025 https://github.com/python/cpython/pull/139380/commits/ef220447fb8e4aa8428ae98110e46b60a48fd4fb
244cd0b ensure that PYTHON_HISTORY is not altered picnixz Sep 27, 2025 https://github.com/python/cpython/pull/139380/commits/244cd0b6da23e63c8ded4c22a1f61770aecf4ba4
70ba65a fix WASI build picnixz Sep 27, 2025 https://github.com/python/cpython/pull/139380/commits/70ba65a9e134ee87f341e713b7d099cfce6d2e98
41ceb15 correctly call setUp/tearDown hooks picnixz Sep 27, 2025 https://github.com/python/cpython/pull/139380/commits/41ceb15cf2dad1805838f6f8ddf5fddae736c614
a574767 run checks after tearDown() picnixz Sep 28, 2025 https://github.com/python/cpython/pull/139380/commits/a574767b711079715048fa84030b9cb0ee2ba927
e44596e add eager checks in regrtest picnixz Sep 28, 2025 https://github.com/python/cpython/pull/139380/commits/e44596e975fe3d49e72ca8d235e966724b9f2fc1
5126bf0 fix editline analysis on macOS picnixz Sep 29, 2025 https://github.com/python/cpython/pull/139380/commits/5126bf0a815d783e6797f653abc1cd4d9eced731
6237cc7 fix mypy picnixz Sep 29, 2025 https://github.com/python/cpython/pull/139380/commits/6237cc779fbd43cc790eba7a2c284510f0550c71
9d31898 fix possible unbound errors picnixz Sep 29, 2025 https://github.com/python/cpython/pull/139380/commits/9d318985eac5b4768ab68f6a05bc920b57083761
1c7e2d9 fixup! picnixz Sep 29, 2025 https://github.com/python/cpython/pull/139380/commits/1c7e2d9b083382254ad5c7c24bdd679ffbd94ddc
21b3083 simplify! picnixz Sep 29, 2025 https://github.com/python/cpython/pull/139380/commits/21b308371db3005e9cae2976ab9e7c3d29e57e99
8939460 fix C readline picnixz Oct 5, 2025 https://github.com/python/cpython/pull/139380/commits/8939460235bedd2c432acf169d0db2315d2839d7
Clear filters https://github.com/python/cpython/pull/139380/files
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
readline.py https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
main.py https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
script_helper.py https://github.com/python/cpython/pull/139380/files#diff-ab537d38e290ab1e31c5f9dc71ceadec8f26de787bac9c3143d3528b482d2156
test_cmd_line_script.py https://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
test_pyrepl.py https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
test_repl.py https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
2025-09-27-12-02-49.gh-issue-139352.dblQRA.rst https://github.com/python/cpython/pull/139380/files#diff-722029784dc3a89ac95f9b4ae235fb683c39b38981f7570f4d63fbc4b98a82af
readline.c https://github.com/python/cpython/pull/139380/files#diff-c132c341140255d60e7d57d6d94ceb0b8fa364efac5bdbbd344e2c977c805144
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L571
Lib/_pyrepl/readline.pyhttps://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/_pyrepl/readline.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
ambvhttps://github.com/ambv
Oct 6, 2025https://github.com/python/cpython/pull/139380/files#r2406331677
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
ambvhttps://github.com/ambv
Oct 6, 2025https://github.com/python/cpython/pull/139380/files#r2406343045
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
https://github.com/python/cpython/pull/139380/files#diff-42f9fa1db06717da03a700b0766e97629aabf111c0afab47f2f32867c81d87a6
Lib/test/libregrtest/main.pyhttps://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/test/libregrtest/main.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
ambvhttps://github.com/ambv
Oct 6, 2025https://github.com/python/cpython/pull/139380/files#r2406365049
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
https://github.com/python/cpython/pull/139380/files#diff-90b1258926545f5c3c67e7de0cb5f50dc293b41c7a075a3eb316df99f3b875d5
Lib/test/support/script_helper.pyhttps://github.com/python/cpython/pull/139380/files#diff-ab537d38e290ab1e31c5f9dc71ceadec8f26de787bac9c3143d3528b482d2156
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/test/support/script_helper.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-ab537d38e290ab1e31c5f9dc71ceadec8f26de787bac9c3143d3528b482d2156
https://github.com/python/cpython/pull/139380/files#diff-ab537d38e290ab1e31c5f9dc71ceadec8f26de787bac9c3143d3528b482d2156
https://github.com/python/cpython/pull/139380/files#diff-ab537d38e290ab1e31c5f9dc71ceadec8f26de787bac9c3143d3528b482d2156
Lib/test/test_cmd_line_script.pyhttps://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/test/test_cmd_line_script.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
https://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
https://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
https://github.com/python/cpython/pull/139380/files#diff-c69c5c4fe60c0f6e7d6b899735e3671397db217175cdf3f4906087d84664e4fd
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L572
Lib/test/test_pyrepl/test_pyrepl.pyhttps://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/test/test_pyrepl/test_pyrepl.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/pull/139380/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
Lib/test/test_repl.pyhttps://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Lib/test/test_repl.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
https://github.com/python/cpython/pull/139380/files#diff-5401943d2b776b0ff00529833651ea8a9ad5ecbbf064efc86a5caa7d746ecd91
Misc/NEWS.d/next/Tests/2025-09-27-12-02-49.gh-issue-139352.dblQRA.rsthttps://github.com/python/cpython/pull/139380/files#diff-722029784dc3a89ac95f9b4ae235fb683c39b38981f7570f4d63fbc4b98a82af
View file https://github.com/picnixz/cpython/blob/8939460235bedd2c432acf169d0db2315d2839d7/Misc/NEWS.d/next/Tests/2025-09-27-12-02-49.gh-issue-139352.dblQRA.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/139380/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/139380/files
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.