Title: unicodedata.bidirectional does not return expected default value for certain code points · Issue #142224 · python/cpython · GitHub
Open Graph Title: unicodedata.bidirectional does not return expected default value for certain code points · Issue #142224 · python/cpython
X Title: unicodedata.bidirectional does not return expected default value for certain code points · Issue #142224 · python/cpython
Description: Bug report Bug description: Per UAX #44, "entries for a code point may be omitted in a data file of the code point has a default value for the property in question.". Additionally, certain default properties can be "complex", which means...
Open Graph Description: Bug report Bug description: Per UAX #44, "entries for a code point may be omitted in a data file of the code point has a default value for the property in question.". Additionally, certain default ...
X Description: Bug report Bug description: Per UAX #44, "entries for a code point may be omitted in a data file of the code point has a default value for the property in question.". Additionally, certai...
Opengraph URL: https://github.com/python/cpython/issues/142224
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"unicodedata.bidirectional does not return expected default value for certain code points","articleBody":"# Bug report\n\n### Bug description:\n\n[Per UAX #44](https://www.unicode.org/reports/tr44/tr44-34.html#Default_Values), \"entries for a code point may be omitted in a data file of the code point has a default value for the property in question.\".\n\nAdditionally, certain default properties can be \"complex\", which means that the correct default for the value is contingent on a code point range or other conditions. In the case of BiDi, these default values are defined for code point ranges, in [DerivedBidiClass.txt](https://www.unicode.org/Public/17.0.0/ucd/extracted/DerivedBidiClass.txt).\n\nAs an illustrative example, consider two code points, U+0378 and U+0590. The first is in the private use block, and the second is an unassigned code point in the hebrew block. Per `DerivedBidiClass.txt`, the first should be assigned `Left_To_Right` (L) and the second should be assigned 'Right_To_Left' (R); however `unicodedata.bidrectional` returns the empty string in both cases.\n\nAlthough I have not investigated thoroughly, it appears that other complex default values are also not being handled correctly: for instance [UAX#11 indicates](https://www.unicode.org/reports/tr11/#:~:text=the%20Supplementary%20Ideographic%20Plane%2C%2020000..2FFFF) that the East_Asian_Width property of U+2FFFE should be 'W', but `unicodedata.east_asian_width` returns 'N'.\n\n\nThis issue was first encountered in python 3.13.7, and I have verified it is still present in 3.15, as of 8801c6d.\n\n```python\nimport unicodedata\n\n# both assertions should pass\nassert unicodedata.bidirectional(chr(0x0378)) == 'L'\nassert unicodedata.bidirectional(chr(0x0590)) == 'R'\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-144815\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/cmyr","@type":"Person","name":"cmyr"},"datePublished":"2025-12-03T14:18:08Z","url":"https://github.com/python/cpython/issues/142224"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ebc0639f-9996-8ecf-2d12-1298c7423c3b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C52:323204:15C113F:1CAFC52:6B01FE75 |
| html-safe-nonce | 9d3c805b9a94eadb7c0923e0806664de3889807328cbfc40f307012cd1791bc7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzUyOjMyMzIwNDoxNUMxMTNGOjFDQUZDNTI6NkIwMUZFNzUiLCJ2aXNpdG9yX2lkIjoiNDUxMTc1NTQxOTg3MzU3NDUxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 82622b58eee2b6bef7f7fdcb978a0379d1b0f42d98c3701410be87c1516b6564 |
| hovercard-subject-tag | issue:3690444150 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/142224/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d24af7c22e07866e6bbd2ae0cb4172e6d4f1eb0b817624a91fcddab9b0d307e/python/cpython/issues/142224 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d24af7c22e07866e6bbd2ae0cb4172e6d4f1eb0b817624a91fcddab9b0d307e/python/cpython/issues/142224 |
| og:image:alt | Bug report Bug description: Per UAX #44, "entries for a code point may be omitted in a data file of the code point has a default value for the property in question.". Additionally, certain default ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cmyr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| 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 | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width