[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21421: 24.5; python mode interpreter path problem on windows.
From: |
Eli Zaretskii |
Subject: |
bug#21421: 24.5; python mode interpreter path problem on windows. |
Date: |
Sat, 05 Sep 2015 10:12:19 +0300 |
> From: "Currell Berry" <currellberry@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.