GNU bug report logs - #76205
31.0.50; 31.0.50; python.el completion broken for non-builtin objects in IPython 8.30.0 & Python 3.13.2

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Visuwesh <visuweshm@HIDDEN>; dated Tue, 11 Feb 2025 15:08:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 16 Feb 2025 14:02:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 16 09:02:51 2025
Received: from localhost ([127.0.0.1]:32922 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjfER-0005Ey-Bq
	for submit <at> debbugs.gnu.org; Sun, 16 Feb 2025 09:02:51 -0500
Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:58550)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1tjfEO-0005Ed-30
 for 76205 <at> debbugs.gnu.org; Sun, 16 Feb 2025 09:02:49 -0500
Received: by mail-pj1-x1042.google.com with SMTP id
 98e67ed59e1d1-2fc0026eb79so6598519a91.0
 for <76205 <at> debbugs.gnu.org>; Sun, 16 Feb 2025 06:02:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739714562; x=1740319362; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=PKAJ2UUJ++IeRJM1MqSnd5q0sSmiZnZWIOWF9Qhb3vk=;
 b=MA1gZhZT0bUDiENbfe5qZXADdzAMUshnQbWvLEo+dOY5zWLBt7nbWMTf04NU8DENqH
 s1g7DB91qifPTEOdaw+NiEHo7ZMghAWxV+eq5EFBdEX/nKsphNE/Ih2k9UDwWtDRvyje
 QGIfk2Jhkkcsy368KeKVEVePeV2ZL6JyOEB6SEj6+UkTSl5KGYRkvBBbyWEfL7/IduFW
 aGefT6BJkf3waSGuXr6MLpci0ywV9KMUNKK/fy4q8TEliX7okdjfZbNsGckUHUvISLEM
 WCumGR+7XZtI9tGc4IKARc5aip8l5IMDpbfVWk9wZ2yDkUJ871jdqePZC4rOWH/n7A20
 v3dQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739714562; x=1740319362;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=PKAJ2UUJ++IeRJM1MqSnd5q0sSmiZnZWIOWF9Qhb3vk=;
 b=Ld0W+yIVZmkZHoKi9QqhHd7ioLFtvuKba+07TTsnLCn64F9Zs2iSMkSAlctapsEctp
 jjKr0+3NFs7T9Pzvw3hgT3DTcvAbXKAyylckk5juBgI29ki1Z9Y4wCO4/U+V7vrK2wqA
 TXJHX2/uQEDllJnjyAqkRX/3Iw6o1bGOfQHM/aF8BW6SdjpKZauVdYQ9JMq6rq/mPJna
 L4pCXHA8s903MO/2zPuhm7q/ybUluoUT80OYdA1eC+G9bSkjxoqQ2CJTDaOxewZDpiX3
 qqb2Pc6pR0ROT6u311/JDLOW1Vkrc2Q03Oo4dsbwXbg+/3DpSaNcIcmjIFwBOGo6qPx3
 RWsw==
X-Forwarded-Encrypted: i=1;
 AJvYcCX7wYeF7/rAAptllTFfUkef1nUIT4F/QlLxINvzzAU0OkADcObo1A3v6m1GCa6cNjPGqnKxPw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YztuMo4Eyo+kkErDrbJvnjde9yE0UCOwP2AMV2cc0IUwtOhiVkD
 vc1SVqeOoI44TfS5GaZUdhU+smPJBY3quDGZwluELmkio6ZagfES
X-Gm-Gg: ASbGncvneYcusKVYywfUpopATKfxNetxyiLIVsI5nGy+ThqUjAmJPDCLlQ4dLUzFUtY
 H3D8L8pYkKzC31inLE2B+YUbrJg0oPAWyxbDDEoG2RRrzQhelJ+3q5Pbyt4HVD1hoIK7AUybjEP
 xRvN9Jt7HMBoMY2ujM/EKawI5PAVNI/YjMNypc1l+d8e0u02vBj9GfrMNnWAJwqcr3xZhi4uqGA
 6LECONjt9WmCfzgtsdW+Y29D32s1JVMD1nNnYqKaeJRiONmYyOpPLVtgHhe8tdanImTno01woPJ
 o39/pqICMVdZU9t8
X-Google-Smtp-Source: AGHT+IG6MOpNxVg33GkzeGHn1IxTmhBac6KPBIEqxY9tXGb5V3VcL5E4qbCycCOsG5riZfrTg1NS4A==
X-Received: by 2002:a17:90b:4ad0:b0:2ee:a4f2:b307 with SMTP id
 98e67ed59e1d1-2fc40d14deamr10172807a91.4.1739714562023; 
 Sun, 16 Feb 2025 06:02:42 -0800 (PST)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 98e67ed59e1d1-2fc13ba61f1sm6238484a91.42.2025.02.16.06.02.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 16 Feb 2025 06:02:40 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: kobarity <kobarity@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
In-Reply-To: <eke7zfimqjgp.wl-kobarity@HIDDEN>
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
 <eke74j0xsxeh.wl-kobarity@HIDDEN> <87cyflixo8.fsf@HIDDEN>
 <eke734ggsdvg.wl-kobarity@HIDDEN> <875xlbidz2.fsf@HIDDEN>
 <eke7zfimqjgp.wl-kobarity@HIDDEN>
Date: Sun, 16 Feb 2025 19:32:36 +0530
Message-ID: <87msemugw3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76205
Cc: Liu Hui <liuhui1610@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 76205 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=AA=E0=AE=BF=
=E0=AE=AA=E0=AF=8D=E0=AE=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 16, 2025] kobarity w=
rote:

> Visuwesh wrote:
>>=20
>> [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=AA=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=
=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 15, 2025] kobarity wrote:
>>=20
>> >> [...]
>> >> So...what do we do from here?  Unfortunately, I know next to nothing
>> >> about this area to file a sensible bug report myself.
>> >
>> > I'm not sure either.  As ipython --simple-prompt does not support
>> > completion, I don't know if using rlcompleter with ipython
>> > --simple-prompt is supported or not.
>> >
>> > The direct cause of this problem seems to be that rlcompleter.__main__
>> > is not as expected.  So the following steps enable completion on
>> > ipython --simple-prompt on Python 3.13.
>> >
>> > import readline
>> > import rlcompleter
>> > import __main__
>> > rlcompleter.__main__ =3D __main__
>> > readline.parse_and_bind("tab: complete")
>> >
>> > Attached is a test patch that does something similar to this.
>>=20
>> I can confirm that completion works for non-builtin objects with this
>> patch.
>
> Thank you for testing the patch.
>
> Here's what's happening.  ipython --simple-prompt on Python 3.13 is
> indirectly importing rlcompleter, which sets its Completer().complete
> as the completer.  Completer() without the namespace argument uses
> __main__.__dict__ as the source of global symbols to complete.  The
> __main__ here is the name in rlcompleter.py namespace, which is bound
> at import time of rlcompleter.py.  However, __main__ used in the REPL
> of ipython --simple-prompt is different from __main__ used at the
> import time of rlcompleter.py.  Therefore, changes in globals()
> (i.e. __main__.__dict__) are not reflected in
> rlcompleter.__main__.__dict__ and the completion will fail.
>
> Prior to Python 3.12, the problem does not occur because rlcompleter
> was not imported indirectly.  When we import rlcompleter in the native
> completion setup code, __main__ is already the same as the one used in
> the REPL.
>
> Since IPython does not use rlcompleter, it seems difficult to consider
> this problem a bug in IPython.  It would be better if rlcompleter
> reads sys.modules["__main__"] instead of __main__, but it would not be
> easy to change a long standing specification.  So I think it would be
> better for python.el to address this issue.
>
> To set up a completer that works correctly, it is sufficient to
> specify the namespace argument:
>
> readline.set_completer(rlcompleter.Completer(globals()).complete)
>
> However, we need to make sure that we do not override the customized
> completer.  The problem is that it is difficult to distinguish between
> the completer that is set up by importing rlcompleter and the
> customized completer.
>
> So it seems to me that it would be reasonable to override
> rlcompleter.__main__ so that the default completer works properly.  I
> think the attached revised patch is slightly better than my previous
> patch, since it does not add "__main__" to globals.  This change
> affects only IPython.  I added some comments and the commit message.

Thanks for the explanation.  The attached patch works on my end too.

> I would like to hear your opinions.

I do not have background knowledge on these parts so I hold no technical
opinions.  Please go ahead with a solution that you're satisfied with.
I am happy as long as the completion works as expected!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 16 Feb 2025 10:20:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 16 05:20:52 2025
Received: from localhost ([127.0.0.1]:60363 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjblc-0005g4-EF
	for submit <at> debbugs.gnu.org; Sun, 16 Feb 2025 05:20:52 -0500
Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:49439)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <kobarity@HIDDEN>)
 id 1tjblZ-0005fq-DY
 for 76205 <at> debbugs.gnu.org; Sun, 16 Feb 2025 05:20:50 -0500
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-220ecbdb4c2so59606705ad.3
 for <76205 <at> debbugs.gnu.org>; Sun, 16 Feb 2025 02:20:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739701243; x=1740306043; darn=debbugs.gnu.org;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:from:to:cc:subject:date:message-id:reply-to;
 bh=xOTHRt/pZ3YFYAOChGfBfKcxX7HuDtI1mz5ukKvOiak=;
 b=GTWyiYrPDB9RI9cfRxpR8JZpfFvqavxI/+hMaG+VKrHlu6lkJvBmIlEWcbg1ly6HME
 2sj3CuxiY89WE6lKjztLMbJEIjD/F74k4EkqgujpuSOIKKx9WbAS4dglAZW+C5zqtIDu
 DcXWOQxwsQSsCYYxyhfaMusH/VkIge2e6+sIUaXxQzgInBoiGI1pUgWGnvSkPSNUBLj1
 oOP2G6QJxFEHyrYTTBRUAhhvW3SxMUMchZ3d3v6bWN3yS1SjViKKsvBZsjrhotYUcMcn
 Ql/eafIe+MEaGNYvcBpNVWeVnr6aRHZPAAGNsk929x5GFLMYFMo3GUpACDGBhXu6NN4g
 FZlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739701243; x=1740306043;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=xOTHRt/pZ3YFYAOChGfBfKcxX7HuDtI1mz5ukKvOiak=;
 b=UVim3aY/HcHqYTGH4sQJCzo3358SNUOtVH7H+b5u4PzO7wLAceyOqh3tkBVPgUeMbW
 95aYwClZFxHqy44egiFl2HXkcIdQYmA3xbn0/ZCQMGgJTSrF0SDbgH1wix6O1NoiOlaf
 b+ERQEBLKf9lfdpACqjdYcDRd3bIZMl/wXtyzpcfgTX2lidOozevqsdD0TFqYenk8Rna
 cEljrGbQrlIDZ6vxbSsFBJaBLZ0r06uefZuIU0nBnuBsTI/hxeHBHNvlEasjBN+jZ0Bf
 83kAqYU1v3PYlnBfTsh4FjPnmWbo8WMypOr+C3Z0HseW/RRFjYC6KFWwlCzUIXNOddY1
 cNHQ==
