连接JIRA python的问题

时间:2017-07-14 14:05:18

标签: python jira

我在python中使用JIRA身份验证:

from jira.client import JIRA
option={'server':'https://jira.nutanix.com/','verify':False}
jira_obj=JIRA(options=options, basic_auth=(user, password))

代码不正确,我只想展示我调用JIRA API的方式。

我收到的错误是:

  

警告:root:执行GET https://jira.nutanix.com/rest/api/2/serverInfo [{u'标题':{'接受编码''接受编码'}时,EOF发生违反协议(_ssl.c:590)。 :' gzip,deflate','接受' / ',' User-Agent':& #39; python-requests / 2.10.0',' Connection':' keep-alive',u' X-Atlassian-Token':u' ; no-check',u' Cache-Control&#39 ;: u' no-cache',u' Content-Type&#39 ;: u' application / json&#39 ;},' params&#39 ;: None}]

     

警告:root:从GET https://jira.nutanix.com/rest/api/2/serverInfo获得可恢复的错误,将在10秒后重试[1/3]。错误:EOF违反协议(_ssl.c:590)   回溯(最近一次调用最后一次):

对此有何帮助?我在macOS 10.11上

完整追溯:

Traceback (most recent call last):
  File "/Users/syam.mohan/PycharmProjects/cluster_busy/gold_closer.py",   line 25, in <module>
  print connect_jira('syam.mohan','pwd',option)
  File "/Users/syam.mohan/PycharmProjects/cluster_busy/gold_closer.py",    line 12, in connect_jira
    jira = JIRA('https://jira.nutanix.com/',basic_auth=(user,    password))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/client.py", line 261, in __init__
si = self.server_info()
  File    "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/jira/client.py", line 1619, in server_info
    return self._get_json('serverInfo')
  File    "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-  packages/jira/client.py", line 2035, in _get_json
    r = self._session.get(url, params=params)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/resilientsession.py", line 130, in get
    return self.__verb('GET', url, **kwargs)
  File     "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-   packages/jira/resilientsession.py", line 116, in __verb
    if self.__recoverable(response_or_exception, url, verb.upper(),     retry_number):
  File  "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jira/resilientsession.py", line 88, in __recoverable
    time.sleep(delay)

一个KeyboardInterrupt

1 个答案:

答案 0 :(得分:2)

请尝试

sudo apt-get install libffi-dev
sudo pip install -U requests[security]

来源:Python Requests requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol