GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — unicodedata.bidirectional does not return expected default value for certain code points · Issue #142224 · python/cpython

unicodedata.bidirectional does not return expected default value for certain code points #142224

New issue
Copy link
New issue
Copy link
Closed
Closed
unicodedata.bidirectional does not return expected default value for certain code points#142224
Copy link
Labels
3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-unicodetype-featureA feature request or enhancementA feature request or enhancement

Description

@cmyr
cmyr
opened on Dec 3, 2025
Issue body actions

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 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.

As 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.

Although I have not investigated thoroughly, it appears that other complex default values are also not being handled correctly: for instance UAX#11 indicates that the East_Asian_Width property of U+2FFFE should be 'W', but unicodedata.east_asian_width returns 'N'.

This issue was first encountered in python 3.13.7, and I have verified it is still present in 3.15, as of 8801c6d.

import unicodedata

# both assertions should pass
assert unicodedata.bidirectional(chr(0x0378)) == 'L'
assert unicodedata.bidirectional(chr(0x0590)) == 'R'

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

  • gh-142224: makeunicodedata.py: parse default bidi values #144815
Reacted by Cosimo Lupo

Activity

  1. cmyr
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Dec 3, 2025
  2. StanFromIreland
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    topic-unicode
    on Dec 3, 2025
  3. StanFromIreland commented on Dec 3, 2025

    @StanFromIreland
    StanFromIreland
    on Dec 3, 2025
    Member
    More actions

    This is because we don't comply with the @missing convention, we don't parse it at all.

    I'll try to write something up.

  4. cmyr commented on Dec 3, 2025

    @cmyr
    cmyr
    on Dec 3, 2025
    Author
    More actions

    This is obviously a pretty obscure corner of the spec and there may be good arguments to ignore it for binary size or performance reasons, but it might be worth mentioning in the docs?

  5. serhiy-storchaka
    added a commit that references this issue on Feb 18, 2026

    gh-142224: unicodedata: support bidi classes for unassigned code poin…

    e49bfca
  6. StanFromIreland
    closed this as completedon Feb 18, 2026
  7. serhiy-storchaka
    added
    type-featureA feature request or enhancementA feature request or enhancement
    3.15bugs and security fixesbugs and security fixes
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Feb 18, 2026
  8. brijkapadia
    added a commit that references this issue on Feb 28, 2026

    pythongh-142224: unicodedata: support bidi classes for unassigned cod…

    80e9d32
  9. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-142224: unicodedata: support bidi classes for unassigned cod…

    26586b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtopic-unicodetype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.