﻿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
17008	makemessages too eager to cleanup, makes it hard to debug errors	Andy Terra	Andy Terra	"```./manage.py makemessages``` always removes .pot files when finished, but sometimes this just makes debugging harder. I propose an option be added to allow for prevent deletion of these files, even when errors occur in the function.

The need for this option arose of an error which was, even when at verbose level 3, resulting in nearly useless debugging information when running ```./manage.py makemessages --locale=pt_BR -a -d djangojs -v3```:

{{{
processing language pt_BR
ignoring file .gitignore in .
ignoring file .project in .
ignoring file .pydevproject in .
ignoring file .urls.py.swp in .
ignoring file urls.py~ in .
processing file athena.js in .\static\js
(...)
processing file superfish.js in .\static\js
processing file grappelli.js in .\static\js\grappelli
processing file jquery.grp_collapsible.js in .\static\js\grappelli
processing file jquery.grp_collapsible_group.js in .\static\js\grappelli
processing file jquery.grp_inline.js in .\static\js\grappelli
processing file jquery.grp_related_fk.js in .\static\js\grappelli
processing file jquery.grp_related_generic.js in .\static\js\grappelli
processing file jquery.grp_related_m2m.js in .\static\js\grappelli
processing file jquery.grp_timepicker.js in .\static\js\grappelli
Error: errors happened while running msguniq
C:\projects\portal\hermes\locale\pt_BR\LC_MESSAGES\djangojs.pot:57: context separator <EOT> within string
C:\projects\portal\hermes\locale\pt_BR\LC_MESSAGES\djangojs.pot:58: context separator <EOT> within string
msguniq: found 2 fatal errors [1]
}}}

As you can see, it's hard to tell which of these files caused the EOT within string error, but by keeping djangojs.pot and then reading lines 57 and 58, I was able to deduct that athena.js was the file to blame

{{{
#: .\static\js\athena.js.c:30 .\static\js\athena.js.c:38
msgid ""<EOT>"" [2]
msgid_plural ""<EOT>"" [2]
msgstr[0] """"
msgstr[1] """"
}}}


''[1] this line translated from Portuguese in this post to help understanding.''

''[2] these lines had a EOT character rather than <EOT> that can't be displayed here.''


I've attached a simple patch which provides the user with a --keep-pot option to help in edge cases like this one, which simply skips the ```os.unlink(potfile)``` call.


Cheers!"	New feature	closed	Core (Management commands)	1.3	Normal	fixed	makemessages .pot .po gettext xgettext translation debug		Ready for checkin	1	0	1	1	1	0
