Skip to content

Commit

Permalink
clarify byte strings in README
Browse files Browse the repository at this point in the history
  • Loading branch information
vsergeev committed Oct 1, 2014
1 parent ea24448 commit a74ca00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ The streaming `pack()`/`dump()` and `unpack()`/`load()` functions allow packing
>>> class Bar:
... def read(self, n):
... # read and return 'n' number of bytes
... return "\x01"*n
... return b"\x01"*n
...
>>> f = Bar()
>>> umsgpack.unpack(f)
Expand Down Expand Up @@ -205,7 +205,7 @@ If a non-byte-string argument is passed to `umsgpack.unpackb()`, it will raise a
String bytes are strictly decoded with UTF-8. This exception is thrown if UTF-8 decoding of string bytes fails.

``` python
# Attempt to unpack the string "\x80\x81"
# Attempt to unpack the string b"\x80\x81"
>>> umsgpack.unpackb(b"\xa2\x80\x81")
...
umsgpack.InvalidStringException: unpacked string is not utf-8
Expand Down

0 comments on commit a74ca00

Please sign in to comment.