Title: locale.nl_langinfo(locale.ERA) does not work for past eras · Issue #126727 · python/cpython · GitHub
Open Graph Title: locale.nl_langinfo(locale.ERA) does not work for past eras · Issue #126727 · python/cpython
X Title: locale.nl_langinfo(locale.ERA) does not work for past eras · Issue #126727 · python/cpython
Description: Bug report According to the Posix specification (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_02), nl_langinfo(ERA) should return a string containing semicolon separated era description segments. ...
Open Graph Description: Bug report According to the Posix specification (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_02), nl_langinfo(ERA) should return a string containing semico...
X Description: Bug report According to the Posix specification (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_02), nl_langinfo(ERA) should return a string containing semico...
Opengraph URL: https://github.com/python/cpython/issues/126727
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" locale.nl_langinfo(locale.ERA) does not work for past eras","articleBody":"# Bug report\r\n\r\nAccording to the Posix specification (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_02), `nl_langinfo(ERA)` should return a string containing semicolon separated era description segments. But in Glibc it uses NUL instead of a semicolon as a separator. As result, `locale.nl_langinfo(locale.ERA)` in Python only returns the first segment, corresponding to the last (current) era. For example, in Japanese locale the result cannot be used for data before year 2020:\r\n\r\n```pycon\r\n\u003e\u003e\u003e import locale\r\n\u003e\u003e\u003e locale.setlocale(locale.LC_ALL, 'ja_JP')\r\n'ja_JP'\r\n\u003e\u003e\u003e locale.nl_langinfo(locale.ERA)\r\n'+:2:2020/01/01:+*:令和:%EC%Ey年'\r\n```\r\n\r\nThis issue is similar to #124969, but at least the result can be used for the current date.\r\n\r\ncc @methane, @kulikjak.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-126730\r\n* gh-127097\n* gh-127098\n* gh-127327\n* gh-127645\n* gh-127646\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2024-11-12T10:28:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/126727/cpython/issues/126727"}
| 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:4aba5560-9b38-47d7-d73d-64a68eadc1b0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F10:3BBBDD:D4D9EE:12FB26E:6A58942C |
| html-safe-nonce | 08b403b1192a0c1e69d10342751883cc3bf460b0ae448e31256a0d967911871e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjEwOjNCQkJERDpENEQ5RUU6MTJGQjI2RTo2QTU4OTQyQyIsInZpc2l0b3JfaWQiOiIyNjk2NzY5OTUwNzMyMjkzMTY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 93b2727d6eeafa4609b97108aed6321768a992161766848af2aaaf4958bc9a90 |
| hovercard-subject-tag | issue:2651737745 |
| 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/126727/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1136d11db3092b364b2487d804febac7a7eff59cafe338ed6ffd5229ea8c10fd/python/cpython/issues/126727 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1136d11db3092b364b2487d804febac7a7eff59cafe338ed6ffd5229ea8c10fd/python/cpython/issues/126727 |
| og:image:alt | Bug report According to the Posix specification (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_02), nl_langinfo(ERA) should return a string containing semico... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width