Lines Matching defs:errors
39 # Does open() check its 'errors' argument?
77 def open(file, mode="r", buffering=-1, encoding=None, errors=None,
143 errors is an optional string that specifies how encoding errors are to
147 errors. (Note that ignoring encoding errors can lead to data loss.)
205 if errors is not None and not isinstance(errors, str):
206 raise TypeError("invalid errors: %r" % errors)
225 if binary and errors is not None:
226 raise ValueError("binary mode doesn't take an errors argument")
274 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering)
1892 def errors(self):
1908 def __init__(self, decoder, translate, errors='strict'):
1909 codecs.IncrementalDecoder.__init__(self, errors=errors)
1993 errors determines the strictness of encoding and decoding (see the
2019 def __init__(self, buffer, encoding=None, errors=None, newline=None,
2035 if errors is None:
2036 errors = "strict"
2038 if not isinstance(errors, str):
2039 raise ValueError("invalid errors: %r" % errors)
2041 codecs.lookup_error(errors)
2049 self._configure(encoding, errors, newline,
2058 def _configure(self, encoding=None, errors=None, newline=None,
2061 self._errors = errors
2116 def errors(self):
2132 encoding=None, errors=None, newline=Ellipsis,
2139 and (encoding is not None or errors is not None
2145 if errors is None:
2147 errors = self._errors
2149 errors = 'strict'
2150 elif not isinstance(errors, str):
2151 raise TypeError("invalid errors: %r" % errors)
2171 self._configure(encoding, errors, newline,
2671 errors="surrogatepass",
2700 def errors(self):