Lines Matching defs:text

29     "Base class for text I/O.\n"
96 "Encoding of the text stream.\n"
661 Please also note that text to be written is first encoded before being
667 PyObject *decoded_chars; /* buffer for text returned from decoder */
697 ascii_encode(textio *self, PyObject *text)
699 return _PyUnicode_AsASCIIString(text, PyUnicode_AsUTF8(self->errors));
703 utf16be_encode(textio *self, PyObject *text)
705 return _PyUnicode_EncodeUTF16(text,
710 utf16le_encode(textio *self, PyObject *text)
712 return _PyUnicode_EncodeUTF16(text,
717 utf16_encode(textio *self, PyObject *text)
722 return utf16be_encode(self, text);
724 return utf16le_encode(self, text);
727 return _PyUnicode_EncodeUTF16(text,
732 utf32be_encode(textio *self, PyObject *text)
734 return _PyUnicode_EncodeUTF32(text,
739 utf32le_encode(textio *self, PyObject *text)
741 return _PyUnicode_EncodeUTF32(text,
746 utf32_encode(textio *self, PyObject *text)
751 return utf32be_encode(self, text);
753 return utf32le_encode(self, text);
756 return _PyUnicode_EncodeUTF32(text,
761 utf8_encode(textio *self, PyObject *text)
763 return _PyUnicode_AsUTF8String(text, PyUnicode_AsUTF8(self->errors));
767 latin1_encode(textio *self, PyObject *text)
769 return _PyUnicode_AsLatin1String(text, PyUnicode_AsUTF8(self->errors));
772 // Return true when encoding can be skipped when text is ascii.
1150 /* Check we have been asked for a real text encoding */
1313 Reconfigure the text stream with new parameters.
1578 text: unicode
1583 _io_TextIOWrapper_write_impl(textio *self, PyObject *text)
1592 if (PyUnicode_READY(text) == -1)
1601 Py_INCREF(text);
1603 textlen = PyUnicode_GET_LENGTH(text);
1606 if (PyUnicode_FindChar(text, '\n', 0, PyUnicode_GET_LENGTH(text), 1) != -1)
1610 PyObject *newtext = _PyObject_CallMethod(text, &_Py_ID(replace),
1612 Py_DECREF(text);
1615 text = newtext;
1622 PyUnicode_FindChar(text, '\r', 0, PyUnicode_GET_LENGTH(text), 1) != -1))
1627 if (PyUnicode_IS_ASCII(text) &&
1629 PyUnicode_GET_LENGTH(text) <= self->chunk_size &&
1631 b = text;
1635 b = (*self->encodefunc)((PyObject *) self, text);
1640 b = PyObject_CallMethodOneArg(self->encoder, &_Py_ID(encode), text);
1643 Py_DECREF(text);
1646 if (b != text && !PyBytes_Check(b)) {
1655 if (b == text) {