tab completion in shell (bzrtools) fails - WinXP
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BzrTools |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Tab completion in shell, from bzrtools, has some problems. Tested on Win XP.
The following demonstrates. Error reported related to readline, and previous
command - if any - is executed instead of the intended one. Notation "<TAB>" used
to show when Tab key on keyboard was entered.
H:\David\
bzr> ver<TAB>Readline internal error
Traceback (most recent call last):
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 6: ordinal not in range(128)
bzr> version [[Tab-completion NOT used on this line]]
Bazaar (bzr) 2.0rc2
Python interpreter: C:\Added Program Files\Bazaar\
Python standard library: C:\Added Program Files\Bazaar\
Platform: Windows-
bzrlib: C:\Added Program Files\Bazaar\
Bazaar configuration: C:\Documents and Settings\
Bazaar log file: C:\Documents and Settings\David\My Documents\.bzr.log
Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://
bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.
bzr> plug<TAB>Readline internal error [[NOTE that bzr executes 'version' instead of 'plugins']]
Traceback (most recent call last):
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
File "pyreadline\
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 6: ordinal not in range(128)
Bazaar (bzr) 2.0rc2
Python interpreter: C:\Added Program Files\Bazaar\
Python standard library: C:\Added Program Files\Bazaar\
Platform: Windows-
bzrlib: C:\Added Program Files\Bazaar\
Bazaar configuration: C:\Documents and Settings\
Bazaar log file: C:\Documents and Settings\David\My Documents\.bzr.log
Copyright 2005, 2006, 2007, 2008, 2009 Canonical Ltd.
http://
bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.
bzr>
Related branches
- Aaron Bentley: Pending requested
- Diff: None lines
description: | updated |
affects: | bzr → bzrtools |
Changed in bzrtools: | |
status: | New → Fix Released |
So I tracked down the cause. It seems to be this line in bzrtools:
self. identchars += '-'
ensure_ config_ dir_exists( )
self. history_ file = osutils. pathjoin( config_ dir(), 'shell-history') set_completer_ delims( string. whitespace) set_completer_ delims( string. whitespace[ :-1]) self.history_ file, os.R_OK) and \
os. path.isfile( self.history_ file):
readline. read_history_ file(self. history_ file)
=== modified file 'shell.py'
--- shell.py 2008-02-13 04:58:32 +0000
+++ shell.py 2009-09-22 18:09:52 +0000
@@ -99,7 +99,7 @@
- readline.
+ readline.
if os.access(
I don't know 100% how to trigger it, but I know we have this comment in 'osutils.py': whitespace( s): space" as part of ISO-8859-1. But it
def contains_
"""True if there are any whitespace characters in s."""
# string.whitespace can include '\xa0' in certain locales, because it is
# considered "non-breaking-
# 1) Isn't a breaking whitespace
# 2) Isn't one of ' \t\r\n' which are characters we sometimes use as
# separators
# 3) '\xa0' isn't unicode safe since it is >128.
# This should *not* be a unicode set of characters in case the source
# string is not a Unicode string. We can auto-up-cast the characters since
# they are ascii, but we don't want to auto-up-cast the string in case it
# is utf-8
for ch in ' \t\n\r\v\f':
if ch in s:
return True
else:
return False
What is really really weird is that if I do:
python -c "import string; print repr(string. whitespace) "
It *doesn't* contain '\xa0'
But if i do:
bzr shell
And change shell.py to read: whitespace)
readline. set_completer_ delims( string. whitespace)
+ print repr(string.
It *does* contain '\xa0'.
But I haven't figured out anywhere that actually mutates the value...