Skip to content

parseGetText can't parse zope.app catalogs (fr and zh_CN) #6

@tseaver

Description

@tseaver

In https://bugs.launchpad.net/zope.i18n/+bug/356004, Devin (devin@charityfinders.org) reported:

When I attempt to use GettextImportFilter to parse the gettext translation catalogs in zope.app for fr and zh_CN, I get the following tracebacks (the first is fr, the second is zh_CN):

Traceback (most recent call last):
  File "./generate-pillar-domain.py", line 68, in main
    filter.importMessages(language, fp)
  File "/usr/lib/python2.5/site-packages/zope/app/i18n/filters.py", line 95, in importMessages
    result = parseGetText(file.readlines())[3]
  File "/usr/lib/python2.5/site-packages/zope/app/i18n/filters.py", line 197, in parseGetText
    raise ParseError(3, pointer + 1)
ParseError: state 3, line 4382

Traceback (most recent call last):
  File "./generate-pillar-domain.py", line 68, in main
    filter.importMessages(language, fp)
  File "/usr/lib/python2.5/site-packages/zope/app/i18n/filters.py", line 95, in importMessages
    result = parseGetText(file.readlines())[3]
  File "/usr/lib/python2.5/site-packages/zope/app/i18n/filters.py", line 197, in parseGetText
    raise ParseError(3, pointer + 1)
ParseError: state 3, line 268

Both errors occur when a blank line is found at the beginning of a msgstr portion in a gettext file.

and later:

Just to clarify, when I say "blank line", I mean "quoted empty string".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions