cryptblob write needs bytes on py3

This commit is contained in:
Victor Shyba 2018-07-12 16:36:30 -03:00 committed by Jack Robison
parent 39d7f2e46e
commit b1c5fe0b4d
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -128,6 +128,8 @@ class CryptStreamBlobMaker(object):
max bytes are written. num_bytes_to_write is the number max bytes are written. num_bytes_to_write is the number
of bytes that will be written from data in this call of bytes that will be written from data in this call
""" """
if not isinstance(data, bytes):
data = data.encode()
max_bytes_to_write = MAX_BLOB_SIZE - self.length - 1 max_bytes_to_write = MAX_BLOB_SIZE - self.length - 1
done = False done = False
if max_bytes_to_write <= len(data): if max_bytes_to_write <= len(data):