auth_handler.add_password(realm='PDQ Application', uri=
    'https://mahler:8092/site-updates.py', user='klem', passwd='kadidd!ehopper'
    )
opener = urllib.request.build_opener(auth_handler)
urllib.request.install_opener(opener)
How to download a file over http with authorization in python 3.0, working around bugs?