GNU bug report logs -
#20237
Emacs built on Windows cannot figure out path correctly
Previous Next
Reported by: Da Zhang <zhangda82 <at> gmail.com>
Date: Tue, 31 Mar 2015 17:53:02 UTC
Severity: normal
Tags: notabug
Merged with 21421
Found in version 24.5
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Sat 04 Apr 2015, Eli Zaretskii wrote:
>> From: Andy Moreton <andrewjmoreton <at> gmail.com>
>> Date: Tue, 31 Mar 2015 23:46:23 +0100
>>
>> On Tue 31 Mar 2015, Eli Zaretskii wrote:
>>
>> >> Date: Tue, 31 Mar 2015 13:52:20 -0400
>> >> From: Da Zhang <zhangda82 <at> gmail.com>
>> >>
>> >> I am using Python mode in Emacs and wanted to start a python
>> >> sub-process.
>> >> However, Emacs could not find python.exe from the path I specified.
>> >> Particularly, the following message was displayed:
>> >> apply: Searching for program: no such file or directory,
>> >> c\:/Python27/Scripts/ipython.exeInvalid face reference: python-cell
>> >>
>> >> It seemed a "C\:" was added in front of the path to the python.
>> >
>> > You didn't say which path of Python did you specify, and how didyou
>> > specify it. Please tell, otherwise it's very hard to figure out the
>> > reason for the problem.
>>
>> I have seen something similar - I think it's caused by incorrect
>> quoting:
>>
>> --[python.el]-----------------------------------------------------------
>> (defun python-shell-calculate-command ()
>> "Calculate the string used to execute the inferior Python process."
>> (let ((exec-path (python-shell-calculate-exec-path)))
>> ;; `exec-path' gets tweaked so that virtualenv's specific
>> ;; `python-shell-interpreter' absolute path can be found by
>> ;; `executable-find'.
>> (format "%s %s"
>> ;; FIXME: Why executable-find?
>> (shell-quote-argument
>> (executable-find python-shell-interpreter))
>> python-shell-interpreter-args)))
>> --[python.el]-----------------------------------------------------------
>>
>> Removing the use of shell-quote-argument seems to work around this
>> problem.
>
> I don't see why quoting here could do any harm. Could you elaborate
> on why you think it's wrong?
Because removing the shell-quote-argument call fixed it for me:
(when (eq system-type 'windows-nt)
(setq python-shell-exec-path '("C:/Python27"))
(add-function :override (symbol-function 'python-shell-calculate-command)
(lambda ()
(let ((exec-path (python-shell-calculate-exec-path)))
(format "%s %s"
(executable-find python-shell-interpreter)
python-shell-interpreter-args)))))
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.