makemessages command results in html.py files and a UnicodeDecodeError

I had the same issue with the .html.py duplicated files. I ended up with duplicated .txt.py files too, even in my static folder!. And the solution was not utf-8 related.

My problem was that I executed django-admin makemessages -l <locale> at a project level directory. The commands makemessages and compilemessages must be executed being inside the app directory.

As a side note, don't forget to create the locale folder inside the app first, before executing the commands. Also execute the makemessages command using the locale name string (with the form ll_LL, with underscore and capital letter for country) and not the language code (with the form ll-ll, with dash and no capitals)

I hope this helps other people, as this was the only question I found in stackoverflow related to this issue.