Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/813938/?format=api
{ "id": 813938, "url": "http://patchwork.ozlabs.org/api/patches/813938/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170914200634.17818-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": "<20170914200634.17818-6-paul.burton@imgtec.com>", "list_archive_url": null, "date": "2017-09-14T20:06:31", "name": "[U-Boot,5/8] test/py: Encode/decode strings for stdio", "commit_ref": null, "pull_url": null, "state": "superseded", "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/20170914200634.17818-6-paul.burton@imgtec.com/mbox/", "series": [ { "id": 3156, "url": "http://patchwork.ozlabs.org/api/series/3156/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=3156", "date": "2017-09-14T20:06:26", "name": "test/py: Fixes for python 3.x", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3156/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/813938/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/813938/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 3xtV8R1Y7Lz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 06:13:11 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid E8A89C21DF4; Thu, 14 Sep 2017 20:09:45 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E2AABC21E31;\n\tThu, 14 Sep 2017 20:09:43 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 3A881C21E6F; Thu, 14 Sep 2017 20:08:31 +0000 (UTC)", "from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196])\n\tby lists.denx.de (Postfix) with ESMTP id 68FCFC21DCE\n\tfor <u-boot@lists.denx.de>; Thu, 14 Sep 2017 20:08:28 +0000 (UTC)", "from hhmail02.hh.imgtec.org (unknown [10.100.10.20])\n\tby Forcepoint Email with ESMTPS id C05594C838A7C;\n\tThu, 14 Sep 2017 21:08:22 +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 21:08:27 +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 13:06:31 -0700", "Message-ID": "<20170914200634.17818-6-paul.burton@imgtec.com>", "X-Mailer": "git-send-email 2.14.1", "In-Reply-To": "<20170914200634.17818-1-paul.burton@imgtec.com>", "References": "<20170914200634.17818-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 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>\n---\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", "5/8" ] }