X-Gm-Message-State: AOJu0YwGIPj0ThSHnu7JBv73KhPdd5LxO/xE5yLseU4WJ+Lf8XwgsQo7
 lAlk4VpMnTnygwMOZE3+wKBK2rGbRCW0kt62qNamCaSJhAYTG+wM
X-Gm-Gg: ASbGncsn1iGwHA5YuGQnYYla4ZZOEVtSy1Ok37iWQ0eToA2F3xJfor3c8pc0qsW8wEr
 6WTiJ15glKLLS/t++n7Nlsu8IHE71fAnaEpUXz1P3y1fmd19x6FktWrn+oYHe/ADSG9ziqjPwbK
 aUiYezTj0qafGSxI4c3dAedYmp3JI0yto0UMde/3ZNLLmbjzNmCrDgBKwtGIOIpJshdGIWj9lUC
 IN1ebM0kgCz49RrUXFp74t6SOhD7PS8Z9NRh4h7evgd+2MnCPhC2EBLyNK93oOjdWX48KMC8vYU
 EOBgelXXu78KwgEzzuPGRtc53kRbqUBxDtA7XmY4U3pagQ==
X-Google-Smtp-Source: AGHT+IEBrndWMHch/fQcozAivDs+ytEhF8wS5LjZ/NLgDO96lxDrT/XBlprtsEjWuLUGTwZl675obQ==
X-Received: by 2002:a17:903:22cd:b0:21f:49f2:e33f with SMTP id
 d9443c01a7336-221040389ddmr80150945ad.21.1739701243229; 
 Sun, 16 Feb 2025 02:20:43 -0800 (PST)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-22107b2e993sm20608485ad.198.2025.02.16.02.20.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 16 Feb 2025 02:20:42 -0800 (PST)
Date: Sun, 16 Feb 2025 19:20:38 +0900
Message-ID: <eke7zfimqjgp.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>, Liu Hui <liuhui1610@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50;
 python.el completion broken for non-builtin objects in IPython 8.30.0
 & Python 3.13.2
In-Reply-To: <875xlbidz2.fsf@HIDDEN>
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
 <eke74j0xsxeh.wl-kobarity@HIDDEN> <87cyflixo8.fsf@HIDDEN>
 <eke734ggsdvg.wl-kobarity@HIDDEN> <875xlbidz2.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0
 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: multipart/mixed; boundary="Multipart_Sun_Feb_16_19:20:38_2025-1"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--Multipart_Sun_Feb_16_19:20:38_2025-1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Visuwesh wrote:
>=20
> [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=AA=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=
=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 15, 2025] kobarity wrote:
>=20
> >> [...]
> >> So...what do we do from here?  Unfortunately, I know next to nothing
> >> about this area to file a sensible bug report myself.
> >
> > I'm not sure either.  As ipython --simple-prompt does not support
> > completion, I don't know if using rlcompleter with ipython
> > --simple-prompt is supported or not.
> >
> > The direct cause of this problem seems to be that rlcompleter.__main__
> > is not as expected.  So the following steps enable completion on
> > ipython --simple-prompt on Python 3.13.
> >
> > import readline
> > import rlcompleter
> > import __main__
> > rlcompleter.__main__ =3D __main__
> > readline.parse_and_bind("tab: complete")
> >
> > Attached is a test patch that does something similar to this.
>=20
> I can confirm that completion works for non-builtin objects with this
> patch.

Thank you for testing the patch.

Here's what's happening.  ipython --simple-prompt on Python 3.13 is
indirectly importing rlcompleter, which sets its Completer().complete
as the completer.  Completer() without the namespace argument uses
__main__.__dict__ as the source of global symbols to complete.  The
__main__ here is the name in rlcompleter.py namespace, which is bound
at import time of rlcompleter.py.  However, __main__ used in the REPL
of ipython --simple-prompt is different from __main__ used at the
import time of rlcompleter.py.  Therefore, changes in globals()
(i.e. __main__.__dict__) are not reflected in
rlcompleter.__main__.__dict__ and the completion will fail.

Prior to Python 3.12, the problem does not occur because rlcompleter
was not imported indirectly.  When we import rlcompleter in the native
completion setup code, __main__ is already the same as the one used in
the REPL.

Since IPython does not use rlcompleter, it seems difficult to consider
this problem a bug in IPython.  It would be better if rlcompleter
reads sys.modules["__main__"] instead of __main__, but it would not be
easy to change a long standing specification.  So I think it would be
better for python.el to address this issue.

To set up a completer that works correctly, it is sufficient to
specify the namespace argument:

readline.set_completer(rlcompleter.Completer(globals()).complete)

However, we need to make sure that we do not override the customized
completer.  The problem is that it is difficult to distinguish between
the completer that is set up by importing rlcompleter and the
customized completer.

So it seems to me that it would be reasonable to override
rlcompleter.__main__ so that the default completer works properly.  I
think the attached revised patch is slightly better than my previous
patch, since it does not add "__main__" to globals.  This change
affects only IPython.  I added some comments and the commit message.

I would like to hear your opinions.

--Multipart_Sun_Feb_16_19:20:38_2025-1
Content-Type: application/octet-stream; type=patch; name="0001-Improve-completion-in-IPython-Python-3.13.patch"
Content-Disposition: attachment; filename="0001-Improve-completion-in-IPython-Python-3.13.patch"
Content-Transfer-Encoding: 7bit

From 089718ea064bb810edd11c9aea09a1e1e97249c7 Mon Sep 17 00:00:00 2001
From: kobarity <kobarity@HIDDEN>
Date: Sun, 16 Feb 2025 19:07:04 +0900
Subject: [PATCH] Improve completion in IPython/Python 3.13

IPython/Python 3.13 indirectly imports rlcompleter, and the
completer is set up to reference rlcompleter.__main__.
However, this rlcompleter.__main__ is different from the
__main__ in the REPL execution.  Therefore, this completer
cannot correctly complete the REPL globals.  To address this
issue, we override rlcompleter.__main__ with __main__ only in
the case of IPython.

