Skip to content

gh-131146: Fall back to month_name if standalone_month_names aren't distinct #137674

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

Merged
merged 2 commits into from
Aug 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ def __len__(self):
except ValueError:
standalone_month_name = month_name
standalone_month_abbr = month_abbr
else:
# Some systems that do not support '%OB' will keep it as-is (i.e.,
# we get [..., '%OB', '%OB', '%OB']), so for non-distinct names,
# we fall back to month_name/month_abbr.
if len(set(standalone_month_name)) != len(set(month_name)):
standalone_month_name = month_name
if len(set(standalone_month_abbr)) != len(set(month_abbr)):
standalone_month_abbr = month_abbr


def isleap(year):
Expand Down
Loading