Skip to content

test_set_name fails on OpenIndiana #138004

@serhiy-storchaka

Description

@serhiy-storchaka

It seems that pthread_setname_np() only works with ASCII names here.

>>> import _thread
>>> _thread.set_name('')
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    _thread.set_name('€')
    ~~~~~~~~~~~~~~~~^^^^^
OSError: [Errno 22] Invalid argument

In addition to making the test more lenient, we can make _thread.set_name() more tolerant to such restriction -- use ASCII encoding with the "replace" or "ignore" error handler as a fallback.

cc @vstinner

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15new features, bugs and security fixesOS-unsupportedextension-modulesC modules in the Modules dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions