python JIRA 与代理的连接

Kob*_*i K 6 python jira basic-authentication python-jira

我正在尝试使用代理通过 python-jira 连接:

server = {"server": "https://ip:port/jira",
          'proxies': {"http": "http://ip:port", "https": "http://ip:port"},
          'verify': False,
          'stream': True}

cls.jira_object = JIRA(options=server,
                       basic_auth=(user, password),
                       validate=True)
Run Code Online (Sandbox Code Playgroud)

回溯错误:

tests\jira_test\ticket_test.py:52: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
build\bdist.win-amd64\egg\jira\client.py:217: in __init__
    ???
build\bdist.win-amd64\egg\jira\client.py:1841: in session
    ???
build\bdist.win-amd64\egg\jira\utils.py:78: in json_loads
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

r = None, verb = '???', kwargs = {}, request = None, headers = None

>   ???
E   JIRAError: JiraError HTTP None
Run Code Online (Sandbox Code Playgroud)

知道如何允许 jira-python 连接代理吗?

aci*_*unk 5

您可以向 JIRA 的构造函数提供代理:

cls.jira_object = JIRA(options=server,
                       basic_auth=(user, password),
                       validate=True,
                       proxies={"http": "http://ip:port", "https": "http://ip:port"})
Run Code Online (Sandbox Code Playgroud)

请记住从您的选项字典中删除“代理”

有关构造函数的更多信息: https ://github.com/pycontribs/jira/blob/develop/jira/client.py