﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11869	makemessages command hangs when there're many errors in the .po file	Evgenii Morozov	nobody	"I have found a bug in the `makemessages` command. It deadlocks when spawned `msgmerge` utility spits too many errors or warnings (for example, about wrong escape sequences in the po file). In the ideal world these messages wouldn't appear, but we've used custom written po editor for too long and it didn't validate translations as strictly as `msgmerge` does, so we get quite a lot of warnings from the `msgmerge`.

makemessages.py uses the following code for spawning msgmerge.py:
{{{
                (stdin, stdout, stderr) = os.popen3('msgmerge -q ""%s"" ""%s""' % (pofile, potfile), 't')
                msgs = stdout.read()
                errors = stderr.read()
                if errors:
                    raise CommandError(""errors happened while running msgmerge\n%s"" % errors)
}}}
which blocks when there're warnings or errors. I've googled only one report of the `makemessages` deadlock, so this doesn't happen often, but when it happens, it's a real PITA.

It's also very hard to repeat - sometimes it doesn't hang even if there're many errors, sometimes there're fewer errors but it hangs anyway. I believe I have one .po file which can be used to reproduce the bug, which I can share via private communication channel (for example, email, since I cannot share here where anyone would be able to see it).

In the meantime, I'll clone `makemessages` command in the code of my application and change the relevant code with the non-blocking version.
Eugene"		closed	Internationalization	dev		fixed	gettext, msgmerge, popen3, i18n		Accepted	1	0	0	0	0	0
