René's URL Explorer Experiment


Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython · GitHub

Open Graph Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython

X Title: Implement termios.tcgetwinsize/tcsetwinsize by sigmaith · Pull Request #8347 · RustPython/RustPython

Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both functions, following CPython's implementation Modules/termios.c#L417-L444: crates/host_env/src/termios.rs: low-level ioctl(TIOCGWINSZ/TIOCSWINSZ) wrappers crates/stdlib/src/termios.rs: #[pyfunction]s that expose them to Python, reusing the existing Fildes fd conversion and termios_error helper Lib/test/test_termios.py: removes the expectedFailure markers for test_tcgetwinsize, test_tcgetwinsize_errors, test_tcsetwinsize, test_tcsetwinsize_errors, which now pass Lib/test/test_pty.py: marks test_fork/test_spawn_doesnt_hang as expectedFailure — unmasked by this change, but fail on an unrelated, pre-existing bug (os.login_tty not implemented) Summary by CodeRabbit Summary by CodeRabbit New Features Added termios.tcgetwinsize() to retrieve terminal window dimensions. Added termios.tcsetwinsize() to update terminal window dimensions. Added input validation for the window size argument and clear error reporting when terminal operations fail.

Open Graph Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function...

X Description: Closes #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function...

Opengraph URL: https://github.com/RustPython/RustPython/pull/8347

X: @github

direct link

