Martin Panter added the comment:
Issue 17909 (auto-detecting JSON encoding) looks like it has a patch which
would probably satisfy this issue
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
Hanxue Lee added the comment:
This seems to be an issue (bug?) for Python 3.3 When calling json.loads() with
a byte array, this is the error
json.loads(response.data, 'latin-1')
TypeError: can't use a string pattern on a bytes-like object
When I decode the byte array to string
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
___
___
Python-bugs-list
Martin v. Löwis added the comment:
Bike-shedding: instead of jsonb, make it json.bytes. Else, it may get confused
with other protocols, such as JSONP or BSON.
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
Nick Coghlan added the comment:
json.bytes would also work for me. It wouldn't need to replicate the full
main module API, just combine the text transform with UTF-8 encoding and
decoding (as well as autodetected UTF-16 and UTF-32 decoding) for the main
4 functions (dump[s], load[s]).
If people
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
___
___
Python-bugs-list mailing
Nick Coghlan added the comment:
Issue 19837 is the complementary problem on the serialisation side - users
migrating from Python 2 are accustomed to being able to use the json module
directly as a wire protocol module, but the strict Python 3 interpretation as a
text transform means that
Changes by Nick Guenther n...@kousu.ca:
--
nosy: +kousu
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
___
___
Python-bugs-list mailing list
Changes by Josh Lee jlee...@gmail.com:
--
nosy: +jleedev
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
___
___
Python-bugs-list mailing list
Antoine Pitrou pit...@free.fr added the comment:
According to current implementation this is acceptable.
Then perhaps auto-detection can be restricted to strict mode? Non-strict mode
would always use utf-8.
Or we can just skip auto-detection altogether (I don't think many people
produce
Serhiy Storchaka storch...@gmail.com added the comment:
Related to this question is a question about errors. How to inform the user, if
an error occurred in the decoding with detected encoding? Leave
UnicodeDecodeError or convert it to ValueError? If there is a syntax error in
JSON --
Changes by Éric Araujo mer...@netwok.org:
--
title: json.loads() throws TypeError on bytes object - json.loads() raises
TypeError on bytes object
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
Serhiy Storchaka storch...@gmail.com added the comment:
I mean a string that starts with '\u'. b'\x00...'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
___
Antoine Pitrou pit...@free.fr added the comment:
Le jeudi 26 avril 2012 à 15:48 +, Serhiy Storchaka a écrit :
I mean a string that starts with '\u'. b'\x00...'.
According to the RFC, that should be escaped:
All Unicode characters may be placed within the
quotation marks except
Serhiy Storchaka storch...@gmail.com added the comment:
According to current implementation this is acceptable.
json.loads('\u', strict=False)
'\x00'
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10976
15 matches
Mail list logo