Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled AttributeError when passing an integer into a delimited list field #149

Closed
psconnect-dev opened this issue Jan 30, 2017 · 0 comments

Comments

@psconnect-dev
Copy link

commented Jan 30, 2017

Using use_args from webargs.flaskparser, there is an unhandled AttributeError when passing an integer into a delimited list field.

An example usage is:
@use_args("a": fields.DelimitedList(fields.Str())})

With data:
{"a": 1}

Please find below the stack trace:

Traceback (most recent call last):
File "...\webargs\core.py", line 435, in wrapper
force_all=force_all)
File "...\webargs\core.py", line 357, in parse
result = self.load(parsed, schema)
File "...\webargs\core.py", line 293, in load
return schema.load(data)
File "...\marshmallow\schema.py", line 568, in load
result, errors = self._do_load(data, many, partial=partial, postprocess=True)
File "...\marshmallow\schema.py", line 648, in _do_load
index_errors=self.opts.index_errors,
File "...\marshalling.py", line 295, in deserialize
index=(index if index_errors else None)
File "...\marshmallow\marshalling.py", line 68, in call_and_store
value = getter_func(data)
File "...\marshmallow\marshalling.py", line 288, in
data
File "...\marshmallow\fields.py", line 265, in deserialize
output = self._deserialize(value, attr, data)
File "...\webargs\fields.py", line 69, in _deserialize
else value.split(self.delimiter)
AttributeError: 'int' object has no attribute 'split'

Version 1.5.2 of webargs and 2.12.2 of marshmallow.

@sloria sloria closed this in 48b0dce Feb 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.