GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131146: Fix month names in a genitive case in calendar module by plashchynski · Pull Request #131147 · python/cpython

Conversation

@plashchynski

@plashchynski plashchynski commented Mar 12, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

  • Issue: calendar displays month names in a genitive case for some locales #131146

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plashchynski
pythongh-131146: Fix month names in a genitive case in calendar module.
b7a55ee
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.
@ghost

ghost commented Mar 12, 2025 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Mar 12, 2025

Copy link
Copy Markdown

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 skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Mar 12, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 12, 2025
calendar displays month names in a genitive case for some locales #131146
Closed
tomasr8
tomasr8 reviewed Mar 16, 2025
View reviewed changes

@tomasr8 tomasr8 left a comment

Copy link
Copy Markdown
Member

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plashchynski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@plashchynski
plashchynski requested review from a team, AA-Turner, AlexWaygood, Eclips4, JelleZijlstra, barneygale, berkerpeksag, brettcannon, encukou, erlend-aasland, ethanfurman, freakboy3742, gaogaotiantian, gpshead, hugovk, isidentical, jaraco, lysnikolaou, markshannon, pablogsal, rhettinger, sethmlarson and willingc as code owners March 17, 2025 17:50
StanFromIreland
StanFromIreland reviewed Apr 9, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2025-03-17-21-15-04.gh-issue-131146.P9Cdx0.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Apr 29, 2025

Copy link
Copy Markdown

🤖 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented Apr 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Thank you for the PR, @plashchynski
If you don't beat me to it, I plan to fix the formatting/comments/entries tomorrow so that this gets into 3.14.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Apr 29, 2025

Copy link
Copy Markdown
Member

This also needs a proper test (my comment was incorrectly closed) using support's @run_with_locale, grep the existing tests for usage examples, there are quite a few.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Lib/calendar.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/calendar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented May 8, 2025

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

This comment was marked as resolved.

Sign in to view
@plashchynski

plashchynski commented May 11, 2025

Copy link
Copy Markdown
Contributor Author

This also needs a proper test (my comment was incorrectly closed) using support's @run_with_locale, grep the existing tests for usage examples, there are quite a few.

The problem is specific only to certain locales. To properly test it, we need to have these locales installed. A test with @run_with_locale will fail only on systems where that locales are installed. So for most systems that test will be green without proposed changes. I think it's not worth to add tests that can't fail on most of the systems.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented May 11, 2025

Copy link
Copy Markdown
Member

So for most systems that test will be green without proposed changes.

It will not pass, it will be skipped.

I think it's not worth to add tests that can't fail on most of the systems.

It is! Most systems have locale like pl_PL installed anyway, looking at the buildbots the majority do.

serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plashchynski added 2 commits May 11, 2025 12:51
@plashchynski
Fix grammar and wording
5feb1dc
@plashchynski
Rewording
1ecc613
@plashchynski

plashchynski commented May 11, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

I think it's not worth to add tests that can't fail on most of the systems.

It is! Most systems have locale like pl_PL installed anyway, looking at the buildbots the majority do.

Even if the system has pl_PL installed, it's possible that it doesn't support %OB %Ob extensions. And we don't know for sure weather it supported or not.

Given this, how could we distinguish the wrong behaviour from the fallback route?
I mean, if we test for the standalone form, it's possible that the regular form is returned because of the fallback.
Hope it makes sense.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou

encukou commented May 19, 2025

Copy link
Copy Markdown
Member

One trick would be to check for some common platform that does support %OB, for example:

if platform.libc_ver()[0] == 'glibc':
    "Polish month 2 MUST be 'luty'"
else:
    "Polish month 2 could be either 'luty' or 'lut'"
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka

serhiy-storchaka commented Jun 27, 2025

Copy link
Copy Markdown
Member

The test should check for example that calendar.standalone_month_name[5] is contained in the calendar output for May. It can also skip if calendar.standalone_month_name[5] == calendar.month_name[5].

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plashchynski added 7 commits July 30, 2025 01:08
@plashchynski
Revert unrelated formatting changes
1f92067
@plashchynski
Remove the examples as they are pointless in the English locale
4b946bf
@plashchynski
Remove the comment, as the previous comment covers it
3137d37
@plashchynski
Merge NEWS entries as they both are for the same issue
2ddd6f6
@plashchynski
Simpler wording
0862fac
@plashchynski
Merge branch 'main' into fix_calendar_genitive_case
833682c
@plashchynski
Add a test for standalone month names and abbrs in the pl_PL locale
9d1582c
@plashchynski

plashchynski commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

I've added a new test test_standalone_month_name_and_abbr_pl_locale to verify the standalone month names and abbrs specifically in pl_PL. Please check.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka approved these changes Jul 31, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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. 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@encukou

encukou commented Jul 31, 2025

Copy link
Copy Markdown
Member

Thank you for seeing this through, @plashchynski!

plashchynski and StanFromIreland reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@AA-Turner AA-Turner AA-Turner left review comments
@picnixz picnixz picnixz left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@tomasr8 tomasr8 tomasr8 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@plashchynski @picnixz @bedevere-bot @encukou @StanFromIreland @serhiy-storchaka @JelleZijlstra @tomasr8 @AA-Turner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.