From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Currell Berry" Newsgroups: gmane.emacs.bugs Subject: bug#21421: 24.5; python mode interpreter path problem on windows. Date: Sat, 05 Sep 2015 00:48:51 +0000 Message-ID: Reply-To: Currell Berry NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1441414408 11258 80.91.229.3 (5 Sep 2015 00:53:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Sep 2015 00:53:28 +0000 (UTC) To: 21421@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 05 02:53:12 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 1ZY1jE-0005xX-86 for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Sep 2015 02:53:12 +0200 Original-Received: from localhost ([::1]:36295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1jE-00051w-C1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Sep 2015 20:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1j9-00050t-Li for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:53:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZY1j4-0004aK-IG for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1j4-0004aG-FH for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZY1j4-0000aR-9j for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Currell Berry" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Sep 2015 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21421 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14414143682229 (code B ref -1); Sat, 05 Sep 2015 00:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Sep 2015 00:52:48 +0000 Original-Received: from localhost ([127.0.0.1]:49131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY1ip-0000Zs-IM for submit@debbugs.gnu.org; Fri, 04 Sep 2015 20:52:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59990) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY1gJ-0000W8-Ip for submit@debbugs.gnu.org; Fri, 04 Sep 2015 20:50:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZY1gH-00032Q-OV for submit@debbugs.gnu.org; Fri, 04 Sep 2015 20:50:11 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1gH-00032H-MH for submit@debbugs.gnu.org; Fri, 04 Sep 2015 20:50:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1gG-0004Ho-7V for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:50:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZY1gC-0002pe-P8 for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:50:08 -0400 Original-Received: from mail-yk0-f172.google.com ([209.85.160.172]:33498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZY1gC-0002UN-HU for bug-gnu-emacs@gnu.org; Fri, 04 Sep 2015 20:50:04 -0400 Original-Received: by ykei199 with SMTP id i199so36594438yke.0 for ; Fri, 04 Sep 2015 17:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:reply-to:user-agent:mime-version :content-type:content-transfer-encoding; bh=M3+IWZODp8ZhTEUQNsIjstVyWlFyrcpukBVOxVYF5yI=; b=dj5hE6TYCLkuBwQS/SA0XwxPnx9/LOMtBWV5pz6IQcZArGFhWbBBDEhRVkCEWBl/2Q KvQGXeDyW+8jz/5P7W1sA9riufnD5tZmub0JWI2g9eU2aEoh+YOt+DTcj/vSwU3+v8lF +39E6KLvA+EcOXPlZaY/f/D2XvXL2asW8GyuAjudl+Jzsj+iMyE7U5xnfwvcPkXfuf4a QkCYDBJhUHyyda1rPaEZ4fxn7v2gOYmG6YPwyTthYMzPduVJnLVokIpC2kFR0N8Q0sGI T7FEsw0YrfKcsw9N6TeXmouTBrw0dKdNUFkzPc4dgMeQkn8z7LBRoZTVeCaNOglwaRb7 zULQ== X-Received: by 10.170.110.210 with SMTP id c201mr7736143ykb.1.1441414137632; Fri, 04 Sep 2015 17:48:57 -0700 (PDT) Original-Received: from [143.215.109.249] (lawn-143-215-109-249.lawn.gatech.edu. [143.215.109.249]) by smtp.gmail.com with ESMTPSA id a126sm3924316ywc.13.2015.09.04.17.48.56 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Sep 2015 17:48:56 -0700 (PDT) User-Agent: eM_Client/6.0.22344.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Fri, 04 Sep 2015 20:52:46 -0400 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:106161 Archived-At: Hello, python-shell-parse-command in python.el appears to have an issue on=20 Windows which prevents proper startup of the python interpreter depending on the interpreter's path. Here is the current version of=20 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=20 (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=20 pathname coming out of "executable-find". Suppose you have python installed at "C:\Anaconda\python.exe", and=20 "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). Since python-parse-interpeter uses shell-quote-argument, you get the=20 following error when you run "run-python" to start up a python=20 interpreter. "apply: Searching for program: no such file or directory,=20 c\:/Anaconda/python.exe" If I modify Python.el to remove the call to "shell-quote-argument", run-python works properly on my system. Here is the value of my PATH in emacs. (getenv "PATH") ":/usr/local/bin:/mingw/bin:/bin;C:\\Program=20 Files\\ImageMagick-6.9.2-Q16;C:\\windows\\system32;C:\\windows;C:\\windows\= \System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Progra= m=20 Files (x86)\\Git\\cmd;C:\\Anaconda;C:\\Program Files=20 (x86)\\emacs\\bin;C:\\MinGW\\bin;C:\\MinGW\\msys\\1.0;C:\\Program=20 Files\\gs\\gs9.09\\lib;C:\\Program Files\\gs\\gs9.09\\bin;C:\\Program=20 Files (x86)\\Calibre2\\;C:\\Program Files=20 (x86)\\Graphviz2.38\\bin;C:\\Program Files (x86)\\MiKTeX=20 2.9\\miktex\\bin;C:\\Users\\vancan1ty\\AppData\\Roaming\\cabal\\bin;C:\\Use= rs\\vancan1ty\\AppData\\Roaming\\npm;C:\\Python27\\Scripts;C:\\Program=20 Files (x86)\\Nmap;C:\\Program Files\\Boot2Docker for=20 Windows;C:\\altera\\13.0sp1\\modelsim_ase\\win32aloem;C:\\Users\\vancan1ty\= \AppData\\Local\\Pandoc\\" In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/usr --host=3Di686-pc-mingw32' Important settings: value of $LANG: ENU locale-coding-system: cp1252 Major mode: Python Minor modes in effect: shell-dirtrack-mode: t evil-mode: t global-undo-tree-mode: t undo-tree-mode: t evil-local-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: C-; is undefined Quit [2 times] Making completion list... [4 times] Saving file c:/Program Files=20 (x86)/emacs/share/emacs/24.5/lisp/progmodes/python.el... Wrote c:/Program Files=20 (x86)/emacs/share/emacs/24.5/lisp/progmodes/python.el byte-code: Beginning of buffer [2 times] Can't guess python-indent-offset, using defaults: 4 apply: Searching for program: no such file or directory,=20 c\:/Anaconda/python.exe progn: End of line [2 times] user-error: Please specify a file name for the buffer [2 times] byte-code: End of buffer [12 times] Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils python cua-base eieio-opt speedbar sb-image ezimage dframe compile warnings skeleton derived pcase rx loadhist ace-window avy vc-git json help-mode shell misearch multi-isearch ob-dot org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint comint ansi-color ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs cl-macs gv server evil evil-integration undo-tree diff evil-maps evil-commands ffap url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core gnus-util mm-util mail-prsvr password-cache url-vars evil-command-window evil-types evil-search evil-ex evil-macros evil-repeat evil-states evil-core advice help-fns evil-common windmove thingatpt rect evil-digraphs evil-vars ring edmacro kmacro cl-loaddefs cl-lib info easymenu package epg-config time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32notify w32 multi-tty emacs) Memory information: ((conses 8 284198 39511) (symbols 32 33119 0) (miscs 32 160 697) (strings 16 64392 15870) (string-bytes 1 1826027) (vectors 8 33104) (vector-slots 4 1301156 19920) (floats 8 112 474) (intervals 28 2003 81) (buffers 508 19))