mirror of https://github.com/borgbackup/borg.git
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:
|
try:
|
||||||
output = subprocess.check_output(objdump % filename, shell=True,
|
output = subprocess.check_output(objdump % filename, shell=True,
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT)
|
||||||
output = output.decode('utf-8')
|
output = output.decode()
|
||||||
versions = set(parse_version(match.group(1))
|
versions = set(parse_version(match.group(1))
|
||||||
for match in glibc_re.finditer(output))
|
for match in glibc_re.finditer(output))
|
||||||
requires_glibc = max(versions)
|
requires_glibc = max(versions)
|
||||||
|
|
|
@ -1843,7 +1843,7 @@ class Archiver:
|
||||||
if wanted.startswith('hex:'):
|
if wanted.startswith('hex:'):
|
||||||
wanted = unhexlify(wanted[4:])
|
wanted = unhexlify(wanted[4:])
|
||||||
elif wanted.startswith('str:'):
|
elif wanted.startswith('str:'):
|
||||||
wanted = wanted[4:].encode('utf-8')
|
wanted = wanted[4:].encode()
|
||||||
else:
|
else:
|
||||||
raise ValueError('unsupported search term')
|
raise ValueError('unsupported search term')
|
||||||
except (ValueError, UnicodeEncodeError):
|
except (ValueError, UnicodeEncodeError):
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Archives(abc.MutableMapping):
|
||||||
values = self._archives.get(_name)
|
values = self._archives.get(_name)
|
||||||
if values is None:
|
if values is None:
|
||||||
raise KeyError
|
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)
|
return ArchiveInfo(name=name, id=values[b'id'], ts=ts)
|
||||||
|
|
||||||
def __setitem__(self, name, info):
|
def __setitem__(self, name, info):
|
||||||
|
|
|
@ -848,7 +848,7 @@ This problem will go away as soon as the server has been upgraded to 1.0.7+.
|
||||||
self.stderr_received = lines.pop()
|
self.stderr_received = lines.pop()
|
||||||
# now we have complete lines in <lines> and any partial line in self.stderr_received.
|
# now we have complete lines in <lines> and any partial line in self.stderr_received.
|
||||||
for line in lines:
|
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:
|
if w:
|
||||||
while not self.to_send and (calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT:
|
while not self.to_send and (calls or self.preload_ids) and len(waiting_for) < MAX_INFLIGHT:
|
||||||
if calls:
|
if calls:
|
||||||
|
|
Loading…
Reference in New Issue