正常访问出错, Object of type 'bytes' is not JSON serializable

表单

#1

前两天还可以正常访问, 现在访问就会报错,期间没有修改代码
文本对照源码都一样, 这是哪里出错了呢

return self.wsgi_app(environ, start_response)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/lili574/L-flask/goon/goon/blueprints/auth.py", line 21, in register
form = RegisterForm()
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/wtforms/form.py", line 212, in __call__
return type.__call__(cls, *args, **kwargs)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask_wtf/form.py", line 88, in __init__
super(FlaskForm, self).__init__(formdata=formdata, **kwargs)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/wtforms/form.py", line 278, in __init__
self.process(formdata, obj, data=data, **kwargs)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/wtforms/form.py", line 132, in process
field.process(formdata)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/wtforms/csrf/core.py", line 43, in process
self.current_token = self.csrf_impl.generate_csrf_token(self)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask_wtf/csrf.py", line 134, in generate_csrf_token
token_key=self.meta.csrf_field_name
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/flask_wtf/csrf.py", line 47, in generate_csrf
setattr(g, field_name, s.dumps(session[field_name]))
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/itsdangerous.py", line 565, in dumps
payload = want_bytes(self.dump_payload(obj))
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/itsdangerous.py", line 847, in dump_payload
json = super(URLSafeSerializerMixin, self).dump_payload(obj)
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/itsdangerous.py", line 550, in dump_payload
return want_bytes(self.serializer.dumps(obj))
File "/home/lili574/.local/share/virtualenvs/goon-P0W9XWTq/lib/python3.6/site-packages/itsdangerous.py", line 51, in dumps
return json.dumps(obj, separators=(',', ':'))
File "/usr/lib/python3.6/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.6/json/encoder.py", line 180, in default
o.__class__.__name__) ```

#2

使用谷歌浏览器,可以在隐身模式下访问