2 messages in com.googlegroups.pylons-discussPlus sign in url_for() generated URLs
FromSent OnAttachments
Ron Bickers25 Sep 2007 11:22 
Ron Bickers25 Sep 2007 11:56 
Subject:Plus sign in url_for() generated URLs
From:Ron Bickers (ronb@public.gmane.org)
Date:09/25/2007 11:22:08 AM
List:com.googlegroups.pylons-discuss

I'm having a problem with url_for generated URLs. Given the following route:

map.connect('test', 'test/:filename', controller='mytest', action='urltest')

url_for('test', filename='a filename with spaces.txt') generates:

/test/a+filename+with+spaces.txt

I have a file 'public/test/a filename with spaces.jpg', but Pylons does not find it. Instead, it runs urltest in the mytest controller with a filename of 'a filename with spaces.txt' (the correct filename).

When I force the plus signs to %20, Pylons serves the static file as expected, but I'm not sure if this problem is in Routes, or the URL parser used for static pages, or my browser (Safari on a Mac), or something else.

How can I fix this?