• Home
  • Raw
  • Download

Lines Matching full:encoding

6 "open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n"
24 "In text mode, if encoding is not specified the encoding used is platform\n"
25 "dependent: locale.getencoding() is called to get the current locale encoding.\n"
26 "(For reading and writing raw bytes use binary mode and leave encoding\n"
52 "platform-dependent encoding or using the specified encoding if given.\n"
69 "encoding is the name of the encoding used to decode or encode the\n"
70 "file. This should only be used in text mode. The default encoding is\n"
71 "platform dependent, but any encoding supported by Python can be\n"
74 "errors is an optional string that specifies how encoding errors are to\n"
76 "\'strict\' to raise a ValueError exception if there is an encoding error\n"
78 "errors. (Note that ignoring encoding errors can lead to data loss.)\n"
80 "for a list of the permitted encoding error strings.\n"
129 int buffering, const char *encoding, const char *errors,
136 …static const char * const _keywords[] = {"file", "mode", "buffering", "encoding", "errors", "newli… in _io_open()
143 const char *encoding = NULL; in _io_open() local
186 encoding = NULL; in _io_open()
190 encoding = PyUnicode_AsUTF8AndSize(args[3], &encoding_length); in _io_open()
191 if (encoding == NULL) { in _io_open()
194 if (strlen(encoding) != (size_t)encoding_length) { in _io_open()
200 _PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]); in _io_open()
264 …return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, op… in _io_open()
271 "text_encoding($module, encoding, stacklevel=2, /)\n"
274 "A helper function to choose the text encoding.\n"
276 "When encoding is not None, this function returns it.\n"
277 "Otherwise, this function returns the default text encoding\n"
280 "This function emits an EncodingWarning if encoding is None and\n"
283 "This can be used in APIs with an encoding=None parameter.\n"
284 "However, please consider using encoding=\"utf-8\" for new APIs.");
290 _io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel);
296 PyObject *encoding; in _io_text_encoding() local
302 encoding = args[0]; in _io_text_encoding()
311 return_value = _io_text_encoding_impl(module, encoding, stacklevel); in _io_text_encoding()