René's URL Explorer Experiment


Title: GH-103929: handle long input lines with PyOS_InputHook by tacaswell · Pull Request #103931 · python/cpython · GitHub

Open Graph Title: GH-103929: handle long input lines with PyOS_InputHook by tacaswell · Pull Request #103931 · python/cpython

X Title: GH-103929: handle long input lines with PyOS_InputHook by tacaswell · Pull Request #103931 · python/cpython

Description: If: stdin is in line buffer mode the readline module is not loaded not on windows a GUI toolkit has installd PyOS_InputHook Then, if the user enters lines longer than 98 characters into input: user calls input(...) user types/pastes a line longer than 98 characters + 1 newline PyOS_InputHook returns the first 99 characters are returned the last character is not a new line so we go back to my_fgets the PyOS_InputHook blocks because despite there being value in the buffer, stdin does not flag itself as ready to be read again user hits enter again and to finish reading the input the extra new line comes out the next time the user calls input This fixes this bug by passing the currently read number of characters to my_fgets to skip the input hook when reading out a long buffer. closes #103929 Qustions: I do not know how to test this other than manually It seems to work when stdin is unbuffered, but I do not fully understand why Is the edit to the docs of PyOS_InputHook correct? Issue: gh-103929

Open Graph Description: If: stdin is in line buffer mode the readline module is not loaded not on windows a GUI toolkit has installd PyOS_InputHook Then, if the user enters lines longer than 98 characters into input: u...

X Description: If: stdin is in line buffer mode the readline module is not loaded not on windows a GUI toolkit has installd PyOS_InputHook Then, if the user enters lines longer than 98 characters into input: u...

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

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:c40df9bd-3df2-7521-b8d2-b251e9396eaf
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9F1C:1D20B7:3F8F192:5059F9C:6B024AD7
html-safe-noncee9705c239219a4aa8c3310bd375da287ee2a67b527ddec400bed65cedb29827f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjFDOjFEMjBCNzozRjhGMTkyOjUwNTlGOUM6NkIwMjRBRDciLCJ2aXNpdG9yX2lkIjoiMTgyOTQ3Njk0Mzk4NTI2NTM2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac00e95b0848e6c9b734f3789efab774502f7160b36047b40bac13e5e4e736f8e8
hovercard-subject-tagpull_request:1330616686
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/103931/files
twitter:imagehttps://avatars.githubusercontent.com/u/199813?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/199813?s=400&v=4
og:image:altIf: stdin is in line buffer mode the readline module is not loaded not on windows a GUI toolkit has installd PyOS_InputHook Then, if the user enters lines longer than 98 characters into input: u...
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/103931/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F103931%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%2F103931%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/103931/files
Reloadhttps://github.com/python/cpython/pull/103931/files
Reloadhttps://github.com/python/cpython/pull/103931/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
tacaswellhttps://github.com/tacaswell
python:mainhttps://github.com/python/cpython/tree/main
tacaswell:fix/pyos_inputhook_longlineshttps://github.com/tacaswell/cpython/tree/fix/pyos_inputhook_longlines
Conversation 33 https://github.com/python/cpython/pull/103931
Commits 4 https://github.com/python/cpython/pull/103931/commits
Checks 52 https://github.com/python/cpython/pull/103931/checks
Files changed 3 https://github.com/python/cpython/pull/103931/files
GH-103929: handle long input lines with PyOS_InputHook https://github.com/python/cpython/pull/103931/files#top
Show all changes 4 commits https://github.com/python/cpython/pull/103931/files
c3a50dc GH-103929: handle long input lines with PyOS_InputHook tacaswell Apr 25, 2023 https://github.com/python/cpython/pull/103931/commits/c3a50dccaffd452360ae59362caf7f34201bf1df
7094a36 DOC: add additional qualifier to expected behavior of PyOS_InputHook tacaswell Oct 17, 2025 https://github.com/python/cpython/pull/103931/commits/7094a36add7d92be6068dc17da67ef84282b4e75
bea3f06 MNT: move the PyOS_InputHook call up a loop level tacaswell Dec 4, 2025 https://github.com/python/cpython/pull/103931/commits/bea3f06ac64a9043fc94ab6ce67f8325cd30acc1
3794d80 Fix review comments for GH-103931 pablogsal Jun 29, 2026 https://github.com/python/cpython/pull/103931/commits/3794d804fcc43412da0259c5b38890105a1d37d2
Clear filters https://github.com/python/cpython/pull/103931/files
Please reload this pagehttps://github.com/python/cpython/pull/103931/files
Please reload this pagehttps://github.com/python/cpython/pull/103931/files
veryhigh.rst https://github.com/python/cpython/pull/103931/files#diff-f12744846bbcc1b08e6c6faf291c0c46b891a525908b87c10d388ad0152e3cb1
2026-06-29-00-00-00.gh-issue-103929.InputHook.rst https://github.com/python/cpython/pull/103931/files#diff-7f70c5d60a8592b5a6633fa8242e711da612f22bf3713732b1c22dc1dd2d7fcd
myreadline.c https://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L114
Doc/c-api/veryhigh.rsthttps://github.com/python/cpython/pull/103931/files#diff-f12744846bbcc1b08e6c6faf291c0c46b891a525908b87c10d388ad0152e3cb1
View file https://github.com/python/cpython/blob/3794d804fcc43412da0259c5b38890105a1d37d2/Doc/c-api/veryhigh.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/103931/{{ revealButtonHref }}
https://github.com/python/cpython/pull/103931/files#diff-f12744846bbcc1b08e6c6faf291c0c46b891a525908b87c10d388ad0152e3cb1
https://github.com/python/cpython/pull/103931/files#diff-f12744846bbcc1b08e6c6faf291c0c46b891a525908b87c10d388ad0152e3cb1
...NEWS.d/next/Core_and_Builtins/2026-06-29-00-00-00.gh-issue-103929.InputHook.rsthttps://github.com/python/cpython/pull/103931/files#diff-7f70c5d60a8592b5a6633fa8242e711da612f22bf3713732b1c22dc1dd2d7fcd
View file https://github.com/python/cpython/blob/3794d804fcc43412da0259c5b38890105a1d37d2/Misc/NEWS.d/next/Core_and_Builtins/2026-06-29-00-00-00.gh-issue-103929.InputHook.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/103931/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L313
Parser/myreadline.chttps://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
View file https://github.com/python/cpython/blob/3794d804fcc43412da0259c5b38890105a1d37d2/Parser/myreadline.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/103931/{{ revealButtonHref }}
https://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
https://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
https://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
https://github.com/python/cpython/pull/103931/files#diff-85670f42304eb5b9bfd6483c2a3525a63d57570e3e0b3301e9ed48a265068bfc
Please reload this pagehttps://github.com/python/cpython/pull/103931/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.