From: Stefan Berger Subject: [PATCH] [XM] Control characters make xm tests fail Date: Mon, 06 Aug 2007 08:43:42 -0400 Message-ID: <1186404222.9304.15.camel@gsal-3.watson.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-8tJkADgdovQv1qUvyJgD" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --=-8tJkADgdovQv1qUvyJgD Content-Type: text/plain Content-Transfer-Encoding: 7bit On my FC7 installation some of the test in the xm test suite fail for no apparent reason. The problem is that the python 'readline' module puts out control characters that confuse code that parses the output of some of the xm commands that are being run. The readline module dumps those characters upon import. The attached patch works around this problem. Here's what I get in out.txt when doing 'python 2>&1 | tee out.txt' and 'import readline' on the python command line: Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. [[?1034h>>> >>> The characters before the '>>>' above are those printed by that version of 'readline' and remain invisible on the screen but appear in the file and confuse the xm test suite parser. Signed-off-by: Stefan Berger --=-8tJkADgdovQv1qUvyJgD Content-Disposition: attachment; filename=xm_test_fc7_fix.diff Content-Type: text/x-patch; name=xm_test_fc7_fix.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit --- xen-unstable.hg/tools/python/xen/xm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: root/xen-unstable.hg/tools/python/xen/xm/main.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/xm/main.py +++ root/xen-unstable.hg/tools/python/xen/xm/main.py @@ -25,7 +25,6 @@ import atexit import cmd import os import pprint -import readline import shlex import sys import re @@ -615,6 +614,7 @@ class Shell(cmd.Cmd): def preloop(self): cmd.Cmd.preloop(self) + import readline readline.set_completer_delims(' ') def default(self, line): --=-8tJkADgdovQv1qUvyJgD Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-8tJkADgdovQv1qUvyJgD--