From: Eli Zaretskii <eliz@gnu.org>
To: Currell Berry <currellberry@gmail.com>
Cc: 21421@debbugs.gnu.org
Subject: bug#21421: 24.5; python mode interpreter path problem on windows.
Date: Sat, 05 Sep 2015 10:12:19 +0300 [thread overview]
Message-ID: <83egid8hm4.fsf@gnu.org> (raw)
In-Reply-To: <emacfd2763-c42b-4dbe-8433-948d26ab7d14@probook>
> 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.
prev parent reply other threads:[~2015-09-05 7:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-05 0:48 bug#21421: 24.5; python mode interpreter path problem on windows Currell Berry
2015-09-05 7:12 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83egid8hm4.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=21421@debbugs.gnu.org \
--cc=currellberry@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.