Title: gh-152415: Exercise curses non-ASCII tests under 8-bit locale encodings by serhiy-storchaka · Pull Request #152416 · python/cpython · GitHub
Open Graph Title: gh-152415: Exercise curses non-ASCII tests under 8-bit locale encodings by serhiy-storchaka · Pull Request #152416 · python/cpython
X Title: gh-152415: Exercise curses non-ASCII tests under 8-bit locale encodings by serhiy-storchaka · Pull Request #152416 · python/cpython
Description: Issue: gh-152415 The non-ASCII tests in test_curses only exercised what the test runner's locale could encode, in practice UTF-8, so the byte-oriented (8-bit locale) code paths were barely tested and several text-accepting methods were tested only with ASCII. This extends the character and string I/O tests with cases for 8-bit encodings, each guarded by the existing encodability check (skipped when the current locale cannot represent it): ASCII, a character common to the Latin encodings (é), and ones distinctive to a single encoding (byte 0xA4 is ¤ in ISO-8859-1, € in ISO-8859-15, є in KOI8-U). Running the whole suite under different locales (LANG=en_US.ISO8859-1, en_US.ISO8859-15, uk_UA.koi8u) covers those encodings. It also fills read-side and other gaps found by an audit of the text-accepting API: inch/instr, get_wstr (previously untested), getbkgd/getbkgrnd, unctrl, the default border()/box() ACS cells, and characters given as chtype ints > 127. A couple of build-/locale-specific notes captured in the comments: on a wide build inch and int (chtype) characters round-trip only Latin-1 codepoints (the wide build stores text/ints through the locale), so those assertions are guarded to ord < 0x100, while instr covers the full set. Test-only; no behaviour change. Verified on wide and narrow (ncursesw-disabled) builds under UTF-8, ISO-8859-1, ISO-8859-15 and KOI8-U.
Open Graph Description: Issue: gh-152415 The non-ASCII tests in test_curses only exercised what the test runner's locale could encode, in practice UTF-8, so the byte-oriented (8-bit locale) code paths were barely te...
X Description: Issue: gh-152415 The non-ASCII tests in test_curses only exercised what the test runner's locale could encode, in practice UTF-8, so the byte-oriented (8-bit locale) code paths were barel...
Opengraph URL: https://github.com/python/cpython/pull/152416
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9dfc1416-4b68-657f-ee8d-b7cac0608fd4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 83DE:1F87:E22E64:11A4505:6B023F87 |
| html-safe-nonce | 7c4aca1bb73456d3bdf3d665109599ee42412ba00fb9e9061c2dd5653561fbbc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0RFOjFGODc6RTIyRTY0OjExQTQ1MDU6NkIwMjNGODciLCJ2aXNpdG9yX2lkIjoiODA4Mzc0NjM0MzAyMDI5NzAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8941bad0ccf6fed06a11358184e5e59acf6af40bb2a3cafda8a6f26737163477 |
| hovercard-subject-tag | pull_request:3947776396 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/152416/files |
| twitter:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| og:image:alt | Issue: gh-152415 The non-ASCII tests in test_curses only exercised what the test runner's locale could encode, in practice UTF-8, so the byte-oriented (8-bit locale) code paths were barely te... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width