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 200614872e
commit 4b104c742b

View File

@ -251,7 +251,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()