Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tautils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tautils.py b/tautils.py
index d7cd903..8352980 100644
--- a/tautils.py
+++ b/tautils.py
@@ -46,7 +46,11 @@ def json_load(text):
if _old_Sugar_system is True:
listdata = json.read(text)
else:
- io = StringIO(text)
+ # strip out leading and trailing whitespace, nulls, and newlines
+ text = text.lstrip()
+ text = text.replace('\12','')
+ text = text.replace('\00','')
+ io = StringIO(text.rstrip())
listdata = jload(io)
# json converts tuples to lists, so we need to convert back,
return _tuplify(listdata)