From a74ca002f0d64673e9c7bed3bba842aac8f04f17 Mon Sep 17 00:00:00 2001 From: Vanya Sergeev Date: Tue, 30 Sep 2014 23:11:49 -0700 Subject: [PATCH] clarify byte strings in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1acf102..d7268b4 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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