Lines Matching defs:encoding

46 "Another IOBase subclass, TextIOBase, deals with the encoding and decoding\n"
75 encoding: str(accept={str, NoneType}) = None
95 In text mode, if encoding is not specified the encoding used is platform
96 dependent: locale.getencoding() is called to get the current locale encoding.
97 (For reading and writing raw bytes use binary mode and leave encoding
123 platform-dependent encoding or using the specified encoding if given.
140 encoding is the name of the encoding used to decode or encode the
141 file. This should only be used in text mode. The default encoding is
142 platform dependent, but any encoding supported by Python can be
145 errors is an optional string that specifies how encoding errors are to
147 'strict' to raise a ValueError exception if there is an encoding error
149 errors. (Note that ignoring encoding errors can lead to data loss.)
151 for a list of the permitted encoding error strings.
198 int buffering, const char *encoding, const char *errors,
292 if (binary && encoding != NULL) {
294 "binary mode doesn't take an encoding argument");
326 encoding = "utf-8";
426 encoding, errors, newline,
455 encoding: object
459 A helper function to choose the text encoding.
461 When encoding is not None, this function returns it.
462 Otherwise, this function returns the default text encoding
465 This function emits an EncodingWarning if encoding is None and
468 This can be used in APIs with an encoding=None parameter.
469 However, please consider using encoding="utf-8" for new APIs.
473 _io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel)
476 if (encoding == NULL || encoding == Py_None) {
480 "'encoding' argument not specified", stacklevel)) {
487 encoding = &_Py_STR(utf_8);
490 encoding = &_Py_ID(locale);
493 Py_INCREF(encoding);
494 return encoding;