GNU bug report logs -
#68559
[PATCH] Improve Python shell completion
Previous Next
Reported by: Liu Hui <liuhui1610 <at> gmail.com>
Date: Thu, 18 Jan 2024 04:50:01 UTC
Severity: wishlist
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Liu Hui wrote:
> On Thu, Feb 15, 2024 at 10:43 PM Mattias Engdegård
> <mattias.engdegard <at> gmail.com> wrote:
> >
> > The recent change on master, 0b9c7148fd, causes several failures in python-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.
>
> Hi,
>
> 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.
This bug report was last modified 1 year and 66 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.