def append_lines(file, lines, encoding=None, errors=None):
    """Append the lines to a file.

    :param file: path to file or file descriptor
    :type file: :term:`path-like object` or int
    :param list(str) lines: list of strings w/o newline
    :param str encoding: name of the encoding
    :param str errors: error handler
    :return: number of characters written
    :rtype: int
    :raises OSError: on I/O failure

    .. versionchanged:: 0.6.0
       Add parameter ``errors``
    """
    with open(file, 'a', encoding=encoding, errors=errors) as fh:
        cnt = fh.write('\n'.join(lines))
        cnt += fh.write('\n')
        return cnt
