Title: `date.strftime` and `datetime.strftime` format dates wrong in some locales. · Issue #130528 · python/cpython · GitHub
Open Graph Title: `date.strftime` and `datetime.strftime` format dates wrong in some locales. · Issue #130528 · python/cpython
X Title: `date.strftime` and `datetime.strftime` format dates wrong in some locales. · Issue #130528 · python/cpython
Description: Bug report Bug description: date.strftime and datetime.strftime format dates wrong in some locales. For example, when the locale is Bulgaria the '%A' format string returns an incorrect value. >>> locale.setlocale(locale.LC_TIME, 'bg') # ...
Open Graph Description: Bug report Bug description: date.strftime and datetime.strftime format dates wrong in some locales. For example, when the locale is Bulgaria the '%A' format string returns an incorrect value. >>> l...
X Description: Bug report Bug description: date.strftime and datetime.strftime format dates wrong in some locales. For example, when the locale is Bulgaria the '%A' format string returns an incorrect valu...
Opengraph URL: https://github.com/python/cpython/issues/130528
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`date.strftime` and `datetime.strftime` format dates wrong in some locales.","articleBody":"# Bug report\n\n### Bug description:\n\n`date.strftime` and `datetime.strftime` format dates wrong in some locales. For example, when the locale is Bulgaria the '%A' format string returns an incorrect value.\n\n```python\n>>> locale.setlocale(locale.LC_TIME, 'bg') # 'bg' is Bulgaria\n>>> date_str = datetime.date(2025, 2, 25).strftime('%A') # %A is locale's day of the week\n>>> date_str\n'âòîðíèê'\n>>> date_str.encode('cp1252').decode('cp1251') # I think we're interpreting a cp1251 string as cp1252\n'вторник' # Google tells me this is Tuesday in Bulgarian\n```\nThis also fails with the '%x' format string\n\nI've only tested this on Windows.\n\nMy guess is that CPython is making a narrow character API call and using the wrong code page. It should be using the wide character call instead.\n\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nWindows","author":{"url":"https://github.com/petergraham","@type":"Person","name":"petergraham"},"datePublished":"2025-02-25T00:42:27Z","url":"https://github.com/python/cpython/issues/130528"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:a064f288-2ddf-1a70-4649-2906ab65d26f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8394:21BD98:36E9CAE:4594049:6B021F1D |
| html-safe-nonce | e7061da58b5734b29f3c5ab9eb44c6033de1ebb079a05943e387f511bcd768a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mzk0OjIxQkQ5ODozNkU5Q0FFOjQ1OTQwNDk6NkIwMjFGMUQiLCJ2aXNpdG9yX2lkIjoiNTY4ODcwOTA3MDM4NzgxNDE3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6e67e32c6dc99124fe433b2d36c4954141576d717f720d9b2a11ea9340fbb458 |
| hovercard-subject-tag | issue:2876523722 |
| 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/130528/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4fbee00baf37402cfe0eb6a3c83cca8ff7d7be0515b9777798ced67f96730279/python/cpython/issues/130528 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4fbee00baf37402cfe0eb6a3c83cca8ff7d7be0515b9777798ced67f96730279/python/cpython/issues/130528 |
| og:image:alt | Bug report Bug description: date.strftime and datetime.strftime format dates wrong in some locales. For example, when the locale is Bulgaria the '%A' format string returns an incorrect value. >>> l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petergraham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width