Fix Type error

The "file_head" is a 'bytes-like object ,not 'str'.

Update file_head.split() to file_head.decode('utf-8').split()

Change-Id: Ic912cc86d9a5afbdbcd63f27e1f91d2140f9b9ba
This commit is contained in:
Caihui 2020-06-30 04:29:32 -07:00
parent 19aae78daf
commit 3ae26c12fb
1 changed files with 2 additions and 2 deletions

View File

@ -475,10 +475,10 @@ class RsyncEngine(engine.BackupEngine):
len_file_header = len(file_header)
if header_size != len_file_header:
file_header_list = file_header.split('\00')
file_header_list = file_header.decode('utf-8').split('\00')
file_header_list = file_header_list[1:]
file_header_list.insert(0, str(len_file_header))
file_header = '\00'.join(file_header_list)
file_header = '\00'.join(file_header_list).encode('utf-8')
return file_header
def make_files(