Skip to content

Commit 73d8e9a

Browse files
authored
gh-117291: Explain usage of null bytes in Array(c_char).value (GH-117292)
1 parent 0f1f7c7 commit 73d8e9a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/library/multiprocessing.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,10 @@ inherited by child processes.
17231723
Note that *lock* is a keyword only argument.
17241724

17251725
Note that an array of :data:`ctypes.c_char` has *value* and *raw*
1726-
attributes which allow one to use it to store and retrieve strings.
1726+
attributes which can both be used to store and retrieve byte strings.
1727+
While *raw* allows interaction with a :class:`bytes` object the full size of
1728+
the array, reading *value* will terminate after a null byte, like most
1729+
programming languages handle strings.
17271730

17281731

17291732
The :mod:`!multiprocessing.sharedctypes` module

0 commit comments

Comments
 (0)