Issue #23681: Fixed Python 2 to 3 poring bugs.

Indexing bytes retiurns an integer, not bytes.
This commit is contained in:
Serhiy Storchaka 2015-03-20 16:46:19 +02:00
parent d83b7c2df4
commit 74a49ac3f5
5 changed files with 12 additions and 14 deletions

View file

@ -210,12 +210,9 @@ class Au_read:
self._framesize = self._framesize * self._nchannels
if self._hdr_size > 24:
self._info = file.read(self._hdr_size - 24)
for i in range(len(self._info)):
if self._info[i] == b'\0':
self._info = self._info[:i]
break
self._info, _, _ = self._info.partition(b'\0')
else:
self._info = ''
self._info = b''
try:
self._data_pos = file.tell()
except (AttributeError, OSError):