[Zope3-checkins] CVS: Zope3/src - gettext.py:1.2

Godefroid Chapelle gotcha@swing.be
Wed, 9 Apr 2003 06:06:20 -0400


Update of /cvs-repository/Zope3/src
In directory cvs.zope.org:/tmp/cvs-serv6809

Modified Files:
	gettext.py 
Log Message:
added extra test when reading headers to prevent trying to read headers from messages with empty messageId



=== Zope3/src/gettext.py 1.1 => 1.2 ===
--- Zope3/src/gettext.py:1.1	Wed Mar 26 10:25:33 2003
+++ Zope3/src/gettext.py	Wed Apr  9 06:06:19 2003
@@ -267,9 +267,9 @@
             else:
                 raise IOError(0, 'File is corrupt', filename)
             # See if we're looking at GNU .mo conventions for metadata
-            if mlen == 0:
+            if mlen == 0 and tmsg.lower().startswith('project-id-version:'):
                 # Catalog description
-                for item in tmsg.split('\n'):
+                for item in tmsg.splitlines():
                     item = item.strip()
                     if not item:
                         continue