urlfetcher: Write test file as binary content

Triggers an test_ui error otherwise:

TypeError: write() argument must be str, not bytes
This commit is contained in:
Cole Robinson 2017-10-21 19:33:30 -04:00
parent d82022bd2c
commit 374a3779c4

View File

@ -155,7 +155,7 @@ class _URLFetcher(object):
# pylint: disable=redefined-variable-type
if "VIRTINST_TEST_SUITE" in os.environ:
fn = os.path.join("/tmp", prefix)
fileobj = open(fn, "w")
fileobj = open(fn, "wb")
else:
fileobj = tempfile.NamedTemporaryFile(
dir=self.scratchdir, prefix=prefix, delete=False)