-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Environment:PyPy 1.5
Running this script on CPython works, but crashes on PyPy:
import json
import datetime
from bson.json_util import default, object_hook
from bson.tz_util import utc
data = datetime.datetime(2011, 1, 1, 1, 1, 1, 191000, utc)
data2 = json.loads(json.dumps(data, default=default), object_hook=object_hook)
assert data == data2, (data, data2)
The microseconds (191000) are unserialized to a wrong value (190999).