Pass errors='replace' to open command

This is to handle decoding errors described in YunoHost/issues#2156
This commit is contained in:
Eric Geldmacher 2023-02-23 08:48:22 -06:00 committed by GitHub
parent bab27014d9
commit bef4809f94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -775,7 +775,7 @@ def _tail(file, n):
f = gzip.open(file)
lines = f.read().splitlines()
else:
f = open(file)
f = open(file, errors='replace')
pos = 1
lines = []
while len(lines) < to_read and pos > 0: