From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.bugs Subject: bug#64406: [PATCH] Improve commands to manage Python imports Date: Sun, 9 Jul 2023 08:32:09 +0200 Message-ID: References: <874jmnbd5v.fsf@gmail.com> <87pm534puk.fsf@gmail.com> <87lefr399j.fsf@gmail.com> <87bkgl39bm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004740ae06000807c4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26444"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Augusto Stoffel , 64406@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 09 08:33:32 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qINz9-0006jA-QV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jul 2023 08:33:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qINyk-0005Om-I2; Sun, 09 Jul 2023 02:33:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qINyg-0005NZ-5h for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 02:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qINyf-0007jO-U3 for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 02:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qINyf-0007JE-Kr for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2023 02:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jul 2023 06:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64406 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64406-submit@debbugs.gnu.org id=B64406.168888434928056 (code B ref 64406); Sun, 09 Jul 2023 06:33:01 +0000 Original-Received: (at 64406) by debbugs.gnu.org; 9 Jul 2023 06:32:29 +0000 Original-Received: from localhost ([127.0.0.1]:45671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qINy9-0007IS-DO for submit@debbugs.gnu.org; Sun, 09 Jul 2023 02:32:29 -0400 Original-Received: from mail-ej1-f50.google.com ([209.85.218.50]:61519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qINy8-0007ID-Cv for 64406@debbugs.gnu.org; Sun, 09 Jul 2023 02:32:28 -0400 Original-Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-992e22c09edso372790266b.2 for <64406@debbugs.gnu.org>; Sat, 08 Jul 2023 23:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688884342; x=1691476342; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=TsB79bCDGIu84Z6zCmEW9YcMAlCwUHMuXwKa1DaiiEU=; b=mjTBNKOqSBK9IpaF0TZZIiOkVbotgfXQceHzZDCmjEITq21lST1Dhzp7/onQYFTXIg FqxvExyTJVUoVwxvsV6o8mH6NeFws+DR2GK+yplMdMfrR9KcnIycRshuzYkeeNdocnyz 6f0HVWWX5PGxtaQzW9VmiJHhbYEP28hVAGadrWhddzLxaZ3YaVjQfMMckHqSSV/WqLDH cJ4xQBEUxI+OmOp6UlDDQnKzUl3p4Ui3NsqvoBiIgxKkedJZgH2n2bNdXzDZtWv7YjDK 0j6EAwfHPXYDb4ldtZ0IJ9bAafZ6F1MYLvO91+wgiaz5SkwettsXhSmCwIzqW9OY3rqx frHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688884342; x=1691476342; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TsB79bCDGIu84Z6zCmEW9YcMAlCwUHMuXwKa1DaiiEU=; b=b29MFX1uqeocQQ0ceUp9wQS5W0qyN2xaSQiyAvAMKECi3eRmByqLWimMAr9ILyg3oX ZrgLLWmKZG3vAycnCz7kMFE2y12lYqKhLq3UAHjJ5gXKU67ucmuDxp42i8v7u4BEbI2U kjDXTMvjD9ZRG3DewGV9XzC0fNq1Mvgi4tB+++y6jfGX7ivGFbuJyR2MLVj+zKaFuTYd l2LP1TMiEZ6k7MDJSZ4xq6PRORrPMqKkjfcOzIQc5LGaEEBXo4Fv3UcCvMZPBXVBMgqY X/BNwC4ksACOPG7xOGyXU2Gr4LuPuTdMBVPlYx4E0cqZYvmCxq5lYF4iUuJ5XvjHcWMD c/kA== X-Gm-Message-State: ABy/qLaJslhgRHpeaQ2m7vJsc2ZuwoA1/S1Fx4Rf7GDFB7jIZ6OBb8us IGzeyzGJEWC3XwEydrYh8GUQzcR2TEfXTrt8ApM= X-Google-Smtp-Source: APBJJlHex46Yc85cGNUToV5rC20nkkGmB9jTJy6dIE+h9DhYcmLYRio1Ql3uhheH/rGJVEzQQ1mqiK8RQGDfRzOiVh4= X-Received: by 2002:a17:907:2948:b0:961:be96:b0e7 with SMTP id et8-20020a170907294800b00961be96b0e7mr7919947ejc.48.1688884342111; Sat, 08 Jul 2023 23:32:22 -0700 (PDT) In-Reply-To: <87bkgl39bm.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264817 Archived-At: --0000000000004740ae06000807c4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry Eli for asking such trivial question but I didn't manage to find hints on the web: Now that this bug is tagged as done, should I create a new bug for last two patches or is it possible to reopen? Le dim. 9 juil. 2023 =C3=A0 08:09, Matthias Meulien a = =C3=A9crit : > Matthias Meulien writes: > > > Augusto Stoffel writes: > >> (...) > >> This change implies that the "success" branch may run if the exit code > >> is nonzero (without knowing all the isort internals, it can't be > >> excluded that an exit code > 2 is used somewhere). I suggest instead = a > >> (pcase status ...) to construct the " (maybe... ?)" segment of the err= or > >> message. > > > > Thanks, I'll fix this. > > >> We could also take this opportunity to distinguish between random > >> exceptions happening in the script (which likely leads to exit code 1) > >> and the ModuleNotFoundError case. > > > > Good point, I'll improve this too. > > Here are two patches. > > The first one revert part of the original patch where I introduced a > useless detailed check of isort exit status itself. > > The second one relates to your remarks: It shift the custom exit status > of the Python script and make sure that an error is reported assoon as > exit code >0. > > --=20 Matthias --0000000000004740ae06000807c4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry Eli for asking such trivial question but I didn'= t manage to find hints on the web: Now that this bug is tagged as done, sho= uld I create a new bug for last two patches or is it possible to reopen?

Le=C2=A0dim. 9 juil. 2023 =C3=A0=C2=A008:09, Matthias Meulien <orontee@gmail.com> a =C3=A9crit=C2=A0:=
Matthias Meulie= n <orontee@gmail.= com> writes:

> Augusto Stoffel <arstoffel@gmail.com> writes:
>> (...)
>> This change implies that the "success" branch may run if= the exit code
>> is nonzero (without knowing all the isort internals, it can't = be
>> excluded that an exit code > 2 is used somewhere).=C2=A0 I sugg= est instead a
>> (pcase status ...) to construct the " (maybe... ?)" segm= ent of the error
>> message.
>
> Thanks, I'll fix this.

>> We could also take this opportunity to distinguish between random<= br> >> exceptions happening in the script (which likely leads to exit cod= e 1)
>> and the ModuleNotFoundError case.
>
> Good point, I'll improve this too.

Here are two patches.

The first one revert part of the original patch where I introduced a
useless detailed check of isort exit status itself.

The second one relates to your remarks: It shift the custom exit status
of the Python script and make sure that an error is reported assoon as
exit code >0.



--
Matthias --0000000000004740ae06000807c4--