[{"id":22964,"web_url":"https://patchwork.libcamera.org/comment/22964/","msgid":"<YoNaCPSZgyUq2N8a@pendragon.ideasonboard.com>","date":"2022-05-17T08:17:12","subject":"Re: [libcamera-devel] [PATCH 04/14] py: unittests: fix selector fd\n\tuse","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Mon, May 16, 2022 at 05:10:12PM +0300, Tomi Valkeinen wrote:\n> pyright complains about passing fileobj to os.read. Indeed, the\n> parameter should be an int, but I guess fileobj gets automatically\n> converted. In any case, using the fd is better.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  test/py/unittests.py | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/test/py/unittests.py b/test/py/unittests.py\n> index 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>","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 DEBADC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 08:17:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B64765656;\n\tTue, 17 May 2022 10:17:20 +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 35B3D60420\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 10:17:19 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C20FD4A8;\n\tTue, 17 May 2022 10:17:18 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652775440;\n\tbh=ajYXUGcH7rk2CRyybHTJo1yY7gSImLRYdSU4Lp1zJP0=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2r3hgrDMrIVNcl6u/mFTx//TLvS+Ejb5keByMCM/a9/aLkhSXGHqn8db+EGEyplBN\n\tlb7ejWYwlpe4Sy5E9l9lW6FJl+M3QQ5wkzc8BdxqzCa0ovBhPC9Uxxr5vEf41NlI3P\n\tWHzvBaflJJ/jsiguRHCoZJtIR+Fj5zF+AjVT0kVKXonZE3LavMIgPSRVRguVG3pNQ1\n\tw+xTGesz0mvRuuvV4TnGldQ4jUOWR65jHGSb5rhvwsxvgZRjy8duDT+foP5VOKVglf\n\tGUA60kTLDYUq1U8jdNXW1XUJXuCE0OOl4oaodGaEgv/b92EZcYVqZOOHj1V62r3CEV\n\tEGkRgmN0Sdzlg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652775439;\n\tbh=ajYXUGcH7rk2CRyybHTJo1yY7gSImLRYdSU4Lp1zJP0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Duaa6a8Kb0FdghRQLU/9OwWjJxi98sa5nYG3JQiQ+o1SXxpqEfe+Hh7Fvt6icpiGb\n\tH0Wq+2fA8v3hmYlj+QBOC6TdKX+VjV1tNphj4cadxZjlmp8eLEXKUDxXuh4K8X/9av\n\tICYlxm4UZ4fhSyZyAmm0IjlnYefpfiWzfsN0MDSo="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Duaa6a8K\"; dkim-atps=neutral","Date":"Tue, 17 May 2022 11:17:12 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YoNaCPSZgyUq2N8a@pendragon.ideasonboard.com>","References":"<20220516141022.96327-1-tomi.valkeinen@ideasonboard.com>\n\t<20220516141022.96327-5-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220516141022.96327-5-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 04/14] 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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]