Skip to content

Commit

Permalink
fix file streaming examples in docs to open file in binary mode
Browse files Browse the repository at this point in the history
for python 3.
  • Loading branch information
vsergeev committed Feb 3, 2016
1 parent 234d380 commit 073dfd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ A more complicated example:

Streaming serialization with file-like objects:
``` python
>>> f = open('test.bin', 'w')
>>> f = open('test.bin', 'wb')
>>> umsgpack.pack({u"compact": True, u"schema": 0}, f)
>>> umsgpack.pack([1,2,3], f)
>>> f.close()
>>>
>>> f = open('test.bin')
>>> f = open('test.bin', 'rb')
>>> umsgpack.unpack(f)
{u'compact': True, u'schema': 0}
>>> umsgpack.unpack(f)
Expand Down Expand Up @@ -87,11 +87,11 @@ Python standard library style names `dump`, `dumps`, `load`, `loads` are also av
>>> umsgpack.loads(_)
{u'compact': True, u'schema': 0}
>>>
>>> f = open('test.bin', 'w')
>>> f = open('test.bin', 'wb')
>>> umsgpack.dump({u"compact": True, u"schema": 0}, f)
>>> f.close()
>>>
>>> f = open('test.bin')
>>> f = open('test.bin', 'rb')
>>> umsgpack.load(f)
{u'compact': True, u'schema': 0}
>>>
Expand Down
8 changes: 4 additions & 4 deletions msgpack.org.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ A more complicated example:

Streaming serialization with file-like objects:
``` python
>>> f = open('test.bin', 'w')
>>> f = open('test.bin', 'wb')
>>> umsgpack.pack({u"compact": True, u"schema": 0}, f)
>>> umsgpack.pack([1,2,3], f)
>>> f.close()
>>>
>>> f = open('test.bin')
>>> f = open('test.bin', 'rb')
>>> umsgpack.unpack(f)
{u'compact': True, u'schema': 0}
>>> umsgpack.unpack(f)
Expand Down Expand Up @@ -89,11 +89,11 @@ available:
>>> umsgpack.loads(_)
{u'compact': True, u'schema': 0}
>>>
>>> f = open('test.bin', 'w')
>>> f = open('test.bin', 'wb')
>>> umsgpack.dump({u"compact": True, u"schema": 0}, f)
>>> f.close()
>>>
>>> f = open('test.bin')
>>> f = open('test.bin', 'rb')
>>> umsgpack.load(f)
{u'compact': True, u'schema': 0}
>>>
Expand Down

0 comments on commit 073dfd2

Please sign in to comment.