unicode issue in osutils.contains_whitespace

Lukáš Lalinský lalinsky at gmail.com
Sat Jun 17 22:03:37 BST 2006


Hi,

I tried to convert one Subversion repository into Bzr using Tailor and I was
getting an unicode TypeError from osutils.contains_whitespace. I'm not sure if
this function is supposed to be Unicode safe. If no, then this is a Tailor bug
and you can just ignore this e-mail. :)

The problem is that Tailor sends unicode strings to bzrlib, and when
contains_whitespace is looking for whitespace characters it uses
string.whitespace. But string.whitespace contains a '\xa0' (non-breaking space
in ISO-8859-1), which is not convertable to unicode using the default 'ascii'
codec and so it raises a TypeError exception ("TypeError: 'in <string>' requires
string as left operand").

-- 
Lukáš Lalinský
-------------- next part --------------
A non-text attachment was scrubbed...
Name: contains_whitespace.diff
Type: text/x-patch
Size: 498 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060617/c6805f82/attachment.bin 


More information about the bazaar mailing list