Actually decode bytes to unicode the correct way.
wrapping in unicode() is a python-2.7-ism known to lead to various issues.
With these changes it works on Python3, at least partially.
It's interesting, I like that things like \bf{a}
are converted to bold unicode equivalent, which btw is a Python3 valid identifier :-P
The code is a mess though.
Any idea on the licence ?