[New-bugs-announce] [issue39084] string.letters is flipped after setlocale is called

Manish report at bugs.python.org
Tue Dec 17 20:45:28 EST 2019


New submission from Manish <manishsmail at gmail.com>:

Steps to reproduce:

>>> import string
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> help(string)
......
>>> string.letters
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'


The help(string) can also be replaced with locale.setlocale(locale.LC_CTYPE, "en_US.UTF-8")

What's happening here is that any call to setlocale() (which help() calls internally) recomputes string.letters. The recomputation flips the order in the current implementation.

----------
messages: 358604
nosy: Manishearth
priority: normal
severity: normal
status: open
title: string.letters is flipped after setlocale is called
versions: Python 2.7

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


More information about the New-bugs-announce mailing list