Comment #2 on issue 1940 by quinntay...@mac.com: Spaces in URL path are not encoded as %20 in email notifications
http://code.google.com/p/reviewboard/issues/detail?id=1940

Sorry, the URLs I'm talking about are repository paths for the files changed in a given diff. (I have RB connected to our Subversion repository.) When there are spaces in the path (either for a directory or filename) the email dutifully prints the URL as-is. The trouble starts when I try to click on a link to jump to such a file.

For example, if I submit a review request for a diff affecting this URL:
    http://svn.example.com/trunk/A Spaceful Directory Name/foo.java

the email that is sent will include this URL in a bulleted list, but without accounting for spaces, the URL is recognized as:
    http://svn.example.com/trunk/A

Obviously, this is not a URL that RB is creating per se, but is IS something that can be defended against. One simple approach to fix this is detailed here:

http://stackoverflow.com/questions/120951/how-can-i-normalize-a-url-in-python#845595

    import urllib
    url = urllib.quote(url, safe="%/:=&?~#+!$,;'@()*[]")

This percent escapes spaces and other characters, but avoid escaping the colon in the scheme, etc. The result is:
    http://svn.example.com/trunk/A%20Spaceful%20Directory%20Name/foo.java

Hopefully this provides enough context to clarify the problem I'm seeing. Thanks!

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com.
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en.

Reply via email to