def read_htpasswd(path):
    f = codecs.open(path, 'r', 'utf-8')
    try:
        users = {}
        for line in f.readlines():
            line = line.strip()
            if not line or line.startswith('#'):
                continue

            try:
                username, password = line.split(':', 1)
            except __HOLE__:
                continue

            users[username] = password

        return users
    finally:
        f.close()
dataset/ETHPy150Open tomekwojcik/flask-htauth/flask_htauth/htpasswd.py/read_htpasswd