When comparing ujson
and cpickle
for serializing objects in Python 2.7, why does using ujson
as shown gives an error OverflowError: Maximum recursion level reached
?
import ujson as json
sys.setrecursionlimit(10000)
with open(myPath, 'w') as fp:
json.dump(data, fp)
However when using cPickle
, the same error does not occur.
import cPickle as pickle
sys.setrecursionlimit(10000)
with open(myPath, 'w') as fp:
pickle.dump(data, fp)
Why is this?