* lisp/progmodes/python.el
(python-shell-completion-native-setup): Modify
__PYTHON_EL_native_completion_setup(). (Bug#76205)
---
 lisp/progmodes/python.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a42e2b2a28a..2dc0441bd47 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4537,6 +4537,13 @@ python-shell-completion-native-setup
             if not is_ipython:
                 readline.set_completer(new_completer)
             else:
+                # Ensure that rlcompleter.__main__ and __main__ are identical.
+                # (Bug#76205)
+                import sys
+                try:
+                    sys.modules['rlcompleter'].__main__ = sys.modules['__main__']
+                except KeyError:
+                    pass
                 # Try both initializations to cope with all IPython versions.
                 # This works fine for IPython 3.x but not for earlier:
                 readline.set_completer(new_completer)
-- 
2.43.0


--Multipart_Sun_Feb_16_19:20:38_2025-1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 15 Feb 2025 12:34:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 07:34:23 2025
Received: from localhost ([127.0.0.1]:53825 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjHNH-0003Tm-13
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 07:34:23 -0500
Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:49267)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1tjHND-0003TN-V1
 for 76205 <at> debbugs.gnu.org; Sat, 15 Feb 2025 07:34:20 -0500
Received: by mail-pl1-x641.google.com with SMTP id
 d9443c01a7336-22113560c57so2416715ad.2
 for <76205 <at> debbugs.gnu.org>; Sat, 15 Feb 2025 04:34:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739622854; x=1740227654; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=DtZW/R5360Yz8PZjIeNxP1yPwkIAPpdu3fJoHVLhRfk=;
 b=Yi10FWSqsq8mzDLrxRY0/7q2rxT51M2rL0BIMPnfDDvp8D0an+Tzb6Jqu5K8YtV4WY
 UnIJ1U7MQ5BY/CAOwprxgeWVvXyS5h06aZIT8prAv3BnwLONNJ9QKFZWZNPXRTWWqPqd
 tnGyuW3VKkI/1wAGE3VkkI7TPDjsW+VRfMxSHJf79otObtq+7ghVp3EoHCiXMc8WTVHa
 22qIfT465mCrezL0ktscNF+Msm7P6tk0Ey7NnsJ26AhK8NH7QfP/e45sFNcKMzts3oXh
 PpbaYzfY5hEYZb9x6Bz06ijMWI7WPmW/VnHRkqyQf5wBxuSAISkfHvA5jCcPD19361Ux
 xwfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739622854; x=1740227654;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=DtZW/R5360Yz8PZjIeNxP1yPwkIAPpdu3fJoHVLhRfk=;
 b=v49NC7635q5RQpll7i/iRtouyw39yJfguD+HJiH7uUjJcCDWrCbzieRxFau1+yEbAB
 /INWfki43Iln6y4LcP91X8U9aVTLips7JhAqOdt5o8QDee0gOMmRAXdsKlgj6vQ/7Xi9
 XR7LtlDh4jhT+rGM94ddk52TCks7FJ+qxdzBcktUrp/3swCToqi5XU9KM/JOBsVFnqld
 0l124BKYyIznF1X5NViukYbWTLya9p5MlfcOw/8eNk42+SMttb3IO33lnlvV8KXaVA2J
 MjTg2CT01EMRmGOdQvU+OUyNC4xxO3yclFtxyLkZQ+/g2HgK8fogNRAU92/ujCJXm92Y
 JKhA==
X-Forwarded-Encrypted: i=1;
 AJvYcCVzT7k9ByDIjZNvNDcMf56wW5umZfAUBIflTucWqVZwF/3tV0y21/VlAhGDQu97XkDouKf0vw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyEfHi/Au+5sOrAGY2KJYpntzKS1bPAmlPx4NMTWpJSIlzjfCWL
 PE3b20ZQx08AXVB3zu95eWk4iA/JE8KVg8MhHDA+Y60FadypNk4w
X-Gm-Gg: ASbGncsDLmTleCKObMcPcLsipRN+kg9MbKnljyad4FkRy7mFMO/IBL8LPHYy5JllTK+
 kHmcIb3HVIvVxKlOtLdtBWj5RDdmfq051WhpgosvK0xaKlVZH4BrMUkIxILqJtFjaeilBWBl/U7
 bJLrPM/P0VjNgOcHLO3lCp2XIHJ/8iqRg4qpBcWPc88O9jH9XJ+FvfdD7l3gKVsJ6b1OcXZYsoF
 AO8GEcFCBtJvq5YlafRGtuf8hFIuyjVqS7aWMRyndNjdCBcRh4EZ5XkXcXbJPDIu3pdkxMvQUvF
 Fsj8FhuIMeipP+UJ
X-Google-Smtp-Source: AGHT+IERdMed5RlR6Mynj5ZIDaYAwMn6E/4bBRUNRg/FeDVbSHM7qZSKydMkgt8GHMwh60ZVQTdgXg==
X-Received: by 2002:a17:902:e5d0:b0:21f:52e:939e with SMTP id
 d9443c01a7336-22104056afemr48232935ad.28.1739622853749; 
 Sat, 15 Feb 2025 04:34:13 -0800 (PST)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 98e67ed59e1d1-2fc13ac0a66sm4743764a91.12.2025.02.15.04.34.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 15 Feb 2025 04:34:13 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: kobarity <kobarity@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
In-Reply-To: <eke734ggsdvg.wl-kobarity@HIDDEN> (kobarity@HIDDEN's
 message of "Sat, 15 Feb 2025 01:13:55 +0900")
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
 <eke74j0xsxeh.wl-kobarity@HIDDEN> <87cyflixo8.fsf@HIDDEN>
 <eke734ggsdvg.wl-kobarity@HIDDEN>
Date: Sat, 15 Feb 2025 18:04:09 +0530
Message-ID: <875xlbidz2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [சனி பிப்ரவரி 15, 2025] kobarity wrote:
    >> [...] >> So...what do we do from here? Unfortunately, I know next to nothing
    >> about this area to file a sensible bug report myself. > > I'm not sure
    either. As ipython --simple-prompt does not su [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
X-Debbugs-Envelope-To: 76205
Cc: Liu Hui <liuhui1610@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 76205 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [சனி பிப்ரவரி 15, 2025] kobarity wrote:
    >> [...] >> So...what do we do from here? Unfortunately, I know next to nothing
    >> about this area to file a sensible bug report myself. > > I'm not sure
    either. As ipython --simple-prompt does not su [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:641 listed in]
                             [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=AA=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=B0=
=E0=AE=B5=E0=AE=B0=E0=AE=BF 15, 2025] kobarity wrote:

>> [...]
>> So...what do we do from here?  Unfortunately, I know next to nothing
>> about this area to file a sensible bug report myself.
>
> I'm not sure either.  As ipython --simple-prompt does not support
> completion, I don't know if using rlcompleter with ipython
> --simple-prompt is supported or not.
>
> The direct cause of this problem seems to be that rlcompleter.__main__
> is not as expected.  So the following steps enable completion on
> ipython --simple-prompt on Python 3.13.
>
> import readline
> import rlcompleter
> import __main__
> rlcompleter.__main__ =3D __main__
> readline.parse_and_bind("tab: complete")
>
> Attached is a test patch that does something similar to this.

I can confirm that completion works for non-builtin objects with this
patch.

> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 8a99ff0434d..2563044c0ee 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -4534,6 +4534,12 @@ python-shell-completion-native-setup
>              if not is_ipython:
>                  readline.set_completer(new_completer)
>              else:
> +                import sys
> +                import __main__
> +                try:
> +                    sys.modules['rlcompleter'].__main__ =3D __main__
> +                except KeyError:
> +                    pass
>                  # Try both initializations to cope with all IPython vers=
ions.
>                  # This works fine for IPython 3.x but not for earlier:
>                  readline.set_completer(new_completer)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 14 Feb 2025 16:14:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 11:14:22 2025
Received: from localhost ([127.0.0.1]:51358 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiyKb-00086F-Ki
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2025 11:14:21 -0500
Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:55553)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <kobarity@HIDDEN>)
 id 1tiyKL-000858-3v
 for 76205 <at> debbugs.gnu.org; Fri, 14 Feb 2025 11:14:05 -0500
Received: by mail-pl1-x630.google.com with SMTP id
 d9443c01a7336-220bff984a0so39668895ad.3
 for <76205 <at> debbugs.gnu.org>; Fri, 14 Feb 2025 08:14:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739549639; x=1740154439; darn=debbugs.gnu.org;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:from:to:cc:subject:date:message-id:reply-to;
 bh=q6qNzUJ1ospZWBdc5MqL9mWUTVQbhp8337i24DPaGaw=;
 b=HiR9MfO2rpfxNXeYvKZE7kP5VcYnu85dV0ShtaCwyrx8NPo7QAaEX7Xc4/5FnZOjTt
 t0VG/Q72dnYqwjRTMEP2vCKE6AhwaZBfTZeGJ0XUvq9ir27ImfEFqLjCAB6G13WJ9pnc
 46TBXrm5WowzVqb90iEdLE29oQukAtL5RCLqKcstw8RcsHqMRwNBrfOq1CWlMsdVxqtx
 V/VVKEHZJ2fUZUQBgGE+I1WD1rz0699fkJmnlaBmksuyUyO8Irq4Gl6kS7KM5KMUIyE9
 x9i4kPUOahnOdr16Ym9EC7AYI4HQ1ffLd+jPux8YR0aFpozQCwTbZrrzW2wjfS+jbA3W
 SaDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739549639; x=1740154439;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=q6qNzUJ1ospZWBdc5MqL9mWUTVQbhp8337i24DPaGaw=;
 b=OX2p28LNDfNoM7CHgt+rtKRo0Sifuvfdfe/C3PEjn49FzrmO3AqDSTSfm9oR4CIj8f
 fYOweHXYJsIVlORTJg7KB2uaiSqsDnK2VgxzmOS1LiQJRtKkxxH338Z4Vu35WkLrlo6c
 tF2f/3/dcA+KQbMGIgrZ/x5Z59JBfM+zKcBDOvzrBsCGkGkRTDCZ+Oa2+9gPgcOrwgxp
 3/TODQJYPoBzhzqwJFyT4DdKR2CfRxJOmaCS56mRg2EKlW2qYfrP8gHJwDGr8+hkiD9z
 v3Sbi9V+10AkIF9T8zTngin9hm2WgTttgZoxdW6+nNCmC4rU4jqkJSjVqpbiSSzf3So+
 1aSg==
X-Forwarded-Encrypted: i=1;
 AJvYcCX2IqUcmN1IoAQbsCtkF/9Hhhn1jfd0KPg5Tnfm5w37W813SOeAmUfkjj+wMpJHZrLSlKqB/Q==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwnCini3CS7sGm055ZE7QKOwmxCEDwUXwb6jAbVziMGCf8pwFgd
 o/JFxbZ/MGJtcvPGIm1X3T9qbpUktrYpSEbVC29P46i6M10w6h+V
X-Gm-Gg: ASbGnctQzVbSDfPA8BnfQfzb88l0pkZWRTn0Ms176Tww9Zkoq4wf4zpUJRvjIGyy/Kx
 XwfbsIL2Wd030+nxuNcGj/r8FGM/DSRqL/Rvn7iQrZNZkn/8gLmeK3bxsi4afTAyGYSVXJA963i
 zmhy9mk19bAbqLeqo9He+M+1ydbXE9d5gbx+iNVca24d8BuHof/La7eKBRBLCwW3TYxa4HR7lFS
 WvFqvR1w2nlsZEA+C4Lt0RLqSEanTYwUDg0HGZIGGB3BhavhLfF4TL4F8oaXqx03p+wCtfw/lON
 S2jabmPe/5CooOcUx/dhjID1PxMA+LRnHRuB1+6Gc0dGHQ==
X-Google-Smtp-Source: AGHT+IFg3ML7AKck3XUnYOFoX5t4aa+JpXe/5m6kGYFKKUABW6FrCmB1MhNgszpUN5Db/sH/7tSIXQ==
X-Received: by 2002:a17:902:d484:b0:216:3c36:69a7 with SMTP id
 d9443c01a7336-220d215dee3mr118660805ad.45.1739549638459; 
 Fri, 14 Feb 2025 08:13:58 -0800 (PST)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-2fc13b9140esm3326216a91.30.2025.02.14.08.13.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 14 Feb 2025 08:13:57 -0800 (PST)
Date: Sat, 15 Feb 2025 01:13:55 +0900
Message-ID: <eke734ggsdvg.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>, Liu Hui <liuhui1610@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50;
 python.el completion broken for non-builtin objects in IPython 8.30.0
 & Python 3.13.2
In-Reply-To: <87cyflixo8.fsf@HIDDEN>
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
 <eke74j0xsxeh.wl-kobarity@HIDDEN> <87cyflixo8.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0
 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: multipart/mixed; boundary="Multipart_Sat_Feb_15_01:13:55_2025-1"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--Multipart_Sat_Feb_15_01:13:55_2025-1
Content-Type: text/plain; charset=US-ASCII

Visuwesh wrote:
> >> > The problem seems to be not related to emacs, because the completion
> >> > of non-builtin objects doesn't work in terminal too (IPython 8.32.0
> >> > and Python 3.13.2):
> >> >
> >> > 1. run ipython in a terminal: ipython3 --simple-prompt -i
> >> >
> >> > 2. type the following code:
> >> >    import readline
> >> >    import rlcompleter
> >> >    readline.parse_and_bind("tab: complete")
> >> >    import numpy as np
> >> >
> >> > 3. type np.<TAB>, there is no completion
> >> >
> >> >
> >> > If I change the completer to others (e.g. jedi):
> >> >    from jedi.utils import setup_readline
> >> >    setup_readline()
> >> >
> >> > then the completion works in both terminal and emacs.
> >
> > Thanks for pointing this out.  So I confirmed that the following
> > workaround is also effective.
> >
> > PYTHONSTARTUP="$(python -m jedi repl)" emacs -nw -Q
> 
> So...what do we do from here?  Unfortunately, I know next to nothing
> about this area to file a sensible bug report myself.

I'm not sure either.  As ipython --simple-prompt does not support
completion, I don't know if using rlcompleter with ipython
--simple-prompt is supported or not.

The direct cause of this problem seems to be that rlcompleter.__main__
is not as expected.  So the following steps enable completion on
ipython --simple-prompt on Python 3.13.

import readline
import rlcompleter
import __main__
rlcompleter.__main__ = __main__
readline.parse_and_bind("tab: complete")

Attached is a test patch that does something similar to this.

--Multipart_Sat_Feb_15_01:13:55_2025-1
Content-Type: application/octet-stream; type=patch; name="workaround.patch"
Content-Disposition: attachment; filename="workaround.patch"
Content-Transfer-Encoding: 7bit

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 8a99ff0434d..2563044c0ee 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4534,6 +4534,12 @@ python-shell-completion-native-setup
             if not is_ipython:
                 readline.set_completer(new_completer)
             else:
