From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1EEC2ECAAD3 for ; Sat, 17 Sep 2022 11:06:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A6DCC60C07; Sat, 17 Sep 2022 11:06:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A6DCC60C07 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nqYT8RNtIsVO; Sat, 17 Sep 2022 11:06:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 2DD8960B74; Sat, 17 Sep 2022 11:06:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2DD8960B74 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3672D1BF5A3 for ; Sat, 17 Sep 2022 11:06:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1183184306 for ; Sat, 17 Sep 2022 11:06:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1183184306 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pj3W7qGryDCa for ; Sat, 17 Sep 2022 11:06:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3B282842FF Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3B282842FF for ; Sat, 17 Sep 2022 11:06:11 +0000 (UTC) Received: (Authenticated sender: peter@korsgaard.com) by mail.gandi.net (Postfix) with ESMTPSA id 779B61C0003; Sat, 17 Sep 2022 11:06:09 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.94.2) (envelope-from ) id 1oZVeC-009FP4-8g; Sat, 17 Sep 2022 13:06:08 +0200 From: Peter Korsgaard To: "Yann E. MORIN" References: Date: Sat, 17 Sep 2022 13:06:08 +0200 In-Reply-To: (Yann E. MORIN's message of "Sun, 21 Aug 2022 10:41:28 +0200") Message-ID: <87pmfu2rbz.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Subject: Re: [Buildroot] [PATCH 2/2] utils/genrandconfig: dump traceback for unhandled exceptions X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: buildroot@buildroot.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" >>>>> "Yann" == Yann E MORIN writes: > In case of an unexpected error, we currently only print the exception as > an str(). For example, the recent issue with the glibc version check > only reported: > TypeError: cannot use a string pattern on a bytes-like object > That does not help in fixing the issue; the exception text is also not > usually very user-friendly either anyway. > We change the reporting to print the traceback, which in the glibc > version check mentioned above, the error is reported as: > Traceback (most recent call last): > File "./utils/genrandconfig", line 740, in > ret = gen_config(args) > File "./utils/genrandconfig", line 676, in gen_config > if not is_toolchain_usable(configfile, toolchainconfig): > File "./utils/genrandconfig", line 186, in is_toolchain_usable > if StrictVersion('2.14') > StrictVersion(glibc_version): > File "/usr/lib/python3.8/distutils/version.py", line 40, in __init__ > self.parse(vstring) > File "/usr/lib/python3.8/distutils/version.py", line 135, in parse > match = self.version_re.match(vstring) > TypeError: cannot use a string pattern on a bytes-like object > With this, the error is much easier to pinpoint (it's the last one that > is not in a system module). > Signed-off-by: Yann E. MORIN Committed to 2022.05.x and 2022.02.x, thanks. -- Bye, Peter Korsgaard _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot