diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-15 07:37:00 +0300 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-04-15 07:37:00 +0300 |
commit | 6033d26118cec11eca0c06af215b5876d72e24c6 (patch) | |
tree | 27e5e80b6d50ef26082c19baf825f3fadf718fef | |
parent | 929e276176047be15f4fe5df8bb98aed757920b8 (diff) | |
download | cpython-git-6033d26118cec11eca0c06af215b5876d72e24c6.tar.gz |
#4783: document that is not possible to use json.dump twice on the same stream.
-rw-r--r-- | Doc/library/json.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 6c84f94241..546a09d69b 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -156,6 +156,11 @@ Basic Usage :meth:`default` method to serialize additional types), specify it with the *cls* kwarg; otherwise :class:`JSONEncoder` is used. + .. note:: + + Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol so + trying to serialize more objects with repeated calls to :func:`dump` and + the same *fp* will result in an invalid JSON file. .. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) |