+                import sys
+                import __main__
+                try:
+                    sys.modules['rlcompleter'].__main__ = __main__
+                except KeyError:
+                    pass
                 # Try both initializations to cope with all IPython versions.
                 # This works fine for IPython 3.x but not for earlier:
                 readline.set_completer(new_completer)

--Multipart_Sat_Feb_15_01:13:55_2025-1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 13 Feb 2025 17:04:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 12:04:21 2025
Received: from localhost ([127.0.0.1]:45259 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ticdR-0007so-7A
	for submit <at> debbugs.gnu.org; Thu, 13 Feb 2025 12:04:21 -0500
Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:49350)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1ticdO-0007sY-JJ
 for 76205 <at> debbugs.gnu.org; Thu, 13 Feb 2025 12:04:19 -0500
Received: by mail-pl1-x642.google.com with SMTP id
 d9443c01a7336-21f7f1e1194so28372105ad.2
 for <76205 <at> debbugs.gnu.org>; Thu, 13 Feb 2025 09:04:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739466252; x=1740071052; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=moblpTeEhIhROyO9qUrjiT8t1tDhwNV5jAycWBaj5kg=;
 b=APuBO+9yD65rFt5+zjuQ4+zFYY/S9tSPGWn9BkVzS/nbJXKBrLNQgr19bRT/8r6m3E
 mNL4VBD8/Xb2N1KE7HBbF9/X7foy4ZkGEFTJZgmysSlB2DVs2pH2oan0KwPmuKCxhuox
 N0ObBk5G/KPqBLh14BJN+b1UqF9yfg3zoNCQRw1kpkxuPAikls75LgRBjS/S7L8z2Nu+
 AbYeTH3bdsaLH9OIm4O1eFB+akmVszAwvw/zO/SEsQLzUhl7yW2CdHnTqAPYUhz+PSom
 xqRHlM2TO9k708O9ojSo77djABsWISVMoE25QGpMp03E9w+jD/IB34/taZK5G8qioPaM
 JAGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739466252; x=1740071052;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=moblpTeEhIhROyO9qUrjiT8t1tDhwNV5jAycWBaj5kg=;
 b=Ru4mC54D/TMCPj+haRmcy8vksFpXJzqyQRQ51dTyMIyipIUJ5WEUY0SQwlFRLTkTgf
 S/y7Epk+1SkjCk5bGs+6VEDRa7inYUuXaNZkOUGEja2AOFOoeDWEU1XGQud75bKrf3wb
 vn/BrS/pQTf4yfWk/ATq62ZF3+zfHiZct4A5mO+f8X34qkUmW2eNj48WU5LkwSsjWt5F
 j1P6e7a3fNdVbzeBQk+ejiUOc4Z6FRQT1jKD1p9BBBwlBm7rOsVN/w2BvGCuhBg0WhF2
 YB4nyH6Bb/GiICDObou3pipWQ/gIOKNxRFP7PdWAvuu5CMr8UcMU9eZyQ4ragLKC6oqy
 bSDg==
X-Forwarded-Encrypted: i=1;
 AJvYcCWwf6AzUDJXGq2MMVF04IPlXgD1vUzAmTGiswqG27iPFHZK1NUKcom1cQA37WEh3RLu9q80nw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yx7xCFDDD6mHDS56wCBXZwPtKkfmXu/PPyaTlipMBZIXGzMDMnS
 4diEJ4XkK8Erwfi+WSykxtISVGGiLDPegzTyiPb2B+yKUCuFUKuM
X-Gm-Gg: ASbGncsE6/9Pryusq1f3cnd1Mq2NloE1EaeKx4/f6gsX4E3kuafNOuyvaVQhPDyxNce
 g5iA/dDW8K/4pVTyE6ZOgW/JUPLvWoScTMpZSUnJXNtYUXLZAzo0oYIQJD9+A3bWAJdaQu0tEUS
 3fqboIpk0HCsevvkJ5/a7mz+vc7VAxQRkOsPQS5ZXYW6OmqYxDQmM1574p9SKNvbxhE91EunmU3
 hQPjOmZJ4uSj4kzfG2NNRzNb6wQUKsnGcie1MfhHZ1RHognWc7Vc6Hs6AG4Dx+0KmqRKGskYJTB
 W5iIKO4=
X-Google-Smtp-Source: AGHT+IG7mwsae1QxUEFpNxB5pb/LBkiDboNu/LBtbmm8mlaEIgNsz00WsNYWCdYzjKK4nQBagMhG5g==
X-Received: by 2002:a17:902:e54a:b0:216:32ea:c84b with SMTP id
 d9443c01a7336-220bbcc265bmr108462555ad.37.1739466252032; 
 Thu, 13 Feb 2025 09:04:12 -0800 (PST)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-220d556d608sm14611665ad.171.2025.02.13.09.04.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Feb 2025 09:04:11 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: kobarity <kobarity@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
In-Reply-To: <eke74j0xsxeh.wl-kobarity@HIDDEN> (kobarity@HIDDEN's
 message of "Thu, 13 Feb 2025 23:59:50 +0900")
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
 <eke74j0xsxeh.wl-kobarity@HIDDEN>
Date: Thu, 13 Feb 2025 22:34:07 +0530
Message-ID: <87cyflixo8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வியாழன் பிப்ரவரி 13, 2025]
   kobarity wrote: > Visuwesh wrote: >> >> >> One workaround is to disable native
    completion: >> >> M-x python-shell-completion-native-turn-off >> >> It will
    be a little more inconvenient than the native completion. >> [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:642 listed in]
                             [list.dnswl.org]
X-Debbugs-Envelope-To: 76205
Cc: liuhui1610@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 76205 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வியாழன் பிப்ரவரி 13, 2025]
   kobarity wrote: > Visuwesh wrote: >> >> >> One workaround is to disable native
    completion: >> >> M-x python-shell-completion-native-turn-off >> >> It will
    be a little more inconvenient than the native completion. >> [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:642 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=AA=
=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 13, 2025] k=
obarity wrote:

> Visuwesh wrote:
>>=20
>> >> One workaround is to disable native completion:
>> >> M-x python-shell-completion-native-turn-off
>> >> It will be a little more inconvenient than the native completion.
>>=20
>> Thank you very much, this works good enough for my needs.  I can work in
>> peace now.
>
> Then you might want to customize
> `python-shell-completion-native-enable' or
> `python-shell-completion-native-disabled-interpreters'.

Thanks once again for the helpful tip!

>> > The problem seems to be not related to emacs, because the completion
>> > of non-builtin objects doesn't work in terminal too (IPython 8.32.0
>> > and Python 3.13.2):
>> >
>> > 1. run ipython in a terminal: ipython3 --simple-prompt -i
>> >
>> > 2. type the following code:
>> >    import readline
>> >    import rlcompleter
>> >    readline.parse_and_bind("tab: complete")
>> >    import numpy as np
>> >
>> > 3. type np.<TAB>, there is no completion
>> >
>> >
>> > If I change the completer to others (e.g. jedi):
>> >    from jedi.utils import setup_readline
>> >    setup_readline()
>> >
>> > then the completion works in both terminal and emacs.
>
> Thanks for pointing this out.  So I confirmed that the following
> workaround is also effective.
>
> PYTHONSTARTUP=3D"$(python -m jedi repl)" emacs -nw -Q

So...what do we do from here?  Unfortunately, I know next to nothing
about this area to file a sensible bug report myself.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 13 Feb 2025 15:00:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 10:00:03 2025
Received: from localhost ([127.0.0.1]:44888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiah9-0007P6-4D
	for submit <at> debbugs.gnu.org; Thu, 13 Feb 2025 10:00:03 -0500
Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:55764)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <kobarity@HIDDEN>)
 id 1tiah6-0007Nr-L6
 for 76205 <at> debbugs.gnu.org; Thu, 13 Feb 2025 10:00:01 -0500
Received: by mail-pl1-x632.google.com with SMTP id
 d9443c01a7336-220bff984a0so16715895ad.3
 for <76205 <at> debbugs.gnu.org>; Thu, 13 Feb 2025 07:00:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739458794; x=1740063594; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:references
 :in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject
 :date:message-id:reply-to;
 bh=gyZauK3dOnsnxjUan2+65cFWPME01ZGzpd59dTPNSyc=;
 b=LgCTaRAJiSioQtxefLCvpCldxNR1DtW7AonHqW+1zSJKOpRrFY/i3vp76Gz8jIJdvk
 DC3nRBqjp9wds9TNtEA8oSy9s15svFjuptWPnklrrnm94s4hFltJ8ixPntf66h4IiDyP
 4iacl8CLZNYYJjgFE/Fhanbtu4GtWpELxgp66VxtK17gRBCRdd1t9NMG/Xc8nSGQi9PJ
 +lYl+WVWcw84fnxFD7xgXnowISMG5a70kcE614uXxPGW4ExGxxcvQoZqCZJQtjK2hK3S
 iicH8Z2ZtjAkFSr/u9QAe74I2nOaDpIgSEmmf7JP5njaYPLB/6GmFZzHXlNN4d3IO736
 0X7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739458794; x=1740063594;
 h=content-transfer-encoding:mime-version:user-agent:references
 :in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=gyZauK3dOnsnxjUan2+65cFWPME01ZGzpd59dTPNSyc=;
 b=k6CAAH4EQoNZfgcqq+JVh/HZ3qO4t34g5Azxdx1CGYrOao1OKiGqfdK5vbPYj1pqmp
 oa4+7FWz5hjSVvSdkUoXRolbHZft7LPoXkV08QdgdFC51ZJBz+xodAZqJo1Z20rmhw86
 ydurCATuiHCkYudKZ7VH42a6WUtF0vzCjxt+Ph82kyy3cmvrQgmsdviqcyGMdhaPIOPN
 +MKybny2ZA3eEdMZ89xlJ1sLZkGEIDZxJvQ2sMdFSR6wdo7eIs8CwTM9PSoEv/lZwTZ+
 74IbM54MOgSxjHIrYga7cxhP8xHE+c3+Fy7NHsC4uk7xllYvmxA8A2RfA8hy92iJldPx
 XzRQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVzLK3sfqk6hV43l24I2fo6V6Rs2S1Y5ptipNLzEyl0qv0QBBjWLS+IFjmDfsEwHYwig7a7Ug==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwdoA1ohqSD3IyzFPpXvajWXH0OGuRRDYkBoDxjfoiKWT0aIXdu
 IEwykg9/MugS3HZXRg5aMMb6Vib3v+YyizCIHSHwY57WM5DHIgve
X-Gm-Gg: ASbGncuRWU7Nmt6X6/XOkpN7GcY7OZVmBFry4uzQUEnBhDieNTPOYf+nDxYdgVkAXqt
 aV0FVUBvNVocUdVwxBxrbpWdmQGvLBLWOZXvywpIct8r0OHsElI09TJwEg7TDp8QUMIw0jy4DMT
 kyHkAOT57YNkZTe8b3BX8TiNr3HIMwnhoavafsV3irwgWCrYBo+s6wGhqqyzuZ51HnqLpkVP0Kv
 pxpyJAd0SXfdff+gz5kosk9WMLdKjt5P5/behb9d6OGnz4/YRaJ+DmFVTjni+gAdGD8YCnxi+yn
 luVedhx0Fsrhq7v24NgFKs7OKXICP0fU7/YDh87epA8FvQ==
X-Google-Smtp-Source: AGHT+IG26XPRIT2hcgxsskmexYE+3yhhcJ/ByPCaAI2t3q/1SDM9UP9MlJJGiWgyzWo/x8L3ZC87vg==
X-Received: by 2002:a17:902:e5c6:b0:215:72aa:693f with SMTP id
 d9443c01a7336-220d1ec1c78mr50360245ad.9.1739458794459; 
 Thu, 13 Feb 2025 06:59:54 -0800 (PST)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-220d556d111sm13301185ad.169.2025.02.13.06.59.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Feb 2025 06:59:54 -0800 (PST)
Date: Thu, 13 Feb 2025 23:59:50 +0900
Message-ID: <eke74j0xsxeh.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>,
	liuhui1610@HIDDEN
Subject: Re: bug#76205: 31.0.50; 31.0.50;
 python.el completion broken for non-builtin objects in IPython 8.30.0
 & Python 3.13.2
In-Reply-To: <86zfiqi88c.fsf@HIDDEN>
	<87v7tejxtq.fsf@HIDDEN>
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN> <86zfiqi88c.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0
 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Visuwesh wrote:
>=20
> [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=
=AA=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 13, 2025=
] Liu Hui wrote:
>=20
> > On Wed, Feb 12, 2025 at 11:03=E2=80=AFPM kobarity <kobarity@HIDDEN> =
wrote:
> >>
> >> Eli Zaretskii wrote:
> >> >
> >> > > From: Visuwesh <visuweshm@HIDDEN>
> >> > > Date: Tue, 11 Feb 2025 20:37:22 +0530
> >> > >
> >> > > I am unsure if this is a me problem but I can no longer complete
> >> > > non-builtin objects in a python-mode buffer when I'm using the spe=
cified
> >> > > IPython&Python version combination.  However, if I don't use IPyth=
on,
> >> > > then completion does work as expected.  It prints the following me=
ssage
> >> > > though (not sure if it is related):
> >> > >
> >> > >     Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on li=
nux
> >> > >     Type "help", "copyright", "credits" or "license" for more info=
rmation.
> >> > >     warning: can't use pyrepl: terminal doesn't have the required =
clear capability; TERM=3Ddumb
> >> > >     >>>
> >> > >
> >> > > To reproduce the issue,
> >> > >
> >> > >     1. emacs -Q
> >> > >     2. Open a python buffer.
> >> > >     3. Type in "import numpy as np" in the buffer.
> >> > >     4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the =
first
> >> > >        prompt, then say no to the second.
> >> > >     5. After the *Python* is created, say C-c C-c in the python-mo=
de
> >> > >        buffer.
> >> > >     6. Now type "np." and say M-TAB.
> >> > >     7. Observe how no completion candidates are offered.
> >> > >     8. Remove "np." and instead type "pr" and say M-TAB.
> >> > >     9. Observe how two completion candidates (print and property) =
are
> >> > >        offered.
> >> > >     10. Repeat the same without using IPython and observe how
> >> > >         python-mode offers completion after "np."
> >> > >
> >> > > I am on Debian sid with an "apt update && apt upgrade" today some =
15
> >> > > mins ago (no luck after updating if I wasn't clear enough) if it
> >> > > matters.
> >> >
> >> > Thanks.
> >> >
> >> > kobarity, any comments or suggestions?
> >>
> >> I reproduced the issue with IPython 8.32.0 and Python 3.13.2.  It
> >> seems that there is no problem with IPython on Python 3.12.
> >>
> >> One workaround is to disable native completion:
> >> M-x python-shell-completion-native-turn-off
> >> It will be a little more inconvenient than the native completion.
>=20
> Thank you very much, this works good enough for my needs.  I can work in
> peace now.

Then you might want to customize
`python-shell-completion-native-enable' or
`python-shell-completion-native-disabled-interpreters'.

> > The problem seems to be not related to emacs, because the completion
> > of non-builtin objects doesn't work in terminal too (IPython 8.32.0
> > and Python 3.13.2):
> >
> > 1. run ipython in a terminal: ipython3 --simple-prompt -i
> >
> > 2. type the following code:
> >    import readline
> >    import rlcompleter
> >    readline.parse_and_bind("tab: complete")
> >    import numpy as np
> >
> > 3. type np.<TAB>, there is no completion
> >
> >
> > If I change the completer to others (e.g. jedi):
> >    from jedi.utils import setup_readline
> >    setup_readline()
> >
> > then the completion works in both terminal and emacs.

Thanks for pointing this out.  So I confirmed that the following
workaround is also effective.

PYTHONSTARTUP=3D"$(python -m jedi repl)" emacs -nw -Q




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 13 Feb 2025 08:02:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 03:02:04 2025
Received: from localhost ([127.0.0.1]:40096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiUAe-0000vZ-Ff
	for submit <at> debbugs.gnu.org; Thu, 13 Feb 2025 03:02:04 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:56458)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tiUAc-0000v5-9G
 for 76205 <at> debbugs.gnu.org; Thu, 13 Feb 2025 03:02:02 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tiUAW-0004ph-Qn; Thu, 13 Feb 2025 03:01:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=v6pVuR+CjQcYOH7hNCkpiM4HDPPUG/oWftkQfHMdvrw=; b=f/m/0xrdjaea
 JeD0rQ1OaYLkNsTtpf6uvLvdzik0U/WomMhjtXovuJouQKqI1fOLmL8dJ0GDkOW6QW/zSSSvA14I0
 oJDfDhMpXkQERFFEFuFUrHzPTBIV2/Qj5BQ7LSnCMbHvXG9l082dyAypuDWx2j/ZR1fetilzemA56
 Ao+R+W3pXytx9V/bRZR+XqYlgrEH0hnjo2/CAEE0WAWBlBw4N0iJrHE1JP82fFWtjk611uf5Z93z4
 tsDdC5JcI7BGtwEH1fdhIoMbkkYdlqwk8QJ6YCRvL62695pRmH2b+bJo9aEmaPetQjy5RHFmNM0P+
 kEODta2+fgBa954Fp/mlCQ==;
Date: Thu, 13 Feb 2025 10:01:23 +0200
Message-Id: <86zfiqi88c.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>
In-Reply-To: <87v7tejxtq.fsf@HIDDEN> (message from Visuwesh on Thu, 13 Feb
 2025 09:33:13 +0530)
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 <87v7tejxtq.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76205
Cc: liuhui1610@HIDDEN, kobarity@HIDDEN, 76205 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Cc: kobarity <kobarity@HIDDEN>,  76205 <at> debbugs.gnu.org,  Eli Zaretskii
>  <eliz@HIDDEN>
> Date: Thu, 13 Feb 2025 09:33:13 +0530
> 
> Indeed, the completion is broken in the terminal.  It did not occur to
> me to test it from the terminal at all.  :(
> Should we take this as a IPython bug then?

Yes, I think so.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 13 Feb 2025 04:03:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 23:03:28 2025
Received: from localhost ([127.0.0.1]:39370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiQRj-0002Is-Vm
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 23:03:28 -0500
Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:43271)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1tiQRh-0002IU-GO
 for 76205 <at> debbugs.gnu.org; Wed, 12 Feb 2025 23:03:26 -0500
Received: by mail-pj1-x1042.google.com with SMTP id
 98e67ed59e1d1-2fa2eb7eb45so2611094a91.1
 for <76205 <at> debbugs.gnu.org>; Wed, 12 Feb 2025 20:03:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739419399; x=1740024199; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=AyJNooO5FHDQUjH/fvbGdzyEBoWWKhQPdut73FadDCo=;
 b=L/00Xu74klLhIcp8trbBWXx2EtOaOxPUHEnN1GgTMGCsNqFv6f3/zqlpnnEjqqv1FH
 IJ1VXNqJ12NM02i/8VFhg1Vh2Vu/fcOiudj9/qGFCLpCbYDHU9cTDQ/IdJvZ+eo0rH4V
 zvtFpv0Ch0/DNDn94VUc7h6JvyBgVIJ4R8QMQsjUS0K9TUUtjzjTx60U+V4+CI/4uSBd
 mNm/Y56U/NTjDnT48blXcoqulUPl75vNRgOztjYU9uxxlOAfZyN6UYxMPQKc6wRSB65V
 SUeSR1oxgZ9sri1fY4uicMoStQ7MsuHiX/Kz33r7CgwcAaadgJ75UNyf2MbpDOr+id+U
 aikQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739419399; x=1740024199;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=AyJNooO5FHDQUjH/fvbGdzyEBoWWKhQPdut73FadDCo=;
 b=QwjHtGQmRzp2HEPa4pwHGLOvqXOybdAz9e37T998hP7WtfmXnCbEChnSc/uGCdqeS9
 dfzJUkUlUA05TEJhS2Y65ndJDoWGQGcZShuC3AajIngu0gd8tfr9OdiL01+YvqhQh0W2
 DI0byR/tI2u71llyIQ80jL+m2G9ZPts8Pm0ARCqnr64gYxJd3+0NtN2Y2qyjvOpFWkg3
 ubQ0rSDnd5Sxh2rcy3bTAZMK0BKfVsV/kIHtP4gPjxomF0nhaeQ74B8NTYvTYJ7QZp8c
 DbH5XlTMj3LWixItWKWwry1VzwQQScnewftAH/zGwa3PZ2hrlJdUuqH0Otw5Fosd/g6h
 iCGw==
X-Forwarded-Encrypted: i=1;
 AJvYcCVXH8lUKPR47pwiYek0+krD7yPj0N2vQxV+XyAJiV1nkXP9oVGC9hqTaBmrF/aCIDfAHSi+JQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YxflwsEdWN8uSDHnIRxRWPqzk0n6fHrgl1E+x8C3Ifa4Af7mSTL
 uv9b1kI37aSaTpZE5uFw/WouxMl8aKakZpx9WZDCKPtchYq9AxRK
X-Gm-Gg: ASbGncsu1Qk8pqkeOzZjze0RTto/TGO1YgKPtkxKyluz8ch3TKA1+bvQZX5SYZ8X4/8
 kTm0sWHVYsSwUjR/oJQrUMHcqq+YtS5HPfxrN+p3TZwW3JyOWdFRrm1RH1vt0Un42YqbXQnP161
 lA/UB0cMB4mMFEooexE80i+ZArKnAhtgTG5XRWVDd/77nUAamFqyrrpGtqeAJOWfGmeDP9A28uF
 KPMPOxzoUZfIXoOU/AIAWkkExFiK5WVZG2oCucEBr0hfMZxsu2xTQSUMg/+0xKEcyVLe5MK3k3P
 hqWuSREDbKaPSieK
X-Google-Smtp-Source: AGHT+IFo2A9O0Pd+0Jjtxrt1+ECzT78ItY7/ECwqakngIzH8TvhjBLA4iDRT8DmojRWEQ9zuMsOG1w==
X-Received: by 2002:a17:90b:3b8a:b0:2ee:cbd0:4910 with SMTP id
 98e67ed59e1d1-2fc0fbca1fcmr2347888a91.1.1739419398984; 
 Wed, 12 Feb 2025 20:03:18 -0800 (PST)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 98e67ed59e1d1-2fbf9ab049fsm2254023a91.47.2025.02.12.20.03.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Feb 2025 20:03:17 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: Liu Hui <liuhui1610@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
In-Reply-To: <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
 (Liu Hui's message of "Thu, 13 Feb 2025 11:47:00 +0800")
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
 <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
Date: Thu, 13 Feb 2025 09:33:13 +0530
Message-ID: <87v7tejxtq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வியாழன் பிப்ரவரி 13, 2025]
   Liu Hui wrote: > On Wed, Feb 12, 2025 at 11:03 PM kobarity wrote: >> >>
   Eli Zaretskii wrote: >> > >> > > From: Visuwesh >> > > Date: Tue, 11 Feb 2025
    20:37:22 +0530 >> > > >> > > I am unsure if this is a me pr [...] 
 
 Content analysis details:   (3.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:1042 listed in]
                             [list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, kobarity <kobarity@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  [வியாழன் பிப்ரவரி 13, 2025]
   Liu Hui wrote: > On Wed, Feb 12, 2025 at 11:03 PM kobarity wrote: >> >>
   Eli Zaretskii wrote: >> > >> > > From: Visuwesh >> > > Date: Tue, 11 Feb 2025
    20:37:22 +0530 >> > > >> > > I am unsure if this is a me pr [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2607:f8b0:4864:20:0:0:0:1042 listed in]
                             [list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

[=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=AA=
=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=B0=E0=AE=B5=E0=AE=B0=E0=AE=BF 13, 2025] L=
iu Hui wrote:

> On Wed, Feb 12, 2025 at 11:03=E2=80=AFPM kobarity <kobarity@HIDDEN> wr=
ote:
>>
>> Eli Zaretskii wrote:
>> >
>> > > From: Visuwesh <visuweshm@HIDDEN>
>> > > Date: Tue, 11 Feb 2025 20:37:22 +0530
>> > >
>> > > I am unsure if this is a me problem but I can no longer complete
>> > > non-builtin objects in a python-mode buffer when I'm using the speci=
fied
>> > > IPython&Python version combination.  However, if I don't use IPython,
>> > > then completion does work as expected.  It prints the following mess=
age
>> > > though (not sure if it is related):
>> > >
>> > >     Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on linux
>> > >     Type "help", "copyright", "credits" or "license" for more inform=
ation.
>> > >     warning: can't use pyrepl: terminal doesn't have the required cl=
ear capability; TERM=3Ddumb
>> > >     >>>
>> > >
>> > > To reproduce the issue,
>> > >
>> > >     1. emacs -Q
>> > >     2. Open a python buffer.
>> > >     3. Type in "import numpy as np" in the buffer.
>> > >     4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the fi=
rst
>> > >        prompt, then say no to the second.
>> > >     5. After the *Python* is created, say C-c C-c in the python-mode
>> > >        buffer.
>> > >     6. Now type "np." and say M-TAB.
>> > >     7. Observe how no completion candidates are offered.
>> > >     8. Remove "np." and instead type "pr" and say M-TAB.
>> > >     9. Observe how two completion candidates (print and property) are
>> > >        offered.
>> > >     10. Repeat the same without using IPython and observe how
>> > >         python-mode offers completion after "np."
>> > >
>> > > I am on Debian sid with an "apt update && apt upgrade" today some 15
>> > > mins ago (no luck after updating if I wasn't clear enough) if it
>> > > matters.
>> >
>> > Thanks.
>> >
>> > kobarity, any comments or suggestions?
>>
>> I reproduced the issue with IPython 8.32.0 and Python 3.13.2.  It
>> seems that there is no problem with IPython on Python 3.12.
>>
>> One workaround is to disable native completion:
>> M-x python-shell-completion-native-turn-off
>> It will be a little more inconvenient than the native completion.

Thank you very much, this works good enough for my needs.  I can work in
peace now.

>> We need to investigate the cause.
>>
>> Liu Hui, do you have any idea?
>
> The problem seems to be not related to emacs, because the completion
> of non-builtin objects doesn't work in terminal too (IPython 8.32.0
> and Python 3.13.2):
>
> 1. run ipython in a terminal: ipython3 --simple-prompt -i
>
> 2. type the following code:
>    import readline
>    import rlcompleter
>    readline.parse_and_bind("tab: complete")
>    import numpy as np
>
> 3. type np.<TAB>, there is no completion
>
>
> If I change the completer to others (e.g. jedi):
>    from jedi.utils import setup_readline
>    setup_readline()
>
> then the completion works in both terminal and emacs.

Indeed, the completion is broken in the terminal.  It did not occur to
me to test it from the terminal at all.  :(
Should we take this as a IPython bug then?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 13 Feb 2025 03:49:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 22:49:05 2025
Received: from localhost ([127.0.0.1]:39347 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiQDp-0001bD-6b
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 22:49:05 -0500
Received: from mail-vs1-xe30.google.com ([2607:f8b0:4864:20::e30]:54523)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <liuhui1610@HIDDEN>)
 id 1tiQDm-0001ag-OQ
 for 76205 <at> debbugs.gnu.org; Wed, 12 Feb 2025 22:49:03 -0500
Received: by mail-vs1-xe30.google.com with SMTP id
 ada2fe7eead31-4bbbaef28a5so133805137.0
 for <76205 <at> debbugs.gnu.org>; Wed, 12 Feb 2025 19:49:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739418537; x=1740023337; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=hC7/3t/cS1if18R27fQ3DTBPkPqcxne2CbuppAH8N6A=;
 b=bm0DZcC0GQCHsTc5Zj0Cz61e4tixayn/NAk8SKA7nPlM1SPjESsiLuy+BCZnr/rfVF
 60XnH25w6LtK97PPS+3n8c7P9CyoKk/BuWSXbhmFgbsX1tsDhFq7syQex6lRu6B8HeXH
 P50r4Nqfgn1NIwOTtBT64Q+l5ou4/LRpnXdNT9Pi7kjYYROdoC9N/5aVHk4RUE0Mk9Z5
 A0FVkyLgCMdKhMakXlwgDAG5NaC4aixs4lDZHCx++ctZLLwXPJ3QD4EqdZLaF8f4EChG
 QIjwbD5TEd95IHZEK+gLn+hW8GCmGThZGg14DgkCfTb3IZ9EHvg+E/j3gJhCVmc3xHaV
 +2mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739418537; x=1740023337;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=hC7/3t/cS1if18R27fQ3DTBPkPqcxne2CbuppAH8N6A=;
 b=GTNObydUOUh4pEi5JHbg4GL6Zllvw3EsBZKM443HO2DsUNsLASNHPHTym/E6b9sp/B
 XMd7z2B7eHYGS5aiHtDvVT5cfVhx7YB0xiSmrjkMLRnNs8kTFqfFy86g7a6tlLDPJbTW
 gZV02JrDkiQ+hYYVP/S9dj8aALcB5/Xxpok65pWgbUnM/4/gIhu+EAkhrhZb4dCvwaPb
 HdEq1fOjqH1en7wydxAH4kLQdey+GFsBRTHxLlpYWV79dGezuHJsPQbDJtb2n6RO+JNs
 fACRBzRyx4U2ZlO1iKjZ9NFv65vhWZIJQWslBOjHn/gDq9UNG18WsKm58869O2k7sGna
 /0sQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWE6fmVtj59OYgIpmYLA4hRw3GGrU2kbTyC/LkVD8qBmhVZ+5M7pJ98tdFqm/1M94V2o/c2Lw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwNEyLiDmot4r6N4FoFwBFIu241iusKeKiW156R6DgsRiqaB7MC
 aYn7x+RBnOcs8ZXGctpq88QyofAKsEskk2XuWAgFUhmiqftA7hTtxCaT8q5CxQNm1RELU7OdhjY
 OCZwPfCBtk4WYb3HNP4bxEHhBP7o=
X-Gm-Gg: ASbGncvZxGsZy9+19efwgYShsvnKZ4UNkTYw7jZJaJa4n72oLWXHDixpLvPyGuvsfXa
 jWbVHXGqFoG5ifZpP+w9sMUSt6Y+MzSGdI5jSSsswNBzlZ1dExUVz7pawlgpNdnr+Ilf81iu9
X-Google-Smtp-Source: AGHT+IHFzTWoU3yjKsU5itOnmj7ll7yW/qLHVFXw5FHMPqjBjlMxIitHnBy8BK1We0NUlwi5ObRLT8KHHrqeof8yTiQ=
X-Received: by 2002:a05:6102:dce:b0:4bb:d394:46cd with SMTP id
 ada2fe7eead31-4bc03743286mr2462281137.18.1739418536824; Wed, 12 Feb 2025
 19:48:56 -0800 (PST)
MIME-Version: 1.0
References: <87cyfoldud.fsf@HIDDEN> <864j0zwenm.fsf@HIDDEN>
 <eke75xlfryrw.wl-kobarity@HIDDEN>
In-Reply-To: <eke75xlfryrw.wl-kobarity@HIDDEN>
From: Liu Hui <liuhui1610@HIDDEN>
Date: Thu, 13 Feb 2025 11:47:00 +0800
X-Gm-Features: AWEUYZmUxNhkoiJawikeEMVMcmbA3XRGU1bHemMywvjC_6XWBdjGNODOrGbNhVg
Message-ID: <CAOQTW-No-HhGquO5G94u88nujwAfRvDW-jpdaQEYsEaBZW+v=A@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50; python.el completion broken for
 non-builtin objects in IPython 8.30.0 & Python 3.13.2
To: kobarity <kobarity@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Wed, Feb 12, 2025 at 11:03=E2=80=AFPM kobarity <kobarity@HIDDEN> wrot=
e:
>
> Eli Zaretskii wrote:
> >
> > > From: Visuwesh <visuweshm@HIDDEN>
> > > Date: Tue, 11 Feb 2025 20:37:22 +0530
> > >
> > > I am unsure if this is a me problem but I can no longer complete
> > > non-builtin objects in a python-mode buffer when I'm using the specif=
ied
> > > IPython&Python version combination.  However, if I don't use IPython,
> > > then completion does work as expected.  It prints the following messa=
ge
> > > though (not sure if it is related):
> > >
> > >     Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on linux
> > >     Type "help", "copyright", "credits" or "license" for more informa=
tion.
> > >     warning: can't use pyrepl: terminal doesn't have the required cle=
ar capability; TERM=3Ddumb
> > >     >>>
> > >
> > > To reproduce the issue,
> > >
> > >     1. emacs -Q
> > >     2. Open a python buffer.
> > >     3. Type in "import numpy as np" in the buffer.
> > >     4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the fir=
st
> > >        prompt, then say no to the second.
> > >     5. After the *Python* is created, say C-c C-c in the python-mode
> > >        buffer.
> > >     6. Now type "np." and say M-TAB.
> > >     7. Observe how no completion candidates are offered.
> > >     8. Remove "np." and instead type "pr" and say M-TAB.
> > >     9. Observe how two completion candidates (print and property) are
> > >        offered.
> > >     10. Repeat the same without using IPython and observe how
> > >         python-mode offers completion after "np."
> > >
> > > I am on Debian sid with an "apt update && apt upgrade" today some 15
> > > mins ago (no luck after updating if I wasn't clear enough) if it
> > > matters.
> >
> > Thanks.
> >
> > kobarity, any comments or suggestions?
>
> I reproduced the issue with IPython 8.32.0 and Python 3.13.2.  It
> seems that there is no problem with IPython on Python 3.12.
>
> One workaround is to disable native completion:
> M-x python-shell-completion-native-turn-off
> It will be a little more inconvenient than the native completion.
>
> We need to investigate the cause.
>
> Liu Hui, do you have any idea?

The problem seems to be not related to emacs, because the completion
of non-builtin objects doesn't work in terminal too (IPython 8.32.0
and Python 3.13.2):

1. run ipython in a terminal: ipython3 --simple-prompt -i

2. type the following code:
   import readline
   import rlcompleter
   readline.parse_and_bind("tab: complete")
   import numpy as np

3. type np.<TAB>, there is no completion


If I change the completer to others (e.g. jedi):
   from jedi.utils import setup_readline
   setup_readline()

then the completion works in both terminal and emacs.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 12 Feb 2025 15:03:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 10:03:44 2025
Received: from localhost ([127.0.0.1]:37735 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiEHA-0001ZQ-0m
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 10:03:44 -0500
Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:56506)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <kobarity@HIDDEN>)
 id 1tiEH7-0001ZB-MX
 for 76205 <at> debbugs.gnu.org; Wed, 12 Feb 2025 10:03:42 -0500
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-21f0444b478so98312305ad.0
 for <76205 <at> debbugs.gnu.org>; Wed, 12 Feb 2025 07:03:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739372615; x=1739977415; darn=debbugs.gnu.org;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:from:to:cc:subject:date:message-id:reply-to;
 bh=Cu+pd/dTZxLSrPDXdXGZtFPzpYj14jdmI3sPuKp7cxk=;
 b=Jjgx+FnNSyBmnZKKeacEntW+/F+UnTs+i2ZIApelrc3QvQQ0SBMH8IR4KyNtiYSRjj
 cY9f9tbkOWVzod7TcUbPJWV90qgr/iI4vKcKzIT9iW1b+yDvyV0UovbUCxCaMlQ2YA9A
 XGY3Yf3jsyZs9gyjjipg+CoZ4pdwgwIFl48IWHVTmC0evXWc82G4uUBqhQjAGFv4YRUL
 rIsF7iq8WUXPPnr0m00HsAAAS8GhGHIoDNPaI2E+1cmrDl7gg/1/SRJjHbm7Rj0HF5VC
 a6h3SOOt4xPnLf8OciITzTUpPP7jRUqtKb99djf5UJw/Hno+aP0wehOrG/OUT3u8PzT8
 LZUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739372615; x=1739977415;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=Cu+pd/dTZxLSrPDXdXGZtFPzpYj14jdmI3sPuKp7cxk=;
 b=aJ+G+ktLcftWAlrC/mNawosoBRr3r8LQWu9jTHB7gbJ6jLI/UHUvNjtTAMBPk5FQEc
 2BIh+rXXeaooQSqeZu894n67hMUvgzAsd9YK0cHzGornO/RwbwXoNzDTQAJdPpRljQd+
 Y2MGZj3byF2Ogv205Epb96a/J3aSRQ3SLNILlBfrxAmN7YzBHmSAtnNDxiezvaY8GqWx
 egEH6OGtrt6y9/YRRzvfdgXFjLGNELMxY3OzEjkILMTr7R8xK/S540yodt+p1DGRbA8R
 0hmiYP/pkfhqirCzac25qTEkt8UM7rtCHC9slyRr0CyGK7bOciRCEV4SWb9AoT6zMjVd
 41Jw==
X-Forwarded-Encrypted: i=1;
 AJvYcCX6vmHIMSn3LLut+pe3O4EU5NNw552rfzb+GbEXwPtZFEXy0G3Ct2Jb0EwRyoXO6nKvuc5CfA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwrLHf8CcOXd07KDkWIUaOFwnCeubahNGV9dUbBTZ2191UVCQRE
 +tRhRWPn+HfuIDx3Fq03NJN4cz7BN/V4y17JPBW/BR/Xy7cbzP01Wrz60w==
X-Gm-Gg: ASbGncsde0OTI/O4bbjo7RDvgZces0d7DYKp1sgoEcbH0EvnWr8y5ecMSAh9t0tgQIq
 P0jU1fTJfIr4b07pu2k//Wx4NhoXP9+gTRk3bMs0mOP0ovziNkgIvitbsqgokMEtubTbfJQh5MC
 FBUExg6y/1pewRxakpk/49ETzWjzyhBG7Llhlm0KryN4Z7hDdqDQ9sovqlqp9AC46tWjsgWaR3k
 hw8uPAaGJGXCmioQ3+UkvSZKoCi3D7gqBgFoCRLi+863ANaooT6+S7FvMMYGzWYNLOnREjK3iIY
 s4ClGVakEGlX0PqW8SJN1bqZTDMV837uHhOUPF8OFbMgpQ==
X-Google-Smtp-Source: AGHT+IGK1eTdk11jRUKvpTvK9CuqiK+8idk+YrWeARrrpAMyso1OwfdPfYPJnAf6SOPKNTNQwtjI5g==
X-Received: by 2002:a05:6a21:3391:b0:1e1:b19a:fb58 with SMTP id
 adf61e73a8af0-1ee5c7490eamr6725576637.13.1739372615404; 
 Wed, 12 Feb 2025 07:03:35 -0800 (PST)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-ad53aa4678bsm6701737a12.28.2025.02.12.07.03.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Feb 2025 07:03:35 -0800 (PST)
Date: Thu, 13 Feb 2025 00:03:15 +0900
Message-ID: <eke75xlfryrw.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Liu Hui <liuhui1610@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76205: 31.0.50; 31.0.50;
 python.el completion broken for non-builtin objects in IPython 8.30.0
 & Python 3.13.2
In-Reply-To: <864j0zwenm.fsf@HIDDEN>
References: <87cyfoldud.fsf@HIDDEN>
	<864j0zwenm.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0
 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=US-ASCII
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org, Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii wrote:
> 
> > From: Visuwesh <visuweshm@HIDDEN>
> > Date: Tue, 11 Feb 2025 20:37:22 +0530
> > 
> > I am unsure if this is a me problem but I can no longer complete
> > non-builtin objects in a python-mode buffer when I'm using the specified
> > IPython&Python version combination.  However, if I don't use IPython,
> > then completion does work as expected.  It prints the following message
> > though (not sure if it is related):
> > 
> >     Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on linux
> >     Type "help", "copyright", "credits" or "license" for more information.
> >     warning: can't use pyrepl: terminal doesn't have the required clear capability; TERM=dumb
> >     >>>
> > 
> > To reproduce the issue,
> > 
> >     1. emacs -Q
> >     2. Open a python buffer.
> >     3. Type in "import numpy as np" in the buffer.
> >     4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the first
> >        prompt, then say no to the second.
> >     5. After the *Python* is created, say C-c C-c in the python-mode
> >        buffer.
> >     6. Now type "np." and say M-TAB.
> >     7. Observe how no completion candidates are offered.
> >     8. Remove "np." and instead type "pr" and say M-TAB.
> >     9. Observe how two completion candidates (print and property) are
> >        offered.
> >     10. Repeat the same without using IPython and observe how
> >         python-mode offers completion after "np."
> > 
> > I am on Debian sid with an "apt update && apt upgrade" today some 15
> > mins ago (no luck after updating if I wasn't clear enough) if it
> > matters.
> 
> Thanks.
> 
> kobarity, any comments or suggestions?

I reproduced the issue with IPython 8.32.0 and Python 3.13.2.  It
seems that there is no problem with IPython on Python 3.12.

One workaround is to disable native completion:
M-x python-shell-completion-native-turn-off
It will be a little more inconvenient than the native completion.

We need to investigate the cause.

Liu Hui, do you have any idea?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at 76205 <at> debbugs.gnu.org:


Received: (at 76205) by debbugs.gnu.org; 12 Feb 2025 12:07:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 07:07:06 2025
Received: from localhost ([127.0.0.1]:33028 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tiBWE-0004px-DX
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 07:07:06 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39202)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tiBW8-0004pG-Ft
 for 76205 <at> debbugs.gnu.org; Wed, 12 Feb 2025 07:07:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tiBW3-0007CH-1Q; Wed, 12 Feb 2025 07:06:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ASrXFILr4YMRTr9voZJb+PpsHcqBibOrDTf2Qj+yjFM=; b=EI0aZfFisaBp
 WKm+8trbHpnpRZ5LjePBy3y38X2KVlYEwnm0B9zzg//s1M507lbhfkZubklfQH6VsgFoCs3ResdnQ
 YZyIiB5nDxza85nxYCIS5vFsrTmAnE233QB977WD8ATtahsx1CbrTSfoqF2lHau3/MoG5juio0+t3
 tlGuld7rATV1pUQTjqO5dTcWWZ05NUA+n3pBPkSI7rq5OqJtH00k5Kpy4dX1RFloAHMh72GQzUvH8
 eKIcOkN2WdUfoeWwJgX0o392nI6y8opkQDDQhWMWihBCLXBV8Zn8EBwZqJf1i7mLrYrbVXxsPeQji
 DH9PKP7bDm8kzo41X2/6zA==;
Date: Wed, 12 Feb 2025 14:06:37 +0200
Message-Id: <864j0zwenm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Visuwesh <visuweshm@HIDDEN>, kobarity <kobarity@HIDDEN>
In-Reply-To: <87cyfoldud.fsf@HIDDEN> (message from Visuwesh on Tue, 11 Feb
 2025 20:37:22 +0530)
Subject: Re: bug#76205: 31.0.50; 31.0.50;
 python.el completion broken for non-builtin objects in IPython 8.30.0
 & Python 3.13.2
References: <87cyfoldud.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76205
Cc: 76205 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Visuwesh <visuweshm@HIDDEN>
> Date: Tue, 11 Feb 2025 20:37:22 +0530
> 
> I am unsure if this is a me problem but I can no longer complete
> non-builtin objects in a python-mode buffer when I'm using the specified
> IPython&Python version combination.  However, if I don't use IPython,
> then completion does work as expected.  It prints the following message
> though (not sure if it is related):
> 
>     Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on linux
>     Type "help", "copyright", "credits" or "license" for more information.
>     warning: can't use pyrepl: terminal doesn't have the required clear capability; TERM=dumb
>     >>>
> 
> To reproduce the issue,
> 
>     1. emacs -Q
>     2. Open a python buffer.
>     3. Type in "import numpy as np" in the buffer.
>     4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the first
>        prompt, then say no to the second.
>     5. After the *Python* is created, say C-c C-c in the python-mode
>        buffer.
>     6. Now type "np." and say M-TAB.
>     7. Observe how no completion candidates are offered.
>     8. Remove "np." and instead type "pr" and say M-TAB.
>     9. Observe how two completion candidates (print and property) are
>        offered.
>     10. Repeat the same without using IPython and observe how
>         python-mode offers completion after "np."
> 
> I am on Debian sid with an "apt update && apt upgrade" today some 15
> mins ago (no luck after updating if I wasn't clear enough) if it
> matters.

Thanks.

kobarity, any comments or suggestions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Feb 2025 15:07:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 11 10:07:51 2025
Received: from localhost ([127.0.0.1]:58015 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1thrra-0005O6-OA
	for submit <at> debbugs.gnu.org; Tue, 11 Feb 2025 10:07:51 -0500
Received: from lists.gnu.org ([2001:470:142::17]:59266)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <visuweshm@HIDDEN>)
 id 1thrrW-0005Nm-3F
 for submit <at> debbugs.gnu.org; Tue, 11 Feb 2025 10:07:48 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1thrrL-0007Wy-Ku
 for bug-gnu-emacs@HIDDEN; Tue, 11 Feb 2025 10:07:40 -0500
Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <visuweshm@HIDDEN>)
 id 1thrrF-0004Zn-Js
 for bug-gnu-emacs@HIDDEN; Tue, 11 Feb 2025 10:07:34 -0500
Received: by mail-pl1-x643.google.com with SMTP id
 d9443c01a7336-21f50895565so63882265ad.2
 for <bug-gnu-emacs@HIDDEN>; Tue, 11 Feb 2025 07:07:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739286446; x=1739891246; darn=gnu.org;
 h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=YviLLHyodaJpCM90WBrsWObFwlHYLfgdz/IohY2ma3M=;
 b=eAKX8odscbrZwfewU8LDS7WH22uspTOsv/bJmJNedZr0titchfQqIFcdmcEdQyvNjo
 xYtrmVc4CvxdiiWgCIm5dIW5jWn+5ffCweahUbNM58IyvdlU1nTNiY1KssPGtfN6il9z
 BT+8EPBqj3pmbp0o3birglpGhl2pnJN5wZjhuOa/XOYRvoeerZ89qES3HfqQ65dA7/Du
 hHfwLRTkvwAu2WH4/CFmPyV9X1L997QHQBexA1WCfw1hsJQswnu0FeJmGxxgaafYBvVj
 MSdh5s5YAJAB5vZxgbA5rxBlCenPFkS98FlReQTTO3kX6WcGIg6TMFrpuYWVJfloiirx
 1RXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739286446; x=1739891246;
 h=mime-version:user-agent:message-id:date:subject:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=YviLLHyodaJpCM90WBrsWObFwlHYLfgdz/IohY2ma3M=;
 b=dGBSLocR1To0mkz52gVHtBtgkxQi0X0rze6Hp/dyUWYezgdIQ7xQ/vT076KiAzsYCV
 zzNQClmd142d/apMpPitzxjaGoz/L6dbsJJmA7GXb2oqvPjZhnwb2D5GVZQyB4G4f/FZ
 S2gPs84T0jSqLuRRAhk32bEsmfyXVF3hPN6wTxbztWQFUsGzLjRqDT+fLd/MAl+qRfus
 CmlAss2ngziTCPBQ+nzpr7cb+J/Ae0PBZqOHBaP2FxEL31ppBGo/SBzvuiYrrSLw9Ny3
 01w9TSGcPDj/VeZ+82Zm+oSEeEU8l5eS+pZB5uGKvNeOIcVBGdTWqM/LoeYllDZnFhSu
 bdVw==
X-Gm-Message-State: AOJu0YxdTBvPmwroK7fy3JPdhU26xWkQoXvjv5H2Jqv+G5BBfD3Q6Hji
 qyXG0/RGzTc0GC3ONewbSRl5L9V8jqi+nrIqWM9UfC9wPNHOEc/XsAjy6y1J
X-Gm-Gg: ASbGncsIXv2AXdeReTPNMCSkk2TbKxV5DZkSQHSS6fLxPNvBjWbXWBCkctIVOJGlwAB
 u9btmRG7IE8mOYSTBWcGoAP2skSf1Nq/owDDXeFvlrjDJtYjEs2TqWFsvxHTSqcYt5D0tR1/siX
 25XWd0Zno4M54YMOdXWCHnJR/J2ukKFBuKc6je3hSJYll63Q9T55CKq7C6zQHxfk/IP6g0DJYE9
 cJWvyCWfL9AXumS6YDGw/8O7CxTPrTIO0Tis54xwRfZ8eUhWS30uL42QH0PLM7hhQvBzDLZeMql
 ZXwmWkzrdI1LRqV7
X-Google-Smtp-Source: AGHT+IFqL57EtpJAy4uQS/Bl303MpxLCUTpxQgWC1mywfXjINPQxjt5VXwXy2QE8pEN9oywfS5rBkQ==
X-Received: by 2002:a17:902:ea03:b0:21f:6be1:97c4 with SMTP id
 d9443c01a7336-21fb6446026mr60486905ad.26.1739286445827; 
 Tue, 11 Feb 2025 07:07:25 -0800 (PST)
Received: from localhost ([1.7.159.71]) by smtp.gmail.com with UTF8SMTPSA id
 d9443c01a7336-21f368ce639sm96362005ad.243.2025.02.11.07.07.24
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 11 Feb 2025 07:07:25 -0800 (PST)
From: Visuwesh <visuweshm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; 31.0.50; python.el completion broken for non-builtin
 objects in IPython 8.30.0 & Python 3.13.2
X-Debbugs-Cc: 
Date: Tue, 11 Feb 2025 20:37:22 +0530
Message-ID: <87cyfoldud.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::643;
 envelope-from=visuweshm@HIDDEN; helo=mail-pl1-x643.google.com
X-Spam_score_int: 12
X-Spam_score: 1.2
X-Spam_bar: +
X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 4.5 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: I am unsure if this is a me problem but I can no longer
 complete
 non-builtin objects in a python-mode buffer when I'm using the specified
 IPython&Python version combination. However, if I don't use IP [...] 
 Content analysis details:   (4.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org]
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (visuweshm[at]gmail.com)
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  I am unsure if this is a me problem but I can no longer complete
    non-builtin objects in a python-mode buffer when I'm using the specified
   IPython&Python version combination. However, if I don't use IP [...] 
 
 Content analysis details:   (3.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [1.7.159.71 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [2001:470:142:0:0:0:0:17 listed in]
                             [list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (visuweshm[at]gmail.com)
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

I am unsure if this is a me problem but I can no longer complete
non-builtin objects in a python-mode buffer when I'm using the specified
IPython&Python version combination.  However, if I don't use IPython,
then completion does work as expected.  It prints the following message
though (not sure if it is related):

    Python 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    warning: can't use pyrepl: terminal doesn't have the required clear capability; TERM=dumb
    >>>

To reproduce the issue,

    1. emacs -Q
    2. Open a python buffer.
    3. Type in "import numpy as np" in the buffer.
    4. Say C-u C-c C-p, answer ipython3 --simple-prompt -i to the first
       prompt, then say no to the second.
    5. After the *Python* is created, say C-c C-c in the python-mode
       buffer.
    6. Now type "np." and say M-TAB.
    7. Observe how no completion candidates are offered.
    8. Remove "np." and instead type "pr" and say M-TAB.
    9. Observe how two completion candidates (print and property) are
       offered.
    10. Repeat the same without using IPython and observe how
        python-mode offers completion after "np."

I am on Debian sid with an "apt update && apt upgrade" today some 15
mins ago (no luck after updating if I wasn't clear enough) if it
matters.


In GNU Emacs 31.0.50 (build 30, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.18.2, Xaw scroll bars) of 2025-01-23 built on astatine
Repository revision: 7dcc7605d58165dac233bcc029509f1ad9807f72
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Debian GNU/Linux trixie/sid

Configured using:
 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d
 --without-gconf --without-libsystemd --with-cairo CFLAGS=-O2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LC_MONETARY: ta_IN.UTF-8
  value of $LC_NUMERIC: ta_IN.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-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
  minibuffer-regexp-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils time-date compile text-property-search
cl-extra help-mode files-x shell pcomplete cl-seq python rx project
byte-opt gv bytecomp byte-compile compat pcase treesit comint subr-x
ansi-osc ring cl-loaddefs cl-lib ansi-color rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process
tty-child-frames emacs)

Memory information:
((conses 16 70184 11581) (symbols 48 8249 0) (strings 32 22079 1977)
 (string-bytes 1 572455) (vectors 16 14799)
 (vector-slots 8 156908 8229) (floats 8 36 27) (intervals 56 313 0)
 (buffers 984 15))




Acknowledgement sent to Visuwesh <visuweshm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76205; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 16 Feb 2025 14:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.