TaleLin / lin-cms-flask

🎀A simple and practical CMS implememted by Flask
http://doc.cms.talelin.com/
Other
832 stars 216 forks source link

0.2.x版本的使用jsonify方法之后报错 #139

Closed hezygo closed 3 years ago

hezygo commented 3 years ago
2021-01-22 16:26:54,871 ERROR 5672   ---  [Thread-172] - Traceback (most recent call last):
  File "C:\Python\Python37\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Python\Python37\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Python\Python37\lib\site-packages\lin\jwt.py", line 65, in wrapper
    return fn(*args, **kwargs)
  File "D:\LinCMS\app\api\v1\PatientRecommendation.py", line 182, in get_advices
    return jsonify(list1)
  File "C:\Python\Python37\lib\site-packages\flask\json\__init__.py", line 321, in jsonify
    dumps(data, indent=indent, separators=separators) + '\n',
  File "C:\Python\Python37\lib\site-packages\flask\json\__init__.py", line 179, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "C:\Python\Python37\lib\json\__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "C:\Python\Python37\lib\json\encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python\Python37\lib\json\encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "C:\Python\Python37\lib\site-packages\lin\core.py", line 369, in default
    return JSONEncoder.default(self, o)
  File "C:\Python\Python37\lib\site-packages\lin\core.py", line 369, in default
    return JSONEncoder.default(self, o)
  File "C:\Python\Python37\lib\site-packages\lin\core.py", line 369, in default
    return JSONEncoder.default(self, o)
  [Previous line repeated 966 more times]
  File "C:\Python\Python37\lib\site-packages\lin\core.py", line 363, in default
    if hasattr(o, 'keys') and hasattr(o, '__getitem__'):
RecursionError: maximum recursion depth exceeded while calling a Python object

[Previous line repeated 966 more times] File "C:\Python\Python37\lib\site-packages\lin\core.py", line 363, in default if hasattr(o, 'keys') and hasattr(o, 'getitem'): RecursionError: maximum recursion depth exceeded while calling a Python object

某个的循环点这里图片结束之后执行jsonify方法后报错

sunlin92 commented 3 years ago

each对象中可能存在无法被序列化的对象,可以先将它转成字典+基本数据类型的结构

hezygo commented 3 years ago

了解!非常感谢。

------------------ 原始邮件 ------------------ 发件人: "水月"<notifications@github.com>; 发送时间: 2021年1月23日(星期六) 下午3:10 收件人: "TaleLin/lin-cms-flask"<lin-cms-flask@noreply.github.com>; 抄送: "MinGW"<1573249948@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [TaleLin/lin-cms-flask] 0.2.x版本的使用jsonify方法之后报错 (#139)

each对象中可能存在无法被序列化的对象,可以先将它转成字典+基本数据类型的结构

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.