ipautil: Use mode 'w+' in write_tmp_file

Python defaults to 'w+b', but all callers in IPA write use text (as
opposed to bytes).

https://fedorahosted.org/freeipa/ticket/5638

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Petr Viktorin
2016-01-26 15:05:14 +01:00
committed by Jan Cholasta
parent 9a3d5fdadd
commit a2c22bbedc

View File

@@ -252,7 +252,7 @@ def copy_template_file(infilename, outfilename, vars):
def write_tmp_file(txt):
fd = tempfile.NamedTemporaryFile()
fd = tempfile.NamedTemporaryFile('w+')
fd.write(txt)
fd.flush()