From: Jan Kratochvil Date: Fri, 8 Feb 2019 18:49:19 +0000 (-0500) Subject: Avoid readline conflicts in pexpect X-Git-Tag: glibc-2.30~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56a731d4ad319e473851893980e734b7ee42c1a0;p=thirdparty%2Fglibc.git Avoid readline conflicts in pexpect In some cases, sensitive to readline version and the user's environment, gdb might emit escape codes while run under python's pexpect (i.e. testing pretty printers). This patch, suggested by Jan, helps isolate the test from the user's environment. Tested on RHEL 7 x86_64 with DTS 7 and EPEL, which is one magic combination of components that triggers this bug. --- diff --git a/ChangeLog b/ChangeLog index d9852ab95c3..d3560ade54b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-02-14 Jan Kratochvil + + * scripts/test_printers_common.py: Set TERM to a known harmless + value. + 2019-02-14 Joseph Myers * sunrpc/xdr.c (xdr_int): Add fall-through comment. diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py index dada6aadde3..b2bd4ba1ccf 100644 --- a/scripts/test_printers_common.py +++ b/scripts/test_printers_common.py @@ -60,6 +60,10 @@ TIMEOUTFACTOR = os.environ.get('TIMEOUTFACTOR') if TIMEOUTFACTOR: timeout = int(TIMEOUTFACTOR) +# Otherwise GDB is run in interactive mode and readline may send escape +# sequences confusing output for pexpect. +os.environ["TERM"]="dumb" + try: # Check the gdb version. version_cmd = '{0} --version'.format(gdb_invocation, timeout=timeout)