mirror of
https://github.com/borgbackup/borg.git
synced 2024-09-11 12:36:12 +03:00
str.encode() / bytes.decode(): utf-8 is the default, fixes #4306
note: i kept explicit utf-8 at some critical places, like e.g. key passphrase handling.
This commit is contained in:
parent
d644323333
commit
ec9334422e
@ -34,7 +34,7 @@ def main():
|
||||
try:
|
||||
output = subprocess.check_output(objdump % filename, shell=True,
|
||||
stderr=subprocess.STDOUT)
|
||||
output = output.decode('utf-8')
|
||||
output = output.decode()
|
||||
versions = set(parse_version(match.group(1))
|
||||
for match in glibc_re.finditer(output))
|
||||
requires_glibc = max(versions)
|
||||
|
@ -1843,7 +1843,7 @@ def print_finding(info, wanted, data, offset):
|
||||
if wanted.startswith('hex:'):
|
||||
wanted = unhexlify(wanted[4:])
|
||||
elif wanted.startswith('str:'):
|
||||
wanted = wanted[4:].encode('utf-8')
|
||||
wanted = wanted[4:].encode()
|
||||
else:
|
||||
raise ValueError('unsupported search term')
|
||||
except (ValueError, UnicodeEncodeError):
|
||||
|
@ -54,7 +54,7 @@ def __getitem__(self, name):
|
||||
values = self._archives.get(_name)
|
||||
if values is None:
|
||||
raise KeyError
|
||||
ts = parse_timestamp(values[b'time'].decode('utf-8'))
|
||||
ts = parse_timestamp(values[b'time'].decode())
|
||||
return ArchiveInfo(name=name, id=values[b'id'], ts=ts)
|
||||
|
||||
def __setitem__(self, name, info):
|
||||
|
@ -848,7 +848,7 @@ def handle_error(unpacked):
|
||||
self.stderr_received = lines.pop()
|
||||
# now we have complete lines in <lines> and any partial line in self.stderr_received.
|
||||
for line in lines:
|
||||
handle_remote_line(line.decode('utf-8')) # decode late, avoid partial utf-8 sequences
|
||||
handle_remote_line(line.decode()) # decode late, avoid partial utf-8 sequences
|
||||
if w:
|
||||
while not self.to_send and (calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT:
|
||||
if calls:
|
||||
|
Loading…
Reference in New Issue
Block a user