ia64/xen-unstable

changeset 15719:11b70c3d2194

xm: Fix control characters causing xm tests to fail.

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 <stefanb@us.ibm.com>
author kfraser@localhost.localdomain
date Mon Aug 06 13:42:15 2007 +0100 (2007-08-06)
parents c2d4efc2c8f9
children 6f18f5bdeea3
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Mon Aug 06 13:39:20 2007 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Mon Aug 06 13:42:15 2007 +0100
     1.3 @@ -25,7 +25,6 @@ import atexit
     1.4  import cmd
     1.5  import os
     1.6  import pprint
     1.7 -import readline
     1.8  import shlex
     1.9  import sys
    1.10  import re
    1.11 @@ -616,6 +615,7 @@ class Shell(cmd.Cmd):
    1.12  
    1.13      def preloop(self):
    1.14          cmd.Cmd.preloop(self)
    1.15 +        import readline
    1.16          readline.set_completer_delims(' ')
    1.17  
    1.18      def default(self, line):