0
>>> # Get all projects viewable by anonymous users.

... projects = jira.projects()

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "C:\Python27\lib\site-packages\jira_python-0.16-py2.7.egg\jira\client.py", line 941, in projects
    r_json = self._get_json('project')
  File "C:\Python27\lib\site-packages\jira_python-0.16-py2.7.egg\jira\client.py", line 1526, in _get_json
    r = self._session.get(url, params=params, headers=self._options['headers'])
  File "C:\Python27\lib\site-packages\requests-2.2.1-py2.7.egg\requests\sessions.py", line 395, in get
    return self.request('GET', url, **kwargs)
  File "C:\Python27\lib\site-packages\requests-2.2.1-py2.7.egg\requests\sessions.py", line 383, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Python27\lib\site-packages\requests-2.2.1-py2.7.egg\requests\sessions.py", line 486, in send
    r = adapter.send(request, **kwargs)
  File "C:\Python27\lib\site-packages\requests-2.2.1-py2.7.egg\requests\adapters.py", line 381, in send
    raise ProxyError(e)
**requests.exceptions.ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 407 authenticationrequired.**

你能请任何人帮助我如何解决这个问题。

4

1 回答 1

1

尝试这个:

basic_auth = ('username', 'password')
options = {
    'server': <server url>,
    'proxies' : <proxy>,
    'verify' : False,
} 
jira = JIRA(options,basic_auth=basic_auth,validate=True)

应该管用。
我试过了,它对我有用。
确保您有权访问项目以解决问题。

于 2014-09-25T13:55:27.460 回答