Add private _PyUnicode_AsUTF8() function#111957
Add private _PyUnicode_AsUTF8() function#111957serhiy-storchaka merged 2 commits intopython:mainfrom
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. |
|
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.