def csv_io_kwargs(mode):
    # type: (str) -> Dict[str, Any]
    """Return keyword arguments to properly open a CSV file
    in the given mode.
    """
    if sys.version_info.major < 3:
        return {'mode': '{}b'.format(mode)}
    else:
        return {'mode': mode, 'newline': ''}
Return keyword arguments to properly open a CSV file
    in the given mode.
    
product/gradle-plugin/src/main/python/pip/_internal/operations/install/wheel.py