in src/buildstream_plugins/sources/_utils.py [0:0]
def get_url_opener(self, bearer_auth):
if self.netrc_config and not bearer_auth:
netrc_pw_mgr = _NetrcPasswordManager(self.netrc_config)
http_auth = urllib.request.HTTPBasicAuthHandler(netrc_pw_mgr)
return urllib.request.build_opener(http_auth)
return urllib.request.build_opener()