I don't think it would affect the case of 0 args. On Jan 23, 2011, at 2:05 PM, Kenneth Lundström <[email protected]> wrote:
> I´m a little bit surprised that I havn´t noticed this before as I have used > len(request.args) quite much to determine the state of an operation. > > > Kenneth > >> I think we should change it and treat is like a bug. >> >> On Jan 23, 12:46 pm, Jonathan Lundell<[email protected]> wrote: >>> On Jan 23, 2011, at 8:24 AM, Kenneth Lundström wrote: >>> >>> >>> >>>> Has it allways been like this or? >>>> http://...../application/controller/function/args1 len(request.args) = 1 >>>> http://...../application/controller/function/args1/args2 >>>> len(request.args) = 2 >>>> but >>>> http://...../application/controller/function/args1/ len(request.args) = 2 >>>> I would have guessed that the last case would have returned length as 1 >>> OK, I looked at the source: split('/') with no strip, so a trailing '/' >>> will give you an empty string for the last arg. And I think that both the >>> new and old versions do the same thing. >>> >>> We could change it, I suppose, but someone might be relying on the current >>> behavior. Though that would be a little strange, I guess. >>> >>> It's an accident of the original regex that parses the URL. It appears to >>> be intended to strip the trailing slash, but the args pattern is greedy and >>> sucks it in for itself. >>> >>> Massimo, do you have an opinion? It'd be trivial to strip slashes. >

