From 6ae5d7f2a132aa9690bfb59b8eebcc1fb7c792c8 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 31 Oct 2007 18:53:44 +0000 Subject: Fixed gettext module for Windows. The metadata lines always end in \n and not in os.linesep --- Lib/gettext.py | 2 +- Lib/test/test_gettext.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/gettext.py b/Lib/gettext.py index 533be3d..8ff0a80 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -291,7 +291,7 @@ class GNUTranslations(NullTranslations): if mlen == 0: # Catalog description lastk = k = None - for b_item in tmsg.split(os.linesep.encode("ascii")): + for b_item in tmsg.split('\n'.encode("ascii")): item = str(b_item).strip() if not item: continue diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index a32fa27..12a657c 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -332,6 +332,7 @@ class WeirdMetadataTest(GettextBaseTest): def test_weird_metadata(self): info = self.t.info() + self.assertEqual(len(info), 9) self.assertEqual(info['last-translator'], 'John Doe \nJane Foobar ') -- cgit v0.12