-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Open
Labels
OS-macextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
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:
- Locale aware sorting crashes on macOS 15 with OSError WeblateOrg/weblate#14019
- Nicotine+ crashing when trying to browse public shares (on MacOS 15 Public Beta) nicotine-plus/nicotine-plus#3063
- Zim wont open in macOS Sequoia zim-desktop-wiki/zim-desktop-wiki#2665
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
- gh-130567: fix strxfrm memory allocation #130619
- gh-130567: Remove optimistic allocation in locale.strxfrm() #137143
- gh-130567: Fix locale.strxfrm() failure on FreeBSD #138608
- gh-130567: Fix crash in locale.strxfrm() on macOS #138615
- gh-130567: Enable previously skipped locale tests on FreeBSD and macOS #138652
- gh-130567: Fix possible crash in locale.strxfrm() #138940
- [3.14] gh-130567: Fix possible crash in locale.strxfrm() (GH-138940) #139265
- [3.13] gh-130567: Fix possible crash in locale.strxfrm() (GH-138940) #139266
- [3.14] gh-130567: Enable previously skipped locale tests on FreeBSD and macOS (GH-138652) #139421
- [3.13] gh-130567: Enable previously skipped locale tests on FreeBSD and macOS (GH-138652) #139422
Metadata
Metadata
Assignees
Labels
OS-macextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Todo