Domain: Github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7ab84ed4-019a-0c86-c504-480e4d670adc
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAC84:BCEAA:C17F7A:1082911:6A62C35D
html-safe-nonce281843a8b9cd1edfdda69194636de8cf08eee8fccc5507c6903cab167de703d6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzg0OkJDRUFBOkMxN0Y3QToxMDgyOTExOjZBNjJDMzVEIiwidmlzaXRvcl9pZCI6IjUwMjI3MTU0MjU1MjY1NjM2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacac058799fcab1cf8abfa51f0a89032c05736f3e4c5bc5b293712c0d107e16f7e
hovercard-subject-tagpull_request:4108315797
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/RustPython/RustPython/pull/8347/files
twitter:imagehttps://avatars.githubusercontent.com/u/125195487?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/125195487?s=400&v=4
og:image:altCloses #xxxx This PR follows our AI policy Summary The termios module was missing tcgetwinsize/tcsetwinsize, so calling termios.tcgetwinsize(fd) raised AttributeError. This PR adds both function...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonedf33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
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
released41cd1bdb290013455c0ac430fa755621733f5eb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/RustPython/RustPython/pull/8347/files#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F8347%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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2FRustPython%2FRustPython%2Fpull%2F8347%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=RustPython%2FRustPython
Reloadhttps://Github.com/RustPython/RustPython/pull/8347/files
Reloadhttps://Github.com/RustPython/RustPython/pull/8347/files
Reloadhttps://Github.com/RustPython/RustPython/pull/8347/files
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/files
RustPython https://Github.com/RustPython
RustPythonhttps://Github.com/RustPython/RustPython
Notifications https://Github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://Github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://Github.com/login?return_to=%2FRustPython%2FRustPython
Code https://Github.com/RustPython/RustPython
Issues 294 https://Github.com/RustPython/RustPython/issues
Pull requests 105 https://Github.com/RustPython/RustPython/pulls
Discussions https://Github.com/RustPython/RustPython/discussions
Actions https://Github.com/RustPython/RustPython/actions
Projects https://Github.com/RustPython/RustPython/projects
Models https://Github.com/RustPython/RustPython/models
Wiki https://Github.com/RustPython/RustPython/wiki
Security and quality 0 https://Github.com/RustPython/RustPython/security
Insights https://Github.com/RustPython/RustPython/pulse
Code https://Github.com/RustPython/RustPython
Issues https://Github.com/RustPython/RustPython/issues
Pull requests https://Github.com/RustPython/RustPython/pulls
Discussions https://Github.com/RustPython/RustPython/discussions
Actions https://Github.com/RustPython/RustPython/actions
Projects https://Github.com/RustPython/RustPython/projects
Models https://Github.com/RustPython/RustPython/models
Wiki https://Github.com/RustPython/RustPython/wiki
Security and quality https://Github.com/RustPython/RustPython/security
Insights https://Github.com/RustPython/RustPython/pulse
Sign up for GitHub https://Github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://Github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
sigmaithhttps://Github.com/sigmaith
RustPython:mainhttps://Github.com/RustPython/RustPython/tree/main
sigmaith:termioshttps://Github.com/sigmaith/RustPython/tree/termios
Conversation 22 https://Github.com/RustPython/RustPython/pull/8347
Commits 7 https://Github.com/RustPython/RustPython/pull/8347/commits
Checks 26 https://Github.com/RustPython/RustPython/pull/8347/checks
Files changed 4 https://Github.com/RustPython/RustPython/pull/8347/files
Implement termios.tcgetwinsize/tcsetwinsize https://Github.com/RustPython/RustPython/pull/8347/files#top
Show all changes 7 commits https://Github.com/RustPython/RustPython/pull/8347/files
d09e9b8 Implement termios.tcgetwinsize/tcsetwinsize sigmaith Jul 22, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/d09e9b814c551bc0fdf405729158bd70286fd4f3
0614732 Use ret < 0 convention for ioctl error checks in termios winsize sigmaith Jul 22, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/0614732c06b97a8f0d913306e97cb519ffd7af16
2c555e5 Reject non-sequence size in tcsetwinsize sigmaith Jul 22, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/2c555e55af5b27649dd9dac6d71224e09524f710
414a869 Use `core::mem::zeroed` instead of `std::mem::zeroed` sigmaith Jul 22, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/414a86944d7afadf2e887086469badeb184400de
8af3f22 Use try_index for tcsetwinsize row/col conversion sigmaith Jul 23, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/8af3f225a26bd32e2c1ee264e479809b1c7ee54e
cbe201b Mark test_fork/test_spawn_doesnt_hang as expected failures sigmaith Jul 23, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/cbe201b7f1b5b4c05c6f2b4992b4f4ca91d22248
6888774 Use unittest.skip instead of expectedFailure for pty.fork() tests sigmaith Jul 23, 2026 https://Github.com/RustPython/RustPython/pull/8347/commits/6888774c0394d843cc35328d5c5192749c51ae16
Clear filters https://Github.com/RustPython/RustPython/pull/8347/files
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/files
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/files
test_pty.py https://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
test_termios.py https://Github.com/RustPython/RustPython/pull/8347/files#diff-1d551e328263656ddaf66c44e63706eb1cabdd12fdf33f61c22c3c709ce92b5e
termios.rs https://Github.com/RustPython/RustPython/pull/8347/files#diff-99f18b026fed666d68940db9ac6b8c43144ca3f1bfda132dd348c3ad9dd84ce9
termios.rs https://Github.com/RustPython/RustPython/pull/8347/files#diff-f71c9947248d03cff69ec513944e7d52a21b63c8b48ebf54fee1eea4a9145b10
Lib/test/test_pty.pyhttps://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
View file https://Github.com/RustPython/RustPython/blob/6888774c0394d843cc35328d5c5192749c51ae16/Lib/test/test_pty.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/RustPython/RustPython/pull/8347/{{ revealButtonHref }}
https://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
youknowonehttps://Github.com/youknowone
Jul 23, 2026https://Github.com/RustPython/RustPython/pull/8347/files#r3640120599
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/files
https://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
https://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
https://Github.com/RustPython/RustPython/pull/8347/files#diff-818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d
Lib/test/test_termios.pyhttps://Github.com/RustPython/RustPython/pull/8347/files#diff-1d551e328263656ddaf66c44e63706eb1cabdd12fdf33f61c22c3c709ce92b5e
View file https://Github.com/RustPython/RustPython/blob/6888774c0394d843cc35328d5c5192749c51ae16/Lib/test/test_termios.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/RustPython/RustPython/pull/8347/{{ revealButtonHref }}
https://Github.com/RustPython/RustPython/pull/8347/files#diff-1d551e328263656ddaf66c44e63706eb1cabdd12fdf33f61c22c3c709ce92b5e
https://Github.com/RustPython/RustPython/pull/8347/files#diff-1d551e328263656ddaf66c44e63706eb1cabdd12fdf33f61c22c3c709ce92b5e
https://Github.com/RustPython/RustPython/pull/8347/files#diff-1d551e328263656ddaf66c44e63706eb1cabdd12fdf33f61c22c3c709ce92b5e
crates/host_env/src/termios.rshttps://Github.com/RustPython/RustPython/pull/8347/files#diff-99f18b026fed666d68940db9ac6b8c43144ca3f1bfda132dd348c3ad9dd84ce9
View file https://Github.com/RustPython/RustPython/blob/6888774c0394d843cc35328d5c5192749c51ae16/crates/host_env/src/termios.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/RustPython/RustPython/pull/8347/{{ revealButtonHref }}
https://Github.com/RustPython/RustPython/pull/8347/files#diff-99f18b026fed666d68940db9ac6b8c43144ca3f1bfda132dd348c3ad9dd84ce9
crates/stdlib/src/termios.rshttps://Github.com/RustPython/RustPython/pull/8347/files#diff-f71c9947248d03cff69ec513944e7d52a21b63c8b48ebf54fee1eea4a9145b10
View file https://Github.com/RustPython/RustPython/blob/6888774c0394d843cc35328d5c5192749c51ae16/crates/stdlib/src/termios.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://Github.com/RustPython/RustPython/pull/8347/{{ revealButtonHref }}
https://Github.com/RustPython/RustPython/pull/8347/files#diff-f71c9947248d03cff69ec513944e7d52a21b63c8b48ebf54fee1eea4a9145b10
youknowonehttps://Github.com/youknowone
Jul 23, 2026https://Github.com/RustPython/RustPython/pull/8347/files#r3640131037
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/files
https://Github.com/RustPython/RustPython/pull/8347/files#diff-f71c9947248d03cff69ec513944e7d52a21b63c8b48ebf54fee1eea4a9145b10
Please reload this pagehttps://Github.com/RustPython/RustPython/pull/8347/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.