On Mon, Mar 14, 2011 at 4:09 PM, Raymond Hettinger <report@bugs.python.org> wrote:
Raymond Hettinger <rhettinger@users.sourceforge.net> added the comment:
This is unfortunate. The dumps() should have never worked in the first place.
> We seem to be in the worst of both worlds right now
> as I've generated and stored a lot of json that can
> not be read back in
I don't think that loads() should be changed to accommodate the dumps() error though. JSON is UTF-8 by definition and it is a useful feature that invalid UTF-8 won't load.
To fix the data you've already created (one that other compliant JSON readers wouldn't be able to parse), I think you need to repreprocess those file to make them valid:
bs.decode('utf-8', errors='ignore').encode('utf-8')
----------
nosy: +rhettinger
priority: normal -> high
_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue11489>
_______________________________________