From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Strip Newsgroups: gmane.emacs.devel Subject: Bug in python.el (at least for Windows OS) Date: Sat, 06 Dec 2014 04:41:16 +0000 Message-ID: <548288E4.2030302@stripfamily.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1417850288 22623 80.91.229.3 (6 Dec 2014 07:18:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Dec 2014 07:18:08 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 06 08:18:02 2014 Return-path: Envelope-to: ged-emacs-devel@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 1Xx9cv-0002cr-8I for ged-emacs-devel@m.gmane.org; Sat, 06 Dec 2014 08:18:01 +0100 Original-Received: from localhost ([::1]:53592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx9cu-0003Tp-P6 for ged-emacs-devel@m.gmane.org; Sat, 06 Dec 2014 02:18:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx7BW-0007A6-To for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:41:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xx7BF-0005TY-Nb for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:41:34 -0500 Original-Received: from mail128-20.atl41.mandrillapp.com ([198.2.128.20]:51415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xx7BF-0005TT-IU for emacs-devel@gnu.org; Fri, 05 Dec 2014 23:41:17 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=mail128-20.atl41.mandrillapp.com; h=From:Sender:Subject:Message-Id:To:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=david@mail128-20.atl41.mandrillapp.com; bh=RGf7NNNprKyKVILHLjd54ihEfB0=; b=KJO1A6kj8wE3g6hSKefjxWDG0SVfO/Cz6i4u1soQeYv3paYbAbYgjONexWshLHbAU2dlY1GfpjlJ DtJBuw1QZhxXSqInyVGVm/ZRLwKwgtUw9dtRlC9nh3OK0DWCAldf2KKu58lKdF5noQzvJ2ePwhxh cXhtXTSEivssspx9ODM= DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=mail128-20.atl41.mandrillapp.com; b=jyy3r+p33472Wepul5+WNohXkLvBs0cdkWUm+U701IF5/wKYaLLi+vSE/xrSOw+GTK1sfa4AkgfL /8WCZDrwptD716/Lz9ctjuzUYM0HWSF3T4dag4N1XnnGPSVOzRtkJ30vnj6LSeXARCc9q6xpe/X1 cjhirV5g3jbqjH9pyms=; Original-Received: from pmta04.atl01.mandrillapp.com (127.0.0.1) by mail128-20.atl41.mandrillapp.com id hga4eq1mquks for ; Sat, 6 Dec 2014 04:41:16 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1417840876; h=From : Sender : Subject : Message-Id : To : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=CiqBaDnI+m01YZ+NLMLv8a3p0jkU/n5RV3Pr4lp3eh4=; b=BX7SRs6kDFuqXf4YkaVMqBLR1iIvg8KiRFgwwW+KGHzfQDVBtdz/vlr1lct4dvy5w9FABv 7Zxz7Y5+U58ENxgrMsnf4mEbM2SNldcoR4nZwa3ojUrNITFu3BLnH6BJjAv7zVR34DAO0k2c cpYeyuCvISi71k6Xzl04ifpHF6WGY= Original-Received: from [184.63.2.196] by mandrillapp.com id 328575f19b37469199661dc6ce5ec569; Sat, 06 Dec 2014 04:41:16 +0000 X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30054788.328575f19b37469199661dc6ce5ec569 X-Mandrill-User: md_30054788 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.2.128.20 X-Mailman-Approved-At: Sat, 06 Dec 2014 02:17:48 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:179099 Archived-At: If the path to the python executable contains an embedded space, any command that attempts to spawn a shell will fail with "invalid argument" since the space makes the command appear to contain extra args.
In some sense, the root of the problem is locate-file, called by executable-find (both defined in files.el). locate-file does not return quoted paths.=C2=A0 I'm not sure if the best fix is at the locate-files level, since I'm not sure what consequences this might have elsewhere, esp on non-Windows OS's. The most localized fix would be in python.el, changing python-shell-parse-command to add the required quotes. In the simplest case, this would be just change the format statement from
(format "%s %s"
to
(format "\"%s\" %s"
This definitely works on Windows, but I'm not certain how this would affect other OS's. Perhaps the format string has to be conditioned on the OS.

--