davidcox/genson — Issue #24: Not parsing "None"
Author: yamins81
Created: 2011-11-04 22:29:29+00:00
State: open

In [151]: s = '{"a" : None}'

In [152]: genson.loads(s)
---------------------------------------------------------------------------
ParseException Traceback (most recent call last)

/Users/dyamins/Desktop/ in ()

/Users/dyamins/hyperopt/hyperopt/gdist.pyc in __init__(self, genson_string)
257 def __init__(self, genson_string):
258 parser = genson.parser.GENSONParser()
--> 259 genson_obj = parser.parse_string(genson_string)
260 super(gDist, self).__init__(genson_obj)
261 self.genson_generator = genson.JSONGenerator(genson_obj)

/Users/dyamins/genson/genson/parser.pyc in parse_string(self, genson_string)
202
203 def parse_string(self, genson_string):
--> 204 result = self.grammar.parseString(genson_string)
205 return result.asList()[0]
206

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/pyparsing-1.5.6-py2.7.egg/pyparsing.pyc in parseString(self, instring, parseAll)
1030 # catch and re-raise exception from here, clears out pyparsing internal stack trace

1031 exc = sys.exc_info()[1]
-> 1032 raise exc
1033 else:
1034 return tokens

ParseException: Expected "(" (at char 11), (line:1, col:12)