-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_re fails on Alpine Linux (with musl) #131342
Comments
Do you have locale -a | grep en_US Both of the tests depend on it. I presume it is setting a locale that is not available for some reason.
I am unable to reproduce after deleting locale:
|
@StanFromIreland: Do you link Python to the musl C library? |
@vstinner: I should have specified, I did not. I am not sure whether it is even packaged for Fedora. |
musl is package in Fedora, but I failed to build Python using musl-gcc wrapper. I built Python in Alpine to get musl. |
Please add the following lines at the beginning of print()
print(f'LC_CTYPE: {locale.setlocale(locale.LC_CTYPE)}')
print(f'LC_COLLATE: {locale.setlocale(locale.LC_COLLATE)}')
print(f'LC_ALL: {locale.setlocale(locale.LC_ALL)}') |
Here you have:
|
Using musl, setlocale() doesn't fail even if the locale isn't supported:
Another example:
|
See also #131313 |
The PR covers both the tests here already. I guess the PR can be assigned this issue? |
I have roughly identified the reasons:
When I run the code in two environments, the behavior is different locale.setlocale(locale.LC_CTYPE, "xxx.xxx") glibc:
musl: Further, you can refer to the musl source code here: |
Issue fixed by change 6146295. |
Bug report
Bug description:
CPython versions tested on:
3.13
Operating systems tested on:
Linux
The text was updated successfully, but these errors were encountered: