|
发表于 2017-8-31 17:37:20
|
显示全部楼层
本帖最后由 hotsnow 于 2017-8-31 17:49 编辑
开通SSL的时候脚本报错,是啥原因?
- Traceback (most recent call last):
- File "./cloudflare-partner-cli.py", line 352, in <module>
- getattr(cf, act)(arg)
- File "./cloudflare-partner-cli.py", line 195, in ssl_verfication
- r = self._userapi("/zones?name=%s&match=all" % arg['zone'])
- File "./cloudflare-partner-cli.py", line 163, in _userapi
- r = opener.open(req).read()
- File "/usr/lib/python3.5/urllib/request.py", line 466, in open
- response = self._open(req, data)
- File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
- '_open', req)
- File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
- result = func(*args)
- File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open
- context=self._context, check_hostname=self._check_hostname)
- File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
- h.request(req.get_method(), req.selector, req.data, headers)
- File "/usr/lib/python3.5/http/client.py", line 1107, in request
- self._send_request(method, url, body, headers)
- File "/usr/lib/python3.5/http/client.py", line 1147, in _send_request
- self.putheader(hdr, value)
- File "/usr/lib/python3.5/http/client.py", line 1083, in putheader
- if _is_illegal_header_value(values[i]):
- TypeError: expected string or bytes-like object
复制代码
继续尝试,则报下列错误
- Traceback (most recent call last):
- File "./cloudflare-partner-cli.py", line 352, in <module>
- getattr(cf, act)(arg)
- File "./cloudflare-partner-cli.py", line 195, in ssl_verfication
- r = self._userapi("/zones?name=%s&match=all" % arg['zone'])
- File "./cloudflare-partner-cli.py", line 163, in _userapi
- r = opener.open(req).read()
- File "/usr/lib/python3.5/urllib/request.py", line 472, in open
- response = meth(req, response)
- File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
- 'http', request, response, code, msg, hdrs)
- File "/usr/lib/python3.5/urllib/request.py", line 510, in error
- return self._call_chain(*args)
- File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
- result = func(*args)
- File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
- raise HTTPError(req.full_url, code, msg, hdrs, fp)
- urllib.error.HTTPError: HTTP Error 400: Bad Request
复制代码 |
|