From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Live System User Newsgroups: gmane.emacs.bugs Subject: bug#25753: 25.2; Python mode shell interaction not working 100% Date: Sun, 19 Feb 2017 16:32:17 -0500 Message-ID: <878tp1sw7y.fsf@aol.com> References: <83lgt6xbr0.fsf@gnu.org> <87poifjsw2.fsf@users.sourceforge.net> <87lgt2rz4j.fsf@aol.com> <87d1eermwb.fsf@aol.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487539991 6649 195.159.176.226 (19 Feb 2017 21:33:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2017 21:33:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25753@debbugs.gnu.org, "Charles A. Roelli" To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 19 22:33:06 2017 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 1cfZ6P-0001CP-Kk for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Feb 2017 22:33:05 +0100 Original-Received: from localhost ([::1]:35136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfZ6V-0000Pw-Df for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Feb 2017 16:33:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfZ6P-0000Pq-9u for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 16:33:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfZ6M-0000NK-4A for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 16:33:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfZ6M-0000NC-0m for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 16:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cfZ6L-0002Nz-N3 for bug-gnu-emacs@gnu.org; Sun, 19 Feb 2017 16:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Live System User Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Feb 2017 21:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25753 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25753-submit@debbugs.gnu.org id=B25753.14875399469124 (code B ref 25753); Sun, 19 Feb 2017 21:33:01 +0000 Original-Received: (at 25753) by debbugs.gnu.org; 19 Feb 2017 21:32:26 +0000 Original-Received: from localhost ([127.0.0.1]:46550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfZ5m-0002N6-1F for submit@debbugs.gnu.org; Sun, 19 Feb 2017 16:32:26 -0500 Original-Received: from omr-m008e.mx.aol.com ([204.29.186.7]:56861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cfZ5k-0002Mu-Fm for 25753@debbugs.gnu.org; Sun, 19 Feb 2017 16:32:24 -0500 Original-Received: from mtaout-mba01.mx.aol.com (mtaout-mba01.mx.aol.com [172.26.133.109]) by omr-m008e.mx.aol.com (Outbound Mail Relay) with ESMTP id 0781A380004C; Sun, 19 Feb 2017 16:32:19 -0500 (EST) Original-Received: from localhost.localdomain (c-50-163-97-64.hsd1.ma.comcast.net [50.163.97.64]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mtaout-mba01.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id 915CF3800008E; Sun, 19 Feb 2017 16:32:18 -0500 (EST) In-Reply-To: (Noam Postavsky's message of "Sun, 19 Feb 2017 15:00:03 -0500") x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20150623; t=1487539938; bh=6Z6kfjNvFn5gd7gUqvVGVdZSVRagWqZ4irO+LyMAu4w=; h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type; b=UR+9FuldJzLawjZOyg0DM+RcAYRJ5veMCwbm88UxCm6pc7oi/5ghYgA5ooBgKVPCZ cA23S+gnSD6+oVr4gj2hLmMwqbPSfR20sttKtq7Cw2Z4c1C1g4eFJe7UJaMVdLP9BX BiwwPtLEwe/SDY5ZQCe7WF/YEzTT4kKdpyt4nIQM= x-aol-sid: 3039ac1a856d58aa0ee23694 X-AOL-IP: 50.163.97.64 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:129554 Archived-At: Noam Postavsky writes: > On Sun, Feb 19, 2017 at 2:39 PM, Live System User wrote: >>> >>> Do you see this with 25.2-rc1 on GNU/Linux though? >> >> Fedora doesn't have that version available currently. > > Can you try it after M-x load-library python RET and then evaluate > this new definition of python-shell-completion-native-try: > > (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 "_"))) I was already using that (wrapped in a "with-eval-after-load 'python") from: https://github.com/jorgenschaefer/elpy/issues/887#issuecomment-275175119 to no avail. > >> >> I did, however, look into the Python modules having to do with >> "readline"(completion). >> >> I discovered that if I used the "readline" from "pyrepl.py"instead >> of the standard default one, then even though that warning still >> occured in a *Warning* buffer in Emacs, I never saw it -- I just >> saw the *Python* buffer and my source buffer, as expected. > > I'm not sure what "pyrepl" is or to "use" it, but just looking at web > search results, it seems to be connected to pypy, which is in the list > of python-shell-completion-native-disabled-interpreters, could that be > related? Not really but it makes allowances on whether or not pypy.py is currently loaded. Here is an important piece of pyrepl that appears to be revelent to how it deals with input and output from terminals (TTYs) and non-terminals: if '__pypy__' in sys.builtin_module_names: # PyPy def _old_raw_input(prompt=''): # sys.__raw_input__() is only called when stdin and stdout are # as expected and are ttys. If it is the case, then get_reader() # should not really fail in _wrapper.raw_input(). If it still # does, then we will just cancel the redirection and call again # the built-in raw_input(). try: del sys.__raw_input__ except AttributeError: pass return raw_input(prompt) sys.__raw_input__ = _wrapper.raw_input else: # this is not really what readline.c does. Better than nothing I guess import __builtin__ _old_raw_input = __builtin__.raw_input __builtin__.raw_input = _wrapper.raw_input _old_raw_input = None I think that this related in the fact that the Emacs interaction is not with a real TTY (it doesn't have defined or tigetstr-retrievable terminal capabilities (curses) like how to do operations like "clear", "cup" or "horizontal" positioning). Thanks.