Use mode=r for the temp file too.
This commit is contained in:
parent
36ce397a79
commit
df6cf284e4
|
@ -48,7 +48,7 @@ def run_configfile_module():
|
||||||
changed = False
|
changed = False
|
||||||
|
|
||||||
with open(path, 'r') as input:
|
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:
|
for line in input:
|
||||||
print(expand(line), end=' ', file=temp)
|
print(expand(line), end=' ', file=temp)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue