René's URL Explorer Experiment


Title: gh-128067: Fix pyrepl overriding printed output without newlines by JanEricNitschke · Pull Request #138732 · python/cpython · GitHub

Open Graph Title: gh-128067: Fix pyrepl overriding printed output without newlines by JanEricNitschke · Pull Request #138732 · python/cpython

X Title: gh-128067: Fix pyrepl overriding printed output without newlines by JanEricNitschke · Pull Request #138732 · python/cpython

Description: I tried a bit to debug this and narrowed it down to these two lines for windows and unix terminals respectively: https://github.com/python/cpython/blob/main/Lib/_pyrepl/windows_console.py#L186-L187 https://github.com/python/cpython/blob/main/Lib/_pyrepl/unix_console.py#L238-L239 Because while properly running the repl in unix doesnt cause the issue, running the test i added also fails there before these changes. I am not 100% sure if this is the base and 100% correct way, but it causes the test to pass on unix and fixes the issue on windows for me. I also attempted to try to be able to run these tests for windows (because thats where we actually saw the issue) but didnt manage unfortunately. With the fix in the unix console: python -m coverage run --pylib --branch --source=pyrepl Lib/test/regrtest.py test_pyrepl -m test_no_newline Using random seed: 4126788206 0:00:00 load avg: 0.17 Run 1 test sequentially in a single process 0:00:00 load avg: 0.17 [1/1] test_pyrepl 0:00:04 load avg: 0.17 [1/1] test_pyrepl passed == Tests result: SUCCESS == 1 test OK. Total duration: 4.7 sec Total tests: run=1 (filtered) Total test files: run=1/1 (filtered) Result: SUCCESS Without: python -m coverage run --pylib --branch --source=pyrepl Lib/test/regrtest.py test_pyrepl -m test_no_newline Using random seed: 3832564122 0:00:00 load avg: 0.30 Run 1 test sequentially in a single process 0:00:00 load avg: 0.30 [1/1] test_pyrepl test test_pyrepl failed -- Traceback (most recent call last): File "/mnt/d/Programming/Projects/cpython/Lib/test/support/__init__.py", line 2923, in wrapper return func(*args, **kwargs) File "/mnt/d/Programming/Projects/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 1819, in test_no_newline self.assertIn(expected_output_sequence, cleaned_output) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 'Something pretty long>>> exit()' not found in 'print(\'Something pretty long\', end=\'\')\r\nexit()\r\nPython 3.15.0a0 (heads/main:c919d02ede, Sep 6 2025, 15:55:27) [GCC 13.3.0] on linux\r\nType "help", "copyright", "credits" or "license" for more information.\r\n\x1b[1A\n>>> print(\'Something pretty long\', end=\'\')\x1b[42D\n\rSomething pretty long\x1b[1A\n>>> exit()\x1b[10D\n\r' 0:00:02 load avg: 0.30 [1/1/1] test_pyrepl failed (1 failure) == Tests result: FAILURE == 1 test failed: test_pyrepl Total duration: 2.0 sec Total tests: run=1 (filtered) failures=1 Total test files: run=1/1 (filtered) failed=1 Result: FAILURE Issue: gh-128067

Open Graph Description: I tried a bit to debug this and narrowed it down to these two lines for windows and unix terminals respectively: https://github.com/python/cpython/blob/main/Lib/_pyrepl/windows_console.py#L186-L18...

