Closed
Description
I'm using babel-2.6.0, and I'm hitting a problem with generated data, not something I can fix on that end.
I have a standard Makefile for generating pot
files, then I use msgcat
to produce a single merged pot, which I then update with the line:
sphinx-intl update -p _build/locale-merged $(for i in $LANGUAGES; do printf -- '-l %s ' $i; done)
and the result is a crash:
babel/messages/pofile.py", line 552, in write_po
for filename, lineno in sorted(message.locations):
TypeError: unorderable types: NoneType() < int()
which I fixed very brutally by adding a key
parameter to the sorted
function:
sorted(message.locations, key=(lambda x: (x[0], x[1] or -1)))