qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Fam Zheng" <famz@redhat.com>, "Max Reitz" <mreitz@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Daniel P . Berrange" <berrange@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3] python: Use io.StringIO
Date: Thu, 11 Oct 2018 13:33:40 +0200	[thread overview]
Message-ID: <20181011113340.GA4417@localhost.localdomain> (raw)
In-Reply-To: <20181010213102.8373-1-f4bug@amsat.org>

Am 10.10.2018 um 23:31 hat Philippe Mathieu-Daudé geschrieben:
> Both Python 2.7 and 3 support the same io.StringIO to
> handle unicode strings.
> 
> Use the common form to use indistinctly Python 2.7 or 3.
> 
> http://python-future.org/compatible_idioms.html#stringio
> 
> This fixes running tests on the Fedora Docker image,
> which uses Python3 since 356dc290f:
> 
>   $ make docker-test-block@fedora
>   [...]
>   045         [failed, exit status 1] - output mismatch (see 045.out.bad)
>   --- /tmp/qemu-test/src/tests/qemu-iotests/045.out       2018-07-17 16:56:18.000000000 +0000
>   +++ /tmp/qemu-test/build/tests/qemu-iotests/045.out.bad 2018-07-17 17:19:22.448409007 +0000
>   @@ -1,5 +1,6 @@
>   -...........
>   -----------------------------------------------------------------------
>   -Ran 11 tests
>   -
>   -OK
>   +Traceback (most recent call last):
>   +  File "045", line 178, in <module>
>   +    iotests.main(supported_fmts=['raw'])
>   +  File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 682, in main
>   +    import StringIO
>   +ModuleNotFoundError: No module named 'StringIO'
>   132         [failed, exit status 1] - output mismatch (see 132.out.bad)
>   152         [failed, exit status 1] - output mismatch (see 152.out.bad)
> 
>   Failures: 045 132 152
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

This doesn't work for me:

045 1s ...        [13:31:47] [13:31:47] [failed, exit status 1] - output mismatch (see 045.out.bad)
--- /home/kwolf/source/qemu/tests/qemu-iotests/045.out  2017-01-24 14:49:48.000000000 +0100
+++ /home/kwolf/source/qemu/tests/qemu-iotests/045.out.bad      2018-10-11 13:31:47.266876850 +0200
@@ -1,5 +1,26 @@
-...........
-----------------------------------------------------------------------
-Ran 11 tests
-
-OK
+Traceback (most recent call last):
+  File "045", line 178, in <module>
+    iotests.main(supported_fmts=['raw'])
+  File "/home/kwolf/source/qemu/tests/qemu-iotests/iotests.py", line 698, in main
+    unittest.main(testRunner=MyTestRunner)
+  File "/usr/lib64/python2.7/unittest/main.py", line 95, in __init__
+    self.runTests()
+  File "/usr/lib64/python2.7/unittest/main.py", line 232, in runTests
+    self.result = testRunner.run(self.test)
+  File "/usr/lib64/python2.7/unittest/runner.py", line 151, in run
+    test(result)
+  File "/usr/lib64/python2.7/unittest/suite.py", line 70, in __call__
+    return self.run(*args, **kwds)
+  File "/usr/lib64/python2.7/unittest/suite.py", line 108, in run
+    test(result)
+  File "/usr/lib64/python2.7/unittest/suite.py", line 70, in __call__
+    return self.run(*args, **kwds)
+  File "/usr/lib64/python2.7/unittest/suite.py", line 108, in run
+    test(result)
+  File "/usr/lib64/python2.7/unittest/case.py", line 431, in __call__
+    return self.run(*args, **kwds)
+  File "/usr/lib64/python2.7/unittest/case.py", line 406, in run
+    result.addSuccess(self)
+  File "/usr/lib64/python2.7/unittest/runner.py", line 62, in addSuccess
+    self.stream.write('.')
+TypeError: unicode argument expected, got 'str'
Failures: 045
Failed 1 of 1 tests

$ /usr/bin/env python --version
Python 2.7.15

Kevin

  parent reply	other threads:[~2018-10-11 11:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 21:31 [Qemu-devel] [PATCH v3] python: Use io.StringIO Philippe Mathieu-Daudé
2018-10-10 22:22 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2018-10-11 11:33 ` Kevin Wolf [this message]
2018-10-11 12:43   ` Paolo Bonzini
2018-10-11 14:01     ` Markus Armbruster
2018-10-11 14:44       ` Philippe Mathieu-Daudé
2018-10-11 14:56       ` Kevin Wolf
2018-10-11 17:02         ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011113340.GA4417@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).