From 737728a7a05cf849ced6e53d6d776e10b67dc804 Mon Sep 17 00:00:00 2001 From: Christophe Combelles Date: Sat, 24 Jan 2015 21:43:36 +0200 Subject: [PATCH] [FIX] base: import po file with comments only Do not crash when importing a po file with only comments lines (e.g. autogenerated files) Fixes #4887 --- openerp/tools/translate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 4e9ffecb3aa..1c53b47beff 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -329,6 +329,8 @@ class TinyPoFile(object): elif line.startswith('#,') and (line[2:].strip() == 'fuzzy'): fuzzy = True line = self.lines.pop(0).strip() + if not self.lines: + raise StopIteration() while not line: # allow empty lines between comments and msgid line = self.lines.pop(0).strip()