Don't know python, but i get an error, and this might be the problem.
Sorry to waste your time if encode(u"UTF-8") is valid :-(
It's valid, however, it won't hurt to remove it. What was the error you got?
File "lxml.etree.pyx", line 134, in init lxml.etree (src/lxml/lxml.etree.c:179 662) TypeError: encode() argument 1 must be string without null bytes, not unicode
And this is using Python version ... ?
Python 2.7.3-3, but got a update this morning, all running fine, sorry for the trouble :-(