From: Ben Darnell Date: Mon, 10 May 2010 01:51:49 +0000 (-0700) Subject: Translate ". --- diff --git a/tornado/escape.py b/tornado/escape.py index bacb1c51d..af99f52fe 100644 --- a/tornado/escape.py +++ b/tornado/escape.py @@ -54,7 +54,13 @@ def xhtml_unescape(value): def json_encode(value): """JSON-encodes the given Python object.""" - return _json_encode(value) + # JSON permits but does not require forward slashes to be escaped. + # This is useful when json data is emitted in a tags from prematurely terminating + # the javscript. Some json libraries do this escaping by default, + # although python's standard library does not, so we do it here. + # http://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped + return _json_encode(value).replace("