Apparently on some systems (Mandriva and Slackware at least), importing
the readline library can print some escape sequences to stdout, which screws
things up with the unit tests that run 'bup ftp "cat filename"' and expect
it to be the right data.
Thanks to Eduardo Kienetz for noticing and helping to track down the problem
since I couldn't reproduce it.
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
from bup import options, git, shquote, vfs
from bup.helpers import *
-try:
- import readline
-except ImportError:
- log('* readline module not available: line editing disabled.\n')
- readline = None
-
-
def node_name(text, n):
if stat.S_ISDIR(n.mode):
return '%s/' % text
optspec = """
-bup ftp
+bup ftp [commands...]
"""
o = options.Options('bup ftp', optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
if extra:
lines = extra
else:
+ try:
+ import readline
+ except ImportError:
+ log('* readline module not available: line editing disabled.\n')
+ readline = None
+
if readline:
readline.set_completer_delims(' \t\n\r/')
readline.set_completer(completer)