Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813952/?format=api
{ "id": 813952, "url": "http://patchwork.ozlabs.org/api/patches/813952/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170914213450.28754-6-paul.burton@imgtec.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170914213450.28754-6-paul.burton@imgtec.com>", "list_archive_url": null, "date": "2017-09-14T21:34:47", "name": "[U-Boot,v2,5/8] test/py: Encode/decode strings for stdio", "commit_ref": null, "pull_url": null, "state": "deferred", "archived": false, "hash": "7c8014de1e504f3147a454d7133e77906f498494", "submitter": { "id": 33698, "url": "http://patchwork.ozlabs.org/api/people/33698/?format=api", "name": "Paul Burton", "email": "paul.burton@imgtec.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170914213450.28754-6-paul.burton@imgtec.com/mbox/", "series": [ { "id": 3166, "url": "http://patchwork.ozlabs.org/api/series/3166/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=3166", "date": "2017-09-14T21:34:42", "name": "test/py: Fixes for python 3.x", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/3166/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813952/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813952/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xtX464393z9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 07:39:34 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid 55C32C21EE2; Thu, 14 Sep 2017 21:37:55 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 4883EC21EEF;\n\tThu, 14 Sep 2017 21:37:52 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 728C0C21F20; Thu, 14 Sep 2017 21:37:09 +0000 (UTC)", "from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196])\n\tby lists.denx.de (Postfix) with ESMTP id 80115C21ED9\n\tfor <u-boot@lists.denx.de>; Thu, 14 Sep 2017 21:37:05 +0000 (UTC)", "from hhmail02.hh.imgtec.org (unknown [10.100.10.20])\n\tby Forcepoint Email with ESMTPS id 996276AF2B1E3;\n\tThu, 14 Sep 2017 22:36:59 +0100 (IST)", "from localhost (10.20.1.88) by hhmail02.hh.imgtec.org\n\t(10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0;\n\tThu, 14 Sep 2017 22:37:04 +0100" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE\n\tautolearn=unavailable autolearn_force=no version=3.4.0", "From": "Paul Burton <paul.burton@imgtec.com>", "To": "<u-boot@lists.denx.de>", "Date": "Thu, 14 Sep 2017 14:34:47 -0700", "Message-ID": "<20170914213450.28754-6-paul.burton@imgtec.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170914213450.28754-1-paul.burton@imgtec.com>", "References": "<20170914213450.28754-1-paul.burton@imgtec.com>", "MIME-Version": "1.0", "X-Originating-IP": "[10.20.1.88]", "Cc": "Stephen Warren <swarren@nvidia.com>", "Subject": "[U-Boot] [PATCH v2 5/8] test/py: Encode/decode strings for stdio", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "When reading stdin python 3.x will give us byte arrays, and when writing\nstdout or stderr it will expect byte arrays. In order to insulate the\nrest of the code from this difference, call encode or decode at\nappropriate points when reading or writing stdio files. This works fine\non python 2.x too.\n\nSigned-off-by: Paul Burton <paul.burton@imgtec.com>\nReviewed-by: Stephen Warren <swarren@nvidia.com>\n---\n\nChanges in v2: None\n\n test/py/multiplexed_log.py | 4 ++--\n test/py/tests/test_ut.py | 2 +-\n test/py/u_boot_spawn.py | 4 ++--\n 3 files changed, 5 insertions(+), 5 deletions(-)", "diff": "diff --git a/test/py/multiplexed_log.py b/test/py/multiplexed_log.py\nindex bf926c3e77..21bdcb7309 100644\n--- a/test/py/multiplexed_log.py\n+++ b/test/py/multiplexed_log.py\n@@ -140,11 +140,11 @@ class RunAndLog(object):\n if stdout:\n if stderr:\n output += 'stdout:\\n'\n- output += stdout\n+ output += stdout.decode('utf8')\n if stderr:\n if stdout:\n output += 'stderr:\\n'\n- output += stderr\n+ output += stderr.decode('utf8')\n exit_status = p.returncode\n exception = None\n except subprocess.CalledProcessError as cpe:\ndiff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py\nindex 5c25a2d465..1f40e2c2d0 100644\n--- a/test/py/tests/test_ut.py\n+++ b/test/py/tests/test_ut.py\n@@ -14,7 +14,7 @@ def test_ut_dm_init(u_boot_console):\n data = 'this is a test'\n data += '\\x00' * ((4 * 1024 * 1024) - len(data))\n with open(fn, 'wb') as fh:\n- fh.write(data)\n+ fh.write(data.encode('utf-8'))\n \n fn = u_boot_console.config.source_dir + '/spi.bin'\n if not os.path.exists(fn):\ndiff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py\nindex 638c5dd31d..751302a529 100644\n--- a/test/py/u_boot_spawn.py\n+++ b/test/py/u_boot_spawn.py\n@@ -114,7 +114,7 @@ class Spawn(object):\n Nothing.\n \"\"\"\n \n- os.write(self.fd, data)\n+ os.write(self.fd, data.encode('utf8'))\n \n def expect(self, patterns):\n \"\"\"Wait for the sub-process to emit specific data.\n@@ -172,7 +172,7 @@ class Spawn(object):\n events = self.poll.poll(poll_maxwait)\n if not events:\n raise Timeout()\n- c = os.read(self.fd, 1024)\n+ c = os.read(self.fd, 1024).decode('utf8')\n if not c:\n raise EOFError()\n if self.logfile_read:\n", "prefixes": [ "U-Boot", "v2", "5/8" ] }