> On Feb 21, 2017, at 10:16 AM, Chuck Short <email address hidden> wrote:
>
> Which version is this with?
>
> ** Changed in: voluptuous (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1665709
>
> Title:
> humanize_error function has type error
>
> Status in voluptuous package in Ubuntu:
> Incomplete
>
> Bug description:
> The following code will trigger a type error
>
> ######################################################
> import voluptuous
> import voluptuous.humanize
> import voluptuous.error
>
> allowed_value = [1, 2, 3]
>
> base = voluptuous.Schema({
> voluptuous.Required('age'): int,
> voluptuous.Required('children'): voluptuous.All(voluptuous.ExactSequence([
> {voluptuous.Required('first'): [voluptuous.Any(*allowed_value)]},
> {voluptuous.Required('second'): [voluptuous.Any(*allowed_value)]},
> ]),
> voluptuous.Length(min = 2, max=2))
> })
>
>
> test = {'age': 40, 'children': [{'first': 12, 'second': 8}]}
>
> def main():
> try:
> base(test)
> except voluptuous.error.Error as e:
> return voluptuous.humanize.humanize_error(test, e)
>
> main()
>
>
> Traceback (most recent call last):
> File "voluptuous_test.py", line 31, in <module>
> main()
> File "voluptuous_test.py", line 29, in main
> return voluptuous.humanize.humanize_error(test, e)
> File "/usr/local/lib/python2.7/site-packages/voluptuous/humanize.py", line 26, in humanize_error
> for sub_error in validation_error.errors
> File "/usr/local/lib/python2.7/site-packages/voluptuous/humanize.py", line 26, in <genexpr>
> for sub_error in validation_error.errors
> File "/usr/local/lib/python2.7/site-packages/voluptuous/humanize.py", line 29, in humanize_error
> offending_item_summary = repr(_nested_getitem(data, validation_error.path))
> File "/usr/local/lib/python2.7/site-packages/voluptuous/humanize.py", line 11, in _nested_getitem
> data = data[item_index]
> TypeError: list indices must be integers, not str
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/voluptuous/+bug/1665709/+subscriptions
0.9.3
Sent from my iPhone
> On Feb 21, 2017, at 10:16 AM, Chuck Short <email address hidden> wrote: /bugs.launchpad .net/bugs/ 1665709 ####### ####### ####### ####### ####### ####### ##### Required( 'age'): int, Required( 'children' ): voluptuous. All(voluptuous. ExactSequence( [ Required( 'first' ): [voluptuous. Any(*allowed_ value)] }, Required( 'second' ): [voluptuous. Any(*allowed_ value)] }, Length( min = 2, max=2)) error.Error as e: humanize. humanize_ error(test, e) test.py" , line 31, in <module> test.py" , line 29, in main humanize. humanize_ error(test, e) lib/python2. 7/site- packages/ voluptuous/ humanize. py", line 26, in humanize_error error.errors lib/python2. 7/site- packages/ voluptuous/ humanize. py", line 26, in <genexpr> error.errors lib/python2. 7/site- packages/ voluptuous/ humanize. py", line 29, in humanize_error item_summary = repr(_nested_ getitem( data, validation_ error.path) ) lib/python2. 7/site- packages/ voluptuous/ humanize. py", line 11, in _nested_getitem /bugs.launchpad .net/ubuntu/ +source/ voluptuous/ +bug/1665709/ +subscriptions
>
> Which version is this with?
>
> ** Changed in: voluptuous (Ubuntu)
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> humanize_error function has type error
>
> Status in voluptuous package in Ubuntu:
> Incomplete
>
> Bug description:
> The following code will trigger a type error
>
> #######
> import voluptuous
> import voluptuous.humanize
> import voluptuous.error
>
> allowed_value = [1, 2, 3]
>
> base = voluptuous.Schema({
> voluptuous.
> voluptuous.
> {voluptuous.
> {voluptuous.
> ]),
> voluptuous.
> })
>
>
> test = {'age': 40, 'children': [{'first': 12, 'second': 8}]}
>
> def main():
> try:
> base(test)
> except voluptuous.
> return voluptuous.
>
> main()
>
>
> Traceback (most recent call last):
> File "voluptuous_
> main()
> File "voluptuous_
> return voluptuous.
> File "/usr/local/
> for sub_error in validation_
> File "/usr/local/
> for sub_error in validation_
> File "/usr/local/
> offending_
> File "/usr/local/
> data = data[item_index]
> TypeError: list indices must be integers, not str
>
> To manage notifications about this bug go to:
> https:/