-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Add private _PyUnicode_AsUTF8() function #111957
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
Add private _PyUnicode_AsUTF8() function #111957
Conversation
Like PyUnicode_AsUTF8(), but check for embedded null characters.
Can you rename it to _PyUnicode_AsUTF8NoNUL() (or any other name)? A single underscore to distinguish it from PyUnicode_AsUTF8() is not enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
Like PyUnicode_AsUTF8(), but check for embedded null characters. (cherry picked from commit 771bd3c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-111975 is a backport of this pull request to the 3.12 branch. |
I will perhaps backport this, because some bugfixes need to check for embedded NUL. It is simpler to replace |
Damn, the guard against ABI changes does not allow this. |
Even if the function is not exported? Using the right command, you can ignore this ABI warning, but regenerating ABI data. |
Like PyUnicode_AsUTF8(), but check for embedded null characters.
Like PyUnicode_AsUTF8(), but check for embedded null characters.
Like PyUnicode_AsUTF8(), but check for embedded null characters.
It is only used in two places, but I am planning to use it more.
Since it is a private function, I do not expect a hot discussion about it. I added similar variants of
PyUnicode_AsUnicode()
in the past.