diff babel/messages/pofile.py @ 448:c6babc3bbc10 stable-0.9.x

Backport r483. This fixes messages containing square brackets from failing with unpack errors. Submitted by: Benoit Boissinot
author jruigrok
date Wed, 24 Feb 2010 12:59:35 +0000
parents 1c0915da48c6
children 2c6f5e610e86
line wrap: on
line diff
--- a/babel/messages/pofile.py
+++ b/babel/messages/pofile.py
@@ -184,7 +184,7 @@
             in_msgstr[0] = True
             msg = line[6:].lstrip()
             if msg.startswith('['):
-                idx, msg = msg[1:].split(']')
+                idx, msg = msg[1:].split(']', 1)
                 translations.append([int(idx), msg.lstrip()])
             else:
                 translations.append([0, msg])
Copyright (C) 2012-2017 Edgewall Software