import sys import urllib.request from pathlib import Path from urllib.error import HTTPError print(sys.version) url = 'https://pkgs.dev.azure.com/.../_packaging/.../maven/v1/customer.jar' username = 'artifacts' password = 'password' try: auth_handler = urllib.request.HTTPBasicAuthHandler() auth_handler.add_password(None, url, username, password) # proxy_support = urllib.request.ProxyHandler({"http" : "http://127.0.0.1:3128"}) opener = urllib.request.build_opener(auth_handler, urllib.request.HTTPSHandler(debuglevel=1)) urllib.request.install_opener(opener) urllib.request.urlopen(url) except (HTTPError, ValueError) as err: print(err)