Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

locale.nl_langinfo(locale.ERA) does not work for past eras #126727

Closed
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error
@serhiy-storchaka

Description

@serhiy-storchaka

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

>>>import locale>>> locale.setlocale(locale.LC_ALL,'ja_JP')'ja_JP'>>> locale.nl_langinfo(locale.ERA)'+:2:2020/01/01:+*:令和:%EC%Ey年'

This issue is similar to#124969, but at least the result can be used for the current date.

cc@methane,@kulikjak.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp