summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Davis <ian.davis@grassrootsbio.com>2012-05-10 10:01:47 -0400
committerIan Davis <ian.davis@grassrootsbio.com>2012-05-10 10:01:47 -0400
commit1a2a72cea0400e7095f6a40f0aa8fe83af995c75 (patch)
tree472936fa27eda9939f771b6f6a75a7565cb60c55
parent461c5a714c46d5378f0073fc2740dc8fb6884e2b (diff)
downloadbottle-1a2a72cea0400e7095f6a40f0aa8fe83af995c75.tar.gz
BUGFIX: avoid cryptic TypeError when pickling FormsDict objects.
-rw-r--r--bottle.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bottle.py b/bottle.py
index 9e7f900..ed15b5b 100644
--- a/bottle.py
+++ b/bottle.py
@@ -1765,6 +1765,9 @@ class FormsDict(MultiDict):
return default
def __getattr__(self, name, default=unicode()):
+ # Without this guard, pickle generates a cryptic TypeError:
+ if name.startswith('__') and name.endswith('__'):
+ return super(FormsDict, self).__getattr__(name)
return self.getunicode(name, default=default)