From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21421: 24.5; python mode interpreter path problem on windows. Date: Sat, 05 Sep 2015 10:12:19 +0300 Message-ID: <83egid8hm4.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441437207 22052 80.91.229.3 (5 Sep 2015 07:13:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Sep 2015 07:13:27 +0000 (UTC) Cc: 21421@debbugs.gnu.org To: Currell Berry Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 05 09:13:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZY7ey-00072J-0o for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Sep 2015 09:13:12 +0200 Original-Received: from localhost ([::1]:38137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY7ex-0006mQ-LF for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Sep 2015 03:13:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY7et-0006jp-Ng for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2015 03:13:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZY7eo-0005wc-Nr for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2015 03:13:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY7eo-0005wY-Ka for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2015 03:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZY7eo-0002EH-17 for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2015 03:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Sep 2015 07:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21421 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21421-submit@debbugs.gnu.org id=B21421.14414371388501 (code B ref 21421); Sat, 05 Sep 2015 07:13:01 +0000 Original-Received: (at 21421) by debbugs.gnu.org; 5 Sep 2015 07:12:18 +0000 Original-Received: from localhost ([127.0.0.1]:49330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY7e5-0002D3-J8 for submit@debbugs.gnu.org; Sat, 05 Sep 2015 03:12:17 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:51015) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY7e2-0002Cu-Uo for 21421@debbugs.gnu.org; Sat, 05 Sep 2015 03:12:16 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NU600F00ZO84V00@a-mtaout20.012.net.il> for 21421@debbugs.gnu.org; Sat, 05 Sep 2015 10:12:13 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NU700ER900DS760@a-mtaout20.012.net.il>; Sat, 05 Sep 2015 10:12:13 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106165 Archived-At: > From: "Currell Berry" > Date: Sat, 05 Sep 2015 00:48:51 +0000 > > python-shell-parse-command in python.el appears to have an issue on > Windows which prevents proper startup of the python interpreter > depending on the interpreter's path. Here is the current version of > python-shell-parse-command in python.el, as of Emacs 24.5.1. > > (defun python-shell-parse-command () ;FIXME: why name it "parse"? > "Calculate the string used to execute the inferior Python process." > ;; FIXME: process-environment doesn't seem to be used anywhere within > ;; this let. > (let ((process-environment > (python-shell-calculate-process-environment)) > (exec-path (python-shell-calculate-exec-path))) > (format "%s %s" > ;; FIXME: Why executable-find? > (shell-quote-argument > (executable-find python-shell-interpreter)) > python-shell-interpreter-args))) > > The problem is with the usage of "shell-quote-argument" to quote the > pathname coming out of "executable-find". > > Suppose you have python installed at "C:\Anaconda\python.exe", and > "C:\Anaconda" is on your path. > > Then when we run > (executable-find python-shell-interpreter) > we get the output > "c:/Anaconda/python.exe" > This is a valid path which can be used to launch python. > > However > (shell-quote-argument "c:/Anaconda/python.exe") > results in > "c\\:/Anaconda/python.exe" > This is NOT a valid windows path, as an extra backquote has been > inserted before the colon (second character). My crystal ball says you have w32-shell-name set to Cygwin's Bash, in which case this is bug#20237, whose root cause is incompatibility between Cygwin file names and native Windows file names. See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20237#50 for more details. In a nutshell, setting w32-shell-name to point to Bash causes shell-quote-argument to work differently, under the assumption that file names are in Posix-style /foo/bar format, whereas your Python file name is in native Windows format.