URL encoding in a script for Plone
First thing you think of is python's urllib or urlencode, but security means you can't import either of these. That would mean an external method, which is a bit heavy duty really.
Luckily, we can just
from Products.PythonScripts.standard import url_quote
That works just fine.
If you want + instead of %20 for spaces use
from Products.PythonScripts.standard import url_quote_plus
Then obviously it's just
url_quote(http://www.your_domain.com/an url with spaces)
url_quote_plus(http://www.your_domain.com/an url with spaces)
Everything in the garden is rosy once more.