diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-06 09:56:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 09:56:55 (GMT) |
commit | 60407e8a1937cc4aaf6218a957743f62482257a1 (patch) | |
tree | 7ea3246ace821ac8cff59878614188c35ff557b1 /Doc | |
parent | df48bd926ee4bec9a1ca5b94c2254ad8a4c2eb13 (diff) | |
download | cpython-60407e8a1937cc4aaf6218a957743f62482257a1.zip cpython-60407e8a1937cc4aaf6218a957743f62482257a1.tar.gz cpython-60407e8a1937cc4aaf6218a957743f62482257a1.tar.bz2 |
Document the lifetime of `PyUnicode_AsUTF8String` (GH-92325)
The current wording implied this, but didn't state it explicitly.
(cherry picked from commit 740da8d37a84638f4a8893bee3648f36fc6beb0f)
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/unicode.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index a6ae8ba..8bdcad6 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1110,7 +1110,8 @@ These are the UTF-8 codec APIs: This caches the UTF-8 representation of the string in the Unicode object, and subsequent calls will return a pointer to the same buffer. The caller is not - responsible for deallocating the buffer. + responsible for deallocating the buffer. The buffer is deallocated and + pointers to it become invalid when the Unicode object is garbage collected. .. versionadded:: 3.3 |