Ok, the error was caused by Genshi. Failing over to BeautifulSoup in case of UnicodeDecodeError.