def _load_file(parser, filename):
    if not os.path.exists(filename):
        logger.debug(
            'Loading config from %s failed; it does not exist', filename)
        return
    if not os.access(filename, os.R_OK):
        logger.warning(
            'Loading config from %s failed; read permission missing',
            filename)
        return

    try:
        logger.info('Loading config from %s', filename)
        with io.open(filename, 'rb') as filehandle:
            parser.readfp(filehandle)
    except configparser.MissingSectionHeaderError as e:
        logger.warning('%s does not have a config section, not loaded.',
                       filename)
    except configparser.ParsingError as e:
        linenos = ', '.join(str(lineno) for lineno, line in e.errors)
        logger.warning(
            '%s has errors, line %s has been ignored.', filename, linenos)
    except __HOLE__:
        # TODO: if this is the initial load of logging config we might not
        # have a logger at this point, we might want to handle this better.
        logger.debug('Config file %s not found; skipping', filename)
dataset/ETHPy150Open mopidy/mopidy/mopidy/config/__init__.py/_load_file