diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytearrayobject.c | 6 | ||||
-rw-r--r-- | Objects/stringobject.c | 4 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index fd201cafa7..5f575805d4 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -783,7 +783,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) if (PyBytes_Check(arg)) { PyObject *new, *encoded; if (encoding != NULL) { - encoded = PyCodec_Encode(arg, encoding, errors); + encoded = _PyCodec_EncodeText(arg, encoding, errors); if (encoded == NULL) return -1; assert(PyBytes_Check(encoded)); @@ -809,7 +809,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) "unicode argument without an encoding"); return -1; } - encoded = PyCodec_Encode(arg, encoding, errors); + encoded = _PyCodec_EncodeText(arg, encoding, errors); if (encoded == NULL) return -1; assert(PyBytes_Check(encoded)); @@ -2567,7 +2567,7 @@ bytearray_decode(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; #endif } - return PyCodec_Decode(self, encoding, errors); + return _PyCodec_DecodeText(self, encoding, errors); } PyDoc_STRVAR(alloc_doc, diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 46f46db0e0..c1e12a7aae 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -449,7 +449,7 @@ PyObject *PyString_AsDecodedObject(PyObject *str, } /* Decode via the codec registry */ - v = PyCodec_Decode(str, encoding, errors); + v = _PyCodec_DecodeText(str, encoding, errors); if (v == NULL) goto onError; @@ -529,7 +529,7 @@ PyObject *PyString_AsEncodedObject(PyObject *str, } /* Encode via the codec registry */ - v = PyCodec_Encode(str, encoding, errors); + v = _PyCodec_EncodeText(str, encoding, errors); if (v == NULL) goto onError; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 91e75244bf..08723ac9b8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1259,7 +1259,7 @@ PyObject *PyUnicode_Decode(const char *s, buffer = PyBuffer_FromMemory((void *)s, size); if (buffer == NULL) goto onError; - unicode = PyCodec_Decode(buffer, encoding, errors); + unicode = _PyCodec_DecodeText(buffer, encoding, errors); if (unicode == NULL) goto onError; if (!PyUnicode_Check(unicode)) { @@ -1292,7 +1292,7 @@ PyObject *PyUnicode_AsDecodedObject(PyObject *unicode, encoding = PyUnicode_GetDefaultEncoding(); /* Decode via the codec registry */ - v = PyCodec_Decode(unicode, encoding, errors); + v = _PyCodec_DecodeText(unicode, encoding, errors); if (v == NULL) goto onError; return v; @@ -1331,7 +1331,7 @@ PyObject *PyUnicode_AsEncodedObject(PyObject *unicode, encoding = PyUnicode_GetDefaultEncoding(); /* Encode via the codec registry */ - v = PyCodec_Encode(unicode, encoding, errors); + v = _PyCodec_EncodeText(unicode, encoding, errors); if (v == NULL) goto onError; return v; @@ -1369,7 +1369,7 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode, } /* Encode via the codec registry */ - v = PyCodec_Encode(unicode, encoding, errors); + v = _PyCodec_EncodeText(unicode, encoding, errors); if (v == NULL) goto onError; if (!PyString_Check(v)) { |