You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecation warning for non-integer number in gettext is not always accurate #110519
gettext functions and methods that consider plural forms (like ngettext()) and directly or indirectly use GNUTranslations emit a deprecation warning if the number is not integer. But it only points to the line where GNUTranslations methods ngettext() or npgettext() are used directly. Since module level functions use it indirectly, and methods of other classes can use it indirectly as a fallback, the deprecation warning usually points to the line in the gettext module instead of the line in the user code that uses it. It makes deprecation warnings much less useful.
The following PR dynamically calculate the stacklevel for warning, skipping any gettext code.
Also I have found that many code is not covered by tests (in particular NullTranslations and domain-aware functions like dngettext()). The PR extends tests.
Activity
pythongh-110519: Improve deprecation warning in the gettext module
gh-110519: Improve deprecation warning in the gettext module (#110520)
pythongh-110519: Improve deprecation warning in the gettext module (p…
pythongh-110519: Improve deprecation warning in the gettext module (p…
[3.11] gh-110519: Improve deprecation warning in the gettext module (G…
[3.12] gh-110519: Improve deprecation warning in the gettext module (G…
pythongh-110519: Improve deprecation warning in the gettext module (p…