diff options
author | 2014-09-08 00:30:40 +0200 | |
---|---|---|
committer | 2014-09-14 11:02:52 +0200 | |
commit | 25a6564b42c8e73843b63ca57357a3573ac48c9c (patch) | |
tree | 36d2f2c3edbfa425e945c927757449c0060b18d6 /pyload/lib/simplejson/decoder.py | |
parent | module -> pyload (diff) | |
download | pyload-25a6564b42c8e73843b63ca57357a3573ac48c9c.tar.xz |
[Lib] Update simplejson to v3.6.3 + one file wsgiserver + importing fixup
Diffstat (limited to 'pyload/lib/simplejson/decoder.py')
-rw-r--r-- | pyload/lib/simplejson/decoder.py | 7 |
1 files changed, 7 insertions, 0 deletions
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()) |