Disappearing newline characters
I just found what appears to be a bug in polib which affects all versions after 0.6. In msgids, there are cases where trailing newlines are removed from the pofile when using the str() method to convert the loaded PO/POT back to text. Here is an example:
I have a POT file with a single PO entry containing this:
msgid "" "There was an error running your transaction for the following reason: %s\n" msgstr ""
However when I load it in the python interpreter I get these results:
for entry in pot: entry.msgid u'There was an error running your transaction for the following reason: %s\n'
which seems correct but:
SOME DESCRIPTIVE TITLE.
Copyright (C) YEAR Red Hat, Inc.
This file is distributed under the same license as the PACKAGE package.
FIRST AUTHOR EMAIL@ADDRESS, YEAR.
msgid "" msgstr "" "Project-Id-Version: test\n" "Report-Msgid-Bugs-To: firstname.lastname@example.org\n" "POT-Creation-Date: 2011-02-10 11:42-0500\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" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: \n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
msgid "" "There was an error running your transaction for the following reason: " "%s " msgstr ""
in which you can see that the trailing '\n' in the msgid is missing. I've tried it with 0.6 and 0.6.2 and both seem to be affected so it probably has to do with the changes from 0.5.5 to 0.6.
If you need any more info let me know.