From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Newsgroups: gmane.emacs.bugs Subject: bug#24401: python-shell-completion-native-try returns incorrect results with python 3.5.2 Date: Fri, 9 Sep 2016 19:07:54 -0400 Message-ID: <1d47cad6-227f-280a-2645-d97b45bbda44@live.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HwX6W23VB1olhdqoxfvdm9KJsiEfhD5UU" X-Trace: blaine.gmane.org 1473462574 13680 195.159.176.226 (9 Sep 2016 23:09:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2016 23:09:34 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 To: 24401@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 10 01:09:30 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 1biUv7-0001bs-8K for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Sep 2016 01:09:17 +0200 Original-Received: from localhost ([::1]:60629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUv5-0006ip-4G for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Sep 2016 19:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUux-0006hV-98 for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:09:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biUus-0004iz-7u for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:09:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUus-0004iv-4F for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1biUus-0005xz-15 for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Sep 2016 23:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24401 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.147346251122897 (code B ref -1); Fri, 09 Sep 2016 23:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Sep 2016 23:08:31 +0000 Original-Received: from localhost ([127.0.0.1]:54991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biUuN-0005xE-CO for submit@debbugs.gnu.org; Fri, 09 Sep 2016 19:08:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1biUuL-0005wz-EC for submit@debbugs.gnu.org; Fri, 09 Sep 2016 19:08:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biUuF-0004gz-8q for submit@debbugs.gnu.org; Fri, 09 Sep 2016 19:08:24 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUuF-0004gn-5l for submit@debbugs.gnu.org; Fri, 09 Sep 2016 19:08:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUuC-0006M3-PM for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:08:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biUu7-0004gI-Nm for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2016 19:08:20 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:51221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biUu7-0004g6-9I; Fri, 09 Sep 2016 19:08:15 -0400 Original-Received: from [18.26.2.123] ([18.26.2.123]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0MJawd-1bjssZ2NeF-0039Lt; Sat, 10 Sep 2016 01:08:12 +0200 X-Provags-ID: V03:K0:087GdHC7wL5uXRwAgmFMgIw8eJkWUR7urOlw/jOqHnJjC9zYwNm Bjha97a8TBeRyHXzYp6h0vZY4dM4R+cPQWagX2pKFKcIdkLJhJwes39xGZYBPdp8e/iagmQ wnooDkDPu5KQBBOHfcSqMYfZrRrChLuJ3RsLsOFPiDT2mZunGZvXlf/1UoyE64VtQpnjIBu juhLU5BP0Rwos34Iqnhgw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Xq8kGhDlyIg=:YUl/gQHu41YwJZKEX/JC6M 4tPraLleSCF5QVI3aTwpv4m3awm+tQYyAg38vUIpMQ3P/AFKs5vmar05aOBqMvw+XBjdWTI0D B5ZmNLKY8Gj81R95bWmZ4nEiQ31k+irfMMWnhH7xcYm/aaQzZuYwznW/iRbG5Rxt3cyEqFwF6 mvMRDEPl+ZS56O7si488eVr0VbB8E5IUf8uHEknnSp5G9LgiijZSu8u0NkgfE/R+LQw2RlOZS wvc0/6H9FaaMq0d4kKVFTI2+XkoLfgsdLD5aUWhMIHXSA2LNjr9QfekIoYLRJOmY0ztXrodJI khRw7L7oEYuWr7aX3/9206FQh3bkoxosvLUn9BMuIL4t1EH92Kr2JsBrOAPkkKshzlSgl7hgi yIjv2J2rUsztLt2RhMXhdspXrFiDNBKRQp2O3nLGmhVFw8/zlFET4U5fUoj/mmg/EJoL6pzn9 fVXyi34pnFBjzQF0/oIov9xwP2SurVQoC0uK3qDB70pfJJJL1kMS+uuXM4NYkgj87mZjHm2rk YmMpNNrWizTVe4E7RMT+W2e/GEdCCYhKEVhSBbeHNh/HQtJvuyQmqRM6I7WX1nzjSZsoEUeJB NVh24ejDS6zcONOJddt6ToPNdCa9yzUIaURtc4NXiBjCQyESLFrl2eYEK496MZfkdgriujW+m TwyYwa81FYAh5ikhPFMFW79J3i0JgrF6xjIrbh6b+90mSOxMhey1zcO2km8jpsFBsn2s= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:123129 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HwX6W23VB1olhdqoxfvdm9KJsiEfhD5UU Content-Type: multipart/mixed; boundary="4w1AUgbXh6Pc4ivfcLwT6HbfPbX1evFWd"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: bug-gnu-emacs@gnu.org Cc: fgallina@gnu.org Message-ID: <1d47cad6-227f-280a-2645-d97b45bbda44@live.com> Subject: python-shell-completion-native-try returns incorrect results with python 3.5.2 --4w1AUgbXh6Pc4ivfcLwT6HbfPbX1evFWd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi all, Calling =E2=80=98run-python=E2=80=99 in =E2=80=98emacs -Q=E2=80=99 with =E2= =80=98python-shell-interpreter=E2=80=99 set to "python3", I get the follo= wing warning: Warning (python): Your =E2=80=98python-shell-interpreter=E2=80=99 doe= sn=E2=80=99t seem to support readline, yet =E2=80=98python-shell-completion-native=E2=80=99 was t = and "python3" is not part of the =E2=80=98python-shell-completion-native-disabled-interpre= ters=E2=80=99 list. Native completions have been disabled locally. This warning is specific to Python 3 (it doesn't happen with Python 2.7).= Additionally, the warning is spurious; native completion works fine. Th= is whole feature is new in Emacs 25. The problem seems to be in (defun python-shell-completion-native-try () "Return non-nil if can trigger native completion." (let ((python-shell-completion-native-enable t) (python-shell-completion-native-output-timeout python-shell-completion-native-try-output-timeout)) (python-shell-completion-native-get-completions (get-buffer-process (current-buffer)) nil ""))) The last call returns nil, apparently because =E2=80=98=E2=80=A6-get-comp= letions=E2=80=99 doesn't work with an empty input string in Python 3.5.2 = with Emacs 25; however, if I change that last call as follows: (python-shell-completion-native-get-completions (get-buffer-process (current-buffer)) nil "_") ^ add an underscore here, or another character that has complet= ions Then the warning message doesn't appear any more. Put more succinctly: Emacs 25, Python 2.7 (no warnings): Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more informa= tion. >>> python.el: native completion setup loaded (python-shell-completion-native-get-completions (get-buffer-proce= ss (current-buffer)) nil "") =E2=87=92 ("and" "as" "assert" "break" "class" "continue" "def" "= del" "elif" "else" "except" "exec" "finally" "for" "from" =E2=80=A6) (python-shell-completion-native-get-completions (get-buffer-proce= ss (current-buffer)) nil "_") =E2=87=92 ("__package__" "__PYTHON_EL_native_completion_setup" "_= _pyfile" "__name__" "__code" "__doc__" "__import__" "__debug__") Emacs 25, Python 3.5 (shows a warning): Python 3.5.2 (default, Jul 5 2016, 12:43:10) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more informa= tion. >>> python.el: native completion setup loaded (python-shell-completion-native-get-completions (get-buffer-proce= ss (current-buffer)) nil "") =E2=87=92 nil ;; =E2=86=90 This is the bug (python-shell-completion-native-get-completions (get-buffer-proce= ss (current-buffer)) nil "_") =E2=87=92 ("__name__" "__package__" "__spec__" "__PYTHON_EL_nativ= e_completion_setup" "__doc__" "__loader__" "__code" "__pyfile" "__build_c= lass__" "__import__" "__debug__") Can we add the suggested underscore? Cheers, Cl=C3=A9ment. --4w1AUgbXh6Pc4ivfcLwT6HbfPbX1evFWd-- --HwX6W23VB1olhdqoxfvdm9KJsiEfhD5UU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX00DWAAoJEPqg+cTm90wjGs8P/AguYpjUyhvgirobE2V4Imrw CiFlHFBOkqf57LqRzzTcssTyIO1puGM21U6N8BX9dO5sVce5SjadLtI4k0/Hc1hK n1xT5kNc8un+6DRHqrxWrHNRCzSkax4IGZXtRR+jJwdatOkvxyc/QrLY/NVHRWCJ Wa6RpSNOob0SuTX8ECymU5zrsNWUhPYZa1S0G/GIWZDzHPxYrIRAxUtVUXDM5RzU IS33rasIWvOKOOELHOhzyNJKhiZ9KmwPHjVwSe0aF1OhzbxnK2Q2njAJxVw/SJd+ poLp8SAOq4u1evDqMZloFiQePD5ZBm807+wIO3YDCnpH6wnR3XIfpN1ZNTDGNaHl 3hpqG1iPgIu36CI4NP9QsPSWwRGo5xMXAsaaM00xwjlloAB61Zq6r8/LQjRHiJQn W8ukwJMEJ+dkP6OPtvHqOpsOYRIV5iVX/SmvQr/m79unVrWDpZ69P7ojTTsuRj4M DA1u7JXnT2/vIcYjIRYXw21Cg0lMUIgNL/PM9uyOcXW8xGYN5tfHTxV8T3pYYVjS WNW8vGKEeBS5NGD8b6wyqDv7J2VMJmXG8a8GQU3UrXBWzaqlu1kSu8qNBgtCQaTh o2IhDQDLlVWkGtx+CSxH6izyZtoTFwkss2PLgz+VIKzzOD9zaZsrvR7m4afExOnj oIfg70O1s13zt0YuvsCb =prEp -----END PGP SIGNATURE----- --HwX6W23VB1olhdqoxfvdm9KJsiEfhD5UU--