On Fri, Feb 22, 2013 at 8:35 AM, Brian Sutherland <[email protected]> wrote: > On Thu, Feb 21, 2013 at 05:11:28AM -0800, Simon King wrote: >> Hi all, >> >> I'm not sure if this would be considered a bug, but I'm having trouble >> generating URLs using request.route_url, when my replacement values >> themselves contain slashes. For example, if I had the following route >> defined: >> >> config.add_route('test', '/tests/{testname}/') >> >> and I generate a route like this: >> >> request.route_url('test', testname='one/two') >> >> ...the resulting URL will look something like: >> >> http://localhost/tests/one%2Ftwo/ >> >> However, if I try to visit this URL, it is treated exactly the same as: >> >> http://localhost/tests/one/two/ > > AFAIKR this is because the WSGI spec requires an unquoted path so the > information is lost before pyramid gets it. It comes up on web-sig every > now and then, here's one of the times it was talked about: > > http://mail.python.org/pipermail/web-sig/2011-March/005007.html > > So it is a bug, but in WSGI, rather than in pyramid. >
Thanks - that thread (and http://mail.python.org/pipermail/web-sig/2011-March/005005.html in particular) has persuaded me that double-escaping the slash is required. And although I think this *could* be handled in pyramid, the use case is probably unusual enough that it doesn't really matter. I'm happy with my workaround. Thanks, Simon -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
