Closed izimobil closed 6 years ago
Original comment by David Jean Louis (Bitbucket: izi, GitHub: izi):
I still do not reproduce this issue, all entries starting with "#." are correctly parsed. That said, "#~|" fails, but this is another issue reported here: #28/ioerror-on-reading-obsolete-previous-msgid
Please (@Og Maciel, @rachidbm) if you still reproduce the issue with "#." try to post a reproducible case with a description of your environment (os, python version, etc.). Thanks a lot !
Original comment by rachidbm (Bitbucket: rachidbm, GitHub: rachidbm):
I got the same error again when the .po file contains comment like: #~| It works when I changed a statement to:
elif (tokens[0] == '#.' or tokens[0] == '#~|') and nb_tokens >= 1:
Don't know if this will break something else, but for me polib is usable again :)
Original comment by rachidbm (Bitbucket: rachidbm, GitHub: rachidbm):
I think I have almost the same problem in polib 0.7. When the .po file contains the line "#." parse() terminates with the error:
#!bash
File "/usr/lib/python2.7/dist-packages/polib.py", line 102, in pofile
return _pofile_or_mofile(pofile, 'pofile', **kwargs)
File "/usr/lib/python2.7/dist-packages/polib.py", line 73, in _pofile_or_mofile
instance = parser.parse()
File "/usr/lib/python2.7/dist-packages/polib.py", line 1250, in parse
self.process('??', i)
File "/usr/lib/python2.7/dist-packages/polib.py", line 1313, in process
raise IOError('Syntax error in po file (line %s)' % linenum)
IOError: Syntax error in po file (line 4202)
Original comment by Og Maciel (Bitbucket: omaciel, GitHub: omaciel):
If filename is http://l10n.gnome.org/POT/gnome-terminal.master/gnome-terminal.master.zh_TW.po which is saved locally, then:
IOError Traceback (most recent call last)
/Library/Python/2.7/site-packages/django/core/management/commands/shell.pyc in
/Library/Python/2.7/site-packages/polib.pyc in pofile(pofile, kwargs)
100 file (optional, default: False
).
101 """
--> 102 return _pofile_or_mofile(pofile, 'pofile', kwargs)
103
104 # `
/Library/Python/2.7/site-packages/polib.pyc in _pofile_or_mofile(f, type, **kwargs) 71 check_for_duplicates=kwargs.get('check_for_duplicates', False) 72 ) ---> 73 instance = parser.parse() 74 instance.wrapwidth = kwargs.get('wrapwidth', 78) 75 return instance
/Library/Python/2.7/site-packages/polib.pyc in parse(self) 1248 1249 else: -> 1250 self.process('??', i) 1251 1252 if self.current_entry:
/Library/Python/2.7/site-packages/polib.pyc in process(self, symbol, linenum) 1311 self.current_state = state 1312 except Exception: -> 1313 raise IOError('Syntax error in po file (line %s)' % linenum) 1314 1315 # state handlers
IOError: Syntax error in po file (line 2143)
In [17]: polib.version Out[17]: '0.7.0'
The contents for line 2143 show:
msgid "%c. %s" msgstr "%c. %s"
Close this historic issue
Originally reported by: Anonymous
such like