diff options
author | Spiros Eliopoulos <seliopou@gmail.com> | 2012-11-01 00:55:33 -0400 |
---|---|---|
committer | Spiros Eliopoulos <seliopou@gmail.com> | 2012-11-01 00:55:33 -0400 |
commit | 30233a5a995e23b72319598d11ebba084497a18b (patch) | |
tree | 2974b4ff7f014fadb686134ccb5b3e33410e7d6c | |
parent | 62e8f400244a449ab4ca72991ae8f06610298dc6 (diff) | |
download | msgpack-python-30233a5a995e23b72319598d11ebba084497a18b.tar.gz |
Fix Unpacker example in README
The example did not properly deserialize, since it was dropping bytes
from the input stream.
-rw-r--r-- | README.rst | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -52,14 +52,15 @@ stream. buf.seek(0) - unpacker = msgpack.Unpacker() - while True: - data = buf.read(4) + unpacker = msgpack.Unpacker() + while True: + data = buf.read(16) if not data: break - unpacker.feed(buf.read(16)) - for unpacked in unpacker: - print unpacked + unpacker.feed(data) + + for unpacked in unpacker: + print unpacked packing/unpacking of custom data type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |