﻿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
29074	makemessages duplicates .po file headers when fed with empty strings	instantname	Manthan Sharma	"Django 1.11.9

== Steps to reproduce

{{{
django-admin startproject mysite
cd mysite/mysite
mkdir locale
}}}

Edit urls.py to add this line at the end:

{{{
_('hello')
}}}

Create messages:

{{{
django-admin makemessages -l de
}}}

Edit urls.py again to add this line at the end:

{{{
pgettext_lazy('context', '')
}}}

Update messages:

{{{
django-admin makemessages
}}}

== Result

The locale/de/django.po file obtained is the following:

{{{
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid """"
msgstr """"
""Project-Id-Version: PACKAGE VERSION\n""
""Report-Msgid-Bugs-To: \n""
""POT-Creation-Date: 2018-01-27 03:50+0100\n""
""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""
""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""
""Language-Team: LANGUAGE <LL@li.org>\n""
""Language: \n""
""MIME-Version: 1.0\n""
""Content-Type: text/plain; charset=UTF-8\n""
""Content-Transfer-Encoding: 8bit\n""
""Plural-Forms: nplurals=2; plural=(n != 1);\n""

#: urls.py:23
msgid ""hello""
msgstr """"

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#: urls.py:24
#, fuzzy
msgctxt ""context""
msgid """"
msgstr """"
""Project-Id-Version: PACKAGE VERSION\n""
""Report-Msgid-Bugs-To: \n""
""POT-Creation-Date: 2018-01-27 03:49+0100\n""
""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""
""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""
""Language-Team: LANGUAGE <LL@li.org>\n""
""Language: \n""
""MIME-Version: 1.0\n""
""Content-Type: text/plain; charset=UTF-8\n""
""Content-Transfer-Encoding: 8bit\n""
""Plural-Forms: nplurals=2; plural=(n != 1);\n""
}}}

The unexpected behavior is the repetition of some header lines. This seems to only happen with empty strings in the Python code. While a bit odd, I think empty strings are valid strings (at least with a context) that may sometimes need translation."	Bug	closed	Core (Management commands)	1.11	Normal	wontfix	i18n	dgt-qzl@…	Accepted	0	0	0	0	0	0
