From 180ada57da1ae2cd113b82e5da884d8355a12de8 Mon Sep 17 00:00:00 2001 From: ilvalle Date: Mon, 13 Jun 2016 18:00:14 +0200 Subject: [PATCH] fix request.json, close #1337 --- gluon/contrib/shell.py | 2 +- gluon/globals.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gluon/contrib/shell.py b/gluon/contrib/shell.py index 341b32a2..638d3c81 100755 --- a/gluon/contrib/shell.py +++ b/gluon/contrib/shell.py @@ -48,7 +48,7 @@ _HISTORY_KIND = '_Shell_History' UNPICKLABLE_TYPES = [ types.ModuleType, type, - ClassType + ClassType, types.FunctionType, ] diff --git a/gluon/globals.py b/gluon/globals.py index 43079593..3af951c1 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -40,7 +40,7 @@ import threading import cgi import copy import tempfile -import json +import json as json_parser FMT = '%a, %d-%b-%Y %H:%M:%S PST' @@ -215,7 +215,7 @@ class Request(Storage): if is_json: try: - json_vars = json.load(body) + json_vars = json_parser.load(body) except: # incoherent request bodies can still be parsed "ad-hoc" json_vars = {}