gh-131146: Fix month names in a genitive case in calendar module#131147
gh-131146: Fix month names in a genitive case in calendar module#131147encukou merged 19 commits intopython:mainfrom
Conversation
The calendar module displays month names in some locales using the genitive case. This is grammatically incorrect, as the nominative case should be used when the month is named by itself. To address this issue, this change introduces new lists `alt_month_name` and `alt_month_abbr` that contain month names in the nominative case. The module now uses `%OB` format specifier to get month names in the nominative case where available.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
tomasr8
left a comment
There was a problem hiding this comment.
Thanks for the PR! This will also need a NEWS entry and tests (check Lib/test/test_calendar.py)
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 36bb456 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F131147%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Thank you for the PR, @plashchynski |
|
This also needs a proper test (my comment was incorrectly closed) using |
|
I can finish this off if you are unable to, it should still be backported to 3.14 since it is a bug fix, no? |
This comment was marked as resolved.
This comment was marked as resolved.
The problem is specific only to certain locales. To properly test it, we need to have these locales installed. A test with |
It will not pass, it will be skipped.
It is! Most systems have locale like |
Even if the system has Given this, how could we distinguish the wrong behaviour from the fallback route? |
|
One trick would be to check for some common platform that does support if platform.libc_ver()[0] == 'glibc':
"Polish month 2 MUST be 'luty'"
else:
"Polish month 2 could be either 'luty' or 'lut'" |
|
The test should check for example that |
|
I've added a new test |
|
Thank you for seeing this through, @plashchynski! |
The calendar module displays month names in some locales using the genitive case. This is grammatically incorrect, as the nominative case should be used when the month is named by itself. To address this issue, this change introduces new lists
alt_month_nameandalt_month_abbrthat contain month names in the nominative case. The module now uses%OBformat specifier to get month names in the nominative case where available.