You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a result, if there are at least 2 arguments passed, args is something like 'world', 2 and is evaluated to tuple: ('world', 2). Then later zip properly joins sequence of names with sequence of values.
But if there is only one argument, then eval returns this argument. As a result, string is interpreted as a sequence of characters. And if it is not a string but something more complex (like WTForms field) then we get error.
How can this be fixed:
I think that before passing args to _do_eval we should just wrap them with []:
arg_values = self._do_eval('[%s]' % (args or ''))
This will properly work even when no arguments was passed.
The text was updated successfully, but these errors were encountered:
Here is a minimal example:
Expected result:
Actual result:
While does it happen: in
ext.html.Compiler._make_mixin._mixin
, arguments are parsed like this:As a result, if there are at least 2 arguments passed,
args
is something like'world', 2
and is evaluated totuple
:('world', 2)
. Then laterzip
properly joins sequence of names with sequence of values.But if there is only one argument, then
eval
returns this argument. As a result, string is interpreted as a sequence of characters. And if it is not a string but something more complex (likeWTForms
field) then we get error.How can this be fixed:
I think that before passing
args
to_do_eval
we should just wrap them with[]
:This will properly work even when no arguments was passed.
The text was updated successfully, but these errors were encountered: