From unknown Sat Jun 21 10:40:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#70440 <70440@debbugs.gnu.org> To: bug#70440 <70440@debbugs.gnu.org> Subject: Status: [PATCH] Use -P switch when calling 'python-interpreter' Reply-To: bug#70440 <70440@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:40:56 +0000 retitle 70440 [PATCH] Use -P switch when calling 'python-interpreter' reassign 70440 emacs submitter 70440 Augusto Stoffel severity 70440 normal tag 70440 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 17 14:23:58 2024 Received: (at submit) by debbugs.gnu.org; 17 Apr 2024 18:23:59 +0000 Received: from localhost ([127.0.0.1]:47371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx9wr-0003MP-41 for submit@debbugs.gnu.org; Wed, 17 Apr 2024 14:23:58 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx9wo-0003LJ-OO for submit@debbugs.gnu.org; Wed, 17 Apr 2024 14:23:56 -0400 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 1rx9wW-0006Y9-Ba for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 14:23:36 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rx9wU-00029k-Fx for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 14:23:36 -0400 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a5568bef315so29818466b.1 for ; Wed, 17 Apr 2024 11:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713378212; x=1713983012; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=9wPg521bRrBGo+8PDrIfBWcFqB6Cu0RWd5esso3cMg8=; b=GMLTjkipjzs6wKIji4VbnfCfRUepo44n4tbSyFBgQGushDMX+5+HPI3rfs1UFBCYU+ DEnGmkesDO+8Jwphm2owztl5KHCMRF36G6fGBkfJB4Me+VSC63sgF2/W0VFnh/QSo80J t9oygtZRw2+5QRgI5q1YTuNnZMVutDuMsPbKJkKev7VJpgVdKq/dGMvz1+OSwgs9k2bG wzGUPv+Ieh0vsmxAyGS8v0bHBC1IXcgn+y5LF/7eJ+l7R+CiuK4iZ48YTcWp8qxgzJDo g6heFFLn46X1F5fomoh2ckBT2AvYHrQmD2WFnmASJef/gplfUzLwXCZCbMy+0iG2m1k0 m5Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713378212; x=1713983012; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9wPg521bRrBGo+8PDrIfBWcFqB6Cu0RWd5esso3cMg8=; b=dz5TlThs+5+PGXZt0S2Xvi7rLEkNP4wHYBA12+5+xagArEPZO14C6fnUcYLSPA8LUO yMrNMWQIAE1P+YCUkKOgmuZYnPXn6lvz+RQ46pFlDeH1GzD71T1VSC8h2jdaPcssAw6O YqWspNafQ4ei0IB1idPgYxyioUnAK5YMHQDIof9mbwurcEaFV+i58I5UZppOYUlLN5tD rpdcY7CLdQ3cIgQC9yl1un6dtxCYJd8GI9hMIExobhKBQlUdPSUb7n8MZccd0PWG2Z5K 9tUOXLrDY5A9Xe3DRnv1viupLa6hFZ5JsGnYMWy5r+L7SLyNg02YG+xpqzxQ0YoZuhj6 ifUA== X-Gm-Message-State: AOJu0YwT0Nh/lSCNSOodAEAqxYxDhhKwKTGtTRjNL9bucqHyZfcGjZDF UZ2KigPBMePk0gztLM+ovoZRF/K20VtpMX0zMijzwA5KoCjUBy0d3nGp2g== X-Google-Smtp-Source: AGHT+IGiV7S7bhMFJZAxFdhc4iAsrcgcSoNmSzN83SHaGwWHDdWsPNzO7xq/T5ADBPpPZhAzMyumVg== X-Received: by 2002:a17:907:7256:b0:a55:622c:7e with SMTP id ds22-20020a170907725600b00a55622c007emr1661365ejc.36.1713378212272; Wed, 17 Apr 2024 11:23:32 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id cx10-20020a170906c80a00b00a51b5282837sm8437472ejb.15.2024.04.17.11.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 11:23:31 -0700 (PDT) From: Augusto Stoffel To: bug-gnu-emacs@gnu.org Subject: [PATCH] Use -P switch when calling 'python-interpreter' Date: Wed, 17 Apr 2024 20:23:30 +0200 Message-ID: <87h6fzj1b1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=arstoffel@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Tags: patch The attachment should be self-explanatory, otherwise let me know. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Use-P-switch-when-calling-python-interpreter.patch >From 04db8a3fbb29f497fdc728f4413aea162650b30b Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Wed, 17 Apr 2024 20:17:22 +0200 Subject: [PATCH] Use -P switch when calling 'python-interpreter' This excludes the current directory from Python's module load path, which can be unsafe. * lisp/progmodes/python.el (python--list-imports): Use -P switch (python--do-isort): Use -P switch (python-fix-imports): Use -P switch --- lisp/progmodes/python.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 85279d3e84b..180a8357aad 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6805,7 +6805,7 @@ python--list-imports (append (split-string-shell-command python-interpreter-args) - `("-c" ,python--list-imports) + `("-Pc" ,python--list-imports) (list (or name ""))))) (with-current-buffer buffer (apply #'call-process @@ -6814,7 +6814,7 @@ python--list-imports (append (split-string-shell-command python-interpreter-args) - `("-c" ,python--list-imports) + `("-Pc" ,python--list-imports) (list (or name "")) (mapcar #'file-local-name source)))))) lines) @@ -6862,7 +6862,7 @@ python--do-isort (append (split-string-shell-command python-interpreter-args) - '("-m" "isort" "-") + '("-Pm" "isort" "-") args))) (tick (buffer-chars-modified-tick))) (unless (eq 0 status) @@ -6940,7 +6940,7 @@ python-fix-imports (append (split-string-shell-command python-interpreter-args) - '("-m" "pyflakes")))) + '("-Pm" "pyflakes")))) (goto-char (point-min)) (when (looking-at-p ".* No module named pyflakes$") (error "%s couldn't find pyflakes" python-interpreter)) -- 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 17 15:14:13 2024 Received: (at 70440) by debbugs.gnu.org; 17 Apr 2024 19:14:13 +0000 Received: from localhost ([127.0.0.1]:47644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxAjV-00014K-8W for submit@debbugs.gnu.org; Wed, 17 Apr 2024 15:14:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxAjT-00013w-8Q for 70440@debbugs.gnu.org; Wed, 17 Apr 2024 15:14:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxAjA-00049d-RO; Wed, 17 Apr 2024 15:13:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=utEHf2Ajv1+ezhmTXjxjEix8qHx0/C5SqwOLAGocPkg=; b=XHDyvaZlr/64 BTWPuCV203Rc1KTaOwbH+4pHwWu7H3VorKzvETg4tjgn3pQ25TqOxJPngbhfiGj12pzz7+j/yTr91 6+nLmuK9Az+8K/O4/anAIUKPq+z3loGsV7wdx47ckm9ZeI52EV0jRS4rbr/eNf6TCwSLqBRUFiZcF C2hpopVLUuh2MV+Z5zBggTYaRevyd7LCRvp9qvxQWaGD8oYs49jlXpelSnltbPYjasoMBgNyULwj/ EFKZpkkXcLrS77XrRZ7xhOHdAYrFfJodbJXCx2KMNQgHxFhXDVZI1b+dVHYdhFr4DbykpPW2yrfxA 9YxC8L28Jsl9DWqUbcXAAg==; Date: Wed, 17 Apr 2024 22:13:49 +0300 Message-Id: <861q73hkeq.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel , kobarity In-Reply-To: <87h6fzj1b1.fsf@gmail.com> (message from Augusto Stoffel on Wed, 17 Apr 2024 20:23:30 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Date: Wed, 17 Apr 2024 20:23:30 +0200 > > The attachment should be self-explanatory, otherwise let me know. > > > >From 04db8a3fbb29f497fdc728f4413aea162650b30b Mon Sep 17 00:00:00 2001 > From: Augusto Stoffel > Date: Wed, 17 Apr 2024 20:17:22 +0200 > Subject: [PATCH] Use -P switch when calling 'python-interpreter' > > This excludes the current directory from Python's module load path, > which can be unsafe. > > * lisp/progmodes/python.el (python--list-imports): Use -P switch > (python--do-isort): Use -P switch > (python-fix-imports): Use -P switch > --- > lisp/progmodes/python.el | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index 85279d3e84b..180a8357aad 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -6805,7 +6805,7 @@ python--list-imports > (append > (split-string-shell-command > python-interpreter-args) > - `("-c" ,python--list-imports) > + `("-Pc" ,python--list-imports) > (list (or name ""))))) > (with-current-buffer buffer > (apply #'call-process > @@ -6814,7 +6814,7 @@ python--list-imports > (append > (split-string-shell-command > python-interpreter-args) > - `("-c" ,python--list-imports) > + `("-Pc" ,python--list-imports) > (list (or name "")) > (mapcar #'file-local-name source)))))) > lines) > @@ -6862,7 +6862,7 @@ python--do-isort > (append > (split-string-shell-command > python-interpreter-args) > - '("-m" "isort" "-") > + '("-Pm" "isort" "-") > args))) > (tick (buffer-chars-modified-tick))) > (unless (eq 0 status) > @@ -6940,7 +6940,7 @@ python-fix-imports > (append > (split-string-shell-command > python-interpreter-args) > - '("-m" "pyflakes")))) > + '("-Pm" "pyflakes")))) > (goto-char (point-min)) > (when (looking-at-p ".* No module named pyflakes$") > (error "%s couldn't find pyflakes" python-interpreter)) > -- > 2.44.0 > Thanks. kobarity, any comments? From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 11:26:43 2024 Received: (at 70440) by debbugs.gnu.org; 18 Apr 2024 15:26:44 +0000 Received: from localhost ([127.0.0.1]:53030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxTet-0007iT-4i for submit@debbugs.gnu.org; Thu, 18 Apr 2024 11:26:43 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:52439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxTeq-0007hc-LU for 70440@debbugs.gnu.org; Thu, 18 Apr 2024 11:26:41 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6ed054f282aso906768b3a.0 for <70440@debbugs.gnu.org>; Thu, 18 Apr 2024 08:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713453981; x=1714058781; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=fQPV5YwkqxQCplC3b2R/AGfe9IP0waz5ptaCzJs46VM=; b=CNQHYsIR7w0QXH1TQWjmadt8DevWhLxqk7i77BZiNwTYs8A0NX9uWB1bpl/42APuBB 4qwdZ8Q4o4LiOlpajXaZyB/sFWohzOdZiPWI/JgRID7e7Wu3rS+RuBXeWJR5MBg9PHNN +qgS0AEUakVft5TLmzDbqAN8p32n7SlzG/Tak4ftToalJD6DhZTJlU09BO5VBemPVZ2m Pg6K4qD6CB/RLxWjLVwgndt7f44al3RNvzfF0Frzda2V0VJ6LO9s7SOBeVNKCwjoQyyx 2dKWvVy1Tc571fKeWo7hLPqEG4pIPzC1ZfQ+K5npl/E0j1rk0t7oUnA2gxr6V8ez5h0V twEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713453981; x=1714058781; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fQPV5YwkqxQCplC3b2R/AGfe9IP0waz5ptaCzJs46VM=; b=pqrwHxJE0xHUGMJ2ld9MlBlMtWiebzNfz56/K9wSaBS5XqCsn/Ak1fNZtjGPhY4GSn S+0cGwnduLZs2EcrVferrOIsB95IwxpG2xF7mIA+k0/Lr1Whn1dRbN2gTZkiMYK0ZHiW XuLySVv6m8hIhfG9r+f9iPRvVwAf93WeSY+hyUyzOQWOT2G6sFQ+ieGCyZctadouwyJ0 5KenfjzEdXn5wEuHjYDEBU7X0sFVXgrZCnp7l5w6FpxApuUs7OHbZQoDf8JPrMe2uDzk 5MBtCdcJe7KuPAPgmewuVpI4VhY2QbMEIMCADZukjgSyNipuTBHZ8koEygWt8wxAkLX2 UxEg== X-Gm-Message-State: AOJu0YyYqobMwtC2MfIr7XBeiu0P0zfyQUfNVAzwP2mVKgpFHqnTvcV0 UzvP1VtuEvhAyfbn4i+wRZo8MDCRmByiXicuOivzAovRpI/zXsYp X-Google-Smtp-Source: AGHT+IHfI7qyPVs6EuoCm7oxGwTdHWFMzsJ3Cw66aznRcYTIUgL84ru9MhLlzI/x3N45VDDiLt+qkA== X-Received: by 2002:a05:6a21:3e01:b0:1aa:8442:21ba with SMTP id bk1-20020a056a213e0100b001aa844221bamr3509248pzc.21.1713453981173; Thu, 18 Apr 2024 08:26:21 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id h15-20020a170902680f00b001e89e7b2b74sm850061plk.235.2024.04.18.08.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 08:26:20 -0700 (PDT) Date: Fri, 19 Apr 2024 00:25:46 +0900 Message-ID: From: kobarity To: Augusto Stoffel , Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <861q73hkeq.fsf@gnu.org> References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii wrote: > > From: Augusto Stoffel > > Date: Wed, 17 Apr 2024 20:23:30 +0200 > > > > The attachment should be self-explanatory, otherwise let me know. > > > > > > >From 04db8a3fbb29f497fdc728f4413aea162650b30b Mon Sep 17 00:00:00 2001 > > From: Augusto Stoffel > > Date: Wed, 17 Apr 2024 20:17:22 +0200 > > Subject: [PATCH] Use -P switch when calling 'python-interpreter' > > > > This excludes the current directory from Python's module load path, > > which can be unsafe. > > > > * lisp/progmodes/python.el (python--list-imports): Use -P switch > > (python--do-isort): Use -P switch > > (python-fix-imports): Use -P switch > > --- > > lisp/progmodes/python.el | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > > index 85279d3e84b..180a8357aad 100644 > > --- a/lisp/progmodes/python.el > > +++ b/lisp/progmodes/python.el > > @@ -6805,7 +6805,7 @@ python--list-imports > > (append > > (split-string-shell-command > > python-interpreter-args) > > - `("-c" ,python--list-imports) > > + `("-Pc" ,python--list-imports) > > (list (or name ""))))) > > (with-current-buffer buffer > > (apply #'call-process > > @@ -6814,7 +6814,7 @@ python--list-imports > > (append > > (split-string-shell-command > > python-interpreter-args) > > - `("-c" ,python--list-imports) > > + `("-Pc" ,python--list-imports) > > (list (or name "")) > > (mapcar #'file-local-name source)))))) > > lines) > > @@ -6862,7 +6862,7 @@ python--do-isort > > (append > > (split-string-shell-command > > python-interpreter-args) > > - '("-m" "isort" "-") > > + '("-Pm" "isort" "-") > > args))) > > (tick (buffer-chars-modified-tick))) > > (unless (eq 0 status) > > @@ -6940,7 +6940,7 @@ python-fix-imports > > (append > > (split-string-shell-command > > python-interpreter-args) > > - '("-m" "pyflakes")))) > > + '("-Pm" "pyflakes")))) > > (goto-char (point-min)) > > (when (looking-at-p ".* No module named pyflakes$") > > (error "%s couldn't find pyflakes" python-interpreter)) > > -- > > 2.44.0 > > > > Thanks. > > kobarity, any comments? The -P switch is new, introduced in CPython 3.11, so I don't think it can be added unconditionally. Furthermore, `python-interpreter' may not be CPython. Isn't it enough to customize `python-interpreter-args'? From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 11:52:44 2024 Received: (at 70440) by debbugs.gnu.org; 18 Apr 2024 15:52:44 +0000 Received: from localhost ([127.0.0.1]:53168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxU44-0002K8-8A for submit@debbugs.gnu.org; Thu, 18 Apr 2024 11:52:44 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:54351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxU43-0002K2-1N for 70440@debbugs.gnu.org; Thu, 18 Apr 2024 11:52:43 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a555faf94fcso113910366b.0 for <70440@debbugs.gnu.org>; Thu, 18 Apr 2024 08:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713455543; x=1714060343; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=lLzMxAWR3H5mCnNMxEyc0zRQyvytda0uZnh2OR3c+CE=; b=abeOw6Qi13+qQBz/ojvAegnXZAs+FBSAwoAyCkBfGPN/LAEYyIYK4G8PMXL9SeVosr eI9oDybd/DPx0o0S0sFV399vuARRjUDPR3rGT1bwHK4NkutJEmK3xGLRTSt3HvLYy3/U 4wDSfm2bqKaUmaxWfMOpYEMg6BigaOkXOdv/b3LlKuSmsCwfbB9Pgod7qs1WmJoMOo/v i9Pw+6hOCc9UaEzLogzSRE1Dnl4sQjG0a6MHztKEbWYkLQRMdB/vHmotJAYv0OUJM0I2 Fl/zuCRKo4WB0cchKRAvzSBHsWw3dMKClIyePfk38o6yitWq9f7ju1qDKPXCtYK1JOcG 3tGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713455543; x=1714060343; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lLzMxAWR3H5mCnNMxEyc0zRQyvytda0uZnh2OR3c+CE=; b=XYn4bVxRkJLd9TV4gumh9OXp80x3oJS6lXG7D8NIHAd2wKtwHp6EBNjbC+KzUx2C42 Gx/2CLpkYy/J95Z8vxYgWY3qKLmfVvADe3g8XKdQYUTml8qrCSBsCzI+FM8Ohne1sOs2 YQY3ERbkyARhDCNDENYWEfSZVSRZoTny5flMUTm/5K9mGicp0zlLN8tPibFc+0e5Josq EzQzCEi8xrMvWPKeZqsC0usL9hgROu2UPSXJJX6pLCmjyzcHszmch7yRMc93uiHXCWmt Tpkq7kyr2EygCcs54WUjZE2QUps06p7v7ZO7qLSpmrVYHOUwCK3Gh9UJbQ3EkUYjv2sK Cmfw== X-Forwarded-Encrypted: i=1; AJvYcCU4E0ijytzRDBxI1mG7kuoMoycT2WtFAy31rhDvenCFpvZ4kfzicfcUqdb/GRqZ9pf0ClqXmsmLC8G/aTIYSQZFsB3q9WI= X-Gm-Message-State: AOJu0YzcayNRme04FMUfYwqzCWiIS+SoSBdYgUI79OVJPBx3g0Eq6O7I 0DX7EpBDWk04elpPUCNBKLiAq5Ma7ghHlIVrgMLkn5+lq0umpPL3gtKJ1duT X-Google-Smtp-Source: AGHT+IHRZTnA8tDdSdP+Zay7SMEpWr+/1FqwLkh6mw33g3DJuwPU7bbwDHQ6Wk1hhZbziK+lgksoGw== X-Received: by 2002:a17:906:4c54:b0:a46:65fd:969d with SMTP id d20-20020a1709064c5400b00a4665fd969dmr1927099ejw.71.1713455542935; Thu, 18 Apr 2024 08:52:22 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id u14-20020a170906b10e00b00a5534758ef7sm1070910ejy.148.2024.04.18.08.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 08:52:22 -0700 (PDT) From: Augusto Stoffel To: kobarity Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: (kobarity@gmail.com's message of "Fri, 19 Apr 2024 00:25:46 +0900") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> Date: Thu, 18 Apr 2024 17:52:21 +0200 Message-ID: <87sezihdmy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > The -P switch is new, introduced in CPython 3.11, so I don't think it > can be added unconditionally. Furthermore, `python-interpreter' may > not be CPython. Isn't it enough to customize > `python-interpreter-args'? Ah, too bad. So let's send that option via environment variables. I'll make a new patch when I get the chance. This patch is a quite important fix and shouldn't be left to a customization. Without it, you need to trust the .py files in the current directory. Moreover any name clashes with the built-in library module names can crash the commands (just happened to me). From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 11:58:22 2024 Received: (at 70440) by debbugs.gnu.org; 18 Apr 2024 15:58:22 +0000 Received: from localhost ([127.0.0.1]:53194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxU9U-00033c-Vu for submit@debbugs.gnu.org; Thu, 18 Apr 2024 11:58:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxU9S-00032M-0f for 70440@debbugs.gnu.org; Thu, 18 Apr 2024 11:58:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxU93-0004Iy-SG; Thu, 18 Apr 2024 11:57:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XCt6Ig6Fxmw9/YarWoy8uctgR0Fsr+5h3q/oZPtdN8c=; b=qcYkAMU2jE4N iqnp5tDSb63y1n23r5bZC+PULs4e1B9htB1oqT0lkXcLIB1kL0y/QHiuZdAhdcANpLwrbTIs+BTIb AJl7HErBa+dyH+imPQOaBgpSPql4qTkJW8QbLvDBbwUDlpgRgIz3QzZbP4z6Y+FlwurVENImLSwxJ 4qrgZW1vXWYaohGzcisLoFT0OiyI6AmR6pcb7tav+Dty6zwPfjCL1wPtNQWOHTWDZYRX5OKUQATN4 LB3i6KW9Zhmrs6qpr1pi/2kgEpFO90NcIn/MRrL8cmAeUeVMZtX4hIdGxXcDZ+md+bIC8aSOCKGMv x4P/2ArYEA+fz5l1mCwVXQ==; Date: Thu, 18 Apr 2024 18:57:38 +0300 Message-Id: <86wmoud5ot.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87sezihdmy.fsf@gmail.com> (message from Augusto Stoffel on Thu, 18 Apr 2024 17:52:21 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87sezihdmy.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: Eli Zaretskii , 70440@debbugs.gnu.org > Date: Thu, 18 Apr 2024 17:52:21 +0200 > > On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > > > The -P switch is new, introduced in CPython 3.11, so I don't think it > > can be added unconditionally. Furthermore, `python-interpreter' may > > not be CPython. Isn't it enough to customize > > `python-interpreter-args'? > > Ah, too bad. So let's send that option via environment variables. I'll > make a new patch when I get the chance. Maybe we should discuss this before you sit down to write and text the code. Pushing things into the environment has its downsides: those environment variables then affect all the subordinate processes, including their children, grandchildren etc. This is not always wanted. One alternative to environment variables would be detecting whether -P is supported before the first time we invoke Python. We do similar stuff for Grep and other programs we invoke. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 12:02:59 2024 Received: (at 70440) by debbugs.gnu.org; 18 Apr 2024 16:02:59 +0000 Received: from localhost ([127.0.0.1]:53215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxUDz-0003f3-2L for submit@debbugs.gnu.org; Thu, 18 Apr 2024 12:02:59 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:60545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxUDv-0003di-V3 for 70440@debbugs.gnu.org; Thu, 18 Apr 2024 12:02:57 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a51addddbd4so101490166b.0 for <70440@debbugs.gnu.org>; Thu, 18 Apr 2024 09:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713456156; x=1714060956; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ctqcodJ8its27RyEal7tFLcvWxoAPMKHP0uVerDjJz8=; b=Nm1XqX6MGcPK8es7PPd8Q0Omf/SB8ZAiDe3BxltXo1FPrVg9IMlgwPAI0AI5KyUrHp r5rsnQTqAsDvOPTwsOVzPbqh5EOwrkkuuPym4SNQpkKUvzUnMUkPb4WCRe2VgBaI/mqs Fk7/8U8NgpSd+L8IMbOFKtDBXQ+bmQe1UfSL8mvIBzmwsT8Jwt58VOEFt788TMcCWgQN xlpjmp7LyfujmCY/Xvc2lHLhzaURmfV2xBcfPlXT31qNGuJCf8hRCQ5dQcmTVRP09tXI ybNtK50lnHMzyDBF/oh1ZDYbs9EYyQ0QgIN9pAwETFWpf8fL5eQrK1N+FdlFnpDa2Aek bUDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713456156; x=1714060956; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ctqcodJ8its27RyEal7tFLcvWxoAPMKHP0uVerDjJz8=; b=JInVxezkouXLdrRbTreub3kvjjiQ9TKjFuqWNR1rtmTZB/SVPjVrcBSxjLweI8ZYog YuKLcYq2CrBIhWez3Yqe/p/jipg+nMWtvJKezhPsMBh7qeap02uDc7/ouBhFf5jB7o9A Hq+zpDvxWww656BshauMzzS1kWjubtlTc1rrKguyNKMjQx2B+jDYFFXJL2dhoQcYm2gE GFsFRGo4yKsHucP858DqCxYJBr05WyeKV2APi+yYtKB3v/SYBTQGGx3B5FE/jMQyA2G8 NGXEH2rgQIeYdqj2Fski0djMxyOpbKyutQ57pOWTO3E+S4I2XLYvcpNsR6T0l9zZTBtG qMlg== X-Forwarded-Encrypted: i=1; AJvYcCWNY+0Q/St5ly5bl4oP0zYIRRjYWGZFaj6OrZtOqHYMuJH+4hfzEqkf8uZGUbPLMRgkrNaecOGG7P/GafwwbqiYi0eshPg= X-Gm-Message-State: AOJu0YxCHSQAxVtsWJ76EVp7/mEmsLZtHMxiHGBT7pRwm3IpNge2qcjF JF1Jfr5/gMbfDSA0wzeyyDhEs7eDpYsJ/nkHc+5297wL9BH0ZeHWtIKmqbDg X-Google-Smtp-Source: AGHT+IFX98llqWR2aHN/QIECFguahlwvvnu67Uubp8oro9yO6/fgHQyACwL6egngyAmvzryi6g7Spg== X-Received: by 2002:a17:906:c08b:b0:a55:6d0a:74a2 with SMTP id f11-20020a170906c08b00b00a556d0a74a2mr1711163ejz.40.1713456156088; Thu, 18 Apr 2024 09:02:36 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id w25-20020a17090633d900b00a51cdde5d9bsm1067800eja.225.2024.04.18.09.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 09:02:35 -0700 (PDT) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <86wmoud5ot.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Apr 2024 18:57:38 +0300") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87sezihdmy.fsf@gmail.com> <86wmoud5ot.fsf@gnu.org> Date: Thu, 18 Apr 2024 18:02:34 +0200 Message-ID: <87o7a6hd5x.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, 18 Apr 2024 at 18:57, Eli Zaretskii wrote: >> From: Augusto Stoffel >> Cc: Eli Zaretskii , 70440@debbugs.gnu.org >> Date: Thu, 18 Apr 2024 17:52:21 +0200 >> >> On Fri, 19 Apr 2024 at 00:25, kobarity wrote: >> >> > The -P switch is new, introduced in CPython 3.11, so I don't think it >> > can be added unconditionally. Furthermore, `python-interpreter' may >> > not be CPython. Isn't it enough to customize >> > `python-interpreter-args'? >> >> Ah, too bad. So let's send that option via environment variables. I'll >> make a new patch when I get the chance. > > Maybe we should discuss this before you sit down to write and text the > code. Pushing things into the environment has its downsides: those > environment variables then affect all the subordinate processes, > including their children, grandchildren etc. This is not always > wanted. In this case we would just let-bind the env variable for this specific subprocess call only. It's no different than passing a command-line switch. > One alternative to environment variables would be detecting whether -P > is supported before the first time we invoke Python. We do similar > stuff for Grep and other programs we invoke. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 18 12:14:15 2024 Received: (at 70440) by debbugs.gnu.org; 18 Apr 2024 16:14:15 +0000 Received: from localhost ([127.0.0.1]:53269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxUOt-0004wY-15 for submit@debbugs.gnu.org; Thu, 18 Apr 2024 12:14:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxUOq-0004vg-Im for 70440@debbugs.gnu.org; Thu, 18 Apr 2024 12:14:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxUOX-0007A4-J0; Thu, 18 Apr 2024 12:13:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B3lLtzdHqXChY8tZz93vHNgjah8vuofqdjYVPGp2HB0=; b=IurQR1E4qw2q etAOk7iGHz86ibJIicw9TWkf1tijRAZrQ6P02VIDUHA0pJj9dIGAQM5fCB2Ut8Lh9MCyj3phnMugu P0KKlvjglGotCH/LX3PWYBy5ePUwAcQ/feHcbvYKb8BOy+96COBfNcDmSYvlVTgRuFu5m3kgpBvNR dhEdgwg+/sKavUegCK62yz1XH9HfSvUe2Rzfn3ba2gaqnGsq/xnJ+AIlhVpycMEKrQBmuQB6HB5Hi /2PcWPEnqtJO5uu33nmh0jXUMkX5jSpfPOM05HJ4jr1/vXZ3ldUks7mBPkWSE6TcA5/D1zG6l96Nk Nj1+VscsiW10rFAsqmSBbw==; Date: Thu, 18 Apr 2024 19:13:47 +0300 Message-Id: <86v84ed4xw.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87o7a6hd5x.fsf@gmail.com> (message from Augusto Stoffel on Thu, 18 Apr 2024 18:02:34 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87sezihdmy.fsf@gmail.com> <86wmoud5ot.fsf@gnu.org> <87o7a6hd5x.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: kobarity@gmail.com, 70440@debbugs.gnu.org > Date: Thu, 18 Apr 2024 18:02:34 +0200 > > On Thu, 18 Apr 2024 at 18:57, Eli Zaretskii wrote: > > >> From: Augusto Stoffel > >> Cc: Eli Zaretskii , 70440@debbugs.gnu.org > >> Date: Thu, 18 Apr 2024 17:52:21 +0200 > >> > >> On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > >> > >> > The -P switch is new, introduced in CPython 3.11, so I don't think it > >> > can be added unconditionally. Furthermore, `python-interpreter' may > >> > not be CPython. Isn't it enough to customize > >> > `python-interpreter-args'? > >> > >> Ah, too bad. So let's send that option via environment variables. I'll > >> make a new patch when I get the chance. > > > > Maybe we should discuss this before you sit down to write and text the > > code. Pushing things into the environment has its downsides: those > > environment variables then affect all the subordinate processes, > > including their children, grandchildren etc. This is not always > > wanted. > > In this case we would just let-bind the env variable for this specific > subprocess call only. It's no different than passing a command-line > switch. Don't then the child processes of that python subprocess inherit the same variable in their environments? That's what I meant by what I wrote above: all of the descendants of our sub-process will inherit the variable. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 02:09:10 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 06:09:10 +0000 Received: from localhost ([127.0.0.1]:56949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxhQs-000478-83 for submit@debbugs.gnu.org; Fri, 19 Apr 2024 02:09:10 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:57460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxhQp-000470-TR for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 02:09:08 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-56e56ee8d5cso2361748a12.2 for <70440@debbugs.gnu.org>; Thu, 18 Apr 2024 23:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713506927; x=1714111727; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xFOVhqc674409pHr1o0cS+LI5DzBexhTPKaHlTUPI80=; b=bJOfAK/KPVadAyQYTPshyjPl7T6z4Od1OlqSOk0kW58wBt8pLWDpU63Q0D1YUNZcTC qsSVvsEJubTs558SjTDRHHYb9TqANkKZeQqz3dyEsnYJpu6lAl6CaozCmgOrQPvWNriY IEPdbVhP1kuBUOfAKTi1U9QArQeuYi/XNzqgSGFUDySf+N9Pd556FvbI6L+Sm9F4hTsP TMZSLohDq3uCH6ZH9DBLTpaw8bceTdhatw9llk62WxBbHmPxmniZiWN3jRsGzvf7RcUc 8gn+RIsFhg8HTM1Ltv043tJt/TEE/PwErmhnPYx5bKbth1gD8teIeDvclgecO186NgYg f/uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713506927; x=1714111727; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xFOVhqc674409pHr1o0cS+LI5DzBexhTPKaHlTUPI80=; b=fDpyYdlWaoOpDWWcYb6V5xp4vqm9qzWWvrS7hHbvM8pZudyj33HyLebzduzVKyjZPg 7wgUyI92IeuUK2oTkmYN/zvYKuqrPzT8tsXytr3RwJQJI839G7Jp3nuPByOb+hrCK5wT In4Bi4kAQ2yonjpwyGKdI1eSO5pV1suvwUmtIsjwztFzL0YvEkYS/lcHhiA45MboYQ7V vcCTBRxyUejcYt6Uszk+00f5U5ohl1cy/AuGxr15roGzk8d0zLNNDgnTLoOhUR7EYwZQ Kb5QmpBgBMr4puppBXm00Nc5VetP3Ee2JEG2z3X4rXltPy0jkxOr3uZbdN+w398IsAzd uLwg== X-Forwarded-Encrypted: i=1; AJvYcCUc7q9jGvhSlDz5MJNufsE6BTGiTHWu7oSmQm5TNbzEP/AuGMPQ4AMT2FF39D6oOjDBeUpgbeb7mwnYyTF6Ql7v/wNXoUM= X-Gm-Message-State: AOJu0YwpBpsOnokuMQhc+AHBvp5X2GS59cr3sxhcgvmAZOSroyYjx9mZ oi/rQba6bkLqn8AGlos5w5azhyMdDChQTB44hnDNmEG6jWOyaRzkfkaFpw== X-Google-Smtp-Source: AGHT+IGIoxD4/XeGx4KAzBCKmQDu06Q5PtcU5jh+TNlEFwN40LUhYABedcSzFdaoZkBm7U3eNCBpqA== X-Received: by 2002:a17:906:f255:b0:a52:2284:d97f with SMTP id gy21-20020a170906f25500b00a522284d97fmr744593ejb.25.1713506927113; Thu, 18 Apr 2024 23:08:47 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id 25-20020a170906311900b00a52331a9bdasm1753855ejx.48.2024.04.18.23.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 23:08:46 -0700 (PDT) From: Augusto Stoffel To: kobarity Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: (kobarity@gmail.com's message of "Fri, 19 Apr 2024 00:25:46 +0900") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> Date: Fri, 19 Apr 2024 08:08:43 +0200 Message-ID: <87jzkthok4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > The -P switch is new, introduced in CPython 3.11, so I don't think it > can be added unconditionally. Furthermore, `python-interpreter' may > not be CPython. Isn't it enough to customize > `python-interpreter-args'? After sleeping on this, I recommend using -P anyway and simply failing if the installed Python is too old. The reason is that this has a security implication, similar to the recent Org mode Latex preview situation. Without -P the user is tacitly trusting the contents of the current directory. By tricking an user into downloading a malicious file with an intentional name clash (say via git pull), arbitrary code could in principle be executed on the user's machine. The -P switch completely removes this possibility, and conversely, without -P there seems to be no reasonable way to make Python safe. I've attached a new patch that informs the user why the commands failed when Python is too old, which is good enough in my opinion. Note also that this change only affects the Python import management commands, which is a very handy but by no means essential feature. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-P-switch-when-calling-python-interpreter.patch >From 2cca02440069a31546eff04c8cd6c00b171a85a2 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Wed, 17 Apr 2024 20:17:22 +0200 Subject: [PATCH] Use -P switch when calling 'python-interpreter' This excludes the current directory from Python's module load path, which can be unsafe. * lisp/progmodes/python.el (python--list-imports, python--do-isort), (python-fix-imports): Use -P switch (python--list-imports-check-status): Warn about old Python versions missing the -P switch. --- lisp/progmodes/python.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 85279d3e84b..304aa2d9d6e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6744,9 +6744,9 @@ python--list-imports try: from isort import find_imports_in_stream, find_imports_in_paths except ModuleNotFoundError: - exit(2) -except ImportError: exit(3) +except ImportError: + exit(4) query, files, result = argv[1] or None, argv[2:], {} @@ -6781,8 +6781,9 @@ python--list-imports-check-status (unless (eq 0 status) (let* ((details (cond - ((eq 2 status) " (maybe isort is missing?)") - ((eq 3 status) " (maybe isort version is older than 5.7.0?)") + ((eq 2 status) " (maybe Python version is older than 3.11?)") + ((eq 3 status) " (maybe isort is missing?)") + ((eq 4 status) " (maybe isort version is older than 5.7.0?)") (t ""))) (msg (concat "%s exited with status %s" details))) @@ -6805,7 +6806,7 @@ python--list-imports (append (split-string-shell-command python-interpreter-args) - `("-c" ,python--list-imports) + `("-Pc" ,python--list-imports) (list (or name ""))))) (with-current-buffer buffer (apply #'call-process @@ -6814,7 +6815,7 @@ python--list-imports (append (split-string-shell-command python-interpreter-args) - `("-c" ,python--list-imports) + `("-Pc" ,python--list-imports) (list (or name "")) (mapcar #'file-local-name source)))))) lines) @@ -6862,7 +6863,7 @@ python--do-isort (append (split-string-shell-command python-interpreter-args) - '("-m" "isort" "-") + '("-Pm" "isort" "-") args))) (tick (buffer-chars-modified-tick))) (unless (eq 0 status) @@ -6940,7 +6941,7 @@ python-fix-imports (append (split-string-shell-command python-interpreter-args) - '("-m" "pyflakes")))) + '("-Pm" "pyflakes")))) (goto-char (point-min)) (when (looking-at-p ".* No module named pyflakes$") (error "%s couldn't find pyflakes" python-interpreter)) -- 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 03:15:32 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 07:15:32 +0000 Received: from localhost ([127.0.0.1]:57256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxiT5-00069N-K2 for submit@debbugs.gnu.org; Fri, 19 Apr 2024 03:15:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxiT3-0005lr-5g for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 03:15:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxiSj-0006jd-NZ; Fri, 19 Apr 2024 03:15:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ZcNOgNikurQxYN5cNJeIJfgVy0FAdu3NFxYZmv+7ACQ=; b=dgYaAXdhPPR7 l5bNHz+a6us+wEYlMyekvP6TPM2CnV4TYwMm2HnRHep9ZxtyOqg888ok/qsgl1piZZCTGyMrELJiR DZELPFj2glyAFrRrKix7EBxw7pp6W8JFJgZ4EB4T2QQDBx10b49h6TN4OPkfSTcpysLTdw6EYX0BJ +XgRwaUrkcZ9wjfbojcHriZrZaPPudJVEmVNqRyi6U97/nWswhEQYz1s/6y6v5tQBY/Q0/bRMWrsR id/qqdfsYPsdrHoI+4HSlUK1VACFjMlcWOf80yutdBWu/kacn9RM/66bIsIFeS9gETH2ELQvE8quY WlOUKFSoY6gxp2L0hCBxRQ==; Date: Fri, 19 Apr 2024 10:15:06 +0300 Message-Id: <861q71dds5.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87jzkthok4.fsf@gmail.com> (message from Augusto Stoffel on Fri, 19 Apr 2024 08:08:43 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: Eli Zaretskii , 70440@debbugs.gnu.org > Date: Fri, 19 Apr 2024 08:08:43 +0200 > > On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > > > The -P switch is new, introduced in CPython 3.11, so I don't think it > > can be added unconditionally. Furthermore, `python-interpreter' may > > not be CPython. Isn't it enough to customize > > `python-interpreter-args'? > > After sleeping on this, I recommend using -P anyway and simply failing > if the installed Python is too old. > > The reason is that this has a security implication, similar to the > recent Org mode Latex preview situation. Without -P the user is tacitly > trusting the contents of the current directory. By tricking an user > into downloading a malicious file with an intentional name clash (say > via git pull), arbitrary code could in principle be executed on the > user's machine. > > The -P switch completely removes this possibility, and conversely, > without -P there seems to be no reasonable way to make Python safe. > > I've attached a new patch that informs the user why the commands failed > when Python is too old, which is good enough in my opinion. Note also > that this change only affects the Python import management commands, > which is a very handy but by no means essential feature. Doing it this way would be an annoyance. Users could have less-than-the-latest Python (or non-CPython version) installed for any number of reasons, and it is not our business to annoy them because of this. Security of using Python is not our concern, it is the user's concern. So I'd prefer that the change probed the support for the -P switch when the relevant Emacs commands/functions are first invoked, and used that if -P is supported, without any annoying messages. Do you see any problems with such an approach? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 11:22:17 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 15:22:17 +0000 Received: from localhost ([127.0.0.1]:58735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxq47-0005wY-VT for submit@debbugs.gnu.org; Fri, 19 Apr 2024 11:22:17 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:52408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxq43-0005v2-4S for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 11:22:13 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-419c8236b34so3495205e9.0 for <70440@debbugs.gnu.org>; Fri, 19 Apr 2024 08:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713540111; x=1714144911; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=VaIUtOcCaN6tYTsZy+DimrSjgAvDVHA6bxBaEQt4auk=; b=Z2PCVmM0Zq4az9rL2euQpmDgH3jH0TMc2wOlQm/dJfYZoEgUC7yCSTd7msOmDxl/Ez e4P8CEyo3M65+XTQ89xqpcXq+KHe3TN/qTeoR5JTtgst4jgmlbRG6xdXYE03NhV3sWWB sUOvxnmPR3qrDR3lyfRIDYvAw5yHq7ZPR0fa+0Y+g1JbbDAbJQmfzb/S7crLMEZ6Jp2z BCDciH4fpbaRgvJVwhSYEhtTUuFfWFM2D+dKeyiSstA5/wNHvRELjTBBT70YhlvxUKNK Iue6i8i+orZkRgNeEk4jBO1pQX428ttaDkDBL4Vjs1dp8+lC8VsYJtm+96ZPzFtpT9zm uVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713540111; x=1714144911; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VaIUtOcCaN6tYTsZy+DimrSjgAvDVHA6bxBaEQt4auk=; b=AVO609GOtI1SMXSMisXSHekRdjmfRZxZpuoTw8m7dU/xXkICqcdQGATiruVXK4F7DU MHjz2NktmIWzN9keCTSxEb4T06MgtlfgJYDc3WSnIMXRqgiP5R5xnlwmpGkJBEs4e0pp ynA9eOEDyzkkJN6osCWSSumJPnc/mW5w25O13Y33qFcMRCMtGqhQl7C+zaB2L+jmcYp4 VBxjlRkPhQ43XUqvf6OgU1jUPP4ilH52FnCf8lP5ckGXUEuz08Ry1JK2N8rRJKfdiMzR xX1V75VNZ9VUjDMYIOPjtH8y1IlBSx8OXZhzqg1+jFkByMqRR+hsLex1zoj0uHAxAPXj OtNw== X-Forwarded-Encrypted: i=1; AJvYcCUV+Vtq6PYMnUo3rcek/Ntop06DQQypVL9exooaiaUWZzaxaXoL15wFSAUcxPrINbxKhuXkzhfv6s2E6pyTbb9lNqV0k98= X-Gm-Message-State: AOJu0Yz0aUC+uoiwTqj8mnndCCRJ6+t5xYiT+6AZnPtjTCjkk71id/Bt mhdckorB/aJMiqJWmz1H5+oisyt/EyPdmcwNzUTIM6mkNcmlHfocj8CI+A== X-Google-Smtp-Source: AGHT+IETAyupFPFe9rYE4gj8rJJCsW5VW5dL35teCBXTBnpuTpJVlfzd2/qVdvX2mSBc5HRr1ICLSQ== X-Received: by 2002:a05:6000:b8a:b0:347:d045:1fd8 with SMTP id dl10-20020a0560000b8a00b00347d0451fd8mr1961496wrb.38.1713540110412; Fri, 19 Apr 2024 08:21:50 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id h25-20020a1709070b1900b00a558f01499asm345477ejl.154.2024.04.19.08.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:21:49 -0700 (PDT) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <861q71dds5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Apr 2024 10:15:06 +0300") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> Date: Fri, 19 Apr 2024 17:21:48 +0200 Message-ID: <87frvhgyyb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 19 Apr 2024 at 10:15, Eli Zaretskii wrote: >> From: Augusto Stoffel >> Cc: Eli Zaretskii , 70440@debbugs.gnu.org >> Date: Fri, 19 Apr 2024 08:08:43 +0200 >> >> On Fri, 19 Apr 2024 at 00:25, kobarity wrote: >> >> > The -P switch is new, introduced in CPython 3.11, so I don't think it >> > can be added unconditionally. Furthermore, `python-interpreter' may >> > not be CPython. Isn't it enough to customize >> > `python-interpreter-args'? >> >> After sleeping on this, I recommend using -P anyway and simply failing >> if the installed Python is too old. >> >> The reason is that this has a security implication, similar to the >> recent Org mode Latex preview situation. Without -P the user is tacitly >> trusting the contents of the current directory. By tricking an user >> into downloading a malicious file with an intentional name clash (say >> via git pull), arbitrary code could in principle be executed on the >> user's machine. >> >> The -P switch completely removes this possibility, and conversely, >> without -P there seems to be no reasonable way to make Python safe. >> >> I've attached a new patch that informs the user why the commands failed >> when Python is too old, which is good enough in my opinion. Note also >> that this change only affects the Python import management commands, >> which is a very handy but by no means essential feature. > > Doing it this way would be an annoyance. Users could have > less-than-the-latest Python (or non-CPython version) installed for any > number of reasons, and it is not our business to annoy them because of > this. Security of using Python is not our concern, it is the user's > concern. > > So I'd prefer that the change probed the support for the -P switch > when the relevant Emacs commands/functions are first invoked, and used > that if -P is supported, without any annoying messages. Do you see > any problems with such an approach? > > Thanks. Okay, you are the maintainer, but I hope I explained well that this is a security hole. (Apart from the security aspect, without -P the tool will just mysteriously stop working if a file with a name such as csv.py is added to the project; that's what happened to me. Perhaps outright not working and explaining why is not as bad as working fine until it doesn't anymore.) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 11:41:16 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 15:41:17 +0000 Received: from localhost ([127.0.0.1]:58826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqMW-00086y-EM for submit@debbugs.gnu.org; Fri, 19 Apr 2024 11:41:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqMS-00085k-ME for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 11:41:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxqM9-0006By-2J; Fri, 19 Apr 2024 11:40:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BECfY5nR3tJOo2A8kJ2V7mY+wJbQSNlS1zVgZjN85sI=; b=On1Mg0vcnW4P iMpQ0GgIaL4zINI5R4+DMaBTUYJ6FxMrMySaoeEd5AHM3sxS2PYLNuOo76jaQqvETm8Nq/J6OMInJ Q44CE5FqydH3LKJHrAXNrjCBKwiIlIE9vuCe5y5+kV7hEVJRa1PZ6V/NdCKMBnSYeoPZgiuT1atm7 qcJ09JV6zlbmQ2DNFKVxH7EruD+1FBsYVt8+pImT9jopEwFLDzSDrWSbJ5x/EQ4D8aSH9kNPGAOmh iMeirnRKtMMPnF67Fng5HgiaUb2S+ertD/3ki5MsmTWTz2jBEevTtJh/aYaeqYSICd/cn1gNpimEr LOlaB03s6SHZkFtMoZJilA==; Date: Fri, 19 Apr 2024 18:40:49 +0300 Message-Id: <8634rhbbsu.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87frvhgyyb.fsf@gmail.com> (message from Augusto Stoffel on Fri, 19 Apr 2024 17:21:48 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: kobarity@gmail.com, 70440@debbugs.gnu.org > Date: Fri, 19 Apr 2024 17:21:48 +0200 > > On Fri, 19 Apr 2024 at 10:15, Eli Zaretskii wrote: > > >> From: Augusto Stoffel > >> Cc: Eli Zaretskii , 70440@debbugs.gnu.org > >> Date: Fri, 19 Apr 2024 08:08:43 +0200 > >> > >> On Fri, 19 Apr 2024 at 00:25, kobarity wrote: > >> > >> > The -P switch is new, introduced in CPython 3.11, so I don't think it > >> > can be added unconditionally. Furthermore, `python-interpreter' may > >> > not be CPython. Isn't it enough to customize > >> > `python-interpreter-args'? > >> > >> After sleeping on this, I recommend using -P anyway and simply failing > >> if the installed Python is too old. > >> > >> The reason is that this has a security implication, similar to the > >> recent Org mode Latex preview situation. Without -P the user is tacitly > >> trusting the contents of the current directory. By tricking an user > >> into downloading a malicious file with an intentional name clash (say > >> via git pull), arbitrary code could in principle be executed on the > >> user's machine. > >> > >> The -P switch completely removes this possibility, and conversely, > >> without -P there seems to be no reasonable way to make Python safe. > >> > >> I've attached a new patch that informs the user why the commands failed > >> when Python is too old, which is good enough in my opinion. Note also > >> that this change only affects the Python import management commands, > >> which is a very handy but by no means essential feature. > > > > Doing it this way would be an annoyance. Users could have > > less-than-the-latest Python (or non-CPython version) installed for any > > number of reasons, and it is not our business to annoy them because of > > this. Security of using Python is not our concern, it is the user's > > concern. > > > > So I'd prefer that the change probed the support for the -P switch > > when the relevant Emacs commands/functions are first invoked, and used > > that if -P is supported, without any annoying messages. Do you see > > any problems with such an approach? > > > > Thanks. > > Okay, you are the maintainer, but I hope I explained well that this is a > security hole. I'm not sure I understand: if the user doesn't have a version of Python which supports this option, what else can we do? Refuse to use such a Python? That doesn't seem to be an option we can use. Yes, this is a security hole, but it's the user's security hole, not ours, if the user doesn't install the safer Python. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 11:56:23 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 15:56:24 +0000 Received: from localhost ([127.0.0.1]:58894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqb5-0001aP-ON for submit@debbugs.gnu.org; Fri, 19 Apr 2024 11:56:22 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:45551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqb0-0001Yq-9K for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 11:56:16 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-56e1f3462caso2790594a12.3 for <70440@debbugs.gnu.org>; Fri, 19 Apr 2024 08:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713542153; x=1714146953; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=VWHCUsSb8O+qQKNAUP6W6ZTWDmHMyQl58AQ8Sc6A70o=; b=ksQgdqFTh+zxV3laFuTgmWqWawUuksSM6AH5Dfpg2x5rANiJemZ9tema3Hj3W0FNLT s9mDwqF3IcXjA6omH5Gro2PS88kjbUzy4PVs6IVbHOeD9tLM+dOhIhwxtr7ChKyW8i1y JZdAinwW6bsK1W0Oj1QUZD7GXmGyC2NCDlvtfydcIjhly/9LMBp08qbDzv3nSxn6WtjX aFucD6kYkYvfdqKCztAL5sCh7HhPYUgWKqwgPbOKrjS09f79u8plsQtADHmQAr7ScgYI Yb83Kv7khKmgMDBgF2Lxld2c2COCjM+Gq9WjXVhWAuS+0clTZ1Zos+OQu5y0ZeNUciRE Cbrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713542153; x=1714146953; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VWHCUsSb8O+qQKNAUP6W6ZTWDmHMyQl58AQ8Sc6A70o=; b=ZfiIq2y4yMtWqqncy5wE7KZo3pdqYwOHx5drSB2dGuivJwzqbMwSySq4yeYHSasKt4 0KDTyD1THdjGZ1/kCBnnVl2M/sbNeXfxTJVPHsgDlYezV5tbrbKIh8GyKYPEPEhFJwHp elLqL4e7IRPZSXxS4w0fopVDdYVPj9rj7xxtBqbhAkyXOEJGRhcED6Qr8hm/195fW4WU DUUJ4Ok+kjSfbiZUlN3/zl1r0xub1uiYw2trY7T2cmlb+ynpcrLd5tnAxAIRr2Rjb3lG WXKmDfOvOYB79LzTDElvLoJm/E5mGAFR8k8MEj5dnJ4DNjaNFUNf5fm4BSCHIpxmu9l3 7oHQ== X-Forwarded-Encrypted: i=1; AJvYcCWsGnAJOhNRoYaIUAYS1/UP31tao8EWXBcLaBg6yR5alVwBfeMFasFaVOPH9M6B5kmSAM+vScNidmD4dd3/jb6WfcNaZlw= X-Gm-Message-State: AOJu0YyllHV/2SNEZppNW13A9BFGDXINht37R/PbYv+maxKsg7pg89Ck LdzuCg+/3JlwVl9h2O73JlvGP1scJNuHKuS2DIZ9tpeIUDNLHhGpIMDUGw== X-Google-Smtp-Source: AGHT+IHYIbOoKEoDVgZw9g5iZc5eXINUiHGLird+4E3GG2fsjHWa6ZxivE7+0Vo0KMYdwOoyND590w== X-Received: by 2002:a17:906:66da:b0:a55:61cc:7337 with SMTP id k26-20020a17090666da00b00a5561cc7337mr2036675ejp.43.1713542153352; Fri, 19 Apr 2024 08:55:53 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id i19-20020a170906265300b00a4e7d03e995sm2347329ejc.45.2024.04.19.08.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:55:52 -0700 (PDT) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <8634rhbbsu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Apr 2024 18:40:49 +0300") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> Date: Fri, 19 Apr 2024 17:55:51 +0200 Message-ID: <87bk65gxdk.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 19 Apr 2024 at 18:40, Eli Zaretskii wrote: > I'm not sure I understand: if the user doesn't have a version of > Python which supports this option, what else can we do? Refuse to > use such a Python? That doesn't seem to be an option we can use. Why not? Let me make sure we're on the same page that this affects only couple of handy but by no means essential commands that add or remove import statements. Nobody _needs_ this to write Python code. > Yes, this is a security hole, but it's the user's security hole, not > ours, if the user doesn't install the safer Python. I see it as _my_ security hole, since it was me who added a line to Emacs that calls 'python -c' in a random directory without removing the current directory from the module load path (as much as a find it a bad design choice in Python to do that by default.) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 13:31:28 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 17:31:29 +0000 Received: from localhost ([127.0.0.1]:59353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxs5A-0004O5-Is for submit@debbugs.gnu.org; Fri, 19 Apr 2024 13:31:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxs57-0004Mn-6f for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 13:31:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxs4n-0002Tx-GD; Fri, 19 Apr 2024 13:31:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/JlFnqK5MeUbZzPpBb0Gii0496fvuNkLeW4ZmrcMb3w=; b=AvijLIPrF8Eu sGjDue3Z3ZPSu1kQvMUuv2z0ebtuXUM9yuSxj6tXqHKVpZS0kAU9C1loOLLrsS5ZWq6F0YRHIqKN+ MgFIwSKNa9nM7GOfCMcIbW/IFA3cZy9+OBARvXSqEmrPPGGifaBcxHqBvoyshBmzT0LYoOFfcLHFj wJl2xoHWL/1L8kZ9jeEMleDcz3B6SCrdMfFY3HfFKewNOrrfAnIb3kknwjo8aRyNZgLKrE69yiWa3 T1OKdi4BSoBGdoTeojzpnRGISj3satukjQskrV+fq16MD3CJGd8Tne6R1nr8Uo94eiNZ9X5uF71Ps XxDwFFoNByHtT5vPw/7whg==; Date: Fri, 19 Apr 2024 20:31:01 +0300 Message-Id: <86y1999s4q.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87bk65gxdk.fsf@gmail.com> (message from Augusto Stoffel on Fri, 19 Apr 2024 17:55:51 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> <87bk65gxdk.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: kobarity@gmail.com, 70440@debbugs.gnu.org > Date: Fri, 19 Apr 2024 17:55:51 +0200 > > On Fri, 19 Apr 2024 at 18:40, Eli Zaretskii wrote: > > > I'm not sure I understand: if the user doesn't have a version of > > Python which supports this option, what else can we do? Refuse to > > use such a Python? That doesn't seem to be an option we can use. > > Why not? Because it's unthinkable? > Let me make sure we're on the same page that this affects only > couple of handy but by no means essential commands that add or remove > import statements. Nobody _needs_ this to write Python code. That's not relevant. The important part is that if we accept your proposal, users who have Python that doesn't support -P will be unable to invoke Python even if their Python programs don't use the problematic features. > > Yes, this is a security hole, but it's the user's security hole, not > > ours, if the user doesn't install the safer Python. > > I see it as _my_ security hole, since it was me who added a line to > Emacs that calls 'python -c' in a random directory without removing the > current directory from the module load path (as much as a find it a bad > design choice in Python to do that by default.) Sorry, you lost me here. But if there's a way to close the hole without preventing users to use a subordinate Python, please describe it in more details. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:02:44 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 18:02:44 +0000 Received: from localhost ([127.0.0.1]:59512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxsZP-0008Cf-6u for submit@debbugs.gnu.org; Fri, 19 Apr 2024 14:02:44 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:56635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxsZL-0008BG-QW for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 14:02:41 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-51ac9c6599bso1078010e87.1 for <70440@debbugs.gnu.org>; Fri, 19 Apr 2024 11:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713549739; x=1714154539; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=RfxB+lz3ma5ccLnjbinQyhGvLnCwVXfS8BwEVEEZi/M=; b=guPNmxn2Nypy5A/ZYsSS9oMUr9W+kPNTWDASXEIMe7YtRPxXo6uioBkqoTciCzKw8j g4n+l3rilk2mDcygCclGnnt3u171WFowpWDUhKTKXwD0yBbchwpz2aoKxmh0z5c0nitF gQzapDJO0ki0p9hKxw1jdYTGrhbBMs8JFqV1iKiHp1n1JfblzBANftH3JyX8yOc1iA6N 9sIl387kq14xNdDamsoMJKQGdzvuUSZATPbysqJIC658vZYpauVbfBqLqaOHGsl/Xp3Q ya9CnVTbarqyErz2KI/3VARDL1FdDJFFe1V4YZEk3MUhHJ5toCvtojXEGCyav+wQIAmy CcSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713549739; x=1714154539; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RfxB+lz3ma5ccLnjbinQyhGvLnCwVXfS8BwEVEEZi/M=; b=Q6WhnDGB/fF6NG5ruhhq6bHkyh4zVhICJWTUGgQroYXQxlNn73J7RQAlOfi5f34mLu POf9yxCbKLESO5Kbr3oD4wGOCFgSOJNsqnk8eHwFrUz2ZKxWGNgQRSswVTv7gmurJU4u TsZTzT+jrPoauZHqadicto91sfHa3MjHrB2bJi1m3W1WsOFYB+W/bZA5kzToa9rJulO9 AZRxdefaGovjC1zCH0udloFHhmsjm4QqE10Lvp0E0LoFqQ6g92wIwBwW4gOnp2xOBw1e fw005QIpb+PhHjVak+a6xmxqaORv3EcWP0xhrVAtBsNoQTYHdWbce+hOQiVulJ9RU2bt V96Q== X-Forwarded-Encrypted: i=1; AJvYcCXFd8H8PMfyMMXpntYRo1XkcniZzBYnfGkVqOybllX8+HQzUTBtVGu7IXx2c/+aaHc7WbboL5Lw28cNlh1SoYPV4IKf+ns= X-Gm-Message-State: AOJu0YwuaFj/CfqT9q8GVOkyqZwyRe/oD0BWRw9HWU1sm3QLjDNO17nx +7Oaqb1X6mgIk3cHvj6g3NrAt3U8J3W7KQNLj9Nv2uZ3MGeLBjZaMiJi5g== X-Google-Smtp-Source: AGHT+IHgnzaTJw/1bkj0mTbU536kDuwVwfdrh0CnRrIwhmRPVmK12Sv2DfWUSmdwWiLNr5gZETI8kQ== X-Received: by 2002:ac2:5dcd:0:b0:51a:bee1:f45c with SMTP id x13-20020ac25dcd000000b0051abee1f45cmr1636904lfq.12.1713549738843; Fri, 19 Apr 2024 11:02:18 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id hy25-20020a1709068a7900b00a4e03c28fd5sm2480322ejc.43.2024.04.19.11.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 11:02:18 -0700 (PDT) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <86y1999s4q.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Apr 2024 20:31:01 +0300") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> <87bk65gxdk.fsf@gmail.com> <86y1999s4q.fsf@gnu.org> Date: Fri, 19 Apr 2024 20:02:16 +0200 Message-ID: <877cgtgriv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 19 Apr 2024 at 20:31, Eli Zaretskii wrote: >> Let me make sure we're on the same page that this affects only >> couple of handy but by no means essential commands that add or remove >> import statements. Nobody _needs_ this to write Python code. > > That's not relevant. The important part is that if we accept your > proposal, users who have Python that doesn't support -P will be unable > to invoke Python even if their Python programs don't use the > problematic features. That's a misunderstanding. My patch only affects the following commands: python-sort-imports python-add-import python-fix-imports python-remove-import python-import-symbol-at-point There's no change in any customization option or in the way Python is invoked for any other purpose. Of course it would be unreasonable to change the way other Python subprocesses are invoked. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:17:43 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 18:17:44 +0000 Received: from localhost ([127.0.0.1]:59582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxsnu-0001UL-KI for submit@debbugs.gnu.org; Fri, 19 Apr 2024 14:17:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxsns-0001TG-Bt for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 14:17:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxsnY-0004hl-DO; Fri, 19 Apr 2024 14:17:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lamSX+XcaA01AVONeP0GVsJy5hrI3pM7e8IqJ3aOgPM=; b=AKICrdOH4hno IKJzc8ATjMDpI+rxkDKG0Y7UWCIVbVxmZyXZuUOYcU6jAieXJSXZbzJ2sgOAwoi7JBj8u9l/sX00U QVyeJBP1cHkA8bI7iJuvW53hf3cwW2WNCniR8uj1fTE7vdUcOfov314ewlY0e3P7DdsO6vKnnC0zQ IIxVkCeqteV83qG6Hztv9VQCrDYEm4lw1fobRep3ff+ufMW6ZmSRA6bZCqyXAJj7mQHHdcIWK6J+W IT1gQ+SacXJaNQegNCEGHkuUl6F/yrBppchBICxWcjdf5ZHd+/7LUWUlBp3C/hf8BZquSbOSXw9O+ loPpSeXzJ5QEJXFMCwGKNA==; Date: Fri, 19 Apr 2024 21:17:16 +0300 Message-Id: <86ttjx9pzn.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <877cgtgriv.fsf@gmail.com> (message from Augusto Stoffel on Fri, 19 Apr 2024 20:02:16 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> <87bk65gxdk.fsf@gmail.com> <86y1999s4q.fsf@gnu.org> <877cgtgriv.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: kobarity@gmail.com, 70440@debbugs.gnu.org > Date: Fri, 19 Apr 2024 20:02:16 +0200 > > On Fri, 19 Apr 2024 at 20:31, Eli Zaretskii wrote: > > >> Let me make sure we're on the same page that this affects only > >> couple of handy but by no means essential commands that add or remove > >> import statements. Nobody _needs_ this to write Python code. > > > > That's not relevant. The important part is that if we accept your > > proposal, users who have Python that doesn't support -P will be unable > > to invoke Python even if their Python programs don't use the > > problematic features. > > That's a misunderstanding. My patch only affects the following > commands: > > python-sort-imports > python-add-import > python-fix-imports > python-remove-import > python-import-symbol-at-point Affects in what way? AFAIU, with your patch these commands will not work if Python doesn't support -P. Is that right? From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:30:52 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 18:30:53 +0000 Received: from localhost ([127.0.0.1]:59659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxt0e-00030u-Kb for submit@debbugs.gnu.org; Fri, 19 Apr 2024 14:30:52 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:51498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxt0c-000301-Dl for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 14:30:51 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a44ad785a44so238452266b.3 for <70440@debbugs.gnu.org>; Fri, 19 Apr 2024 11:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713551430; x=1714156230; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=07gfUhhBN7HSj0T2IPMd3vxRmlteTUPnvCjVE0POeI4=; b=KtYni/GI7mQ+VAibFUV7eaYo1mCZbb7+EJgDubar9osNOJSyW9RgDpft+IhzExkncy 0IknaNle4QUsihdX71dEYep4w7WEcBXT7vyMNWB5UaR/HjhOq6y2oFA5iFavuLZxxsGP 8vIv5ZXOdPDh3wOR1jNbrN4ztQ4D6usSkfVTg1KXYRO2Ry6v2Ey5lLahP3X13s0FV7Oh 96ehnGFM5xKajpESYKhm8fmUU+RF/77AgA+29TEwReePLAvVk19H3YLxbFN6ggUmjhzE ZIhRAGhUSmtL0xI/W0c2xnvOXvvy/qORBZxwUFm2IicnY5o5NrtIlbasBj1Yeq4rJaj4 kBUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713551430; x=1714156230; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=07gfUhhBN7HSj0T2IPMd3vxRmlteTUPnvCjVE0POeI4=; b=UB23enJAn6co+0Fq6a0JJzcCfnXj/v+EUTiAOsdwFEEgucQsVe/M5LXIBtPP2rTs82 jY+lzFWb+40+fxvDdjgZrQorqdNKk61IELDPj9yB+6jg/tOGsl02+RILFWxkgY6Vnyxb xTqVrscexTrbZFYpRKw2GXACCY/kT1ddIpDgsAxiBlOBRAhclwh0tY06lvsp2c1aS/k5 u8BmNoaa/mIRsWuG+95HgdhoHD+DGNuPyJzv99jjIQyD/MrEzK1vi46LTVxiT8+NQeQm NDyZqZPZIs5/RmR596s+t53qUM6lKctmj/2Cao2KP7DfG7RYbVUrFNhH/FxD51t8E9ra cTlQ== X-Forwarded-Encrypted: i=1; AJvYcCVpMKDP+DpPWZGQIfhq2c8A2fuyHLrpwZQ4lRmdSPgAipElUwEPlTL5XM121har7ModlIHLrZz9Z+4jC3kbFouAwPq86vE= X-Gm-Message-State: AOJu0Yy0XolI1G9kvm+BZixx54UCfbEqq3AEfszE9tI7CJD1T24o8Fo1 7EjAAb0DiG3JLD/7xIVQwANSa1sbigkDm2zcySg77fZp2jhOQOCP4129wg== X-Google-Smtp-Source: AGHT+IGQYPKXwmNQtpL0jFcBkvpTpOTz4rdQZ4weKXE7CD6LKfmcKxHS4k3lHqYWrOSTau/mt7EYgg== X-Received: by 2002:a17:907:7714:b0:a52:5a02:2432 with SMTP id kw20-20020a170907771400b00a525a022432mr1953271ejc.50.1713551429533; Fri, 19 Apr 2024 11:30:29 -0700 (PDT) Received: from ars3 ([2a02:8109:8a87:ff00::6223]) by smtp.gmail.com with ESMTPSA id w25-20020a1709060a1900b00a4e40e48f8dsm2473178ejf.185.2024.04.19.11.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 11:30:28 -0700 (PDT) From: Augusto Stoffel To: Eli Zaretskii Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' In-Reply-To: <86ttjx9pzn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Apr 2024 21:17:16 +0300") References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> <87bk65gxdk.fsf@gmail.com> <86y1999s4q.fsf@gnu.org> <877cgtgriv.fsf@gmail.com> <86ttjx9pzn.fsf@gnu.org> Date: Fri, 19 Apr 2024 20:30:27 +0200 Message-ID: <87o7a5kxx8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, 19 Apr 2024 at 21:17, Eli Zaretskii wrote: >> That's a misunderstanding. My patch only affects the following >> commands: >> >> python-sort-imports >> python-add-import >> python-fix-imports >> python-remove-import >> python-import-symbol-at-point > > Affects in what way? AFAIU, with your patch these commands will not > work if Python doesn't support -P. Is that right? Yes. (And again, that's not a gratuitous choice.) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 15:02:43 2024 Received: (at 70440) by debbugs.gnu.org; 19 Apr 2024 19:02:43 +0000 Received: from localhost ([127.0.0.1]:59849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxtVR-0006t5-Er for submit@debbugs.gnu.org; Fri, 19 Apr 2024 15:02:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxtUs-0006mT-Qi for 70440@debbugs.gnu.org; Fri, 19 Apr 2024 15:02:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxtUZ-0003qG-1m; Fri, 19 Apr 2024 15:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=dfy+HWkSmxojkwF1jXzGcgsAMlcgGAPlkVFaFBFz0XM=; b=XEyhP35fX466 W+YT/I9L9FuqbZnWBFu+FLp4BDCDTp71LGJuYjtHpbtVxjU696TCy5c2KoYrvCp2F4SwxxNP12I5J 6hZI1wsnN8svX5ebQacIZmTL9+/cTcwH+aEvzaPhmVOwlSHkr8owSn6Qwx8IWkaLqcPYjJ1a0zhlv 4UTEZ3pm7wd9RvgLTo46KITNfDqVYIum0nT0zdncNZIBPz9EBKgwzON6APp6i3wS8JT5I/An57PNj 4TK7f+M4rn/UrCTgwDaPb3l6M4GePHNfv63YDqJVFHwpPMu9LqURdnJFBAciDDZMIzolCAdHatbH6 7u2Kz5nbodHQmiI8JHSAJA==; Date: Fri, 19 Apr 2024 22:01:44 +0300 Message-Id: <86r0f19nxj.fsf@gnu.org> From: Eli Zaretskii To: Augusto Stoffel In-Reply-To: <87o7a5kxx8.fsf@gmail.com> (message from Augusto Stoffel on Fri, 19 Apr 2024 20:30:27 +0200) Subject: Re: bug#70440: [PATCH] Use -P switch when calling 'python-interpreter' References: <87h6fzj1b1.fsf@gmail.com> <861q73hkeq.fsf@gnu.org> <87jzkthok4.fsf@gmail.com> <861q71dds5.fsf@gnu.org> <87frvhgyyb.fsf@gmail.com> <8634rhbbsu.fsf@gnu.org> <87bk65gxdk.fsf@gmail.com> <86y1999s4q.fsf@gnu.org> <877cgtgriv.fsf@gmail.com> <86ttjx9pzn.fsf@gnu.org> <87o7a5kxx8.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70440 Cc: 70440@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Augusto Stoffel > Cc: kobarity@gmail.com, 70440@debbugs.gnu.org > Date: Fri, 19 Apr 2024 20:30:27 +0200 > > On Fri, 19 Apr 2024 at 21:17, Eli Zaretskii wrote: > > >> That's a misunderstanding. My patch only affects the following > >> commands: > >> > >> python-sort-imports > >> python-add-import > >> python-fix-imports > >> python-remove-import > >> python-import-symbol-at-point > > > > Affects in what way? AFAIU, with your patch these commands will not > > work if Python doesn't support -P. Is that right? > > Yes. That's what IMO is unthinkable: we cannot possibly force the user's hand that much, especially since this used to work before. Users need to learn about the problem and install a newer Python, and then the security hole will be gone, at least as far as invoking Python from Emacs is concerned. The most we can do is urge the users to upgrade in the NEWS entry where we announce this new feature.