def _wrap_io_open(file, mode, encoding, errors):
    """Handles not passing ``encoding`` and ``errors`` in binary mode."""
    if "b" in mode:
        return open(file, mode)

    return open(file, mode, encoding=encoding, errors=errors)
Handles not passing ``encoding`` and ``errors`` in binary mode.
dynaconf/vendor/click/_compat.py