Skip to content

Commit 746ee08

Browse files
committed
bpo-47182: Fix crash by named unicode characters after interpreter reinitialization
1 parent b36d222 commit 746ee08

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a crash when using a named unicode character like ``"\N{digit nine}"``
2+
after the main interpreter has been initialized a second time.

Objects/unicodeobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16085,6 +16085,8 @@ _PyUnicode_Fini(PyInterpreterState *interp)
1608516085
if (_Py_IsMainInterpreter(interp)) {
1608616086
// _PyUnicode_ClearInterned() must be called before _PyUnicode_Fini()
1608716087
assert(interned == NULL);
16088+
16089+
ucnhash_capi = NULL;
1608816090
}
1608916091

1609016092
_PyUnicode_FiniEncodings(&state->fs_codec);

0 commit comments

Comments
 (0)