Skip to content

Commit 367faf7

Browse files
Document the lifetime of PyUnicode_AsUTF8String (GH-92325)
The current wording implied this, but didn't state it explicitly. (cherry picked from commit 740da8d) Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
1 parent 3db0e0b commit 367faf7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/c-api/unicode.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,8 @@ These are the UTF-8 codec APIs:
10931093
10941094
This caches the UTF-8 representation of the string in the Unicode object, and
10951095
subsequent calls will return a pointer to the same buffer. The caller is not
1096-
responsible for deallocating the buffer.
1096+
responsible for deallocating the buffer. The buffer is deallocated and
1097+
pointers to it become invalid when the Unicode object is garbage collected.
10971098
10981099
.. versionadded:: 3.3
10991100

0 commit comments

Comments
 (0)