https://github.com/python/cpython/commit/7f88cb1f28900ddb24b672456d768021ad27bba5
commit: 7f88cb1f28900ddb24b672456d768021ad27bba5
branch: 3.11
author: Miss Islington (bot) <[email protected]>
committer: encukou <[email protected]>
date: 2024-02-14T11:24:54+01:00
summary:

[3.11] gh-113437: Update documentation about PyUnicode_AsWideChar() function 
(GH-113455) (GH-115408)

(cherry picked from commit 5719aa23ab7f1c7a5f03309ca4044078a98e7b59)

Co-authored-by: qqwqqw689 <[email protected]>

files:
M Doc/c-api/unicode.rst

diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index ffa2d131235f25..2f0b0514144ede 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -950,7 +950,12 @@ wchar_t Support
    Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*.  
At most
    *size* :c:type:`wchar_t` characters are copied (excluding a possibly 
trailing
    null termination character).  Return the number of :c:type:`wchar_t` 
characters
-   copied or ``-1`` in case of an error.  Note that the resulting 
:c:expr:`wchar_t*`
+   copied or ``-1`` in case of an error.
+
+   When *wstr* is ``NULL``, instead return the *size* that would be required
+   to store all of *unicode* including a terminating null.
+
+   Note that the resulting :c:expr:`wchar_t*`
    string may or may not be null-terminated.  It is the responsibility of the 
caller
    to make sure that the :c:expr:`wchar_t*` string is null-terminated in case 
this is
    required by the application. Also, note that the :c:expr:`wchar_t*` string

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to