diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-08 22:54:19 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-08 22:54:19 (GMT) |
commit | 3dcb5acdb0151d1686762329ec07ae2ac4d1caae (patch) | |
tree | 1b9d0230afafafa0cff920c7f55c9ca98e433719 /Python/getargs.c | |
parent | 1fbd36b51d1bf65bc110e51840bede646b58f2d5 (diff) | |
download | cpython-3dcb5acdb0151d1686762329ec07ae2ac4d1caae.zip cpython-3dcb5acdb0151d1686762329ec07ae2ac4d1caae.tar.gz cpython-3dcb5acdb0151d1686762329ec07ae2ac4d1caae.tar.bz2 |
Issue #8838, #8339: Remove codecs.charbuffer_encode() and "t#" parsing format
Remove last references to the "char buffer" of the buffer protocol from
Python3.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 31b9d35..2a26a8f 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -864,7 +864,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, break; } - /* XXX WAAAAH! 's', 'y', 'z', 'u', 'Z', 'e', 'w', 't' codes all + /* XXX WAAAAH! 's', 'y', 'z', 'u', 'Z', 'e', 'w' codes all need to be cleaned up! */ case 's': {/* text string */ @@ -1362,45 +1362,6 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags, break; } - /*TEO: This can be eliminated --- here only for backward - compatibility */ - case 't': { /* 8-bit character buffer, read-only access */ - char **p = va_arg(*p_va, char **); - PyBufferProcs *pb = arg->ob_type->tp_as_buffer; - Py_ssize_t count; - Py_buffer view; - - if (*format++ != '#') - return converterr( - "invalid use of 't' format character", - arg, msgbuf, bufsize); - if (pb == NULL || pb->bf_getbuffer == NULL) - return converterr( - "bytes or read-only character buffer", - arg, msgbuf, bufsize); - - if (PyObject_GetBuffer(arg, &view, PyBUF_SIMPLE) != 0) - return converterr("string or single-segment read-only buffer", - arg, msgbuf, bufsize); - - count = view.len; - *p = view.buf; - if (pb->bf_releasebuffer) - return converterr( - "string or pinned buffer", - arg, msgbuf, bufsize); - - PyBuffer_Release(&view); - - if (count < 0) - return converterr("(unspecified)", arg, msgbuf, bufsize); - { - FETCH_SIZE; - STORE_SIZE(count); - } - break; - } - default: return converterr("impossible<bad format char>", arg, msgbuf, bufsize); |