Implicit UnicodeDecodeErrors is what you get when you try to add str and unicode objects. Then Python will try to decode str in unicode, but using ASCII encoding. If your str contains everything that is not ascii, you will get this error.
Your solution is to manually decode it:
thestring = thestring.decode('utf8')
Try, as far as possible, to decode any string that may contain non-ascii characters, like su, as you pass it from any module you get it from, in this case suds.
Then, if suds cannot handle Unicode (which may be the case), make sure you encode it just before passing the text back to the foam (or any other library that breaks if you give it unicode).
That should solve everything well. This can be a big change, since you need to move all your internal processing from str to unicode, but it's worth it. :)
Lennart Regebro
source share