-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-131146: Fix month names in a genitive case in calendar module #131147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-131146: Fix month names in a genitive case in calendar module #131147
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This will also need a NEWS entry and tests (check Lib/test/test_calendar.py
)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
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_name
andalt_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.