objstr: Make sure that bytes are indexed as bytes, not as unicode.

Fixes #795.
This commit is contained in:
Paul Sokolovsky
2014-08-11 22:36:38 +03:00
parent 6e6bcccdc1
commit 9749b2fb0d
2 changed files with 12 additions and 6 deletions

View File

@@ -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])