From 25a6564b42c8e73843b63ca57357a3573ac48c9c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Sep 2014 00:30:40 +0200 Subject: [Lib] Update simplejson to v3.6.3 + one file wsgiserver + importing fixup --- pyload/lib/simplejson/decoder.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pyload/lib/simplejson/decoder.py') diff --git a/pyload/lib/simplejson/decoder.py b/pyload/lib/simplejson/decoder.py index 1a6c5d938..545e65877 100644 --- a/pyload/lib/simplejson/decoder.py +++ b/pyload/lib/simplejson/decoder.py @@ -390,4 +390,11 @@ class JSONDecoder(object): raise JSONDecodeError('Expecting value', s, idx) if _PY3 and not isinstance(s, text_type): raise TypeError("Input string must be text, not bytes") + # strip UTF-8 bom + if len(s) > idx: + ord0 = ord(s[idx]) + if ord0 == 0xfeff: + idx += 1 + elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf': + idx += 3 return self.scan_once(s, idx=_w(s, idx).end()) -- cgit v1.2.3