Skip to content

Conversation

@Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Nov 18, 2023

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to handle the case 'N' in _PyUnicode_DecodeUnicodeEscapeInternal.

@Eclips4
Copy link
Member Author

Eclips4 commented Nov 19, 2023

Should we do something with _PyUnicode_Fini?

cpython/Objects/unicodeobject.c

Lines 15445 to 15460 in 14fd86a

void
_PyUnicode_Fini(PyInterpreterState *interp)
{
struct _Py_unicode_state *state = &interp->unicode;
// _PyUnicode_ClearInterned() must be called before _PyUnicode_Fini()
assert(get_interned_dict(interp) == NULL);
_PyUnicode_FiniEncodings(&state->fs_codec);
// bpo-47182: force a unicodedata CAPI capsule re-import on
// subsequent initialization of interpreter.
interp->unicode.ucnhash_capi = NULL;
unicode_clear_identifiers(state);
}

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_PyUnicode_Fini looks fine. I don't think it needs any special handling.

@colesbury
Copy link
Contributor

@erlend-aasland, would you please review this when you get a chance?

@erlend-aasland
Copy link
Contributor

Thanks for the PR, Kirill, and thanks for the review, Sam!

@Eclips4 Eclips4 deleted the issue-111972 branch November 30, 2023 10:15
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unicode: make ucnhash_capi initialization thread-safe in --disable-gil builds

4 participants