From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25025: python-shell-calculate-command is wrong Date: Fri, 02 Dec 2016 10:07:57 -0500 Message-ID: <87bmwugyia.fsf@users.sourceforge.net> References: <83polk3qow.fsf@gnu.org> <83inra13r3.fsf@gnu.org> <8337ic29y0.fsf@gnu.org> <87r35wj4b8.fsf@users.sourceforge.net> <83zikkzytf.fsf@gnu.org> <8737i9iz28.fsf@users.sourceforge.net> <1949fc46-fd26-dddb-86b2-ab3478587271@gmail.com> <87wpflhgsf.fsf@users.sourceforge.net> <83a8chq7x6.fsf@gnu.org> <83d1hbpobp.fsf@gnu.org> <87h96ngmmq.fsf@users.sourceforge.net> <83k2biokad.fsf@gnu.org> <83r35qmljw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480691297 5362 195.159.176.226 (2 Dec 2016 15:08:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 15:08:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25025@debbugs.gnu.org, clement.pit@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 02 16:08:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpRa-0000RF-5i for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 16:08:10 +0100 Original-Received: from localhost ([::1]:35022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCpRe-00075J-4n for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 10:08:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCpRV-000743-PG for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 10:08:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCpRS-00089s-GU for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 10:08:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35065) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCpRS-00089Y-Bz for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 10:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cCpRR-0007h7-LM for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 10:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 15:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25025-submit@debbugs.gnu.org id=B25025.148069122929516 (code B ref 25025); Fri, 02 Dec 2016 15:08:01 +0000 Original-Received: (at 25025) by debbugs.gnu.org; 2 Dec 2016 15:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:50464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpQa-0007g0-QH for submit@debbugs.gnu.org; Fri, 02 Dec 2016 10:07:08 -0500 Original-Received: from mail-io0-f170.google.com ([209.85.223.170]:33333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCpQZ-0007fo-DF for 25025@debbugs.gnu.org; Fri, 02 Dec 2016 10:07:07 -0500 Original-Received: by mail-io0-f170.google.com with SMTP id j65so485710457iof.0 for <25025@debbugs.gnu.org>; Fri, 02 Dec 2016 07:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=K2R8i/fEXpPPTFL4dpByCE0a5JYjlo56EVbdV4IXakA=; b=DmgVFK7/W8gX8sDHBqVI5RNXBHPERCN0K+TozGam/R6DxY0xc6aY3laQ02luVYEwEF CCsUvPlEY/HMrcHiNb5tskLPqcbC9uxbqY/77otwD+I29YagOJ8xGP5xMi1Iq2C5Kn0K QUKOaWBvZlsmq2wg3SDZYtC50yqbAv4hC95g/AD23kGxQHBRp5QC9k8CYp8qqLfgUSMh OslyNGe46T+Tp+UXdRfV8PhfmmepJqtQ8hdTdpYgmnCZ44mDYuV+aw6SJtxnHCPN3s76 owvbfWmYawiFGga7XOL+m9BU/UVNJlXdScJgiHwBZtm+4oVoJP73RbO262cv5Jow/88A JpEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=K2R8i/fEXpPPTFL4dpByCE0a5JYjlo56EVbdV4IXakA=; b=SSEqzDbEMetBLFT5GLt6gkZclnViXApQ4M+UqYKT0dCkzUMt8o659y6huAFYjSzSy0 1GYXfFR30DLPA0qVokn9O1dIInKkS4hebssENK8V3CmPPZsxXgxvsMuNzvx82ZUUnLTC TDFJcQ8GfsS+z+QkbcYVfyKVhQ3MSAlzpqZOYI10WbRZeiyPXcmBfr0nyi2s0YWWIE4M TkuYu1K+0rUQ7j5CJVtF1EI9/HAjxOlC0k1aivY5Xio+19QNVidfPvx3RkNQyRsXDY/y tviaLcIA+q7rSctrmeoKUb3ZvG04MY17kjUh7/X0FG0Wbx2kjxp+oEFHDFyqY4wBvoPM XI8Q== X-Gm-Message-State: AKaTC00ClH3iQmFxTF/FWgLdsmJur2HZncvF1D2QlAwGoTmBSp4piaFHAIv7O+0kaLhAvw== X-Received: by 10.36.108.17 with SMTP id w17mr2897139itb.108.1480691220626; Fri, 02 Dec 2016 07:07:00 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id i62sm1200706itb.12.2016.12.02.07.06.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Dec 2016 07:06:59 -0800 (PST) In-Reply-To: <83r35qmljw.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Dec 2016 16:51:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126415 Archived-At: Eli Zaretskii writes: >> From: Noam Postavsky >> Date: Fri, 2 Dec 2016 09:16:04 -0500 >> Cc: 25025@debbugs.gnu.org, Cl=C3=A9ment Pit--Claudel >>=20 >> On Fri, Dec 2, 2016 at 2:35 AM, Eli Zaretskii wrote: >> >> --- a/lisp/progmodes/python.el >> >> +++ b/lisp/progmodes/python.el >> >> @@ -2379,7 +2379,7 @@ python-shell-internal-get-process-name >> >> (defun python-shell-calculate-command () >> >> "Calculate the string used to execute the inferior Python process." >> >> (format "%s %s" >> >> - (shell-quote-argument python-shell-interpreter) >> >> + (combine-and-quote-strings (list python-shell-interpreter)) >> >> python-shell-interpreter-args)) >> > >> > Isn't combine-and-quote-strings wrong for quoting shell commands? >> > AFAIR, it doesn't DTRT with some special characters that can appear in >> > file names on Unix. Am I mistaken? >>=20 >> It's not a shell command though, hence this bug. > > No, but the code in question generates a shell command, from the file > name of the interpreter and its arguments. Right? Okay, let me rephrase. `python-shell-calculate-command' currently generates a shell command, but none of its callers treat the result as a shell command (they don't pass it to a shell, they parse it with `split-string-and-unquote'). Therefore, the easiest fix is to change `python-shell-calculate-command' to no longer generate a shell command. The other possiblity is to change the callers to treat `python-shell-calculate-command's result as a shell command, but that looks more difficult (though it may be the better solution overall).