From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?J=C3=B6rg?= Behrmann Newsgroups: gmane.emacs.bugs Subject: bug#28499: 27.0.50; Improve python.el fallback shell completion python3 compatibility Date: Mon, 18 Sep 2017 17:23:40 +0200 Message-ID: <8760cguj2b.fsf@boltzmann.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1505749125 11527 195.159.176.226 (18 Sep 2017 15:38:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Sep 2017 15:38:45 +0000 (UTC) To: 28499@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 18 17:38:41 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 1dty88-0002l2-QY for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 17:38:41 +0200 Original-Received: from localhost ([::1]:37324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dty8G-0003R6-5P for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 11:38:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dty2k-0007Wk-JC for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:33:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dty2h-0000G5-6a for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:33:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dty2h-0000Fv-26 for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dty2g-0004R3-SB for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?J=C3=B6rg?= Behrmann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2017 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28499 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.150574875316990 (code B ref -1); Mon, 18 Sep 2017 15:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2017 15:32:33 +0000 Original-Received: from localhost ([127.0.0.1]:46615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dty2B-0004Pv-Bq for submit@debbugs.gnu.org; Mon, 18 Sep 2017 11:32:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtxuq-0004Cl-4o for submit@debbugs.gnu.org; Mon, 18 Sep 2017 11:24:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtxuj-0004mN-ND for submit@debbugs.gnu.org; Mon, 18 Sep 2017 11:24:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44231) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dtxuj-0004mF-J9 for submit@debbugs.gnu.org; Mon, 18 Sep 2017 11:24:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtxuh-0005C8-SY for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:24:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtxuc-0004jv-KY for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:24:47 -0400 Original-Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:36658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dtxuc-0004ic-Br for bug-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:24:42 -0400 Original-Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.85) for bug-gnu-emacs@gnu.org with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1dtxuY-000T1s-Py>; Mon, 18 Sep 2017 17:24:38 +0200 Original-Received: from p5ddb0849.dip0.t-ipconnect.de ([93.219.8.73] helo=boltzmann) by inpost2.zedat.fu-berlin.de (Exim 4.85) for bug-gnu-emacs@gnu.org with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (envelope-from ) id <1dtxuY-000ARX-I1>; Mon, 18 Sep 2017 17:24:38 +0200 X-Originating-IP: 93.219.8.73 X-ZEDAT-Hint: A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Mon, 18 Sep 2017 11:32:30 -0400 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:137059 Archived-At: --=-=-= Content-Type: text/plain When using IPython as the python-shell-interpreter using (setq python-shell-interpreter "ipython" python-shell-interpreter-args "-i --simple-prompt") the fallback shell completion is used. When this IPython is using the python3-interpreter upon resting point on a function name some information is shown using eldoc, but also /usr/sbin/ipython:21: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec() This can be easily fixed by customizing python-eldoc-setup-code to not only account for the differing str_type between python2 and python3, but to also either set inspect.getargspec or inspect.getfullargspec as inspection function. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-18 built on boltzmann Repository revision: 61a5c30e70926f48480b03b79f4f531c8d64418e Windowing system distributor 'The X.Org Foundation', version 11.0.11903000 System Description: Arch Linux Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --prefix=/home/drako/.devlocal' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD LCMS2 Important settings: value of $LC_COLLATE: de_DE.utf8 value of $LC_MONETARY: de_DE.utf8 value of $LC_NUMERIC: en_US.utf8 value of $LC_TIME: de_DE.utf8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message subr-x puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils python easymenu tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete parse-time format-spec advice auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map seq byte-opt gv bytecomp byte-compile cconv comint ring cl-loaddefs cl-lib ansi-color elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 224182 11719) (symbols 48 22573 1) (miscs 40 52 176) (strings 32 36999 1441) (string-bytes 1 1087109) (vectors 16 38977) (vector-slots 8 758280 10386) (floats 8 67 517) (intervals 56 468 0) (buffers 992 12)) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Improve-python3-compatibility-of-fallback-completion.patch >From 5f7f6d47504b53e80e6bd948aa46d77612ff8504 Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Mon, 18 Sep 2017 16:59:49 +0200 Subject: [PATCH] Improve python3-compatibility of fallback completion * lisp/progmodes/python.el (python-eldoc-setup-code): Use inspect.getfullargspec instead of inspect.getargspec to avoid a deprecation warning on every usage of eldoc in python-mode --- lisp/progmodes/python.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f3513ced4b..365191c56b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -4271,8 +4271,10 @@ python-eldoc-setup-code import inspect try: str_type = basestring + argspec_function = inspect.getargspec except NameError: str_type = str + argspec_function = inspect.getfullargspec if isinstance(obj, str_type): obj = eval(obj, globals()) doc = inspect.getdoc(obj) @@ -4285,9 +4287,7 @@ python-eldoc-setup-code target = obj objtype = 'def' if target: - args = inspect.formatargspec( - *inspect.getargspec(target) - ) + args = inspect.formatargspec(*argspec_function(target)) name = obj.__name__ doc = '{objtype} {name}{args}'.format( objtype=objtype, name=name, args=args -- 2.14.1 --=-=-=--