Use mode=r for the temp file too.

This commit is contained in:
Andrea Dell'Amico 2023-10-11 18:20:29 +02:00
parent 36ce397a79
commit df6cf284e4
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def run_configfile_module():
changed = False
with open(path, 'r') as input:
with tempfile.NamedTemporaryFile(dir=os.path.dirname(path)) as temp:
with tempfile.NamedTemporaryFile(dir=os.path.dirname(path), mode="r") as temp:
for line in input:
print(expand(line), end=' ', file=temp)