From nobody Sun May 19 03:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539207155188698.209192949436; Wed, 10 Oct 2018 14:32:35 -0700 (PDT) Received: from localhost ([::1]:59239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAM5f-0006qO-9e for importer@patchew.org; Wed, 10 Oct 2018 17:32:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAM4V-0006Uk-Ox for qemu-devel@nongnu.org; Wed, 10 Oct 2018 17:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAM4S-00085C-40 for qemu-devel@nongnu.org; Wed, 10 Oct 2018 17:31:11 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:40571) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAM4R-00084J-TS; Wed, 10 Oct 2018 17:31:08 -0400 Received: by mail-wm1-x334.google.com with SMTP id z204-v6so7249786wmc.5; Wed, 10 Oct 2018 14:31:07 -0700 (PDT) Received: from x1.local (26.red-83-32-208.dynamicip.rima-tde.net. [83.32.208.26]) by smtp.gmail.com with ESMTPSA id x66-v6sm7478322wme.35.2018.10.10.14.31.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 14:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=doYYmIjGnXZmXC7U4ZkS1If1PvYviBPFI5q7olWy3Tw=; b=niVz7vGpCBbRBwMVjnXm9P2Vf68LHTsgmQt4uPWYWoeuUBIsKWpZ4cW386LXykhW3T PDb/bQN1gfPFh/3k77z8D8N1AN6EslRe9y+QNV7Zzv0/Cy+GKWw+pviFEHmYi5QZ6wcx Ruenj+mlpsVV9KdexhbLkCON8R7WcsHKy/NfkAGWMktTDBTykqop4LXcFnWUmA78ouIl RFbOUXAov9w7MP7G1qtIBddwiSAad8uXg/GtAbUUfsZyaW1ms/tKe4PPE63oS9Zs8s9F 1HgKJ80SwgeJSkM593agTsr4l4iaMYVYg5hq9uBeoPpYc9XbiHvU7wBxb0deSfqFJ89H 5imQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=doYYmIjGnXZmXC7U4ZkS1If1PvYviBPFI5q7olWy3Tw=; b=Uf0vlA8+5MJyRAfQwiZntQB6ANHCtnE8AmqR2aUHCm95DSrdRP1a8hUwATidY0X6d6 bqsK4DTEVixWRcLBEA2sL94TGdQl8Shq432SeWHPRny/dUztjANptS94q6k/L9eCpxJq znpX2MXeauWQb33/Z3LYacqcg7fZhzRoEo8dq5r6qtfCC1P90ctA5z4NfZxT61tzFsYu jlHCmRaeGlG5aCMUcbWCBtcw8Wmhc4tmOEQ+yt0vAHnPDti3rrkgN5ZdEt7QnSl8fEVa dveCp8CwKqnFCaejY33IwAXHkLuNpGbZVYdXHYGpwb0VGdr5LVI2kzocmRHpm23EfInW RzfA== X-Gm-Message-State: ABuFfoj0Npnce8C2mHi7Bu7O8DwCLa6UblHDYSYOJ5zB2MlG5SMHLSqS OyQeUIzSOmxW/imU2lXl0bM= X-Google-Smtp-Source: ACcGV62xT1PSS6ZMlATvn/Hx/5cxSBdQnDiZeW37kwLHMYgDTnlDIaCoBMSgtq2OTd/dx8TfcT67ZA== X-Received: by 2002:a1c:5e49:: with SMTP id s70-v6mr2165966wmb.131.1539207066797; Wed, 10 Oct 2018 14:31:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Fam Zheng , Kevin Wolf , Max Reitz , Eduardo Habkost , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Daniel P . Berrange" Date: Wed, 10 Oct 2018 23:31:02 +0200 Message-Id: <20181010213102.8373-1-f4bug@amsat.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 Subject: [Qemu-devel] [PATCH v3] python: Use io.StringIO X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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 + iotests.main(supported_fmts=3D['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=C3=A9 Reviewed-by: Paolo Bonzini --- tests/qemu-iotests/iotests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 4e67fbbe96..cd9be1bd9c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -679,13 +679,13 @@ def main(supported_fmts=3D[], supported_oses=3D['linu= x'], supported_cache_modes=3D[], =20 # We need to filter out the time taken from the output so that qemu-io= test # can reliably diff the results against master output. - import StringIO + from io import StringIO if debug: output =3D sys.stdout verbosity =3D 2 sys.argv.remove('-d') else: - output =3D StringIO.StringIO() + output =3D StringIO() =20 logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) =20 --=20 2.19.1