-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
gh-138004: Encode thread names on Solaris-based platforms as ASCII and fix main/worker threading test #138017
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
Changes from 48 commits
d97417d
1db08a7
0606968
b556774
38a75d3
31731b1
83fe205
aadf7f3
612a0a4
1fa51f8
d24d0bb
95d289f
d7a47bf
1970a00
6395323
241e097
66c058b
f817412
3349464
ac3d3dd
1ab9ecd
d9ba9e8
d7025f5
3689044
246f880
407b1e9
dc43fc4
7aa256c
b4934a2
ae5ac4b
4fc368d
392aa5a
84daea4
d5e9399
105d4e6
c67e93d
508f24d
25085bf
cd26833
dc86a29
c9f554d
c0f672e
69796ff
15c8481
99f13ec
8fc613b
5e5effb
9690eee
338593c
e642264
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| On Solaris/Illumos platforms, thread names are now encoded as ASCII to avoid errors on systems (e.g. OpenIndiana) that don't support non-ASCII names. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2523,7 +2523,9 @@ _thread__get_name_impl(PyObject *module) | |
| } | ||
|
|
||
| #ifdef __sun | ||
| return PyUnicode_DecodeUTF8(name, strlen(name), "surrogateescape"); | ||
| // gh-138004: Decode Solaris/Illumos (e.g. OpenIndiana) thread names | ||
| // from ASCII, since OpenIndiana only supports ASCII names. | ||
serhiy-storchaka marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return PyUnicode_DecodeASCII(name, strlen(name), "surrogateescape"); | ||
| #else | ||
| return PyUnicode_DecodeFSDefault(name); | ||
| #endif | ||
|
|
@@ -2561,8 +2563,9 @@ _thread_set_name_impl(PyObject *module, PyObject *name_obj) | |
| { | ||
| #ifndef MS_WINDOWS | ||
| #ifdef __sun | ||
| // Solaris always uses UTF-8 | ||
jadonduff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const char *encoding = "utf-8"; | ||
| // gh-138004: Encode Solaris/Illumos thread names to ASCII, | ||
| // since OpenIndiana does not support non-ASCII names. | ||
| const char *encoding = "ascii"; | ||
| #else | ||
| // Encode the thread name to the filesystem encoding using the "replace" | ||
| // error handler | ||
|
|
@@ -2873,4 +2876,4 @@ PyMODINIT_FUNC | |
| PyInit__thread(void) | ||
| { | ||
| return PyModuleDef_Init(&thread_module); | ||
| } | ||
| } | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.