Document the lifetime of PyUnicode_AsUTF8String (GH-92325)

The current wording implied this, but didn't state it explicitly.
(cherry picked from commit 740da8d37a)

Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-05-06 02:55:01 -07:00 committed by GitHub
parent 3db0e0b9f7
commit 367faf71ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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