From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25025: python-shell-calculate-command is wrong Date: Tue, 29 Nov 2016 20:56:16 -0500 Message-ID: <87wpflhgsf.fsf@users.sourceforge.net> References: <83polk3qow.fsf@gnu.org> <83inra13r3.fsf@gnu.org> <8337ic29y0.fsf@gnu.org> <87r35wj4b8.fsf@users.sourceforge.net> <83zikkzytf.fsf@gnu.org> <8737i9iz28.fsf@users.sourceforge.net> <1949fc46-fd26-dddb-86b2-ab3478587271@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480470978 27277 195.159.176.226 (30 Nov 2016 01:56:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 01:56:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25025@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 30 02:56:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBu83-0006G1-V3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2016 02:56:12 +0100 Original-Received: from localhost ([::1]:40381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBu87-0003c5-Oc for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Nov 2016 20:56:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBu7y-0003aw-7B for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 20:56:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBu7v-0004Tm-7b for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 20:56:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBu7v-0004TL-50 for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 20:56:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cBu7u-0008Oc-D1 for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2016 20:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2016 01:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25025 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25025-submit@debbugs.gnu.org id=B25025.148047092832226 (code B ref 25025); Wed, 30 Nov 2016 01:56:02 +0000 Original-Received: (at 25025) by debbugs.gnu.org; 30 Nov 2016 01:55:28 +0000 Original-Received: from localhost ([127.0.0.1]:46700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBu7M-0008Ni-5X for submit@debbugs.gnu.org; Tue, 29 Nov 2016 20:55:28 -0500 Original-Received: from mail-io0-f182.google.com ([209.85.223.182]:33816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBu7J-0008NU-Uc for 25025@debbugs.gnu.org; Tue, 29 Nov 2016 20:55:26 -0500 Original-Received: by mail-io0-f182.google.com with SMTP id c21so306289631ioj.1 for <25025@debbugs.gnu.org>; Tue, 29 Nov 2016 17:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=dNknytu0VvJ/vb7m1RwEHvFK9l6gsIS96KkjZTmgxPc=; b=lp3Mj/Bw7BE115Tk4IZbZhx5OrGN+bc7BU0VF+9XhxvoGMaAgpNjz4S/7TyN6lWzU9 NfS8Y4nt9OUzfI2QfDAjsCsYmPvrrv02TuG6PAvbEu3hlUczpLAg7Moz0BBtxMHKktD7 H2GwrfuDjIlmUbmSnMtrggux3lDdpZoxX8rekAF8hI3RWz9XdX+06iQyroQ1roLGDCcL BRztfMd5fb+eqn58MvoG7DwWMATAt/1C1p62HWwfnJN1VbE49lJBIDfymh12VRIKoqqT 3lthCK0LZJ51AvBhY1PKfzct5Ebj7+fsaY1oHPq4AhP7e77/NYn+FnxqDjqyQpBjogHa YcVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=dNknytu0VvJ/vb7m1RwEHvFK9l6gsIS96KkjZTmgxPc=; b=bDWGzN16dVK1dXn9+smeuxU1xD8zOV8VhTbYehoORuqIUyKFMvJ25dbwiUX9nova9Y doGFjsNc75M9Hn0QCw3OnLenQ5s4pC35ygquymt9bRDzjCGXlz477LQMU6Vv9Jy35JSe WI6KjTFmdW1rdoENhn8mnIF8BKiZZE1NW5ISUz168Pb9qvyTpcXmZ4k5Mb7NFuasjlzV D0GvhdzXpR6+A7jqsywcngT+7e/T2zLwTLggzu7Nnl/VPbPk1ZcvuxXCjT1jX9WPW1Oj cGbuqXX9XkIH9ucpkenaVDEFJc68o4oKaXtD56Vo/r0a3nqoRLCMeMK2mCVByy0qJbnU +T2Q== X-Gm-Message-State: AKaTC02FssMQaWlFvWat/2rFYMtjdlCYvhZvPlAHcGI3oFI2c5gUPXOG0lq+PhaQVsoefQ== X-Received: by 10.36.184.194 with SMTP id m185mr26274754ite.3.1480470919173; Tue, 29 Nov 2016 17:55:19 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l203sm1877256ita.6.2016.11.29.17.55.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Nov 2016 17:55:18 -0800 (PST) In-Reply-To: <1949fc46-fd26-dddb-86b2-ab3478587271@gmail.com> ("=?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel"'s message of "Tue, 29 Nov 2016 20:35:46 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:126282 Archived-At: Cl=C3=A9ment Pit--Claudel writes: > On 2016-11-29 19:36, npostavs@users.sourceforge.net wrote: >> Eli Zaretskii writes: >>=20 >>>> From: npostavs@users.sourceforge.net >>>> Cc: 25025@debbugs.gnu.org, clement.pit@gmail.com >>>> Date: Sun, 27 Nov 2016 11:06:03 -0500 >>>> >>>>> Why does it need to be split? A shell command can (even should) be >>>>> handed to the shell as a single string. >>>> >>>> Currently it's not a shell command, because a shell isn't being used. >>>> My other suggestion was to use a shell: >>>> >>>>>> It might be more intuitive to actually use a shell and then the user >>>>>> would enter a shell command (though inserting a shell into things >>>>>> might bring more complications). >>> >>> If it doesn't use a shell, then it has no business quoting commands or >>> their parts using shell-related APIs. >>> >>> So yes, I think using a shell would be TRT here. Can someone please >>> work on a patch in that direction? This problem exists for a long >>> time, so I hope we could solve it soon. >>=20 >> Hmm, the difficulty in using a shell is that the current code wants to >> parse the command into interpreter and arguments in order to match >> against `python-shell-completion-native-disabled-interpreters'. > > That doesn't prevent us from using a shell. We run the command > unmodified through a shell, and we split it and analyze it separately > to decide whether to enable completion. But we don't split and > reassemble it before running it. Yes, but then we need to parse a shell quoted command, which is quite a bit more difficult. That gets back to your suggestion about getting an elisp equivalent to shlex I suppose. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25025#28