[Python-3000-checkins] r66239 - in python/branches/py3k: Misc/NEWS Modules/Setup.dist Python/pythonrun.c setup.py

benjamin.peterson python-3000-checkins at python.org
Sat Sep 6 01:27:16 CEST 2008


Author: benjamin.peterson
Date: Sat Sep  6 01:27:15 2008
New Revision: 66239

Log:
compile _bytesio and _stringio into the binary and initalize stdio before site fixing #3279

Reviewer: Alexandre Vassalotti


Modified:
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Modules/Setup.dist
   python/branches/py3k/Python/pythonrun.c
   python/branches/py3k/setup.py

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Sat Sep  6 01:27:15 2008
@@ -12,6 +12,9 @@
 Core and Builtins
 -----------------
 
+- Issue #3279: Importing site at interpreter was failing silently because the
+  site module uses the open builtin which was not initialized at the time.
+
 - Issue #3660: Corrected a reference leak in str.encode() when the encoder
   does not return a bytes object.
 
@@ -125,6 +128,8 @@
   update this code in Python 3.0 by hand. Update the 2.6 one and then
   do "2to3".
 
+- The _bytesio and _stringio modules are now compiled into the python binary.
+
 Tools/Demos
 -----------
 

Modified: python/branches/py3k/Modules/Setup.dist
==============================================================================
--- python/branches/py3k/Modules/Setup.dist	(original)
+++ python/branches/py3k/Modules/Setup.dist	Sat Sep  6 01:27:15 2008
@@ -113,6 +113,8 @@
 _codecs _codecsmodule.c		# access to the builtin codecs and codec registry
 _fileio _fileio.c		# Standard I/O baseline
 _weakref _weakref.c		# weak references
+_bytesio _bytesio.c		# For Lib/io.py
+_stringio _stringio.c		# For Lib/io.py
 
 # The zipimport module is always imported at startup. Having it as a
 # builtin module avoids some bootstrapping problems and reduces overhead.

Modified: python/branches/py3k/Python/pythonrun.c
==============================================================================
--- python/branches/py3k/Python/pythonrun.c	(original)
+++ python/branches/py3k/Python/pythonrun.c	Sat Sep  6 01:27:15 2008
@@ -239,11 +239,11 @@
 	}
 
 	initmain(); /* Module __main__ */
-	if (!Py_NoSiteFlag)
-		initsite(); /* Module site */
 	if (initstdio() < 0)
 		Py_FatalError(
 		    "Py_Initialize: can't initialize sys standard streams");
+	if (!Py_NoSiteFlag)
+		initsite(); /* Module site */
 
 	/* auto-thread-state API, if available */
 #ifdef WITH_THREAD

Modified: python/branches/py3k/setup.py
==============================================================================
--- python/branches/py3k/setup.py	(original)
+++ python/branches/py3k/setup.py	Sat Sep  6 01:27:15 2008
@@ -439,9 +439,6 @@
         exts.append( Extension('operator', ['operator.c']) )
         # _functools
         exts.append( Extension("_functools", ["_functoolsmodule.c"]) )
-        # Memory-based IO accelerator modules
-        exts.append( Extension("_bytesio", ["_bytesio.c"]) )
-        exts.append( Extension("_stringio", ["_stringio.c"]) )
         # C-optimized pickle replacement
         exts.append( Extension("_pickle", ["_pickle.c"]) )
         # atexit


More information about the Python-3000-checkins mailing list