codecs.StreamReader.read()

read([size[, chars[, firstline]]]) Decodes data from the stream and returns the resulting object. The chars argument indicates the number of decoded code points or bytes to return. The read() method will never return more data than requested, but it might return less, if there is not enough available. The size argument indicates the approximate maximum number of encoded bytes or code points to read for decoding. The decoder can modify this setting as appropriate. The default value -1 indicat

codecs.StreamReader.readline()

readline([size[, keepends]]) Read one line from the input stream and return the decoded data. size, if given, is passed as size argument to the stream’s read() method. If keepends is false line-endings will be stripped from the lines returned.

codecs.StreamReader.readlines()

readlines([sizehint[, keepends]]) Read all lines available on the input stream and return them as a list of lines. Line-endings are implemented using the codec’s decoder method and are included in the list entries if keepends is true. sizehint, if given, is passed as the size argument to the stream’s read() method.

codecs.register()

codecs.register(search_function) Register a codec search function. Search functions are expected to take one argument, being the encoding name in all lower case letters, and return a CodecInfo object. In case a search function cannot find a given encoding, it should return None. Note Search function registration is not currently reversible, which may cause problems in some cases, such as unit testing or module reloading.

codecs.register_error()

codecs.register_error(name, error_handler) Register the error handling function error_handler under the name name. The error_handler argument will be called during encoding and decoding in case of an error, when name is specified as the errors parameter. For encoding, error_handler will be called with a UnicodeEncodeError instance, which contains information about the location of the error. The error handler must either raise this or a different exception, or return a tuple with a replacemen

codecs.replace_errors()

codecs.replace_errors(exception) Implements the 'replace' error handling (for text encodings only): substitutes '?' for encoding errors (to be encoded by the codec), and '\ufffd' (the Unicode replacement character) for decoding errors.

codecs.open()

codecs.open(filename, mode='r', encoding=None, errors='strict', buffering=1) Open an encoded file using the given mode and return an instance of StreamReaderWriter, providing transparent encoding/decoding. The default file mode is 'r', meaning to open the file in read mode. Note Underlying encoded files are always opened in binary mode. No automatic conversion of '\n' is done on reading and writing. The mode argument may be any binary mode acceptable to the built-in open() function; the 'b'

codecs.lookup_error()

codecs.lookup_error(name) Return the error handler previously registered under the name name. Raises a LookupError in case the handler cannot be found.

codecs.namereplace_errors()

codecs.namereplace_errors(exception) Implements the 'namereplace' error handling (for encoding with text encodings only): the unencodable character is replaced by a \N{...} escape sequence. New in version 3.5.

codecs.iterencode()

codecs.iterencode(iterator, encoding, errors='strict', **kwargs) Uses an incremental encoder to iteratively encode the input provided by iterator. This function is a generator. The errors argument (as well as any other keyword argument) is passed through to the incremental encoder.