GNU bug report logs - #21421
24.5; python mode interpreter path problem on windows.

Previous Next

Package: emacs;

Reported by: Currell Berry <currellberry <at> gmail.com>

Date: Sat, 5 Sep 2015 00:53:02 UTC

Severity: normal

Tags: notabug

Merged with 20237

Found in version 24.5

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 21421 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Currell Berry <currellberry <at> gmail.com>
Cc: 21421 <at> debbugs.gnu.org
Subject: Re: bug#21421: 24.5; python mode interpreter path problem on windows.
Date: Sat, 05 Sep 2015 10:12:19 +0300
> From: "Currell Berry" <currellberry <at> gmail.com>
> 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.




This bug report was last modified 8 years and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.