From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 19 Nov 2026 18:05:07 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f61.google.com (mail-lf1-f61.google.com [209.85.167.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 6AJH55oX019531 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 19 Nov 2026 18:05:05 +0100 Received: by mail-lf1-f61.google.com with SMTP id 2adb3069b0e04-5be43747161sf1241914e87.1 for ; Thu, 19 Nov 2026 09:05:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1795107900; cv=pass; d=google.com; s=arc-20260327; b=NOBc6qspPkNvMah22RtoPwNllfMqr1RUIh59ebuSuH6bDw+QKYrnuynYsJlxmqJRYX Q4r2eMWFwjMWGk5zVufAZ43x2L5Xf3c2ujVXTPQ8hEpcmYBz2UP1ClKSijm20Fw0do9X vtpE+avjGKkN3GraDp7SRigC1VZRfA+UgPpS0hDmBzRQKzev5Pw1d0bnG5dla+sdNH4m 2NkagidPtb2qHZa39Nm+Ue27N0rfDio0s10p8+XEM64qmT8Z7Dzs4g4ofj9PsuIkoxmM 27gQLxckDzHm8BRf57fwC4+A3cAXkZtouYx/7lg/8G62nX1+RrOGjJddGHpCkINYW9B5 8OvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:dkim-signature; bh=IoYWyr8SJktJgR7k+flMMm5Mb/BA7aTxNMqPygNR97w=; fh=IGrbeckMbCUCQJojdwMgur+Y+KHt2NIPW7tXmmmGpRE=; b=RtHfmN8JEW4tUdf6iWGeLihuy3PqZKggEQ+NBYQmJ8grX6D+T2138RJ7ALfYLZRL3D kD2FqTDWqYPzl15Lp4pgcLtPkAI5Mt9U6DEuAXX1HF3DnB6cIPFExdPtfEMfz9CmJROp h3bmKpZpvCF9gIaASKO+XDwFYb93xS/mzNJLCBFmFZBOP3x++I15lNkWwje6wZYb+T/Z 9pIWUH3nIzjyBMkSJzhNetIzw5uq86mwSXctwAfgrm9m+eVslDx2yrF0kCPAh55T2Zhh hrYhDn9DDdpMdpDZiiXLBBFafNuTNjzH27Dt+fPZVzFpuqOJwIArx3Phu53kaHiO1RcW YI1w==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20260707; t=1795107900; x=1795712700; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-type:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to:content-type; bh=IoYWyr8SJktJgR7k+flMMm5Mb/BA7aTxNMqPygNR97w=; b=DAnNAqlu6cjE5iShIdi/cvMY7n/r04SEKxVbBlVvQ7cayLYedQK0SezleYKscM5nEy unIcZC6ljlOrRh+uPUZul0lnh2ZoGYLKG88TsRqIl1vhohc7mdkI6B1d/nefwHSIXXpu ft2o2iKlK5baNwxMdBGfnOIPZSh2+NQRyeM5xK8oQm7qRtMcDIiF+VklK6ELeOrMC9P3 yIFMbV9RGAyRFt5kEJHi+2dRxqpbEc8Du4XDMHFV+3OWjkPDxGGwROPhSy+cAXo169Nw dg93H4XHdko4DIzQoWXz6FmGW/p4N2fcvNjVpguQb0969LrU+DpKJ7nXscFGZ/fKD5Tq wz2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795107900; x=1795712700; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:content-type :in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-beenthere:x-gm-message-state:sender :from:to:cc:subject:date:message-id:reply-to:content-type; bh=IoYWyr8SJktJgR7k+flMMm5Mb/BA7aTxNMqPygNR97w=; b=xs/1HKv5kxcxvnGUYqaYDT7ySMb+pz2DGImFQdlV32R9rD60K3hBFwqbdJc6poWFpL wt0HhIh0/UzDVw8gZlYyEutSOTASHOIXflRmfS7LGN7py16XLxGrKT3R4DQomjB0Z+fP S0P9J9Kxwo5kVCwf+rxacPPiH1xHXZm2YhBw2TodN2fQzvYKaRoWxEWinl030hINAP21 9o3JFlMsAIqUlzaeg6cwtdbbnBUkXOM3OYiCLDLop+nNYdi7vA9c+ewjHsGZMw915Jp5 VDizkymm541+MKueixzY3TpN+HQApXgiZF0M1VEt6A0CzlsKDeScGsBADnbcQOjULd+6 Dphg== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AL+hErHCy2lsy54URdXKqYZrwawgPAUZnu1He2MR38mtpts7706fG2MEtyIvxoI0SpcCXoZHvICl@ilbers.de X-Gm-Message-State: APuU4Z86gnS1ypyMNrPUYaq5YydReK8FnzFUtMIeyWM7IgVGqNbDsH9+ 1m3QuYmn1+w/hOscY+athoTfqnVZiXaafK/LHieK1kpvtxskAbTnMEFn X-Received: by 2002:a05:6512:2308:b0:5bf:dc0f:5f07 with SMTP id 2adb3069b0e04-5c1bc7bd116mr100452e87.20.1795107899640; Thu, 19 Nov 2026 09:04:59 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="ATskLdcwKHCMCsYvSn+KnxL8rY0DgEuXST9E5tnqEm/MnnNUlg==" Received: by 2002:a05:6512:2553:b0:5c1:483b:995e with SMTP id 2adb3069b0e04-5c1b14b9377ls437386e87.1.-pod-prod-06-eu; Thu, 19 Nov 2026 09:04:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFEMoG0QaTkh65Zp1hPqt0WgNeopifjnYMN65uvc4+HfO2eu5T1Ofd4BlGuRcx85ZGTopJ1xsLwsu9h@googlegroups.com X-Received: by 2002:a05:6512:6683:10b0:5c1:4ef5:30e7 with SMTP id 2adb3069b0e04-5c1bc7d159amr67372e87.32.1795107896218; Thu, 19 Nov 2026 09:04:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795107896; cv=none; d=google.com; s=arc-20260327; b=E4EmkiYkQMk6hQsCH4DgIBvaVvqHU7GvILRq1SMvFHQqRxd768iDEQpi4umrT+JCjd qg6ZSaDLxfSp7TVoo0/nbz8AZh9EDs2Me+4LMCSNREz5oFBt7GHtE5UfZPKkF9KGiYua g+Ou27532R0mWskRitAG06frrl6+ql/FTW4cK1mASOd6m6tcNrgeYJCipce4zw2xdyXb 7Nj0zOCSzTnadJBnz4IULx/3j3qoPqxifjTbYfmXGoq4I0X2TNFnkFBOkSFrtumfGjVU nLnP6vD5PQqI3X/nzXx3a4AF4fea7nHjtKCLsyt1D1Skz3Z6Fjw1BJpA38sLCOYB/S/m pnNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id; bh=8GGdpYvPNleRsBHu8t81EHFDj7Ejhe6UuIjcyJuyqe4=; fh=lOecfPjbysiGzlRBef36l/WlHWoMC0vHaB+pO6uJ+To=; b=khOiIl30AUNan1WQnSNAKGsAmqg7qiZZfZgWsO8q5tIrqOdO8GctGj0y8j6Er+ci3w qq+hQUjmpTacETspp2o2IGbMs6Oi7llepbJZlEhgzD9LDdBec0BY7V0tOtwUDIFefub4 eZArdPG5lWNYsGo7ZgVzm5l/Qr9g/LcOVzzdbP5L3Pgkx1sVWRut84GVtmj6D3rrNCyj hQIqKKMxGMviKWeUx1N/UCa2++7CkiOh+6IbuD4TGD5Qf5Ll3UU3gcYFfH+v8lU3HOZJ 8SYAcatFhIs5+dOH7CxNcv4Lud4UmccgR73edISYwVfl8thgX4Y46RjVPG72gZRI4r+I hQKQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-3ae802b33f0si28291fa.0.2026.11.19.09.04.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Nov 2026 09:04:56 -0800 (PST) Received-SPF: pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from [10.50.8.38] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 6AJH2rv3019509 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2026 18:02:54 +0100 Message-ID: <65d3c5c0-2975-43a8-b145-dc16f6bcc12b@ilbers.de> Date: Thu, 19 Nov 2026 18:02:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] isar-events: close /proc/mounts after cleanup To: Clara Kowalsky , isar-users@googlegroups.com References: <20261111144025.2516053-1-clara.kowalsky@siemens.com> Content-Language: en-US From: Zhihang Wei In-Reply-To: <20261111144025.2516053-1-clara.kowalsky@siemens.com> Content-Type: text/plain; charset="UTF-8"; format=flowed X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: wzh@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of wzh@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=wzh@ilbers.de Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: F6o7zD5gD5Bh Applied to next, thanks. Zhihang On 11/11/26 15:40, 'Clara Kowalsky' via isar-users wrote: > When running a Python unittest that exercises the BuildCompleted > handler, a warning is emitted: > > /isar/meta/classes-global/isar-events.bbclass:65: > ResourceWarning: unclosed file <_io.TextIOWrapper name='/proc/mounts' > mode='r' encoding='UTF-8'> > > The BuildCompleted handler reads /proc/mounts using open() without > closing the file. Fix this by reading the mount entries within a > context manager for deterministic file closure. > > Fixes: e596cdf97198 ("isar-events: Unhide mounts left behind") > Signed-off-by: Clara Kowalsky > --- > meta/classes-global/isar-events.bbclass | 37 +++++++++++++------------ > 1 file changed, 19 insertions(+), 18 deletions(-) > > diff --git a/meta/classes-global/isar-events.bbclass b/meta/classes-global/isar-events.bbclass > index 15bfdb99..1427bf64 100644 > --- a/meta/classes-global/isar-events.bbclass > +++ b/meta/classes-global/isar-events.bbclass > @@ -65,24 +65,25 @@ python build_completed() { > > basepath = tmpdir + '/work/' > > - for line in reversed(list(open('/proc/mounts'))): > - if basepath not in line: > - continue > - msg_line = f"{line.split()[1]} left mounted" > - # If bitbake is started manually, bb.warn and bb.error go to stdout; > - # with bb.error, bitbake additionally fails the build. Under CI, > - # bb.warn and bb.error currently go to a file. > - if fail_on_cleanup: > - bb.error(msg_line) > - else: > - msg_line += ', unmounting...' > - bb.warn(msg_line) > - try: > - subprocess.run( > - f"sudo umount {line.split()[1]}", shell=True, check=True > - ) > - except subprocess.CalledProcessError as e: > - bb.error(str(e)) > + with open('/proc/mounts') as mounts: > + for line in reversed(mounts.readlines()): > + if basepath not in line: > + continue > + msg_line = f"{line.split()[1]} left mounted" > + # If bitbake is started manually, bb.warn and bb.error go to stdout; > + # with bb.error, bitbake additionally fails the build. Under CI, > + # bb.warn and bb.error currently go to a file. > + if fail_on_cleanup: > + bb.error(msg_line) > + else: > + msg_line += ', unmounting...' > + bb.warn(msg_line) > + try: > + subprocess.run( > + f"sudo umount {line.split()[1]}", shell=True, check=True > + ) > + except subprocess.CalledProcessError as e: > + bb.error(str(e)) > > # Cleanup build UUID, the next bitbake run will generate new one > bb.persist_data.persist('BB_ISAR_UUID_DATA', d).clear() -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/65d3c5c0-2975-43a8-b145-dc16f6bcc12b%40ilbers.de.