palmdoc: consistently use bytes when writing to the buffer

This commit is contained in:
Eli Schwartz 2019-03-17 04:18:55 -04:00
parent e02f836bd0
commit 0b252e8659

View File

@ -83,7 +83,7 @@ def py_compress_doc(data):
i += 1 i += 1
continue continue
if och == 0 or (och > 8 and och < 0x80): if och == 0 or (och > 8 and och < 0x80):
out.write(ch) out.write(ch.encode('utf-8'))
else: else:
j = i j = i
binseq = [ch] binseq = [ch]
@ -95,6 +95,6 @@ def py_compress_doc(data):
binseq.append(ch) binseq.append(ch)
j += 1 j += 1
out.write(pack('>B', len(binseq))) out.write(pack('>B', len(binseq)))
out.write(''.join(binseq)) out.write(''.join(binseq).encode('utf-8'))
i += len(binseq) - 1 i += len(binseq) - 1
return out.getvalue() return out.getvalue()