Message358588
For completeness, here's the path leading to the reassignment (after hacking in a raise to the appropriate place in _localemodule.c). It's a side-effect of calling `locale.getpreferredencoding`.
>>> help(int)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/mdickinson/GitHub/python/cpython/Lib/site.py", line 445, in __call__
import pydoc
File "/Users/mdickinson/GitHub/python/cpython/Lib/pydoc.py", line 202, in <module>
_encoding = locale.getpreferredencoding()
File "/Users/mdickinson/GitHub/python/cpython/Lib/locale.py", line 616, in getpreferredencoding
setlocale(LC_CTYPE, "")
File "/Users/mdickinson/GitHub/python/cpython/Lib/locale.py", line 581, in setlocale
return _setlocale(category, locale)
ValueError: about to reassign string.letters
So a minimal reproducer is something like:
Python 2.7.17 (default, Oct 20 2019, 14:46:50)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import string, locale
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> locale.getpreferredencoding()
'UTF-8'
>>> string.letters
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' |
|
Date |
User |
Action |
Args |
2019-12-17 21:48:32 | mark.dickinson | set | recipients:
+ mark.dickinson, eric.smith, steven.daprano, Zectbumo |
2019-12-17 21:48:32 | mark.dickinson | set | messageid: <1576619312.81.0.186811397237.issue39079@roundup.psfhosted.org> |
2019-12-17 21:48:32 | mark.dickinson | link | issue39079 messages |
2019-12-17 21:48:32 | mark.dickinson | create | |
|