﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2694	[patch] urlencode to use optional safe argument for urllib.quote	Kaaya	nobody	"I know this issue got set as wontfix before but the previous solution was not backwards compatible and this one is.

{{{
def urlencode(value, safe='/'):
    ""Escapes a value for use in a URL""
    import urllib
    return urllib.quote(value, safe)
}}}

urlencode will work exactly as is does now but can *optionally* set which characters won't be escaped. The / character is the default for urllib.quote http://docs.python.org/lib/module-urllib.html

Test case for this is when you have a url stored in the db e.g. ""http://djangoproject.com/"" if you do a var|urlencode on that you get back 'http%3A//djangoproject.com/' which will cause the browser to show http://example.com/http://djangoproject.com/ which is not what you want but if you can use var|urlencode:"":/"" you'll get the link working properly."	enhancement	closed	Core (Other)		trivial	invalid	urlencode		Design decision needed	1	0	0	0	0	0
