"import readline" crashes after loading an extension linked against libedit

Bug #1899076 reported by Colin Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.6 (Ubuntu)
New
Undecided
Unassigned

Bug Description

The Launchpad test suite segfaults on Python 3.6 in bionic when its stdout is not a tty. This is currently visible as http://lpbuildbot.canonical.com/builders/lp-devel-bionic-py3/builds/4/steps/shell_7/logs/stdio, though I'm not sure how long that link will continue to exist before buildbot garbage-collects it, so the relevant bit is:

  No entry for terminal type "unknown";
  using dumb terminal settings.
  bind: Invalid command `enable-meta-key'.
  No entry for terminal type "unknown";
  using dumb terminal settings.
  No entry for terminal type "unknown";
  using dumb terminal settings.
  Segmentation fault

After considerable effort I tracked this down as far as this upstream bug report:

  https://bugs.python.org/issue38634

A reduced reproduction recipe (requiring "apt install gir1.2-gtk-3.0 python3-gi xvfb") is:

  xvfb-run python3 -c 'from gi.repository import Gtk; import readline'

While we may be able to work around this somehow in our test suite, it's going to be very cumbersome and it looks as though it will have to involve not importing readline anywhere, which is going to be pretty fragile, or maybe stubbing readline. Would you consider please backporting the upstream change in https://github.com/python/cpython/pull/16986/files, which looks as though it should fix this properly? (I also commented on the upstream bug report remarking on how this isn't necessarily a rare case.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.