Skip to content

Commit 78a9ab9

Browse files
committed
Add test on non-ASCII name
1 parent 97ea645 commit 78a9ab9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_threading.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,16 @@ def work():
21182118
name = "CustomName"
21192119
tests = [(name, name)]
21202120

2121+
# Test non-ASCII short name
2122+
name = "namé€"
2123+
try:
2124+
os.fsencode(name)
2125+
except UnicodeEncodeError:
2126+
# name cannot be encoded to the filesystem encoding
2127+
pass
2128+
else:
2129+
tests.append((name, name))
2130+
21212131
if sys.platform == "linux":
21222132
# On Linux, set_name() truncates the name to 15 bytes.
21232133

0 commit comments

Comments
 (0)