我尝试使用此代码设置 url c.setopt(pycurl.URL, link)
,但出现以下异常
File "/home/sultan/Repository/Django/monitor/app/thread/utils.py", line 164, in perform
self.proxy_request.setopt(pycurl.URL, u'%s' % unicode(link))
TypeError: invalid arguments to setopt
我的代码有什么问题?
苏丹
最佳答案
问题是它接受字符串,而不是 unicode 对象。删除 u 和 unicode()。
关于Python:PyCurl 设置 URL 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6495077/