X Description: I tried a bit to debug this and narrowed it down to these two lines for windows and unix terminals respectively: https://github.com/python/cpython/blob/main/Lib/_pyrepl/windows_console.py#L186-L18...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c59ca4b7-cfa5-1a49-de3a-cf4422ca0fcf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE240:23E3E9:A9E3711:AD515AF:6A50B5A0
html-safe-nonce4a9b50e09f1af5e95bfab8a6d949d2df065d66a8ba55bed465f0105f5aec4896
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjQwOjIzRTNFOTpBOUUzNzExOkFENTE1QUY6NkE1MEI1QTAiLCJ2aXNpdG9yX2lkIjoiNjY4OTU4MDEzODQ3NTA3NDk3NiIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9
visitor-hmac2b69c346175ee44a1a46732829a4f101f1b2ecf2fd2a215a3387df1d4729a6d8
hovercard-subject-tagpull_request:2814730740
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/138732/files
twitter:imagehttps://avatars.githubusercontent.com/u/47750513?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/47750513?s=400&v=4
og:image:altI tried a bit to debug this and narrowed it down to these two lines for windows and unix terminals respectively: https://github.com/python/cpython/blob/main/Lib/_pyrepl/windows_console.py#L186-L18...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None63772747707af4093f0d5fc7aa1bb3bb55f412a9865207c4f421aa34c64cc404
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
releaseded53fe94e3ff1bb4dbf8cc77e285396c92580fb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/138732/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F138732%2Ffiles
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%2Fpull%2F138732%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/138732/files
Reloadhttps://github.com/python/cpython/pull/138732/files
Reloadhttps://github.com/python/cpython/pull/138732/files
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k 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
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
ambvhttps://github.com/ambv
python:mainhttps://github.com/python/cpython/tree/main
JanEricNitschke:fix-pyreplhttps://github.com/JanEricNitschke/cpython/tree/fix-pyrepl
Conversation 24 https://github.com/python/cpython/pull/138732
Commits 10 https://github.com/python/cpython/pull/138732/commits
Checks 60 https://github.com/python/cpython/pull/138732/checks
Files changed https://github.com/python/cpython/pull/138732/files
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
gh-128067: Fix pyrepl overriding printed output without newlines https://github.com/python/cpython/pull/138732/files#top
Show all changes 10 commits https://github.com/python/cpython/pull/138732/files
074d743 Fix pyrepl overriding printed output without newlines JanEricNitschke Sep 10, 2025 https://github.com/python/cpython/pull/138732/commits/074d743eb19a29a5287c4cbe2755dd4a3e1a1b53
771b387 Define more save escape sequences JanEricNitschke Sep 10, 2025 https://github.com/python/cpython/pull/138732/commits/771b387d9abe0d2cef6b8dd68da2fd5bc3175925
011a7ca Fix allowed character insert escape JanEricNitschke Sep 10, 2025 https://github.com/python/cpython/pull/138732/commits/011a7ca13b5145073f8b07ccce34fe34ccc251c7
713b649 📜🤖 Added by blurb_it. blurb-it[bot] Sep 14, 2025 https://github.com/python/cpython/pull/138732/commits/713b649b4b763f90f382eb4b2fb4f714294a83d9
edf20b7 Merge branch 'main' into fix-pyrepl JanEricNitschke Sep 14, 2025 https://github.com/python/cpython/pull/138732/commits/edf20b7f5e2e118300ff8aee72e7e65fe9b8789f
a43a319 Add dedicated unittests for unix and windows console JanEricNitschke Sep 14, 2025 https://github.com/python/cpython/pull/138732/commits/a43a319b0468773061344cacdb90e002f06d0c56
8c75345 Harmonize clear between windows and unix JanEricNitschke Sep 14, 2025 https://github.com/python/cpython/pull/138732/commits/8c75345370cec7d1a90afe4da368fa6d171e6fd5
3308891 Add myself to ACKS JanEricNitschke Sep 16, 2025 https://github.com/python/cpython/pull/138732/commits/3308891a1970d3d618d626c9debb3ba2fb6c7a9a
611a1f8 Merge remote-tracking branch 'origin/main' into fix-pyrepl JanEricNitschke Oct 17, 2025 https://github.com/python/cpython/pull/138732/commits/611a1f83ac13e060e28d282e1c7d788bb7037ebf
22e9542 Merge branch 'main' into fix-pyrepl ambv Nov 11, 2025 https://github.com/python/cpython/pull/138732/commits/22e954283da5d4c3331ccc48b744ff61f208acce
Clear filters https://github.com/python/cpython/pull/138732/files
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
unix_console.py https://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
windows_console.py https://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
test_pyrepl.py https://github.com/python/cpython/pull/138732/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
test_unix_console.py https://github.com/python/cpython/pull/138732/files#diff-bd56b95d174a8939e71984be3453d3a41315d3fdab37649a87f5c79703f9d304
test_windows_console.py https://github.com/python/cpython/pull/138732/files#diff-86926a3f1ab6405b57d06094351c6625a4ebb9260d23ae7b3fb82b5ba0099873
ACKS https://github.com/python/cpython/pull/138732/files#diff-d1243956feb505c5459fc05387e194609efb5c350cee202942be47ed30d7d7d0
2025-09-14-13-35-44.gh-issue-128067.BGdP_A.rst https://github.com/python/cpython/pull/138732/files#diff-85259a966b33d9d3268bcbc107f4a26125317f86e6b6794cb717b5f8ee58c4f1
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L561
Lib/_pyrepl/unix_console.pyhttps://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Lib/_pyrepl/unix_console.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
https://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
https://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
https://github.com/python/cpython/pull/138732/files#diff-0e46521e64c67a83699619343508f4e57968fb450c9075139d47786e1ed89cb1
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L561
Lib/_pyrepl/windows_console.pyhttps://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Lib/_pyrepl/windows_console.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
chris-eiblhttps://github.com/chris-eibl
Sep 14, 2025https://github.com/python/cpython/pull/138732/files#r2347323585
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
https://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
https://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
ambvhttps://github.com/ambv
Jan 2, 2026https://github.com/python/cpython/pull/138732/files#r2657682177
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
https://github.com/python/cpython/pull/138732/files#diff-77cdde1442e2d3a5fe5ee852304d1af6d0a2033e718dc588552d61596cb72100
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L562
Lib/test/test_pyrepl/test_pyrepl.pyhttps://github.com/python/cpython/pull/138732/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Lib/test/test_pyrepl/test_pyrepl.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
Please reload this pagehttps://github.com/python/cpython/pull/138732/files
https://github.com/python/cpython/pull/138732/files#diff-527def17e95277d68de9ccbef2358e5b89aba5407163ff8d0777936bb3f3bfab
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L562
Lib/test/test_pyrepl/test_unix_console.pyhttps://github.com/python/cpython/pull/138732/files#diff-bd56b95d174a8939e71984be3453d3a41315d3fdab37649a87f5c79703f9d304
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Lib/test/test_pyrepl/test_unix_console.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-bd56b95d174a8939e71984be3453d3a41315d3fdab37649a87f5c79703f9d304
https://github.com/python/cpython/pull/138732/files#diff-bd56b95d174a8939e71984be3453d3a41315d3fdab37649a87f5c79703f9d304
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L562
Lib/test/test_pyrepl/test_windows_console.pyhttps://github.com/python/cpython/pull/138732/files#diff-86926a3f1ab6405b57d06094351c6625a4ebb9260d23ae7b3fb82b5ba0099873
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Lib/test/test_pyrepl/test_windows_console.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-86926a3f1ab6405b57d06094351c6625a4ebb9260d23ae7b3fb82b5ba0099873
https://github.com/python/cpython/pull/138732/files#diff-86926a3f1ab6405b57d06094351c6625a4ebb9260d23ae7b3fb82b5ba0099873
Misc/ACKShttps://github.com/python/cpython/pull/138732/files#diff-d1243956feb505c5459fc05387e194609efb5c350cee202942be47ed30d7d7d0
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Misc/ACKS
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
https://github.com/python/cpython/pull/138732/files#diff-d1243956feb505c5459fc05387e194609efb5c350cee202942be47ed30d7d7d0
https://github.com/python/cpython/pull/138732/files#diff-d1243956feb505c5459fc05387e194609efb5c350cee202942be47ed30d7d7d0
Misc/NEWS.d/next/Windows/2025-09-14-13-35-44.gh-issue-128067.BGdP_A.rsthttps://github.com/python/cpython/pull/138732/files#diff-85259a966b33d9d3268bcbc107f4a26125317f86e6b6794cb717b5f8ee58c4f1
View file https://github.com/JanEricNitschke/cpython/blob/22e954283da5d4c3331ccc48b744ff61f208acce/Misc/NEWS.d/next/Windows/2025-09-14-13-35-44.gh-issue-128067.BGdP_A.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/138732/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/cpython/pull/138732/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.