Ansgar pushed to branch master at Debian FTP Team / dak
Commits:
-
c71ebb8e
by Ansgar at 2020-11-15T21:41:01+01:00
1 changed file:
Changes:
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 |
|
34 | 34 |
from __future__ import print_function
|
35 | 35 |
|
36 |
+import six
|
|
36 | 37 |
import sys
|
37 | 38 |
import tempfile
|
38 | 39 |
import apt_pkg
|
... | ... | @@ -363,8 +364,12 @@ def new_stats(logdir, yaml): |
363 | 364 |
with open(logfile, 'rb') as fh:
|
364 | 365 |
data = daklib.daksubprocess.check_output(['xzcat'], stdin=fh)
|
365 | 366 |
else:
|
366 |
- with open(logfile, 'r') as fd:
|
|
367 |
+ with open(logfile, 'rb') as fd:
|
|
367 | 368 |
data = fd.read()
|
369 |
+ try:
|
|
370 |
+ data = six.ensure_str(data)
|
|
371 |
+ except UnicodeDecodeError:
|
|
372 |
+ data = six.ensure_str(data, encoding='latin1')
|
|
368 | 373 |
ts = parse_new_uploads(data)
|
369 | 374 |
if ts > latest_timestamp:
|
370 | 375 |
latest_timestamp = ts
|