Packages update

This commit is contained in:
Ruud
2012-02-11 16:28:06 +01:00
parent 3bbf1126c3
commit 02e01fb2d6
217 changed files with 26395 additions and 21194 deletions
+2 -1
View File
@@ -488,7 +488,8 @@ class RedisCache(BaseCache):
"""Dumps an object into a string for redis. By default it serializes
integers as regular string and pickle dumps everything else.
"""
if isinstance(value, (int, long)):
t = type(value)
if t is int or t is long:
return str(value)
return '!' + pickle.dumps(value)
+5 -1
View File
@@ -201,4 +201,8 @@ class Console(object):
self._ipy = _InteractiveConsole(globals, locals)
def eval(self, code):
return self._ipy.runsource(code)
old_sys_stdout = sys.stdout
try:
return self._ipy.runsource(code)
finally:
sys.stdout = old_sys_stdout
+1 -1
View File
@@ -141,7 +141,7 @@ def iri_to_uri(iri, charset='utf-8'):
if port:
hostname += ':' + port
path = _quote(path.encode(charset), safe="/:~+")
path = _quote(path.encode(charset), safe="/:~+%")
query = _quote(query.encode(charset), safe="=%&[]:;$()+,!?*/")
# this absolutely always must return a string. Otherwise some parts of
+2 -2
View File
@@ -353,7 +353,7 @@ def redirect(location, code=302):
:param code: the redirect status code. defaults to 302.
"""
from werkzeug.wrappers import BaseResponse
display_location = location
display_location = escape(location)
if isinstance(location, unicode):
from werkzeug.urls import iri_to_uri
location = iri_to_uri(location)
@@ -363,7 +363,7 @@ def redirect(location, code=302):
'<h1>Redirecting...</h1>\n'
'<p>You should be redirected automatically to target URL: '
'<a href="%s">%s</a>. If not click the link.' %
(location, display_location), code, mimetype='text/html')
(escape(location, True), display_location), code, mimetype='text/html')
response.headers['Location'] = location
return response