codecs.IncrementalDecoder

class codecs.IncrementalDecoder(errors='strict') Constructor for an IncrementalDecoder instance. All incremental decoders must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry. The IncrementalDecoder may implement different error handling schemes by providing the errors keyword argument. See Error Handlers for possible values. The errors argument will be assigned to an attribute of the

codecs.ignore_errors()

codecs.ignore_errors(exception) Implements the 'ignore' error handling: malformed data is ignored and encoding or decoding is continued without further notice.

codecs.IncrementalDecoder.decode()

decode(object[, final]) Decodes object (taking the current state of the decoder into account) and returns the resulting decoded object. If this is the last call to decode() final must be true (the default is false). If final is true the decoder must decode the input completely and must flush all buffers. If this isn’t possible (e.g. because of incomplete byte sequences at the end of the input) it must initiate error handling just like in the stateless case (which might raise an exception).

codecs.getreader()

codecs.getreader(encoding) Look up the codec for the given encoding and return its StreamReader class or factory function. Raises a LookupError in case the encoding cannot be found.

codecs.getwriter()

codecs.getwriter(encoding) Look up the codec for the given encoding and return its StreamWriter class or factory function. Raises a LookupError in case the encoding cannot be found.

codecs.getdecoder()

codecs.getdecoder(encoding) Look up the codec for the given encoding and return its decoder function. Raises a LookupError in case the encoding cannot be found.

codecs.getincrementalencoder()

codecs.getincrementalencoder(encoding) Look up the codec for the given encoding and return its incremental encoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codec doesn’t support an incremental encoder.

codecs.getincrementaldecoder()

codecs.getincrementaldecoder(encoding) Look up the codec for the given encoding and return its incremental decoder class or factory function. Raises a LookupError in case the encoding cannot be found or the codec doesn’t support an incremental decoder.

codecs.getencoder()

codecs.getencoder(encoding) Look up the codec for the given encoding and return its encoder function. Raises a LookupError in case the encoding cannot be found.

codecs.EncodedFile()

codecs.EncodedFile(file, data_encoding, file_encoding=None, errors='strict') Return a StreamRecoder instance, a wrapped version of file which provides transparent transcoding. The original file is closed when the wrapped version is closed. Data written to the wrapped file is decoded according to the given data_encoding and then written to the original file as bytes using file_encoding. Bytes read from the original file are decoded according to file_encoding, and the result is encoded using d