New submission from Serhiy Storchaka:

Inspired by simplejson issue [1] which is related to standard json module too. 
JSON parser 3.3+ and wide builds of 3.2- raise an error on invalid strings 
(i.e. with unpaired surrogate), while narrow builds and some third-party 
parsers. Wide builds are right, such JSON data is invalid. However it will be 
good to be optionally more permissive to input data. Otherwise it is not easy 
process such invalid data.

I propose to add an "error" parameter to JSON decoder and encoder with the same 
meaning as in string decoding/encoding. "strict" is default and "surrogatepass" 
corresponds to narrow builds (and non-strict third-party parsers).

[1] https://github.com/simplejson/simplejson/issues/62

----------
assignee: serhiy.storchaka
components: Extension Modules, Library (Lib), Unicode
messages: 188364
nosy: bob.ippolito, ezio.melotti, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Add a string error handler to JSON encoder/decoder
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17906>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to