Merge lp://qastaging/~jameinel/bzrtools/bug_431241 into lp://qastaging/bzrtools

Proposed by John A Meinel
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~jameinel/bzrtools/bug_431241
Merge into: lp://qastaging/bzrtools
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~jameinel/bzrtools/bug_431241
Reviewer Review Type Date Requested Status
Aaron Bentley Pending
Review via email: mp+12244@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

This potentially fixes bug #431241

Basically, 'string.whitespace' can contain non-ascii characters by a strange set of circumstances. And it seems that sometimes / always the readline completer works with unicode characters. This forces an upcast of the string, which fails because 0xa0 is not an ascii char.

0xa0 is apparently Non-breaking-space in iso-8859-1. I have not figured out the code path that injects that character, as running python interactively seems to not include it, but every time I run via 'bzr shell' it does show up.

It would be nice to get this into a 2.0.1 (or 2.0.0.1 ?) release, so it could be bundled with the 2.0.0 installer, but we could always roll it into the next one.

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> John A Meinel has proposed merging lp:~jameinel/bzrtools/bug_431241 into lp:bzrtools.
>
> Requested reviews:
> Aaron Bentley (abentley)
>
> This potentially fixes bug #431241

I'll merge this, but I can't reproduce this bug.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkq+Q2EACgkQ0F+nu1YWqI0/lACeJkSsk2uqonhrYwk2jOaVq/2K
ctIAn2Wa5cCVEAFkg9ivf12x7ODywHCZ
=SUUp
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> John A Meinel wrote:
>> John A Meinel has proposed merging lp:~jameinel/bzrtools/bug_431241 into lp:bzrtools.
>
>> Requested reviews:
>> Aaron Bentley (abentley)
>
>> This potentially fixes bug #431241
>
> I'll merge this, but I can't reproduce this bug.
>
> Aaron

It may only be on Windows, but we have a similar comment in the
'osutils.contains_whitespace' helper. I still haven't tracked down why
when I load up bzrtools 'string.whitespace' has '\x0a' in it, but if I
just start python interactively it does not.

Thanks for merging it anyway.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq+VvwACgkQJdeBCYSNAANn9gCgonqF+qSM6Drnki+ONx+glE80
WG4AoLc5JUUj6EXWX+TBQmaV4O8L4t8o
=ahho
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell.py'
2--- shell.py 2008-02-13 04:58:32 +0000
3+++ shell.py 2009-09-22 18:20:33 +0000
4@@ -99,7 +99,8 @@
5 self.identchars += '-'
6 ensure_config_dir_exists()
7 self.history_file = osutils.pathjoin(config_dir(), 'shell-history')
8- readline.set_completer_delims(string.whitespace)
9+ whitespace = ''.join(c for c in string.whitespace if c < chr(127))
10+ readline.set_completer_delims(whitespace)
11 if os.access(self.history_file, os.R_OK) and \
12 os.path.isfile(self.history_file):
13 readline.read_history_file(self.history_file)

Subscribers

People subscribed via source and target branches