mirror of
https://github.com/python/cpython.git
synced 2025-07-13 14:25:18 +00:00
Issue #9548: Add a minimal "_bootlocale" module that is imported by the _io module instead of the full locale module.
This commit is contained in:
parent
73abc527eb
commit
fd4722cacf
6 changed files with 49 additions and 22 deletions
|
@ -426,8 +426,8 @@ def aliasmbcs():
|
|||
while they are always available as "mbcs" in each locale. Make
|
||||
them usable by aliasing to "mbcs" in such a case."""
|
||||
if sys.platform == 'win32':
|
||||
import locale, codecs
|
||||
enc = locale.getdefaultlocale()[1]
|
||||
import _bootlocale, codecs
|
||||
enc = _bootlocale.getpreferredencoding(False)
|
||||
if enc.startswith('cp'): # "cp***" ?
|
||||
try:
|
||||
codecs.lookup(enc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue