Nik Tautenhahn n...@livinglogic.de added the comment:
There is even more inconsistency here.
As already mentioned, we have this:
import json
json.loads(json.dumps(abc))
'abc'
If, however, I am evil and hide _json.so (which is the C-part of the json
module for speedup), the JSON code
Fred L. Drake, Jr. fdr...@acm.org added the comment:
Alternately, the Python implementation may be thought of as definitive
and the optimizations are broken.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
Walter Dörwald wal...@livinglogic.de added the comment:
The following patch (against the release27-maint branch) seems to fix the
problem.
--
keywords: +patch
nosy: +doerwalter
Added file: http://bugs.python.org/file19468/json.diff
___
Python
Barry A. Warsaw ba...@python.org added the comment:
The fact that the C and Python versions are not fully tested (afaict) is not
good. I'm not sure that's worth fixing for 2.7 and it's probably worth a
separate bug report for Python 3.2 on that.
In the meantime, I'll test Walter's patch and
Fred L. Drake, Jr. fdr...@acm.org added the comment:
The incomplete testing and C/Python implementation mismatch are covered by
issue 5723 and issue 9233.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
To mitigate possible negative impacts from changing the return type, consider
adding a parse_string hook that lets users control the return type:
json.loads(f, parse_int=decimal.Decimal, parse_string=repr)
--
Barry A. Warsaw ba...@python.org added the comment:
Adding that argument to Python 2.7 seems like new feature territory.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
___
Barry A. Warsaw ba...@python.org added the comment:
@doerwalter: patch looks good. I've added a test and will commit momentarily.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
___
Barry A. Warsaw ba...@python.org added the comment:
r86126
--
assignee: bob.ippolito - barry
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
Antoine Pitrou pit...@free.fr added the comment:
+1 for fixing this in-tree. We need a patch, though ;)
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
___
Changes by Barry A. Warsaw ba...@python.org:
--
title: json.loads() on str erroneously returns str. should return unicode -
json.loads() on str should return unicode, not str
___
Python tracker rep...@bugs.python.org
Changes by Fred L. Drake, Jr. fdr...@acm.org:
--
title: Returntype of json.loads() on strings - json.loads() on str should
return unicode, not str
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10038
12 matches
Mail list logo