gpt4 book ai didi

python-requests - wrap_socket() 得到一个意外的关键字参数 '_context' 和 deserialize(error)

转载 作者:行者123 更新时间:2023-12-02 04:23:19 25 4
gpt4 key购买 nike

我尝试使用请求来获取文件的 url。它在本地运行良好,但不适用于 nameko。

我尝试了 3 个 python3.7 的库。但都有同样的错误。
导入 urllib.request,urllib3,requests

它在本地运行良好,如下所示:

import requests
url = "https://www.python.org/static/img/python-logo.png"
r = requests.get(url)
print(r.content)

但它不能与 nameko 一起使用:

import requests
from nameko.web.handlers import http

@http("POST", "/import")
def testurl(self,request):
url = "https://www.python.org/static/img/python-logo.png"
r = requests.get(url)
print(r.content)

Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/nameko/rpc.py", line 373, in __call__
return reply.result()
File "/usr/local/lib/python3.7/site-packages/nameko/rpc.py", line 331, in result
raise deserialize(error)
nameko.exceptions.RemoteError: Exception Error on testurl: Cause : wrap_socket() got an unexpected keyword argument '_context'

最佳答案

这是一个 eventlet 错误。如果可能,您需要降级到 Python 3.6。

https://github.com/eventlet/eventlet/issues/526

Nameko 有一个关于这个问题的 PR,在上述问题被修复之前处于暂停状态。

https://github.com/nameko/nameko/pull/644

关于python-requests - wrap_socket() 得到一个意外的关键字参数 '_context' 和 deserialize(error),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57712218/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com