Message85753
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 |
|
Date |
User |
Action |
Args |
2009-04-07 22:29:22 | pitrou | set | recipients:
+ pitrou, loewis, georg.brandl, rhettinger, bob.ippolito, amaury.forgeotdarc, ajaksu2, benjamin.peterson |
2009-04-07 22:29:22 | pitrou | set | messageid: <1239143362.42.0.999155711765.issue4136@psf.upfronthosting.co.za> |
2009-04-07 22:29:20 | pitrou | link | issue4136 messages |
2009-04-07 22:29:20 | pitrou | create | |
|