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: Thu, 01 Dec 2016 20:12:13 -0500 Message-ID: <87h96ngmmq.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480641137 7837 195.159.176.226 (2 Dec 2016 01:12:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 01:12: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 02:12: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 1cCcOb-0001Nd-3u for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 02:12:13 +0100 Original-Received: from localhost ([::1]:59717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCcOf-0004IH-1L for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Dec 2016 20:12:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCcOU-0004I7-Fv for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 20:12:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCcOQ-0003UI-Ft for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 20:12:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCcOQ-0003Tp-Cd for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 20:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cCcOQ-0002zx-16 for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2016 20:12:02 -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 01:12: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.148064108311479 (code B ref 25025); Fri, 02 Dec 2016 01:12:01 +0000 Original-Received: (at 25025) by debbugs.gnu.org; 2 Dec 2016 01:11:23 +0000 Original-Received: from localhost ([127.0.0.1]:49251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCcNn-0002z5-61 for submit@debbugs.gnu.org; Thu, 01 Dec 2016 20:11:23 -0500 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:35610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCcNl-0002yt-Js for 25025@debbugs.gnu.org; Thu, 01 Dec 2016 20:11:21 -0500 Original-Received: by mail-io0-f175.google.com with SMTP id a124so456533414ioe.2 for <25025@debbugs.gnu.org>; Thu, 01 Dec 2016 17:11:21 -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; bh=+tpQxBjNywXw9HsAOGeJrTl4POoN/WY2WlY7LOK/RRs=; b=OLhbEqqNyQ6mVRR3tPo/Lp7fzgq6vm5tlyx5YdkA7CNE8XMVc4OiDhMiQHP65t8kbg dD7JsCfgqSyER0j8ReRojqmQXNFZrQyVeyBYFHpT+GhY6fFzhutA3b8Qi2aiJKXFRnAV 3dzdSVccTTusyvkKydLNhdytIqDdkFZYDjh8DdgkLGIWin6aWdRuLods8DIdLOe8ryrA DrVLWeRHInliVEkJ3igdGG6cE0STyX/moML6UDXtVMAFZWM2qLjrShKOoOi6vzPbEObr 9KJ55wCHhK9ItZEqcpTL1ceMRLbiGAdk3co7w+zF7UANhro3tFqBdZYb8WnEkraB+8Hx b+FA== 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; bh=+tpQxBjNywXw9HsAOGeJrTl4POoN/WY2WlY7LOK/RRs=; b=Xbw+eKbxtaUu2ACMoagmf4i4yPUNiQ9n8LiuUNl6py53BL9XkLzV51k3+01IkJH3Ch V/y2s1YfGRBU26lIcxgWHo3lM4ZA9yvHUMxMf+FwFr3OSVbAALnwkAw4zdSJUjJGCpKg IGNu33dIuif5yvqTaMY4S+TORA/8gDPWn3904RpuA1UXLMlV2NDjKgN39wRsBn82bKOk xoVAjENGXNXUEBrGghzaAnLxfNaYEy0P+HPxOe3IYLHRHGhHOyuqStAmkPYEDrpG9zop 3SljNH4tNnDqUulhLcZe3nIhi8Uf7cE86bO+NNltcleRl+8lPc6eSBgs/stgAIfqlUkV lrYA== X-Gm-Message-State: AKaTC01O861G2laTR8QAbQ1UdGM+qSpnuHu9A4hbbz1zjLtcDwH4hajU/eFYw3uIoV7xbA== X-Received: by 10.107.6.10 with SMTP id 10mr3776757iog.78.1480641076149; Thu, 01 Dec 2016 17:11:16 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f24sm1203096iod.21.2016.12.01.17.11.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Dec 2016 17:11:15 -0800 (PST) In-Reply-To: <83d1hbpobp.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Dec 2016 19:10:50 +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:126381 Archived-At: Eli Zaretskii writes: > > So the problematic scenario is that the user sets > python-shell-interpreter to something we already checked, and then > manually feeds us with a command that invokes a different Python > interpreter, is that it? Is that a frequent use case, which we > should care about? Just to produce a warning? > > Even if we do want to care about, we could try matching the beginning > of the command, perhaps after an optional quote character, and if we > don't recognize the interpreter, do nothing. Would that be > sufficient? To be honest, I don't use python enough to say what the best fix is here. I can say that the easiest way to solve this bug is: --- 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))