[Python-3000-checkins] r58732 - in python/branches/py3k/Lib: gettext.py test/test_gettext.py

christian.heimes python-3000-checkins at python.org
Wed Oct 31 19:53:45 CET 2007


Author: christian.heimes
Date: Wed Oct 31 19:53:44 2007
New Revision: 58732

Modified:
   python/branches/py3k/Lib/gettext.py
   python/branches/py3k/Lib/test/test_gettext.py
Log:
Fixed gettext module for Windows. The metadata lines always end in \n and not in os.linesep

Modified: python/branches/py3k/Lib/gettext.py
==============================================================================
--- python/branches/py3k/Lib/gettext.py	(original)
+++ python/branches/py3k/Lib/gettext.py	Wed Oct 31 19:53:44 2007
@@ -291,7 +291,7 @@
             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

Modified: python/branches/py3k/Lib/test/test_gettext.py
==============================================================================
--- python/branches/py3k/Lib/test/test_gettext.py	(original)
+++ python/branches/py3k/Lib/test/test_gettext.py	Wed Oct 31 19:53:44 2007
@@ -332,6 +332,7 @@
 
     def test_weird_metadata(self):
         info = self.t.info()
+        self.assertEqual(len(info), 9)
         self.assertEqual(info['last-translator'],
            'John Doe <jdoe at example.com>\nJane Foobar <jfoobar at example.com>')
 


More information about the Python-3000-checkins mailing list