From 9749b2fb0d6c4ff65c7395e09028102c9508b34a Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 11 Aug 2014 22:36:38 +0300 Subject: objstr: Make sure that bytes are indexed as bytes, not as unicode. Fixes #795. --- tests/basics/bytes.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/basics/bytes.py') diff --git a/tests/basics/bytes.py b/tests/basics/bytes.py index a084bc3994..ce027e7d19 100644 --- a/tests/basics/bytes.py +++ b/tests/basics/bytes.py @@ -37,3 +37,8 @@ def gen(): for i in range(4): yield i print(bytes(gen())) + +# Make sure bytes are not mistreated as unicode +x = b"\xff\x8e\xfe}\xfd\x7f" +print(len(x)) +print(x[0], x[1], x[2], x[3]) -- cgit v1.2.3