Subject: bug#24401: python-shell-completion-native-try returns incorrect results with python 3.5.2

From: Lukas Juhrich <[email-masked]>
Date: Thu, 27 Oct 2016 03:34:35 +0200

Hi,

On 10.09.2016 06:00, Clément Pit--Claudel wrote:
> Does anyone object to the proposed fix?
>
> Clément.
>

May I as a complete outsider to emacs development ask what the state
on this is?  To me it looks like this just hasn't been done yet.

If having a patch file makes things easier, there is one attached; Let
me know if I can help otherwise.

--
Sincerely,
Lukas Juhrich
From 5919da9446850a3830ea1702c500dd749935dd54 Mon Sep 17 00:00:00 2001
From: Lukas Juhrich <[email-masked]>
Date: Thu, 27 Oct 2016 03:24:58 +0200
Subject: [PATCH] Fix Bug #24401 (python native completion warning)

This commit fixes #24401 by checking for completions using "_" instead

Checking the python processes' completion by completing "" in
`python-shell-completion-native-try` does not work, since an empty
string does not yield any completion in python (at least python3.5).
Thus, `nil` is returned and the completion is regarded unsuccessful.

This commit changes the character to "_" and thus fixes #24401.
---
 lisp/progmodes/python.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ad69f87..290cdc8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3318,7 +3318,7 @@ When a match is found, native completion is disabled."
          python-shell-completion-native-try-output-timeout))
     (python-shell-completion-native-get-completions
      (get-buffer-process (current-buffer))
-     nil "")))
+     nil "_")))
 
 (defun python-shell-completion-native-setup ()
   "Try to setup native completion, return non-nil on success."
-- 
2.10.1