[Python-checkins] CVS: python/dist/src/Lib site.py,1.17,1.18

M.-A. Lemburg python-dev@python.org
Mon, 18 Sep 2000 04:06:05 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11316/Lib

Modified Files:
	site.py 
Log Message:
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)").

Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** site.py	2000/09/05 04:39:55	1.17
--- site.py	2000/09/18 11:06:00	1.18
***************
*** 176,180 ****
  # change this.
  
! encoding = "ascii" # default
  
  if 0:
--- 176,180 ----
  # change this.
  
! encoding = "ascii" # Default value set by _PyUnicode_Init()
  
  if 0:
***************
*** 190,194 ****
      encoding = "undefined"
  
! sys.setdefaultencoding(encoding)
  
  #
--- 190,195 ----
      encoding = "undefined"
  
! if encoding != "ascii":
!     sys.setdefaultencoding(encoding)
  
  #