X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib-python/blobdiff_plain/55b42c189e6a40e66b7beef6056fd8a484ee85f5..7c66d8c9ef1bf4cd701c6eb3da64d2b861cd6f6c:/codec.pyx?ds=sidebyside diff --git a/codec.pyx b/codec.pyx index 815e6b2..b9f910f 100644 --- a/codec.pyx +++ b/codec.pyx @@ -50,6 +50,7 @@ cdef extern from 'mLib/codec.h': CDCF_IGNEQMID CDCF_IGNZPAD CDCF_IGNNEWL + CDCF_IGNSPC CDCF_IGNINVCH CDCF_IGNJUNK @@ -69,6 +70,7 @@ class CDCF: IGNEQMID = CDCF_IGNEQMID IGNZPAD = CDCF_IGNZPAD IGNNEWL = CDCF_IGNNEWL + IGNSPC = CDCF_IGNSPC IGNINVCH = CDCF_IGNINVCH IGNJUNK = CDCF_IGNJUNK @@ -106,14 +108,14 @@ cdef class _BaseCodec: me.c.ops.destroy(me.c) cdef code(me, text, int finishp): cdef void *p - cdef int len + cdef Py_ssize_t len cdef dstr d cdef int err if me.c is NULL: raise ValueError, 'Encoding finished' DCREATE(&d) try: - PyObject_AsReadBuffer(text, &p, &len) + PyObject_AsReadBuffer(text, &p, &len) code(me.c, p, len, &d) if finishp: code(me.c, NULL, 0, &d)