From 5086be9809724b26410adb77ec3f2191199ba2ae Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Wed, 27 Mar 2024 16:20:51 +0100 Subject: [PATCH 1/3] pythongh-117291: Explain usage of nullbytes in Array(c_char).value --- Doc/library/multiprocessing.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 7b17df08f7dc712..4dbcf122aa6c017 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1724,6 +1724,9 @@ inherited by child processes. Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes which allow one to use it to store and retrieve strings. + While *raw* allows interaction with a bytes-object the full size of the + array, reading *value* will terminate after a null-byte, like most + programming languages handle strings. The :mod:`!multiprocessing.sharedctypes` module From d69672babbd8e2b6db4b746f9fe6f7bc335cd69f Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Sat, 30 May 2026 23:49:19 +0200 Subject: [PATCH 2/3] apply commenty from @serhiy-storchaka --- Doc/library/multiprocessing.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 4dbcf122aa6c017..0192b82322aab2b 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1723,9 +1723,9 @@ inherited by child processes. Note that *lock* is a keyword only argument. Note that an array of :data:`ctypes.c_char` has *value* and *raw* - attributes which allow one to use it to store and retrieve strings. - While *raw* allows interaction with a bytes-object the full size of the - array, reading *value* will terminate after a null-byte, like most + attributes which allow one to use it to store and retrieve byte strings. + While *raw* allows interaction with a :class:`bytes` object the full size of + the array, reading *value* will terminate after a null byte, like most programming languages handle strings. From 285797d6c47d8dfcad4ad0b4d4915a803da8867a Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Sat, 30 May 2026 23:57:29 +0200 Subject: [PATCH 3/3] improve grammar --- Doc/library/multiprocessing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 0192b82322aab2b..2d13053915830b0 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1723,7 +1723,7 @@ inherited by child processes. Note that *lock* is a keyword only argument. Note that an array of :data:`ctypes.c_char` has *value* and *raw* - attributes which allow one to use it to store and retrieve byte strings. + attributes which can both be used to store and retrieve byte strings. While *raw* allows interaction with a :class:`bytes` object the full size of the array, reading *value* will terminate after a null byte, like most programming languages handle strings.