diff Modules/_codecsmodule.c @ 62202:d7113cacd428

Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing format Remove last references to the "char buffer" of the buffer protocol from Python3.
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 08 Jun 2010 22:54:19 +0000
parents cab14be0ada1
children 865e34cd7e5b
line wrap: on
line diff
--- a/Modules/_codecsmodule.c	Tue Jun 08 22:27:07 2010 +0000
+++ b/Modules/_codecsmodule.c	Tue Jun 08 22:54:19 2010 +0000
@@ -639,21 +639,6 @@
 }
 
 static PyObject *
-charbuffer_encode(PyObject *self,
-                  PyObject *args)
-{
-    const char *data;
-    Py_ssize_t size;
-    const char *errors = NULL;
-
-    if (!PyArg_ParseTuple(args, "t#|z:charbuffer_encode",
-                          &data, &size, &errors))
-        return NULL;
-
-    return codec_tuple(PyBytes_FromStringAndSize(data, size), size);
-}
-
-static PyObject *
 unicode_internal_encode(PyObject *self,
                         PyObject *args)
 {
@@ -1116,7 +1101,6 @@
     {"charmap_decode",          charmap_decode,                 METH_VARARGS},
     {"charmap_build",           charmap_build,                  METH_VARARGS},
     {"readbuffer_encode",       readbuffer_encode,              METH_VARARGS},
-    {"charbuffer_encode",       charbuffer_encode,              METH_VARARGS},
 #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
     {"mbcs_encode",             mbcs_encode,                    METH_VARARGS},
     {"mbcs_decode",             mbcs_decode,                    METH_VARARGS},