Hello, I hope that this helps you a little bit: (I don't have an exact answer for you.)
Sometimes it is the best to rewrite a project, because you just make the same mistake again and again. By rewriting you have to rethink it and maybie the errors are disappearing.
Btw. you could use dict()
instead of dict([])
. And you don't need a xmlify
-function, you could just use this:
from cgi import escape
print(escape("<a>1 & 3</a>"))
# prints <a>1 & 3</a>
Maybie the error has something to do with the æ
in your csv. (It might be a bug in one of the used modules)