]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document the lifetime of `PyUnicode_AsUTF8String` (GH-92325)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 6 May 2022 09:55:01 +0000 (02:55 -0700)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 09:55:01 +0000 (02:55 -0700)
The current wording implied this, but didn't state it explicitly.
(cherry picked from commit 740da8d37a84638f4a8893bee3648f36fc6beb0f)

Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
Doc/c-api/unicode.rst

index a08cebcc000d0d1097111eb98ab1bd602b0e7ab1..cf7d2232125c892ad070cec87a71091c665bedf7 100644 (file)
@@ -1093,7 +1093,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