-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static URLs unqouted twice #349
Comments
Problem 2 appears to be fixed in the trunk.
|
Problem 1 (static_url) I've fixed on master. Going to look into fixing this on the 1.2 branch too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a project I need a directory structures for images, where each directory name may have undesirable characters such as /. To solve this I am URL-quoting directory names on the filesystem. That means I have paths such as
media/help/tops/halter%20tops/one%2Btwo/image 1.jpg
. I can build a static URL for those in the usual way, for examplerequest.static_url('mypackage:templates/media/help/tops/halter%20tops/image 1.jpg
, which results in the URLhttp://localhost/media/help/tops/halter%20tops/image 1.jpg
. This URL has a problem when used as-is: the spaces and %-sign still need to be quoted. This is problem one:as a workaround I modified my code to double-quote the directory names and quote the filenames. That results in URLs such as
http://localhost/media/help/hater%2520tops/image%201.jpg
. This still does not work: something in the pyramid is double-unquoting incoming paths, and as a result I still get a 404. This is the second problem:as a last attempt I tried to tripple-quote everything. This produces lovely URLs such as
http://localhost/media/help/hater%252520tops/image%25201.jpg
, but does end up working.The text was updated successfully, but these errors were encountered: