Averroes / simplejson

MIT License
0 stars 0 forks source link

loads fails for unicode string with floating number #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. import simplejson as json
2. json.loads(u"0.10000000000000001")

What is the expected output? What do you see instead?

I would like to see 0.10000000000000001 (actually 
json.loads("0.10000000000000001") returns 
it)
Instead I get:
In [9]: json.loads(u"0.10000000000000001")
--------------------------------------------------------------------------
-
ValueError                                Traceback (most recent call last)

<ipython console> in <module>()

eggs/simplejson-2.0.9-py2.6-macosx-10.6-universal.egg/simplejson/__init__.pyc 
in loads(s, 
encoding, cls, object_hook, parse_float, parse_int, parse_constant, **kw)
      8 #

      9 # See the README file for information on usage and redistribution.

     10 #

     11 
     12 # ;-)

eggs/simplejson-2.0.9-py2.6-macosx-10.6-universal.egg/simplejson/decoder.pyc in 
decode(self, s, _w)
    336         end = _w(s, end).end()
    337         if end != len(s):
--> 338             raise ValueError(errmsg("Extra data", s, end, len(s)))
    339         return obj
    340 

ValueError: Extra data: line 1 column 18 - line 1 column 19 (char 18 - 19)

What version of the product are you using? On what operating system?

I'm using simplejson-2.0.9. The problem reproduces on Mac OS X and Linux boxes

Original issue reported on code.google.com by rmih...@gmail.com on 25 Feb 2010 at 2:01

GoogleCodeExporter commented 9 years ago
Oops, sorry.
Forgot to check already closed issues. Please, discard it.

Original comment by rmih...@gmail.com on 25 Feb 2010 at 2:04

GoogleCodeExporter commented 9 years ago

Original comment by bob.ippo...@gmail.com on 25 Feb 2010 at 2:25