{"id":15955,"url":"https://patchwork.libcamera.org/api/patches/15955/?format=json","web_url":"https://patchwork.libcamera.org/patch/15955/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220518131329.66994-6-tomi.valkeinen@ideasonboard.com>","date":"2022-05-18T13:13:16","name":"[libcamera-devel,v3,05/18] py: unittests: fix selector fd use","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"5061c8ec01915fdaf1f8755c7b70770e5a94ba55","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/?format=json","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15955/mbox/","series":[{"id":3122,"url":"https://patchwork.libcamera.org/api/series/3122/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3122","date":"2022-05-18T13:13:11","name":"Misc Python bindings patches","version":3,"mbox":"https://patchwork.libcamera.org/series/3122/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15955/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15955/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B6375C326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 13:13:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0283865661;\n\tWed, 18 May 2022 15:13:55 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 12F976565B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 15:13:49 +0200 (CEST)","from deskari.lan (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 634B41C03;\n\tWed, 18 May 2022 15:13:48 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652879636;\n\tbh=RKi8ohSP2/H4tFlJm6FL57C1QuJSK4DqfYF2nMVFae4=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=ZWORPCRNnKvNpRUVlsTMZFCnB4fCC47BwtbQEdeyhL2bfeG3K8GB8PmCbR8yAw0VO\n\tp6rQeXVMn6BFZMjzTcgG76YxHehHimwbJgTsGyYCawUJSVRTUIrXCcxhbEPBcVrpuU\n\thk/7CdKKKgGUrhV0xn5LWObHPnm9/KlFb2qfcMhU8abnnw29gYgmwpFMg3ivsYq30a\n\toh1hfGGeRR0sub/V2vLZ8I6FxbF0XeA9w9x7Ab6laQontiYidWbo17oAsaS90EKVSi\n\t2pH9k1pa7k3nSHyQnZw6JHJcpX2edjH5/3M+OCbMSyeLuDDH/cpKzle+9Uc6eSYIyh\n\tSb9tbdbpWZNnA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652879628;\n\tbh=RKi8ohSP2/H4tFlJm6FL57C1QuJSK4DqfYF2nMVFae4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PRwMVjY/vmmphkZFBpBPvr4d2hT7X4lzL+GqisixBt44wdRly5TVdI8LzVNOpJhIh\n\tNbnKwxyFmO5sJb3rr1JmW1abjQrfa4qRlTxvzf1IAKaOgUBNmvSDfYLJv7k4tsUSKB\n\tnVQtIGXk0o7wt6l80lDmRRK+S+rLCJWqNd5zrWPU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"PRwMVjY/\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>","Date":"Wed, 18 May 2022 16:13:16 +0300","Message-Id":"<20220518131329.66994-6-tomi.valkeinen@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220518131329.66994-1-tomi.valkeinen@ideasonboard.com>","References":"<20220518131329.66994-1-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 05/18] py: unittests: fix selector fd\n\tuse","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"pyright complains about passing fileobj to os.read. Indeed, the\nparameter should be an int, but I guess fileobj gets automatically\nconverted. In any case, using the fd is better.\n\nSigned-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/py/unittests.py | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/test/py/unittests.py b/test/py/unittests.py\nindex cbc00ff3..9326358d 100755\n--- a/test/py/unittests.py\n+++ b/test/py/unittests.py\n@@ -262,8 +262,8 @@ class SimpleCaptureMethods(CameraTesterBase):\n         running = True\n         while running:\n             events = sel.select()\n-            for key, mask in events:\n-                os.read(key.fileobj, 8)\n+            for key, _ in events:\n+                os.read(key.fd, 8)\n \n                 ready_reqs = cm.get_ready_requests()\n \n","prefixes":["libcamera-devel","v3","05/18"]}