René's URL Explorer Experiment


Title: curses `window.encoding` does not encode `str` arguments on a wide build · Issue #156347 · python/cpython · GitHub

Open Graph Title: curses `window.encoding` does not encode `str` arguments on a wide build · Issue #156347 · python/cpython

X Title: curses `window.encoding` does not encode `str` arguments on a wide build · Issue #156347 · python/cpython

Description: Documentation The curses HOWTO says that strings passed to window.addstr() are "encoded to bytes using the value of the window's encoding attribute", and the window.encoding entry in the library reference describes it as the "Encoding us...

Open Graph Description: Documentation The curses HOWTO says that strings passed to window.addstr() are "encoded to bytes using the value of the window's encoding attribute", and the window.encoding entry in the library re...

X Description: Documentation The curses HOWTO says that strings passed to window.addstr() are "encoded to bytes using the value of the window's encoding attribute", and the window.encoding entry in ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"curses `window.encoding` does not encode `str` arguments on a wide build","articleBody":"### Documentation\n\nThe curses HOWTO says that strings passed to `window.addstr()` are \"encoded to bytes using the value of the window's `encoding` attribute\", and the `window.encoding` entry in the library reference describes it as the \"Encoding used to encode method arguments (Unicode strings and characters)\". On a build linked against a wide-character version of the curses library, which is what CPython configures by default, neither is true: `PyCurses_ConvertToString` in `Modules/_cursesmodule.c` converts `str` with `PyUnicode_AsWideCharString` and never reads `win->encoding`, so the bytes that reach the terminal come from the current locale instead.\n\n```python\nimport curses, os, pty, sys\n_, slave = pty.openpty()\nos.dup2(slave, 0); os.dup2(slave, 1)\nwin = curses.initscr()\nwin.encoding = 'latin-1'\nwin.addstr(0, 0, 'caf\\xe9')\ngot = win.instr(0, 0, 6)\ncurses.endwin()\nprint('stored:', got, '  latin-1 would be:', 'caf\\xe9'.encode('latin-1'), file=sys.stderr)\n```\n\n```\nstored: b'caf\\xc3\\xa9 '   latin-1 would be: b'caf\\xe9'\n```\n\nExpected: `b'caf\\xe9'`, the bytes `latin-1` produces, if `window.encoding` were used to encode the argument.\n\nThe attribute is used on a narrow build, where it also decodes results, so the correction has to name the build rather than call the attribute unused.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156352\n* gh-156354\n* gh-156872\n* gh-156873\n* gh-156874\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/fedonman","@type":"Person","name":"fedonman"},"datePublished":"2026-08-25T08:20:49Z","url":"https://github.com/python/cpython/issues/156347"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:75f5219d-d4ad-2371-f167-5fb581440844
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id82E2:24645:14DA93D:1B86CF4:6B01F761
html-safe-nonceb3ee122c4c7f3a401c150b9f9b99bc9a51def8fa5c7cc8f477195dfcd1a0da9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkUyOjI0NjQ1OjE0REE5M0Q6MUI4NkNGNDo2QjAxRjc2MSIsInZpc2l0b3JfaWQiOiI1NTY4NDIxNTk1MzQzNzI3MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0e9adccf78d4686ef27be599124c2a86c6db1f7c17246a0f395638d116102989
hovercard-subject-tagissue:5243633154
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/156347/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3c987248f8fb1872f1960093fe5936854bd0336dbeea3fba93d8c0d64ab36d6a/python/cpython/issues/156347
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3c987248f8fb1872f1960093fe5936854bd0336dbeea3fba93d8c0d64ab36d6a/python/cpython/issues/156347
og:image:altDocumentation The curses HOWTO says that strings passed to window.addstr() are "encoded to bytes using the value of the window's encoding attribute", and the window.encoding entry in the library re...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefedonman
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/156347#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F156347
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%2Fissues%2F156347
Sign uphttps://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/156347
Reloadhttps://github.com/python/cpython/issues/156347
Reloadhttps://github.com/python/cpython/issues/156347
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
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156347
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156347
curses window.encoding does not encode str arguments on a wide buildhttps://github.com/python/cpython/issues/156347#top
https://github.com/serhiy-storchaka
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
https://github.com/fedonman
fedonmanhttps://github.com/fedonman
on Aug 25, 2026https://github.com/python/cpython/issues/156347#issue-5243633154
gh-156347: Fix the documentation of curses window.encoding #156352https://github.com/python/cpython/pull/156352
gh-156347: Fix wrong statements in the curses documentation #156354https://github.com/python/cpython/pull/156354
[3.15] gh-156347: Fix wrong statements in the curses documentation (GH-156354) #156872https://github.com/python/cpython/pull/156872
[3.14] gh-156347: Fix wrong statements in the curses documentation (GH-156354) #156873https://github.com/python/cpython/pull/156873
[3.13] gh-156347: Fix wrong statements in the curses documentation (GH-156354) #156874https://github.com/python/cpython/pull/156874
serhiy-storchakahttps://github.com/serhiy-storchaka
on Aug 25, 2026https://github.com/python/cpython/issues/156347#event-29963867080
serhiy-storchakahttps://github.com/serhiy-storchaka
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
on Aug 25, 2026https://github.com/python/cpython/issues/156347#event-29969992497
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Aug 25, 2026https://github.com/python/cpython/issues/156347#event-29969997333
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Aug 25, 2026https://github.com/python/cpython/issues/156347
serhiy-storchakahttps://github.com/serhiy-storchaka
Curses issueshttps://github.com/orgs/python/projects/18
on Aug 25, 2026https://github.com/python/cpython/issues/156347#event-29969999922
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Aug 25, 2026https://github.com/python/cpython/issues/156347#issuecomment-5408995955
#156354https://github.com/python/cpython/pull/156354
https://github.com/fedonman
fedonmanhttps://github.com/fedonman
on Aug 25, 2026https://github.com/python/cpython/issues/156347#issuecomment-5409687458
@serhiy-storchakahttps://github.com/serhiy-storchaka
#156352https://github.com/python/cpython/pull/156352
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Aug 27, 2026https://github.com/python/cpython/issues/156347#issuecomment-5435592816
#156354https://github.com/python/cpython/pull/156354
serhiy-storchakahttps://github.com/serhiy-storchaka
on Sep 3, 2026https://github.com/python/cpython/issues/156347#event-30470392036
gh-156347: Fix wrong statements in the curses documentation (GH-156354)https://github.com/python/cpython/commit/161054cbfe5a5fb566698c3514ad6bc2078b00d8
gh-156347https://github.com/python/cpython/issues/156347
GH-156354https://github.com/python/cpython/pull/156354
161054chttps://github.com/python/cpython/commit/161054cbfe5a5fb566698c3514ad6bc2078b00d8
[3.14] gh-156347: Fix wrong statements in the curses documentation (G…https://github.com/python/cpython/commit/a3084ff016ea548d40e6fbcd2271aaa088834420
gh-156347https://github.com/python/cpython/issues/156347
G…https://github.com/python/cpython/pull/156354
a3084ffhttps://github.com/python/cpython/commit/a3084ff016ea548d40e6fbcd2271aaa088834420
[3.13] gh-156347: Fix wrong statements in the curses documentation (G…https://github.com/python/cpython/commit/6ad0c73e45d394c5a390dab3d9ecae7d52040aa0
gh-156347https://github.com/python/cpython/issues/156347
G…https://github.com/python/cpython/pull/156354
6ad0c73https://github.com/python/cpython/commit/6ad0c73e45d394c5a390dab3d9ecae7d52040aa0
serhiy-storchakahttps://github.com/serhiy-storchaka
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 3, 2026https://github.com/python/cpython/issues/156347#event-30471280308
github-project-automationhttps://github.com/apps/github-project-automation
Curses issueshttps://github.com/orgs/python/projects/18
on Sep 3, 2026https://github.com/python/cpython/issues/156347
hugovkhttps://github.com/hugovk
on Sep 5, 2026https://github.com/python/cpython/issues/156347#event-30610601288
[3.15] gh-156347: Fix wrong statements in the curses documentation (G…https://github.com/python/cpython/commit/996300c794683fbb9d6ccc8c697b2e56f52ea1a6
gh-156347https://github.com/python/cpython/issues/156347
G…https://github.com/python/cpython/pull/156354
996300chttps://github.com/python/cpython/commit/996300c794683fbb9d6ccc8c697b2e56f52ea1a6
clin1234https://github.com/clin1234
on Sep 12, 2026https://github.com/python/cpython/issues/156347#event-31023916012
pythongh-156347: Fix wrong statements in the curses documentation (py…https://github.com/clin1234/cpython/commit/a81d06aa141e3a1ee3599df9f9560e88224dc26a
pythongh-156347https://github.com/python/cpython/issues/156347
py…https://github.com/python/cpython/pull/156354
a81d06ahttps://github.com/clin1234/cpython/commit/a81d06aa141e3a1ee3599df9f9560e88224dc26a
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/156347
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/156347
serhiy-storchakahttps://github.com/serhiy-storchaka
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
Curses issueshttps://github.com/orgs/python/projects/18
docs issueshttps://github.com/orgs/python/projects/52
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.