Python (flask/ marshmallow)ValueError: too many values to unpack (expected 2)

空扰寡人 提交于 2019-12-06 04:35:50

I recommend you check your dependency versions. Per the Marshmallow API reference, schema.load returns:

Changed in version 3.0.0b7: This method returns the deserialized data rather than a (data, errors) duple. A ValidationError is raised if invalid data are passed.

I suspect python is trying to unpack the dict (returned as a singular object) into two variables. The exception is raised because there is nothing to pack into the 'errors' variable. The below reproduces the error:

d = dict()
d['test'] = 10101
a, b = d
print("%s : %s" % (a, b))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!