- with open(filename, 'a') as f:
- f.write('%s %s %s %s\n' %
- (time.strftime('%Y-%m%d-%H:%M:%S%z'),
- ('FORCEDFETCH' if force else 'fetch'), rev, ref))
+ with open(filename, 'a', encoding='utf-8') as f:
+ f.write(
+ f'{time.strftime("%Y-%m%d-%H:%M:%S%z")} '
+ f'{"FORCEDFETCH" if force else "fetch"} {rev} {ref}\n'
+ )