[issue12425] gettext breaks on empty plural-forms value

A.M. Kuchling report at bugs.python.org
Mon Apr 13 17:08:35 CEST 2015


A.M. Kuchling added the comment:

Here's a patch against 3.5. This patch is atop the fix for #17898, so it won't apply cleanly to a stock 3.5.

The patch uses warnings.warn() to issue a warning if the plural header is empty. There seems to be precedent for issuing warnings in the case of odd incoming data or behaviour, so I'm comfortable doing this; I think that warnings need not be only for Python language features, like deprecated things.

But this does mean that importing gettext will also import warnings as a result, increasing memory usage.  Probably this doesn't matter -- on any sizable program, you probably already have the warnings module imported.  Otherwise we could print to sys.stderr.

----------
nosy: +akuchling
Added file: http://bugs.python.org/file38918/issue12425.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12425>
_______________________________________


More information about the Python-bugs-list mailing list