summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-25 00:02:38 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-25 00:02:38 (GMT)
commit25e8ec47244b405083b5fe7b353560666cabff44 (patch)
tree2412de21beab51e376834501ddf8beb866b40df9 /Doc
parent21e09487ac9d4365819ae4de31319ae3df9a8b17 (diff)
downloadcpython-25e8ec47244b405083b5fe7b353560666cabff44.zip
cpython-25e8ec47244b405083b5fe7b353560666cabff44.tar.gz
cpython-25e8ec47244b405083b5fe7b353560666cabff44.tar.bz2
Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
"w*" format instead. Add tests for "w*" format.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/arg.rst18
-rw-r--r--Doc/whatsnew/3.2.rst7
2 files changed, 8 insertions, 17 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 158397a..29d3368 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -150,21 +150,11 @@ Unless otherwise stated, buffers are not NUL-terminated.
any conversion. Raises :exc:`TypeError` if the object is not a Unicode
object. The C variable may also be declared as :ctype:`PyObject\*`.
-``w`` (:class:`bytearray` or read-write character buffer) [char \*]
- Similar to ``y``, but accepts any object which implements the read-write buffer
- interface. The caller must determine the length of the buffer by other means,
- or use ``w#`` instead. Only single-segment buffer objects are accepted;
- :exc:`TypeError` is raised for all others.
-
``w*`` (:class:`bytearray` or read-write byte-oriented buffer) [Py_buffer]
- This is to ``w`` what ``y*`` is to ``y``.
-
-``w#`` (:class:`bytearray` or read-write character buffer) [char \*, int]
- Like ``y#``, but accepts any object which implements the read-write buffer
- interface. The :ctype:`char \*` variable is set to point to the first byte
- of the buffer, and the :ctype:`int` is set to the length of the buffer.
- Only single-segment buffer objects are accepted; :exc:`TypeError` is raised
- for all others.
+ This format accepts any object which implements the read-write buffer
+ interface. It fills a :ctype:`Py_buffer` structure provided by the caller.
+ The buffer may contain embedded null bytes. The caller have to call
+ :cfunc:`PyBuffer_Release` when it is done with the buffer.
``es`` (:class:`str`) [const char \*encoding, char \*\*buffer]
This variant on ``s`` is used for encoding Unicode into a character buffer.
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst
index 14f9215..f2d50b5 100644
--- a/Doc/whatsnew/3.2.rst
+++ b/Doc/whatsnew/3.2.rst
@@ -173,7 +173,8 @@ that may require changes to your code:
* bytearray objects cannot be used anymore as filenames: convert them to bytes
-* "t#" format of PyArg_Parse*() functions has been removed: use "s#" or "s*"
- instead
+* PyArg_Parse*() functions:
+
+ * "t#" format has been removed: use "s#" or "s*" instead
+ * "w" and "w#" formats has been removed: use "w*" instead
-* Stub