Content-Length: 323279 | pFad | https://github.com/python/cpython/issues/130567

74 strxfrm fails on macOS 15 with OSError: [Errno 22] Invalid argument · Issue #130567 · python/cpython · GitHub
Skip to content

strxfrm fails on macOS 15 with OSError: [Errno 22] Invalid argument #130567

@nijel

Description

@nijel

Bug report

Bug description:

It appears that macOS 15 broke locale.strxfrm for letters outside the latin-1 set:

import locale
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
locale.strxfrm('Français') # works
locale.strxfrm('zkouška') # crashes with OSError
locale.strxfrm('中文') # crashes with OSError

This works on Linux and macOS 14 and crashes on macOS 15, tested with Python 3.9–3.14: https://github.com/nijel/python-strxfrm/actions/runs/13541306384/job/37842825809

There are several projects which run into this already:

In most cases, this is being addressed by completely removing locale-aware sorting.

CPython versions tested on:

3.14

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/130567

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy