explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
This commit is contained in:
parent
ffa0912bc0
commit
96ae0ecef5
29 changed files with 136 additions and 156 deletions
|
|
@ -267,7 +267,7 @@ class RunRootTask(koji.tasks.BaseTaskHandler):
|
|||
self.logger.info('New runroot')
|
||||
self.logger.info("Runroot mounts: %s" % mounts)
|
||||
fn = '%s/tmp/runroot_mounts' % rootdir
|
||||
with open(fn, 'a') as fslog:
|
||||
with open(fn, 'at', encoding='utf-8') as fslog:
|
||||
logfile = "%s/do_mounts.log" % self.workdir
|
||||
uploadpath = self.getUploadDir()
|
||||
error = None
|
||||
|
|
@ -309,7 +309,7 @@ class RunRootTask(koji.tasks.BaseTaskHandler):
|
|||
mounts = set()
|
||||
fn = '%s/tmp/runroot_mounts' % rootdir
|
||||
if os.path.exists(fn):
|
||||
with open(fn, 'r') as fslog:
|
||||
with open(fn, 'rt', encoding='utf-8') as fslog:
|
||||
for line in fslog.readlines():
|
||||
mounts.add(line.strip())
|
||||
# also, check /proc/mounts just in case
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue