Kaydet (Commit) 09cad08d authored tarafından Marc-André Lemburg's avatar Marc-André Lemburg

sys.setdefaultencoding() should only be called in case the standard

default encoding ("ascii") is changed. This safes quite a few cycles
during startup since the first call to .setdefaultencoding() will
initialize the codec registry and the encodings package.

See python-dev for a discussion (Subject: "[Python-Dev] [comp.lang.python] sys.setdefaultencoding (2.0b1)").
üst 0b7b4b8a
......@@ -175,7 +175,7 @@ else:
# default is 'ascii', but if you're willing to experiment, you can
# change this.
encoding = "ascii" # default
encoding = "ascii" # Default value set by _PyUnicode_Init()
if 0:
# Enable to support locale aware default string encodings.
......@@ -189,7 +189,8 @@ if 0:
# Unicode to string conversion.
encoding = "undefined"
sys.setdefaultencoding(encoding)
if encoding != "ascii":
sys.setdefaultencoding(encoding)
#
# Run custom site specific code, if available.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment