From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#68559: [PATCH] Improve Python shell completion Date: Fri, 16 Feb 2024 18:34:25 +0900 Message-ID: References: <6BAFD8BF-8F18-4D9F-9DB3-A185AEF2EBCA@gmail.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10919"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , 68559@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 16 10:36:00 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1raudU-0002fJ-Ai for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Feb 2024 10:36:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raudF-0006XM-Tc; Fri, 16 Feb 2024 04:35:45 -0500 Original-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 ) id 1raudD-0006X5-Bf for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 04:35:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raudD-00015M-3P for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 04:35:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raudV-0003Ay-Ox for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2024 04:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Feb 2024 09:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68559 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68559-submit@debbugs.gnu.org id=B68559.170807615512186 (code B ref 68559); Fri, 16 Feb 2024 09:36:01 +0000 Original-Received: (at 68559) by debbugs.gnu.org; 16 Feb 2024 09:35:55 +0000 Original-Received: from localhost ([127.0.0.1]:57862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raudO-0003AU-IM for submit@debbugs.gnu.org; Fri, 16 Feb 2024 04:35:54 -0500 Original-Received: from mail-pf1-f178.google.com ([209.85.210.178]:56526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raudM-0003AG-1M for 68559@debbugs.gnu.org; Fri, 16 Feb 2024 04:35:53 -0500 Original-Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6e0a479a6cbso1211989b3a.0 for <68559@debbugs.gnu.org>; Fri, 16 Feb 2024 01:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708076067; x=1708680867; 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=mLpeX275D94K5R5huP9Ti81X6T0FtYknNN1loBIMk0c=; b=WwDxQkiCh5ULz6PBQpV52EPw6w9d+5P3UQlNWRA9HYfL5rIw4WG1rjftZSbAK2xyHi JVD1iocT2YQAyyOGkUB6wbl6GbBYTU4xls9FO6XEUn31+7CWnKArbTaro6jbHdoOEVGi 6xY0uGG77S4FUvqC4YHf8DCD8x/gd+pl7Mp8phbo6VlTHQjLtvn+QOSQYS/yOypm4pMC /PKIm+8yMKyhX9js5Odf19YltcfO4KCbm9Kwseh8gyevfmJCTKG51551gB0Dlr9airov L/gTyiDKHtygoZbzPSbRXZ2ffte9rRi6gP0smFeDE4WnF8sWJCbAkDYCrRis6lT2TWAB h3gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708076067; x=1708680867; 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=mLpeX275D94K5R5huP9Ti81X6T0FtYknNN1loBIMk0c=; b=OdBmXnwgh1REMYkARZP2ReXchH0h3C1uy/jtlrjkTx+qmsQQhjPpVcj8pwiBq6DCJ3 8929eeaSdkcArrM9zRdP5U7D4vmNlAKqSRlzIWnPRZPReETAJHtYcWtXpOetFe9phPYv Fmjfxe8rJOPOFyFjerxZI7pk2LIBJFqehL06cwhA/VXdGHTlQ8jiBp5tP2BXI6AYy0F6 CH87sjdfGT+hBK5RwA+R1+LiMNYqw+ofiPBZrvNXhRocgKKwxE9yQVC1JTP+29JBWSyb qP91XjsZ9YuJVLy50smdbrHBwc4YoT/84t9mhZayFCC/KHpL+EHPWTj8cpYub1IdjwlP 4TMA== X-Forwarded-Encrypted: i=1; AJvYcCWBCvhAKVy8aIf59xZuvW4NTyl8amN9/X9DdVDaBoOWiq0DlySoOz0lfcanHTlxYJIvwtlOoTVz/OodISJ8rgglhSib1xQ= X-Gm-Message-State: AOJu0YwBZ+IIMZOlZDA8fVNbgvgWWW3EXpeWOxK3u23zwZ4pQ3+rQeWq lsti6WaZMNJtiK62TIni1vUiwB87q+501Y1/8ON6q9zRzGEPqcXr X-Google-Smtp-Source: AGHT+IFFmRw8d0pCzzk+hi/X6lp+jcW2TfJwSOzWAt/rMM0kV4VHvzQMKcJlz2hlSO+bqLZWRXQ/9w== X-Received: by 2002:a62:c1c5:0:b0:6e0:ed60:9a27 with SMTP id i188-20020a62c1c5000000b006e0ed609a27mr3919104pfg.7.1708076066703; Fri, 16 Feb 2024 01:34:26 -0800 (PST) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id b11-20020a056a000ccb00b006e0814dbb3bsm2751654pfv.96.2024.02.16.01.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 01:34:26 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280094 Archived-At: Liu Hui wrote: > On Thu, Feb 15, 2024 at 10:43=E2=80=AFPM Mattias Engdeg=C3=A5rd > wrote: > > > > The recent change on master, 0b9c7148fd, causes several failures in pyt= hon-tests here (macOS). Log attached. > > > > It seems to have something to do with completion. Maybe the new code is= sensitive to details of Python's command line editor? The standard Python = interpreter is unlikely to use GNU readline, for example. >=20 > Hi, >=20 > According to the log, the problem may be related to the json library, > which is introduced by the patch to convert the completion results > from Python to elisp. What is the version of Python on macOS? AFAIK > the json library is added to the Standard library since version 2.6. > If the library is not available, could you setup a Python virtual > environment containing the library and run the python tests in it? > Thanks! This is caused by the fact that the input is echoed back on MacOS Python. This is described in etc/PROBLEMS: *** In Inferior Python mode, input is echoed and native completion doesn't = work. The following log shows that it tries to parse the echoed back string as a JSON string. Test python-completion-at-point-1 backtrace: json-parse-string("__PYTHON_EL_eval_file(\"/var/folders/qy/zstv16390 python--parse-json-array("__PYTHON_EL_eval_file(\"/var/folders/qy/zs I think the echoed back string were ignored before the patch is applied. However, after applying the patch, the returned string is now parsed as JSON, which I believe is the reason for the error. So one workaround would be to remove the echoed back string before parsing as JSON.