polib icon indicating copy to clipboard operation
polib copied to clipboard

Add ignore_errors parameter to polib.pofile

Open jordimas opened this issue 2 years ago • 0 comments

Problem

In my use case I use polib.pofile to calculate the number of words in large collections of PO files.

What happens is that as soon polib finds error it throws an IOError and stops parsing the rest of the file

Suggested solution

It will be great that if pofile supports an ignore_errors which changes the behaviour and continues to parse the file ignoring the error. I will expect by default to False, and then to enabling doing:

polib.pofile("file.po", _ignore_errors_ = True)

If this is something interesting, I will be willing to provide a PR to add this optional behaviour

jordimas avatar Nov 01 '23 02:11 jordimas