From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#28499: 27.0.50; Improve python.el fallback shell completion python3 compatibility Date: Fri, 22 Sep 2017 20:20:53 -0400 Message-ID: <87efqynu3e.fsf@users.sourceforge.net> References: <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: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1506126135 2396 195.159.176.226 (23 Sep 2017 00:22:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Sep 2017 00:22:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 28499@debbugs.gnu.org To: =?UTF-8?Q?J=C3=B6rg?= Behrmann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 23 02:22:08 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 1dvYCs-000087-QK for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Sep 2017 02:22:07 +0200 Original-Received: from localhost ([::1]:33236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvYCz-00085w-KZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Sep 2017 20:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvYCr-00083f-Ae for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 20:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvYCo-0000Pq-4B for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 20:22:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44660) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvYCo-0000Pl-05 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 20:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dvYCn-0002do-Q3 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2017 20:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Sep 2017 00:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28499 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28499-submit@debbugs.gnu.org id=B28499.150612606410083 (code B ref 28499); Sat, 23 Sep 2017 00:22:01 +0000 Original-Received: (at 28499) by debbugs.gnu.org; 23 Sep 2017 00:21:04 +0000 Original-Received: from localhost ([127.0.0.1]:53341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvYBs-0002cU-6X for submit@debbugs.gnu.org; Fri, 22 Sep 2017 20:21:04 -0400 Original-Received: from mail-io0-f180.google.com ([209.85.223.180]:46324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvYBp-0002bY-M9; Fri, 22 Sep 2017 20:21:02 -0400 Original-Received: by mail-io0-f180.google.com with SMTP id d16so5882314ioj.3; Fri, 22 Sep 2017 17:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=FSlkTeFdaozsE7NlaDmhHC1c5jgIEQT9EuW8/7L1Iw0=; b=jMJm9MMI6I59hVAbF0HMHm887LnKyIejB6xmkm95QuOUrQd6ze5IVv5j+p658eT8JC q5AzojSCWkhkQmSBcdUr7f2c3wKHReqUFDaxU5UkBRi2ORgckXpAAZRwKbb3Qs4xwMgj 7WmmVEXZ8Pl0PMgnuyNyZPGQUNaEUwzENUE9q3lEi5C8FZZMC6fyfG5j5gz0kHumTmJb sgNrMsgYLdqKAyWTTOdc2YLVPrLber+rbEBv9JtwC00dEKsVlspJryqcKNEMaMV5t0/h BiZs73k+LZEaiKAJdHdzOsh410KP9obcjSCSYI/E/HZuRSl+iM5PsJATNO5mAnbYvPO2 vWFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=FSlkTeFdaozsE7NlaDmhHC1c5jgIEQT9EuW8/7L1Iw0=; b=MGTUFZo/OepQW8rlURlRucxGRXDp+9vNDmkZ0i1ntXeny9Z103Nq5Zd3ywOHRrrTtd VZuyDIlU02tdfXhW5uSlDP54kA607JCgZIAyrImSJ6JDJ1neutGD/B2ifeKzHmXWSbO0 mcJqq/UnIMcncMlHjo9waa/R56R5KYFCE+muDlvoK97vx5E7XiLF7+/crUtb154cQPBL K159dl7hGeiUatKOkYAXlYgRP45XaOrTFcbGzOZKKWV20OuJ/MTbCPDE7jlUU1I1lCh9 zXrXBtdm9KRJK7v635GASr2pgUZA+z09SXXNjIpwsChAzVVgi5iJcr57TWregMmO0Txj REFw== X-Gm-Message-State: AHPjjUhoRBs3hkWl3AV5kGIvgRZgOU9agYu5L8eyOo/UOVrcBSLq79dj 8yEnGU08yzyIL32RbHAzhb76yQ== X-Google-Smtp-Source: AOwi7QDpOrGNGREAkMn6CMbUEt6jxd39Gh+FcYnpWyvebb5w7sex5kC+66JEiCppSHNtuh6AKNQPPg== X-Received: by 10.107.201.84 with SMTP id z81mr1377763iof.96.1506126055582; Fri, 22 Sep 2017 17:20:55 -0700 (PDT) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id l195sm1389820itl.2.2017.09.22.17.20.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Sep 2017 17:20:54 -0700 (PDT) In-Reply-To: <8760cguj2b.fsf@boltzmann.i-did-not-set--mail-host-address--so-tickle-me> ("=?UTF-8?Q?J=C3=B6rg?= Behrmann"'s message of "Mon, 18 Sep 2017 17:23:40 +0200") 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:137260 Archived-At: tags 28499 + patch quit J=C3=B6rg Behrmann writes: > 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=20 > > /usr/sbin/ipython:21: DeprecationWarning: inspect.getargspec() is depreca= ted, 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. Thank! Have you assigned copyright to Emacs? (The patch is small enough to install regardless, I only ask to know whether it should be marked as copyright exempt or not.) >>>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 =3D basestring > + argspec_function =3D inspect.getargspec > except NameError: > str_type =3D str > + argspec_function =3D inspect.getfullargspec > if isinstance(obj, str_type): > obj =3D eval(obj, globals()) > doc =3D inspect.getdoc(obj) > @@ -4285,9 +4287,7 @@ python-eldoc-setup-code > target =3D obj > objtype =3D 'def' > if target: > - args =3D inspect.formatargspec( > - *inspect.getargspec(target) > - ) > + args =3D inspect.formatargspec(*argspec_function(target)) > name =3D obj.__name__ > doc =3D '{objtype} {name}{args}'.format( > objtype=3Dobjtype, name=3Dname, args=3Dargs