Author pitrou
Recipients ajaksu2, amaury.forgeotdarc, benjamin.peterson, bob.ippolito, georg.brandl, loewis, pitrou, rhettinger
Date 2009-04-07.22:29:20
SpamBayes Score 1.01769e-10
Marked as misclassified No
Message-id <1239143362.42.0.999155711765.issue4136@psf.upfronthosting.co.za>
In-reply-to
Content
There is the problem in the current py3k version of json. b"hi" can be
serialized, but not [b"hi"].

>>> json.dumps(b"hi")
'"hi"'
>>> json.dumps([b"hi"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/py3k/__svn__/Lib/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 367, in encode
    chunks = list(self.iterencode(o))
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 306, in
_iterencode
    for chunk in self._iterencode_list(o, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 204, in
_iterencode_list
    for chunk in self._iterencode(value, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 317, in
_iterencode
    for chunk in self._iterencode_default(o, markers):
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 323, in
_iterencode_default
    newobj = self.default(o)
  File "/home/antoine/py3k/__svn__/Lib/json/encoder.py", line 344, in
default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'hi' is not JSON serializable
History
Date User Action Args
2009-04-07 22:29:22pitrousetrecipients: + pitrou, loewis, georg.brandl, rhettinger, bob.ippolito, amaury.forgeotdarc, ajaksu2, benjamin.peterson
2009-04-07 22:29:22pitrousetmessageid: <1239143362.42.0.999155711765.issue4136@psf.upfronthosting.co.za>
2009-04-07 22:29:20pitroulinkissue4136 messages
2009-04-07 22:29:20pitroucreate