scylla
scylla copied to clipboard
NameError: name 'CIMultiDict' is not defined
Describe the bug
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 985, in handle_request
request, response
File "/usr/local/lib64/python3.6/site-packages/spf/framework.py", line 653, in _run_response_middleware_18_12
_response = await _response
File "/usr/local/lib64/python3.6/site-packages/sanic_cors/extension.py", line 267, in unapplied_cors_response_middleware
set_cors_headers(req, resp, context, res_options)
File "/usr/local/lib64/python3.6/site-packages/sanic_cors/core.py", line 254, in set_cors_headers
headers_to_set = get_cors_headers(options, req.headers, req.method)
File "/usr/local/lib64/python3.6/site-packages/sanic_cors/core.py", line 175, in get_cors_headers
headers = CIMultiDict()
NameError: name 'CIMultiDict' is not defined
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
see https://github.com/ashleysommer/sanic-cors/issues/34
- scylla/requirements.txt
sanic==19.6.3
sanic-cors==0.9.9
- https://github.com/ashleysommer/sanic-cors/blob/0.9.9/sanic_cors/core.py
try:
from sanic.compat import Header
except ImportError:
try:
from sanic.server import CIMultiDict
except ImportError:
from sanic.server import CIDict as CIMultiDict
- https://github.com/huge-success/sanic/blob/v19.6.3/sanic/compat.py
class Header(CIMultiDict):
所以就是from sanic.compat import Header
不会ImportError,然后就是NameError: name 'CIMultiDict' is not defined
了。
这 code review 有木有问题?
docker 启动也有这个错误 NameError: name 'CIMultiDict' is not defined