Subject: 29.4; Autocompletion Python Inferior Shell hangs for numpy 2.0

From: Stefan Kuczera <[email-masked]>
Date: Mon, 10 Mar 2025 11:08:18 +0100

After running the following code in Inferior Python mode shell

import numpy as np
a=np.ones((100))

writing a. and then pressing tab results in the shell hanging and no
completion suggestions appear. This affects numpy version 2.0 and
higher. For lower numpy versions it works fine. Problem is observed on
both Fedora and Gentoo.

In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42,
cairo version 1.18.2) of 2025-01-28 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Gentoo Linux

Configured using:
'configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --datarootdir=/usr/share
--disable-silent-rules --docdir=/usr/share/doc/emacs-29.4
--htmldir=/usr/share/doc/emacs-29.4/html --libdir=/usr/lib64
--program-suffix=-emacs-29 --includedir=/usr/include/emacs-29
--infodir=/usr/share/info/emacs-29 --localstatedir=/var
--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
--without-compress-install --without-hesiod --without-pop
--with-file-notification=inotify --with-pdumper --enable-acl
--with-dbus --with-modules --without-gameuser --with-libgmp --with-gpm
--without-native-compilation --without-json --without-kerberos
--without-kerberos5 --with-lcms2 --without-xml2 --without-mailutils
--without-selinux --without-sqlite3 --with-gnutls --with-libsystemd
--with-threads --without-tree-sitter --without-wide-int
--with-sound=alsa --with-zlib --with-x --without-pgtk --without-ns
--without-gconf --without-gsettings --without-toolkit-scroll-bars
--with-xpm --with-xft --with-cairo --without-harfbuzz --without-libotf
--without-m17n-flt --with-x-toolkit=gtk3 --without-xwidgets --with-gif
--with-jpeg --with-png --with-rsvg --with-tiff --without-webp
--without-imagemagick --with-dumping=pdumper 'CFLAGS=-O2 -march=native
-pipe -fno-fast-math -ffp-contract=off' CPPFLAGS= 'LDFLAGS=-Wl,-O1
-Wl,--as-needed -Wl,-z,pack-relative-relocs''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM JPEG LCMS2 LIBSYSTEMD
MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11
XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
value of $LC_COLLATE: en_US.UTF-8
value of $LC_CTYPE: en_US.UTF-8
value of $LC_MESSAGES: en_US.UTF-8
value of $LANG: en_US
locale-coding-system: utf-8-unix

Major mode: Message

Minor modes in effect:
mml-mode: t
company-tng-mode: t
override-global-mode: t
global-company-mode: t
company-mode: t
pyvenv-mode: t
tooltip-mode: t
global-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
line-number-mode: t
auto-fill-function: message-do-auto-fill
visual-line-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
abbrev-mode: t

Load-path shadows:
/home/stefan/.emacs.d/elpa/julia-mode-20230712.1524/julia-mode hides 
/usr/share/emacs/site-lisp/ess/julia-mode
/home/stefan/.emacs.d/elpa/transient-20221020.1019/transient hides 
/usr/share/emacs/29.4/lisp/transient
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-bind-key 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-bind-key
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-delight 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-delight
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package hides 
/usr/share/emacs/29.4/lisp/use-package/use-package
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-core 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-core
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-ensure 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-ensure
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-diminish 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-diminish
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-lint 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-lint
/home/stefan/.emacs.d/elpa/use-package-20221027.1721/use-package-jump 
hides /usr/share/emacs/29.4/lisp/use-package/use-package-jump
/home/stefan/.emacs.d/elpa/bind-key-20221026.1834/bind-key hides 
/usr/share/emacs/29.4/lisp/use-package/bind-key

Features:
(matlab matlab-scan matlab-syntax matlab-compat pulse color shadow sort
mail-extr ispell emacsbug message yank-media puny rfc822 mml mml-sec epa
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
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-cmake company-semantic company-template company-bbdb company-tng
sgml-mode facemenu dom init-local esmd derived tcl origami
origami-parsers cl dash reftex reftex-loaddefs reftex-vars
tree-sitter-langs tree-sitter-langs-build tar-mode arc-mode archive-mode
tree-sitter-hl tree-sitter tree-sitter-load tree-sitter-cli tsc tsc-dyn
tsc-dyn-get dired-aux dired dired-loaddefs tsc-obsolete edmacro kmacro
use-package-bind-key bind-key use-package-core indent-tools yafolding
hydra lv indent-tools-indentation-of highlight-symbol yasnippet-snippets
cl-extra yasnippet highlight-indentation flymake-proc flymake warnings
thingatpt company-capf company help-fns radix-tree help-mode elpy advice
elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util elpy-shell elpy-profile elpy-django s
elpy-refactor diff-mode easy-mmode python rx compat compat-macs pcase
treesit ido hideshow grep compile text-property-search comint ansi-osc
ansi-color files-x etags fileloop generator xref project ring cus-edit
pp cus-load icons wid-edit finder-inf site-gentoo ess-autoloads tex-site
undo-tree-autoloads info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib 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 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 font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 414483 27466)
(symbols 48 27204 1352)
(strings 32 145673 13357)
(string-bytes 1 3675599)
(vectors 16 46005)
(vector-slots 8 671735 33538)
(floats 8 212 573)
(intervals 56 1107 0)
(buffers 976 15))