# HG changeset patch # User Thomas Waldmann # Date 1272450595 -7200 # Node ID 80a7f3cd237b7ad7be2087f3da84c1c750ad29f8 # Parent 24d7e2f450bff706e9f6a8f3dcfebe6940987906 deal with werkzeug 0.6.x behaviour change if redirect() gets unicode 0.5.x seems to happily accept both unicode and str and do same for both. 0.6.x does iri-to-uri transform if it gets unicode (including url-quoting). As our "unicode url" is already url-quoted, we just use str() to make it a str before giving it to werkzeug, so it behaves in the same way for werkzeug 0.5.x and 0.6.x. diff -r 24d7e2f450bf -r 80a7f3cd237b MoinMoin/web/contexts.py --- a/MoinMoin/web/contexts.py Fri Apr 23 21:19:18 2010 +0200 +++ b/MoinMoin/web/contexts.py Wed Apr 28 12:29:55 2010 +0200 @@ -269,6 +269,10 @@ def http_redirect(self, url, code=302): """ Raise a simple redirect exception. """ + # werkzeug >= 0.6 does iri-to-uri transform if it gets unicode, but our + # url is already url-quoted, so we better give it str to have same behaviour + # with werkzeug 0.5.x and 0.6.x: + url = str(url) # if url is unicode, it should contain ascii chars only abort(redirect(url, code=code)) def http_user_agent(self):