@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.11\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2022-12-14 04:15 +0000\n "
14+ "POT-Creation-Date : 2022-12-24 04:13 +0000\n "
1515"PO-Revision-Date : 2021-06-28 00:47+0000\n "
1616"Last-Translator : Maciej Olko <maciej.olko@gmail.com>, 2021\n "
1717"Language-Team : Polish (https://www.transifex.com/python-doc/teams/5390/pl/)\n "
@@ -77,30 +77,46 @@ msgid ""
7777"don't have to provide raw storage for the returned unicode or bytes area."
7878msgstr ""
7979
80+ msgid "Unless otherwise stated, buffers are not NUL-terminated."
81+ msgstr "Bufory nie są zakończone znakiem NULL, chyba że zaznaczono inaczej."
82+
83+ msgid "There are three ways strings and buffers can be converted to C:"
84+ msgstr ""
85+
8086msgid ""
81- "In general, when a format sets a pointer to a buffer, the buffer is managed "
82- "by the corresponding Python object, and the buffer shares the lifetime of "
83- "this object. You won't have to release any memory yourself. The only "
84- "exceptions are ``es``, ``es#``, ``et`` and ``et#``."
87+ "Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This "
88+ "locks the underlying buffer so that the caller can subsequently use the "
89+ "buffer even inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk "
90+ "of mutable data being resized or destroyed. As a result, **you have to "
91+ "call** :c:func:`PyBuffer_Release` after you have finished processing the "
92+ "data (or in any early abort case)."
8593msgstr ""
8694
8795msgid ""
88- "However, when a :c:type:`Py_buffer` structure gets filled, the underlying "
89- "buffer is locked so that the caller can subsequently use the buffer even "
90- "inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk of mutable "
91- "data being resized or destroyed. As a result, **you have to call** :c:func:"
92- "`PyBuffer_Release` after you have finished processing the data (or in any "
93- "early abort case)."
96+ "The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. "
97+ "**You have to call** :c:func:`PyMem_Free` after you have finished processing "
98+ "the data (or in any early abort case)."
9499msgstr ""
95100
96- msgid "Unless otherwise stated, buffers are not NUL-terminated."
97- msgstr "Bufory nie są zakończone znakiem NULL, chyba że zaznaczono inaczej."
101+ msgid ""
102+ "Other formats take a :class:`str` or a read-only :term:`bytes-like object`, "
103+ "such as :class:`bytes`, and provide a ``const char *`` pointer to its "
104+ "buffer. In this case the buffer is \" borrowed\" : it is managed by the "
105+ "corresponding Python object, and shares the lifetime of this object. You "
106+ "won't have to release any memory yourself."
107+ msgstr ""
108+
109+ msgid ""
110+ "To ensure that the underlying buffer may be safely borrowed, the object's :c:"
111+ "member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This "
112+ "disallows common mutable objects such as :class:`bytearray`, but also some "
113+ "read-only objects such as :class:`memoryview` of :class:`bytes`."
114+ msgstr ""
98115
99116msgid ""
100- "Some formats require a read-only :term:`bytes-like object`, and set a "
101- "pointer instead of a buffer structure. They work by checking that the "
102- "object's :c:member:`PyBufferProcs.bf_releasebuffer` field is ``NULL``, which "
103- "disallows mutable objects such as :class:`bytearray`."
117+ "Besides this ``bf_releasebuffer`` requirement, there is no check to verify "
118+ "whether the input object is immutable (e.g. whether it would honor a request "
119+ "for a writable buffer, or whether another thread can mutate the data)."
104120msgstr ""
105121
106122msgid ""
@@ -151,10 +167,11 @@ msgid ""
151167msgstr ""
152168
153169msgid ""
154- "Like ``s*``, except that it doesn't accept mutable objects. The result is "
155- "stored into two C variables, the first one a pointer to a C string, the "
156- "second one its length. The string may contain embedded null bytes. Unicode "
157- "objects are converted to C strings using ``'utf-8'`` encoding."
170+ "Like ``s*``, except that it provides a :ref:`borrowed buffer <c-arg-borrowed-"
171+ "buffer>`. The result is stored into two C variables, the first one a pointer "
172+ "to a C string, the second one its length. The string may contain embedded "
173+ "null bytes. Unicode objects are converted to C strings using ``'utf-8'`` "
174+ "encoding."
158175msgstr ""
159176
160177msgid "``z`` (:class:`str` or ``None``) [const char \\ *]"
@@ -188,10 +205,10 @@ msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]"
188205msgstr ""
189206
190207msgid ""
191- "This format converts a bytes-like object to a C pointer to a character "
192- "string; it does not accept Unicode objects. The bytes buffer must not "
193- "contain embedded null bytes; if it does, a :exc:`ValueError` exception is "
194- "raised."
208+ "This format converts a bytes-like object to a C pointer to a :ref:`borrowed "
209+ "<c-arg-borrowed-buffer>` character string; it does not accept Unicode "
210+ "objects. The bytes buffer must not contain embedded null bytes; if it does, "
211+ "a :exc:`ValueError` exception is raised."
195212msgstr ""
196213
197214msgid ""
0 commit comments