Updated fix for python3. #118
This commit is contained in:
parent
47ec633ff8
commit
28dc0265e4
2 changed files with 1 additions and 2 deletions
|
|
@ -1854,7 +1854,7 @@ class XMLBox(Jp2kBox):
|
|||
except UnicodeDecodeError as ude:
|
||||
# Possibly bad string of bytes to begin with.
|
||||
# Try to search for <?xml and go from there.
|
||||
decl_start = read_buffer.find('<?xml')
|
||||
decl_start = read_buffer.find(b'<?xml')
|
||||
if decl_start > -1:
|
||||
text = read_buffer[decl_start:].decode('utf-8')
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ class TestBadButRecoverableXmlFile(unittest.TestCase):
|
|||
|
||||
# Write out 48 good bytes constituting the XML payload.
|
||||
write_buffer = b'<?xml version="1.0"?><test>this is a test</test>'
|
||||
write_buffer = write_buffer.encode()
|
||||
tfile.write(write_buffer)
|
||||
|
||||
# Get the rest of the input file.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue