Title: Deprecation warning for non-integer number in gettext is not always accurate · Issue #110519 · python/cpython · GitHub
Open Graph Title: Deprecation warning for non-integer number in gettext is not always accurate · Issue #110519 · python/cpython
X Title: Deprecation warning for non-integer number in gettext is not always accurate · Issue #110519 · python/cpython
Description: Bug report 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 GNUTransla...
Open Graph Description: Bug report 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 ...
X Description: Bug report 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 ...
Opengraph URL: https://github.com/python/cpython/issues/110519
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecation warning for non-integer number in gettext is not always accurate","articleBody":"# Bug report\n\n`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.\n\nThe following PR dynamically calculate the stacklevel for warning, skipping any `gettext` code.\n\nAlso I have found that many code is not covered by tests (in particular `NullTranslations` and domain-aware functions like `dngettext()`). The PR extends tests.\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-110520\n* gh-110563\n* gh-110564\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2023-10-08T15:07:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/110519/cpython/issues/110519"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:301382e0-9379-c209-a037-85d86e592932 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DAC:16E0FE:1E64A6C:2A70C3A:696A5703 |
| html-safe-nonce | 6fa0a4b519294d108a3dfdf4d6df3b8242eb04d415bc2e38e9fd33d427a8a5df |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REFDOjE2RTBGRToxRTY0QTZDOjJBNzBDM0E6Njk2QTU3MDMiLCJ2aXNpdG9yX2lkIjoiODMwMzI0NjM4MTQ1OTA2ODY3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a00601acbc7b5c40fddd83a37fd638bfacbda16a393bcf58265046b8a1133f4 |
| hovercard-subject-tag | issue:1931842426 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/110519/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ada40930f004cefc60b6fa1e1bb95dc58b9f86ee9d693b8950374c8bbf49df8f/python/cpython/issues/110519 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ada40930f004cefc60b6fa1e1bb95dc58b9f86ee9d693b8950374c8bbf49df8f/python/cpython/issues/110519 |
| og:image:alt | Bug report 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width