Kaydet (Commit) 7de63f57 authored tarafından Barry Warsaw's avatar Barry Warsaw

GNUTranslations._parse(): Fix SF bug #658233, where continuation lines

in .po metadata caused a crash.

Backport candidate.
üst 15eac1f9
......@@ -261,14 +261,19 @@ class GNUTranslations(NullTranslations):
# See if we're looking at GNU .mo conventions for metadata
if mlen == 0:
# Catalog description
lastk = None
for item in tmsg.splitlines():
item = item.strip()
if not item:
continue
k, v = item.split(':', 1)
k = k.strip().lower()
v = v.strip()
self._info[k] = v
if ':' in item:
k, v = item.split(':', 1)
k = k.strip().lower()
v = v.strip()
self._info[k] = v
lastk = k
elif lastk:
self._info[lastk] += '\n' + item
if k == 'content-type':
self._charset = v.split('charset=')[1]
elif k == 'plural-forms':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment