Hi,
I have an appilcation that has been running for a while, and suddenly today
it gave an error on this line in my view:
[<a href="{{=URL(r=request,args=request.args,vars=dict(all=1)) }}">show
all attachements</a>]
This worked fine, but then I think I upgraded from 1.99.4 to 1.99.7, and it
throws an error complaining that it cannot concatenate string and int types
(because of dict(all=1) instead of all='1')
Of course, the error can be fixed by passing a string literal or calling
str() on the int, but i was curious if this intended?
I haven't been very careful to only use string vars, assuming that my
laziness would be corrected by some gluonic magic.
Am I supposed to have always been passing only strings as vars? Should I be
proactive and hunt down places in my code in other applications (which are
still using slightly older web2py versions) or is this something that might
change back to being able to use integers?
Just curious. Here's the relevant part of the traceback:
File "/usr/web2py-latest/gluon/html.py", line 330, in URL
other += '?%s' % '&'.join([var[0]+'='+var[1] for var in list_vars])
TypeError: cannot concatenate 'str' and 'int' objects
If the "other+=" line were rewritten as such, would it be a bad thing for any
reason?
other += '?%s' % '&'.join([*str(*var[0]*)*+'='+str(var[1]) for var in
list_vars])
Thanks,
Abe
--