From nobody Sun Feb 8 20:33:19 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC1451E520C for ; Wed, 4 Feb 2026 14:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770216629; cv=none; b=d8sEuOIwcQtqz2uFyk+9cdR8yvut5OT2WKPAEnpjsZ/Fx9oC0xXXrtBX1fC6VjW6quYhwojJZOPWkvb+yo+zQUBB12+UjuqY+f8r8pMqeGzgitoIghLEgNycH4xBeBmbB8Wuj6s+35FqvfXSQBlS4ost33V3JvNKxL5pNE+Bzgs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770216629; c=relaxed/simple; bh=fs1Eb/BwH26KDZ/aWSModwgBQ1nMC3ZPEInp7b+m5+U=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xwi61JwPNptv31bZDxpNuccepkj4qtEtizoGFmdpH0QKKNl/HrwAFyBffR8vH/sWrFLeVvZ+xaI47R3SEIkT1KG4WqfVWJjK73NYj/SMuDeCDTiI95X2+X6NaG61WHyywADEFsKUT2aLb8bWxB7/aPWH8rszYqCPipFY6Y+qsgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LhduDMjB; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LhduDMjB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770216628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ucfd3QhmcEvG5vsY6IAEUx/lDH1JMpNbncoTgo/FLFE=; b=LhduDMjB8FMb6GZOE2sOUAqCCAYk1+IrPdUb9bDIQ+cK0fftaKo9VxF9mUGVLakI7HPm/c nUn2NSWieZ1EkceYCGW1g0ZToTRGaSaAI8PZ/uGb0UWLqJhlYIdueglVlCX0uAGwvyoeMr pONwjCPC1SGUPAbu42leVjkH/KjJgXQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-619-Mo4rgb_FNiaGyf2-2vwAaQ-1; Wed, 04 Feb 2026 09:50:24 -0500 X-MC-Unique: Mo4rgb_FNiaGyf2-2vwAaQ-1 X-Mimecast-MFC-AGG-ID: Mo4rgb_FNiaGyf2-2vwAaQ_1770216623 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76E93180025F; Wed, 4 Feb 2026 14:50:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.88.140]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E8F8530001BF; Wed, 4 Feb 2026 14:50:20 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Gabriele Monaco , Nam Cao , Wander Lairson Costa , linux-trace-kernel@vger.kernel.org (open list:RUNTIME VERIFICATION (RV)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 02/20] rv/rvgen: remove bare except clauses in generator Date: Wed, 4 Feb 2026 11:42:28 -0300 Message-ID: <20260204144914.104028-3-wander@redhat.com> In-Reply-To: <20260204144914.104028-1-wander@redhat.com> References: <20260204144914.104028-1-wander@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" Remove bare except clauses from the generator module that were catching all exceptions including KeyboardInterrupt and SystemExit. This follows the same exception handling improvements made in the previous AutomataError commit and addresses PEP 8 violations. The bare except clause in __create_directory was silently catching and ignoring all errors after printing a message, which could mask serious issues. For __write_file, the bare except created a critical bug where the file variable could remain undefined if open() failed, causing a NameError when attempting to write to or close the file. These methods now let OSError propagate naturally, allowing callers to handle file system errors appropriately. This provides clearer error reporting and allows Python's exception handling to show complete stack traces with proper error types and locations. Signed-off-by: Wander Lairson Costa Reviewed-by: Nam Cao Reviewed-by: Gabriele Monaco --- tools/verification/rvgen/rvgen/generator.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tools/verification/rvgen/rvgen/generator.py b/tools/verificati= on/rvgen/rvgen/generator.py index a7bee6b1ea70c..af1662e2c20a7 100644 --- a/tools/verification/rvgen/rvgen/generator.py +++ b/tools/verification/rvgen/rvgen/generator.py @@ -198,17 +198,10 @@ obj-$(CONFIG_RV_MON_%s) +=3D monitors/%s/%s.o os.mkdir(path) except FileExistsError: return - except: - print("Fail creating the output dir: %s" % self.name) =20 def __write_file(self, file_name, content): - try: - file =3D open(file_name, 'w') - except: - print("Fail writing to file: %s" % file_name) - + file =3D open(file_name, 'w') file.write(content) - file.close() =20 def _create_file(self, file_name, content): --=20 2.52.0