使用Daphne服务器上传文件后出现问题。
在Windows(安装了相同的软件包)下工作正常。
例外:
asyncio ERROR Exception in callback AsyncioSelectorReactor.callLater.<locals>.run() at /home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py:287
handle: <TimerHandle when=3546.996700387 AsyncioSelectorReactor.callLater.<locals>.run() at /home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py:287>
Traceback (most recent call last):
File "/home/Python-3.7.6/Lib/asyncio/events.py",line 88,in _run
self._context.run(self._callback,*self._args)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py",line 290,in run
f(*args,**kwargs)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/internet/tcp.py",line 327,in connectionLost
protocol.connectionLost(reason)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/protocols/tls.py",line 403,in connectionLost
ProtocolWrapper.connectionLost(self,reason)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/protocols/policies.py",line 125,in connectionLost
self.wrappedProtocol.connectionLost(reason)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/twisted/web/http.py",line 2394,in connectionLost
request.connectionLost(reason)
File "/home/venvs/Python-3.7.6/lib/python3.7/site-packages/daphne/http_protocol.py",line 203,in connectionLost
logger.debug("HTTP disconnect for %s",self.client_addr)
AttributeError: 'WebRequest' object has no attribute 'client_addr'
命令:
daphne project.asgi:application -b 0.0.0.0 -p 80 -e ssl:443:privateKey=privkey.pem:certKey=fullchain.pem
Linux版本:
Distributor ID: Debian
Description: Debian GNU/Linux 9.11 (stretch)
Release: 9.11
Codename: stretch
Python版本:
Python 3.7.6 (default,Jan 15 2020,14:11:01)
[GCC 6.3.0 20170516] on linux
虚拟环境软件包:
daphne==2.4.1
Django==2.2.6
Twisted==19.10.0