【问题标题】:OSError: [Errno 0] Error in httplib2 requestOSError: [Errno 0] httplib2 请求中的错误
【发布时间】:2018-12-07 20:29:19
【问题描述】:

我的本​​地 python 应用程序使用 httplib2 调用 REST api。一年多来一直运行良好。今天早上我开始收到以下错误:

2018-06-28 12:43:07.001 Python[1722:25727] IMKInputSession [0x7f99e21ac2f0 presentFunctionRowItemTextInputViewWithEndpoint:completionHandler:] : [self textInputContext]=0x7f99dfd48440 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 0" UserInfo={NSDebugDescription=connection from pid 0}, com.apple.inputmethod.EmojiFunctionRowItem

最初,我认为这是由于我的 openSSL 证书过期造成的。我已经更新到 openSSL 1.1。我也从 python 3.6 更新到 3.7。我仍然遇到同样的错误。

调用的代码如下。

    connection = httplib2.HTTPSConnectionWithTimeout(URL, 443, timeout = 300)
    print('Connection made')
    self.headers = {"Accept":"application/json", "Authorization":Token}
    print(connection)
    connection.request('GET', request_command, body=None 
    headers=self.headers)
    print('request made')

错误是由connection.request()引起的。

【问题讨论】:

    标签: python python-3.x rest https httplib2


    【解决方案1】:

    好的,找到错误了。我使用的是 httplib2 0.9 版。我通过以下方式升级:

    pip3 install httplib2==0.11.3
    

    升级后问题解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 2018-04-27
      • 2015-02-20
      • 2016-12-14
      • 2021-04-02
      • 2021-05-26
      相关资源
      最近更新 更多