前言:
还是tornado迁移python3版本项目,图片验证码使用内存保存时候验证码出不来,报了TypeError: string argument expected, got 'bytes';
具体报错如下:
[E 191102 15:11:44 web:1788] Uncaught exception GET /api/piccode?pre=&cur=88508b02-5c21-4ff4-a7eb-dcf01ceb35bf (::1)
HTTPServerRequest(protocol='http', host='localhost:8090', method='GET', uri='/api/piccode?pre=&cur=88508b02-5c21-4ff4-a7eb-dcf01ceb35bf', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/dongchao/.virtualenvs/py_django/lib/python3.7/site-packages/PIL/ImageFile.py", line 498, in _save
fh = fp.fileno()
io.UnsupportedOperation: fileno
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dongchao/.virtualenv