[issue38220] Wrong values for %b and %B in ca_ES and ca_AD locales

Eryk Sun report at bugs.python.org
Thu Sep 19 01:27:39 EDT 2019


Eryk Sun <eryksun at gmail.com> added the comment:

The result from strftime is platform dependent. In Windows, the result has a trailing "." for the abbreviated names that are less than four characters, but no "de" in either form:

    >>> months = [(2019, m) + (0,)*7 for m in range(1,13)]
    >>> locale.setlocale(locale.LC_ALL, 'ca_ES.utf8')
    'ca_ES.utf8'
    >>> print(*(time.strftime('%b|%B', m) for m in months), sep='\n')
    gen.|gener
    febr.|febrer
    març|març
    abr.|abril
    maig|maig
    juny|juny
    jul.|juliol
    ag.|agost
    set.|setembre
    oct.|octubre
    nov.|novembre
    des.|desembre

In Linux, the result uses the same base abbreviations as in Windows, including the trailing ".", but it also includes "de" or "d'" in both forms:

    >>> months = [(2019, m) + (0,)*7 for m in range(1,13)]
    >>> locale.setlocale(locale.LC_ALL, 'ca_ES.utf8')
    'ca_ES.utf8'
    >>> print(*(time.strftime('%b|%B', m) for m in months), sep='\n')
    de gen.|de gener
    de febr.|de febrer
    de març|de març
    d’abr.|d’abril
    de maig|de maig
    de juny|de juny
    de jul.|de juliol
    d’ag.|d’agost
    de set.|de setembre
    d’oct.|d’octubre
    de nov.|de novembre
    de des.|de desembre

----------
nosy: +eryksun
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38220>
_______________________________________


More information about the Python-bugs-list mailing list