Hmm, I tried again with a simpler example in an app built from the welcome
app.
I got the same error, but I noticed this:
(a=None, c=None, f=None, r=<Storage {'body': <cStringIO.StringO object at
0..._vars': <Storage {}>, 'post_vars': <Storage {}>}>, args=[], vars={'a':
2}, anchor='', extension=None, env=<Storage {'debugging': False,
'http_user_agent':...[]), 'query_string': '', 'wsgi_run_once': False}>,
hmac_key=None, hash_vars=True, salt=None, user_signature=None, scheme=None,
host=None, port=None, encode_embedded_slash=False, *url_encode=False*)
As you can see, url_encode is set to false... I double checked the version,
and it is 1.99.7 (i printed out request.env.web2py_version from the app
just to be sure, as I have several web2py versions on the test server, so I
possibly have done something silly somewhere).
However, when I launch an app with python web2py.py -M -S <app>, I do not
in fact get the error, leading me to believe I AM doing something silly.
Any idea where I can look to see how the url_encode might be getting set to
false?
On Wednesday, August 1, 2012 10:54:10 AM UTC-5, Jonathan Lundell wrote:
>
> On 1 Aug 2012, at 8:42 AM, Massimo Di Pierro <[email protected]>
> wrote:
>
> in trunk. please check it.
>
>
> Per my earlier message, this should not be necessary. There must be
> something else wrong, and str() unfortunately just papers over whatever the
> real problem is.
>
>
> On Wednesday, 1 August 2012 10:23:11 UTC-5, AbrahamLinksys wrote:
>>
>> 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
>>
>>
> --
>
>
>
>
>
On Wednesday, August 1, 2012 10:54:10 AM UTC-5, Jonathan Lundell wrote:
>
> On 1 Aug 2012, at 8:42 AM, Massimo Di Pierro <[email protected]>
> wrote:
>
> in trunk. please check it.
>
>
> Per my earlier message, this should not be necessary. There must be
> something else wrong, and str() unfortunately just papers over whatever the
> real problem is.
>
>
> On Wednesday, 1 August 2012 10:23:11 UTC-5, AbrahamLinksys wrote:
>>
>> 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
>>
>>
> --
>
>
>
>
>
--