The error message suggest that you are trying to process Unicode text with a program that only handles ASCII. It would help if you remove all the code not relevant to the problem, and also indicate exactly where the failure occurs. Also, Python questions are more likely to get an answer when posted at [Quick Answers](https://www.codeproject.com/Questions/ask.aspx).