Subject: urlfetcher: Write test file as binary content From: Cole Robinson crobinso@redhat.com Sat Oct 21 19:33:30 2017 -0400 Date: Sat Oct 21 19:41:33 2017 -0400: Git: 374a3779c402b931554aea06c42a9dcb49c35406 Triggers an test_ui error otherwise: TypeError: write() argument must be str, not bytes diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py index a45c6383..5dae424c 100644 --- a/virtinst/urlfetcher.py +++ b/virtinst/urlfetcher.py @@ -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)