]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert the following revisions, as they don't fix security
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Mar 2008 17:47:51 +0000 (17:47 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 2 Mar 2008 17:47:51 +0000 (17:47 +0000)
problems:
52448, 52468, 52472, 52475, 52646, 52797, 52802, 52863, 52999, 53001,
53101, 53371, 53373, 53383, 53384, 53736, 53812, 53921, 55578, 55580,
55581, 55772, 55775, 56557, 57093, 57094, 58630, 60114

23 files changed:
Doc/api/concrete.tex
Doc/lib/libasyncore.tex
Doc/lib/libcommands.tex
Doc/lib/liblogging.tex
Doc/lib/libos.tex
Doc/lib/libpopen2.tex
Doc/lib/libsubprocess.tex
Lib/idlelib/EditorWindow.py
Lib/logging/__init__.py
Lib/logging/config.py
Lib/logging/handlers.py
Lib/random.py
Lib/subprocess.py
Lib/test/test_dbm.py
Lib/test/test_gdbm.py
Lib/test/test_multibytecodec.py
Lib/test/test_sha.py
Lib/trace.py
Lib/uu.py
Mac/BuildScript/build-installer.py
Misc/NEWS
Modules/cjkcodecs/multibytecodec.c
Python/ceval.c

index 6b56844540d5861103d8ddf8d9e337e82f1ae34e..5e2b2e940b754c213b1007857a87ac6841f186db 100644 (file)
@@ -2730,10 +2730,10 @@ rather than explicitly calling \cfunction{PyGen_New}.
 Various date and time objects are supplied by the \module{datetime}
 module.  Before using any of these functions, the header file
 \file{datetime.h} must be included in your source (note that this is
-not included by \file{Python.h}), and the macro
-\cfunction{PyDateTime_IMPORT} must be invoked.  The macro puts a
-pointer to a C structure into a static variable, 
-\code{PyDateTimeAPI}, that is used by the following macros.
+not include by \file{Python.h}), and macro \cfunction{PyDateTime_IMPORT()}
+must be invoked.  The macro arranges to put a pointer to a C structure
+in a static variable \code{PyDateTimeAPI}, which is used by the following
+macros.
 
 Type-check macros:
 
index 131b54989029f193b63f7661f8a3d3371038d2c4..ee50d1889dd52855f0c2db518b99f73c0d280a66 100644 (file)
@@ -199,11 +199,9 @@ Most of these are nearly identical to their socket partners.
 \end{methoddesc}
 
 \begin{methoddesc}{bind}{address}
-  Bind the socket to \var{address}.  The socket must not already be
-  bound.  (The format of \var{address} depends on the address family
-  --- see above.)  To mark the socket as re-usable (setting the
-  \constant{SO_REUSEADDR} option), call the \class{dispatcher}
-  object's \method{set_reuse_addr()} method.
+  Bind the socket to \var{address}.  The socket must not already
+  be bound.  (The format of \var{address} depends on the address
+  family --- see above.)
 \end{methoddesc}
 
 \begin{methoddesc}{accept}{}
index 53b8a2070755fe3ea44eec4acaec08bf7aac3072..74e7023a791a1ab5463c5d148040a574d03c2203 100644 (file)
@@ -12,11 +12,6 @@ The \module{commands} module contains wrapper functions for
 return any output generated by the command and, optionally, the exit
 status.
 
-The \module{subprocess} module provides more powerful facilities for
-spawning new processes and retrieving their results.  Using the
-\module{subprocess} module is preferable to using the \module{commands}
-module.
-
 The \module{commands} module defines the following functions:
 
 
@@ -56,7 +51,3 @@ Example:
 >>> commands.getstatus('/bin/ls')
 '-rwxr-xr-x  1 root        13352 Oct 14  1994 /bin/ls'
 \end{verbatim}
-
-\begin{seealso}
-  \seemodule{subprocess}{Module for spawning and managing subprocesses.}
-\end{seealso}
index e00880d412e11db34100b488a0a24775e3de04c5..414555ad0e022b4495e4b5074cdc3354b906cdd5 100644 (file)
@@ -429,10 +429,8 @@ Removes the specified handler \var{hdlr} from this logger.
 \end{methoddesc}
 
 \begin{methoddesc}{findCaller}{}
-Finds the caller's source filename and line number. Returns the filename,
-line number and function name as a 3-element tuple.
-\versionchanged[The function name was added. In earlier versions, the
-filename and line number were returned as a 2-element tuple.]{2.4}
+Finds the caller's source filename and line number. Returns the filename
+and line number as a 2-element tuple.
 \end{methoddesc}
 
 \begin{methoddesc}{handle}{record}
@@ -1082,11 +1080,8 @@ Returns a new instance of the \class{SysLogHandler} class intended to
 communicate with a remote \UNIX{} machine whose address is given by
 \var{address} in the form of a \code{(\var{host}, \var{port})}
 tuple.  If \var{address} is not specified, \code{('localhost', 514)} is
-used.  The address is used to open a UDP socket.  An alternative to providing
-a \code{(\var{host}, \var{port})} tuple is providing an address as a string,
-for example "/dev/log". In this case, a Unix domain socket is used to send
-the message to the syslog. If \var{facility} is not specified,
-\constant{LOG_USER} is used.
+used.  The address is used to open a UDP socket.  If \var{facility} is
+not specified, \constant{LOG_USER} is used.
 \end{classdesc}
 
 \begin{methoddesc}{close}{}
index 9e8849f74b5bcb25f14ba075278e9b7aa1fcd302..e84402f7c7da254d2b0876adfb65733f3dc1913c 100644 (file)
@@ -357,10 +357,6 @@ object, except that when the exit status is zero (termination without
 errors), \code{None} is returned.
 Availability: Macintosh, \UNIX, Windows.
 
-The \module{subprocess} module provides more powerful facilities for
-spawning new processes and retrieving their results; using that module
-is preferable to using this function.
-
 \versionchanged[This function worked unreliably under Windows in
   earlier versions of Python.  This was due to the use of the
   \cfunction{_popen()} function from the libraries provided with
@@ -375,13 +371,8 @@ deleted once there are no file descriptors for the file.
 Availability: Macintosh, \UNIX, Windows.
 \end{funcdesc}
 
-There are a number of different \function{popen*()} functions that
-provide slightly different ways to create subprocesses.  Note that the
-\module{subprocess} module is easier to use and more powerful;
-consider using that module before writing code using the
-lower-level \function{popen*()} functions.
 
-For each of the \function{popen*()} variants, if \var{bufsize} is
+For each of the following \function{popen()} variants, if \var{bufsize} is
 specified, it specifies the buffer size for the I/O pipes.
 \var{mode}, if provided, should be the string \code{'b'} or
 \code{'t'}; on Windows this is needed to determine whether the file
@@ -1513,13 +1504,7 @@ functions are described in section \ref{os-newstreams}.
 \funcline{spawnve}{mode, path, args, env}
 \funcline{spawnvp}{mode, file, args}
 \funcline{spawnvpe}{mode, file, args, env}
-Execute the program \var{path} in a new process.  
-
-(Note that the \module{subprocess} module provides more powerful
-facilities for spawning new processes and retrieving their results;
-using that module is preferable to using these functions.)
-
-If \var{mode} is
+Execute the program \var{path} in a new process.  If \var{mode} is
 \constant{P_NOWAIT}, this function returns the process ID of the new
 process; if \var{mode} is \constant{P_WAIT}, returns the process's
 exit code if it exits normally, or \code{-\var{signal}}, where
@@ -1647,10 +1632,6 @@ and XP) this is the exit status of the command run; on systems using
 a non-native shell, consult your shell documentation.
 
 Availability: Macintosh, \UNIX, Windows.
-
-The \module{subprocess} module provides more powerful facilities for
-spawning new processes and retrieving their results; using that module
-is preferable to using this function.
 \end{funcdesc}
 
 \begin{funcdesc}{times}{}
index fa0c1a60edaed4b968ddf49469dc676efb6632b6..985f580451bf2b8d32951da3a3d88e453d2da329 100644 (file)
@@ -11,10 +11,10 @@ This module allows you to spawn processes and connect to their
 input/output/error pipes and obtain their return codes under
 \UNIX{} and Windows.
 
-The \module{subprocess} module provides more powerful facilities for
-spawning new processes and retrieving their results.  Using the
-\module{subprocess} module is preferable to using the \module{popen2}
-module.
+Note that starting with Python 2.0, this functionality is available
+using functions from the \refmodule{os} module which have the same
+names as the factory functions here, but the order of the return
+values is more intuitive in the \refmodule{os} module variants.
 
 The primary interface offered by this module is a trio of factory
 functions.  For each of these, if \var{bufsize} is specified, 
@@ -184,7 +184,3 @@ integrate I/O over pipes with their \function{select()} loops, or use
 separate threads to read each of the individual files provided by
 whichever \function{popen*()} function or \class{Popen*} class was
 used.
-
-\begin{seealso}
-  \seemodule{subprocess}{Module for spawning and managing subprocesses.}
-\end{seealso}
index ff50f24e4ca1fe09e01029b35539442cf6689448..af7e157720df6269ab7fb239e28ff881d8e8a8c0 100644 (file)
@@ -12,6 +12,9 @@ connect to their input/output/error pipes, and obtain their return
 codes.  This module intends to replace several other, older modules
 and functions, such as:
 
+% XXX Should add pointers to this module to at least the popen2
+% and commands sections.
+
 \begin{verbatim}
 os.system
 os.spawn*
index 4883f2d3c0dd5390361e1c6657627edf635c3b29..0ab148a90fe2d39bd05fcb72c478abbf8a360fd8 100644 (file)
@@ -703,7 +703,7 @@ class EditorWindow:
 
     def close(self):
         reply = self.maybesave()
-        if str(reply) != "cancel":
+        if reply != "cancel":
             self._close()
         return reply
 
index 6ff9b8ff8cc0503083bc45900b141401ff098a82..07f1add37ace601f1bd6c84d1f777efc17b6f691 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
 #
 # Permission to use, copy, modify, and distribute this software and its
 # documentation for any purpose and without fee is hereby granted,
@@ -21,7 +21,7 @@ comp.lang.python, and influenced by Apache's log4j system.
 Should work under Python versions >= 1.5.2, except that source line
 information is not available unless 'sys._getframe()' is.
 
-Copyright (C) 2001-2007 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2004 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
@@ -68,7 +68,7 @@ def currentframe():
     except:
         return sys.exc_traceback.tb_frame.f_back
 
-if hasattr(sys, '_getframe'): currentframe = lambda: sys._getframe(3)
+if hasattr(sys, '_getframe'): currentframe = sys._getframe
 # done filching
 
 # _srcfile is only used in conjunction with sys._getframe().
@@ -1318,14 +1318,14 @@ def disable(level):
     """
     root.manager.disable = level
 
-def shutdown(handlerList=_handlerList):
+def shutdown():
     """
     Perform any cleanup actions in the logging system (e.g. flushing
     buffers).
 
     Should be called at application exit.
     """
-    for h in handlerList[:]:
+    for h in _handlerList[:]: # was _handlers.keys():
         #errors might occur, for example, if files are locked
         #we just ignore them if raiseExceptions is not set
         try:
index d57fa37c04256d3fb11c805118600e90c5e11164..2d4ec2e9a85a33a2a2cf2b23d925b5da5313018e 100644 (file)
@@ -78,7 +78,7 @@ def fileConfig(fname, defaults=None):
         flist = string.split(flist, ",")
         formatters = {}
         for form in flist:
-            sectname = "formatter_%s" % string.strip(form)
+            sectname = "formatter_%s" % form
             opts = cp.options(sectname)
             if "format" in opts:
                 fs = cp.get(sectname, "format", 1)
@@ -97,7 +97,6 @@ def fileConfig(fname, defaults=None):
         try:
             #first, lose the existing handlers...
             logging._handlers.clear()
-            del logging._handlerList[:]
             #now set up the new ones...
             hlist = cp.get("handlers", "keys")
             if len(hlist):
@@ -106,7 +105,7 @@ def fileConfig(fname, defaults=None):
                 fixups = [] #for inter-handler references
                 for hand in hlist:
                     try:
-                        sectname = "handler_%s" % string.strip(hand)
+                        sectname = "handler_%s" % hand
                         klass = cp.get(sectname, "class")
                         opts = cp.options(sectname)
                         if "formatter" in opts:
@@ -141,7 +140,6 @@ def fileConfig(fname, defaults=None):
             #at last, the loggers...first the root...
             llist = cp.get("loggers", "keys")
             llist = string.split(llist, ",")
-            llist = map(lambda x: string.strip(x), llist)
             llist.remove("root")
             sectname = "logger_root"
             root = logging.root
@@ -156,7 +154,7 @@ def fileConfig(fname, defaults=None):
             if len(hlist):
                 hlist = string.split(hlist, ",")
                 for hand in hlist:
-                    log.addHandler(handlers[string.strip(hand)])
+                    log.addHandler(handlers[hand])
             #and now the others...
             #we don't want to lose the existing loggers,
             #since other threads may have pointers to them.
@@ -190,7 +188,7 @@ def fileConfig(fname, defaults=None):
                 if len(hlist):
                     hlist = string.split(hlist, ",")
                     for hand in hlist:
-                        logger.addHandler(handlers[string.strip(hand)])
+                        logger.addHandler(handlers[hand])
             #Disable any old loggers. There's no point deleting
             #them as other threads may continue to hold references
             #and by disabling them, you stop them doing any logging.
index ea42dd55d24cfce664dacd238512bc9e45e59efa..70bd5d4faecfc44875020f44a9e68e3605783a55 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2005 by Vinay Sajip. All Rights Reserved.
 #
 # Permission to use, copy, modify, and distribute this software and its
 # documentation for any purpose and without fee is hereby granted,
@@ -22,7 +22,7 @@ Apache's log4j system.
 Should work under Python versions >= 1.5.2, except that source line
 information is not available unless 'sys._getframe()' is.
 
-Copyright (C) 2001-2007 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2004 Vinay Sajip. All Rights Reserved.
 
 To use, simply 'import logging' and log away!
 """
@@ -231,11 +231,11 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
             #         of days in the next week until the rollover day (3).
             if when.startswith('W'):
                 day = t[6] # 0 is Monday
-                if day != self.dayOfWeek:
-                    if day < self.dayOfWeek:
-                        daysToWait = self.dayOfWeek - day - 1
-                    else:
-                        daysToWait = 6 - day + self.dayOfWeek
+                if day > self.dayOfWeek:
+                    daysToWait = (day - self.dayOfWeek) - 1
+                    self.rolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24))
+                if day < self.dayOfWeek:
+                    daysToWait = (6 - self.dayOfWeek) + day
                     self.rolloverAt = self.rolloverAt + (daysToWait * (60 * 60 * 24))
 
         #print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime)
@@ -566,8 +566,7 @@ class SysLogHandler(logging.Handler):
         """
         Initialize a handler.
 
-        If address is specified as a string, a UNIX socket is used. To log to a
-        local syslogd, "SysLogHandler(address="/dev/log")" can be used.
+        If address is specified as a string, UNIX socket is used.
         If facility is not specified, LOG_USER is used.
         """
         logging.Handler.__init__(self)
@@ -575,11 +574,11 @@ class SysLogHandler(logging.Handler):
         self.address = address
         self.facility = facility
         if type(address) == types.StringType:
-            self.unixsocket = 1
             self._connect_unixsocket(address)
+            self.unixsocket = 1
         else:
-            self.unixsocket = 0
             self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+            self.unixsocket = 0
 
         self.formatter = None
 
index c86e17a736dd3b085a535f65748c523b5d92558a..3795b4211d8e0584c60191f4df9bb95f0e93f94c 100644 (file)
@@ -205,7 +205,7 @@ class Random(_random.Random):
             raise ValueError, "empty range for randrange()"
 
         if n >= maxwidth:
-            return istart + istep*self._randbelow(n)
+            return istart + self._randbelow(n)
         return istart + istep*int(self.random() * n)
 
     def randint(self, a, b):
index f83108391f89b0805c85d1ae9c894c825b777b99..e1b0c1f43da9ce31b41b917e42762a472c0eb570 100644 (file)
@@ -346,7 +346,6 @@ mswindows = (sys.platform == "win32")
 import os
 import types
 import traceback
-import gc
 
 if mswindows:
     import threading
@@ -900,16 +899,7 @@ class Popen(object):
             errpipe_read, errpipe_write = os.pipe()
             self._set_cloexec_flag(errpipe_write)
 
-            gc_was_enabled = gc.isenabled()
-            # Disable gc to avoid bug where gc -> file_dealloc ->
-            # write to stderr -> hang.  http://bugs.python.org/issue1336
-            gc.disable()
-            try:
-                self.pid = os.fork()
-            except:
-                if gc_was_enabled:
-                    gc.enable()
-                raise
+            self.pid = os.fork()
             if self.pid == 0:
                 # Child
                 try:
@@ -968,8 +958,6 @@ class Popen(object):
                 os._exit(255)
 
             # Parent
-            if gc_was_enabled:
-                gc.enable()
             os.close(errpipe_write)
             if p2cread and p2cwrite:
                 os.close(p2cread)
index b93e72eb728eb02747ee9f54a83f23e0ba2cac1a..e5757c9501a5cdeaf13dccfb73859384bd550ad1 100755 (executable)
@@ -6,11 +6,11 @@ import os
 import random
 import dbm
 from dbm import error
-from test.test_support import verbose, verify, TestSkipped, TESTFN
+from test.test_support import verbose, verify, TestSkipped
 
 # make filename unique to allow multiple concurrent tests
 # and to minimize the likelihood of a problem from an old file
-filename = TESTFN
+filename = '/tmp/delete_me_' + str(random.random())[-6:]
 
 def cleanup():
     for suffix in ['', '.pag', '.dir', '.db']:
index 8e6f76f1702bf26d15524da8e9216dc7cdae30b0..03a47d9c245e883ed8a4a2d4b10abd834557364b 100755 (executable)
@@ -5,9 +5,9 @@
 
 import gdbm
 from gdbm import error
-from test.test_support import verbose, verify, TestFailed, TESTFN
+from test.test_support import verbose, verify, TestFailed
 
-filename = TESTFN
+filename= '/tmp/delete_me'
 
 g = gdbm.open(filename, 'c')
 verify(g.keys() == [])
index ff88dbabf5cfc9248cdec12a5a366a34c6b206ac..3fcc8ba81a50cf23e7645be42207e7c4bd215e93 100644 (file)
@@ -7,19 +7,7 @@
 
 from test import test_support
 from test import test_multibytecodec_support
-from test.test_support import TESTFN
-import unittest, StringIO, codecs, sys, os
-
-class Test_StreamReader(unittest.TestCase):
-    def test_bug1728403(self):
-        try:
-            open(TESTFN, 'w').write('\xa1')
-            f = codecs.open(TESTFN, encoding='cp949')
-            self.assertRaises(UnicodeDecodeError, f.read, 2)
-        finally:
-            try: f.close()
-            except: pass
-            os.unlink(TESTFN)
+import unittest, StringIO, codecs, sys
 
 class Test_StreamWriter(unittest.TestCase):
     if len(u'\U00012345') == 2: # UCS2
@@ -111,7 +99,6 @@ class Test_ISO2022(unittest.TestCase):
 
 def test_main():
     suite = unittest.TestSuite()
-    suite.addTest(unittest.makeSuite(Test_StreamReader))
     suite.addTest(unittest.makeSuite(Test_StreamWriter))
     suite.addTest(unittest.makeSuite(Test_ISO2022))
     test_support.run_suite(suite)
index ea224e439c3d5c60b415bb73f846c1f41ba2c20b..c438cc6417efb5ef20929d1ab830e37f8e9a3319 100644 (file)
@@ -11,23 +11,9 @@ from test import test_support
 
 class SHATestCase(unittest.TestCase):
     def check(self, data, digest):
-        # Check digest matches the expected value
-        obj = sha.new(data)
-        computed = obj.hexdigest()
+        computed = sha.new(data).hexdigest()
         self.assert_(computed == digest)
 
-        # Verify that the value doesn't change between two consecutive
-        # digest operations.
-        computed_again = obj.hexdigest()
-        self.assert_(computed == computed_again)
-
-        # Check hexdigest() output matches digest()'s output
-        digest = obj.digest()
-        hexd = ""
-        for c in digest:
-            hexd += '%02x' % ord(c)
-        self.assert_(computed == hexd)
-
     def test_case_1(self):
         self.check("abc",
                    "a9993e364706816aba3e25717850c26c9cd0d89d")
@@ -40,9 +26,6 @@ class SHATestCase(unittest.TestCase):
         self.check("a" * 1000000,
                    "34aa973cd4c4daa4f61eeb2bdbad27316534016f")
 
-    def test_case_4(self):
-        self.check(chr(0xAA) * 80,
-                   '4ca0ef38f1794b28a8f8ee110ee79d48ce13be25')
 
 def test_main():
     test_support.run_unittest(SHATestCase)
index 967dfd04130d855b0977cc76ecfcdec6586d5513..799c30280840bf527e9992360bcb02f1b6e415e4 100644 (file)
@@ -583,7 +583,7 @@ class Trace:
         """
         if why == 'call':
             code = frame.f_code
-            filename = frame.f_globals.get('__file__', None)
+            filename = code.co_filename
             if filename:
                 # XXX modname() doesn't work right for packages, so
                 # the ignore support won't work right for packages
index fd3e32731f4575ec0e4b4491333337dda8519ccf..f5917983f6b9230e336795a945e5b512a8277191 100755 (executable)
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -115,7 +115,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
     #
     # Open the output file
     #
-    opened = False
     if out_file == '-':
         out_file = sys.stdout
     elif isinstance(out_file, StringType):
@@ -125,7 +124,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
         except AttributeError:
             pass
         out_file = fp
-        opened = True
     #
     # Main decoding loop
     #
@@ -143,8 +141,6 @@ def decode(in_file, out_file=None, mode=None, quiet=0):
         s = in_file.readline()
     if not s:
         raise Error, 'Truncated input file'
-    if opened:
-        out_file.close()
 
 def test():
     """uuencode/uudecode main program"""
index 51f240845a9129a3af5732b718ebddf26b7b4bea..3609eb0febb239b7c3c0d54d89f9b2fcc0324a20 100755 (executable)
@@ -10,7 +10,7 @@ bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
 Usage: see USAGE variable in the script.
 """
 import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
-import grp, md5
+import grp
 
 INCLUDE_TIMESTAMP=1
 VERBOSE=1
@@ -33,7 +33,7 @@ except ImportError:
 
 def shellQuote(value):
     """
-    Return the string value in a form that can safely be inserted into
+    Return the string value in a form that can savely be inserted into
     a shell command.
     """
     return "'%s'"%(value.replace("'", "'\"'\"'"))
@@ -56,13 +56,13 @@ def getFullVersion():
 
     raise RuntimeError, "Cannot find full version??"
 
-# The directory we'll use to create the build (will be erased and recreated)
+# The directory we'll use to create the build, will be erased and recreated
 WORKDIR="/tmp/_py24"
 
-# The directory we'll use to store third-party sources. Set this to something
+# The directory we'll use to store third-party sources, set this to something
 # else if you don't want to re-fetch required libraries every time.
 DEPSRC=os.path.join(WORKDIR, 'third-party')
-DEPSRC=os.path.expanduser('/tmp/other-sources')
+DEPSRC=os.path.expanduser('~/Universal/other-sources')
 
 # Location of the preferred SDK
 SDKPATH="/Developer/SDKs/MacOSX10.4u.sdk"
@@ -94,9 +94,8 @@ USAGE=textwrap.dedent("""\
 # batteries included python.
 LIBRARY_RECIPES=[
     dict(
-        name="Bzip2 1.0.4",
-        url="http://www.bzip.org/1.0.4/bzip2-1.0.4.tar.gz",
-        checksum="fc310b254f6ba5fbb5da018f04533688",
+        name="Bzip2 1.0.3",
+        url="http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz",
         configure=None,
         install='make install PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
             shellQuote(os.path.join(WORKDIR, 'libraries')),
@@ -107,7 +106,6 @@ LIBRARY_RECIPES=[
     dict(
         name="ZLib 1.2.3",
         url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
-        checksum="debc62758716a169df9f62e6ab2bc634",
         configure=None,
         install='make install prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
             shellQuote(os.path.join(WORKDIR, 'libraries')),
@@ -119,7 +117,6 @@ LIBRARY_RECIPES=[
         # Note that GNU readline is GPL'd software
         name="GNU Readline 5.1.4",
         url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" ,
-        checksum="7ee5a692db88b30ca48927a13fd60e46",
         patchlevel='0',
         patches=[
             # The readline maintainers don't do actual micro releases, but
@@ -134,7 +131,6 @@ LIBRARY_RECIPES=[
     dict(
         name="NCurses 5.5",
         url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz",
-        checksum='e73c1ac10b4bfc46db43b2ddfd6244ef',
         configure_pre=[
             "--without-cxx",
             "--without-ada",
@@ -163,7 +159,6 @@ LIBRARY_RECIPES=[
     dict(
         name="Sleepycat DB 4.4",
         url="http://downloads.sleepycat.com/db-4.4.20.tar.gz",
-        checksum='d84dff288a19186b136b0daf7067ade3',
         #name="Sleepycat DB 4.3.29",
         #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz",
         buildDir="build_unix",
@@ -193,7 +188,7 @@ PKG_RECIPES=[
         long_name="GUI Applications",
         source="/Applications/MacPython %(VER)s",
         readme="""\
-            This package installs IDLE (an interactive Python IDE),
+            This package installs IDLE (an interactive Python IDLE),
             Python Launcher and Build Applet (create application bundles
             from python scripts).
 
@@ -249,7 +244,8 @@ PKG_RECIPES=[
         readme="""\
             This package updates the system python installation on
             Mac OS X 10.3 to ensure that you can build new python extensions
-            using that copy of python after installing this version.
+            using that copy of python after installing this version of
+            python.
             """,
         postflight="../OSX/fixapplepython23.py",
         topdir="/Library/Frameworks/Python.framework",
@@ -313,19 +309,6 @@ def checkEnvironment():
         fatal("Please install the latest version of Xcode and the %s SDK"%(
             os.path.basename(SDKPATH[:-4])))
 
-    if os.path.exists('/sw'):
-        fatal("Detected Fink, please remove before building Python")
-
-    if os.path.exists('/opt/local'):
-        fatal("Detected MacPorts, please remove before building Python")
-
-    if not os.path.exists('/Library/Frameworks/Tcl.framework') or \
-            not os.path.exists('/Library/Frameworks/Tk.framework'):
-
-        fatal("Please install a Universal Tcl/Tk framework in /Library from\n\thttp://tcltkaqua.sourceforge.net/")
-
-
-
 
 
 def parseOptions(args = None):
@@ -462,17 +445,6 @@ def downloadURL(url, fname):
         except:
             pass
 
-def verifyChecksum(path, checksum):
-    summer = md5.md5()
-    fp = open(path, 'rb')
-    block = fp.read(10240)
-    while block:
-        summer.update(block)
-        block = fp.read(10240)
-
-    return summer.hexdigest() == checksum
-
-
 def buildRecipe(recipe, basedir, archList):
     """
     Build software using a recipe. This function does the
@@ -494,16 +466,13 @@ def buildRecipe(recipe, basedir, archList):
         os.mkdir(DEPSRC)
 
 
-    if os.path.exists(sourceArchive) and verifyChecksum(sourceArchive, recipe['checksum']):
+    if os.path.exists(sourceArchive):
         print "Using local copy of %s"%(name,)
 
     else:
         print "Downloading %s"%(name,)
         downloadURL(url, sourceArchive)
         print "Archive for %s stored as %s"%(name, sourceArchive)
-        if not verifyChecksum(sourceArchive, recipe['checksum']):
-            fatal("Download for %s failed: bad checksum"%(url,))
-
 
     print "Extracting archive for %s"%(name,)
     buildDir=os.path.join(WORKDIR, '_bld')
@@ -655,15 +624,15 @@ def buildPython():
     print "Running make"
     runCommand("make")
 
-    print "Running make frameworkinstall"
+    print "Runing make frameworkinstall"
     runCommand("make frameworkinstall DESTDIR=%s"%(
         shellQuote(rootDir)))
 
-    print "Running make frameworkinstallextras"
+    print "Runing make frameworkinstallextras"
     runCommand("make frameworkinstallextras DESTDIR=%s"%(
         shellQuote(rootDir)))
 
-    print "Copying required shared libraries"
+    print "Copy required shared libraries"
     if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
         runCommand("mv %s/* %s"%(
             shellQuote(os.path.join(
@@ -751,8 +720,8 @@ def patchScript(inPath, outPath):
 def packageFromRecipe(targetDir, recipe):
     curdir = os.getcwd()
     try:
-        # The major version (such as 2.5) is included in the package name
-        # because having two version of python installed at the same time is
+        # The major version (such as 2.5) is included in the pacakge name
+        # because haveing two version of python installed at the same time is
         # common.
         pkgname = '%s-%s'%(recipe['name'], getVersion())
         srcdir  = recipe.get('source')
@@ -926,7 +895,7 @@ def installSize(clear=False, _saved=[]):
 
 def buildDMG():
     """
-    Create DMG containing the rootDir.
+    Create DMG containing the rootDir
     """
     outdir = os.path.join(WORKDIR, 'diskimage')
     if os.path.exists(outdir):
@@ -940,7 +909,7 @@ def buildDMG():
 
     os.mkdir(outdir)
     time.sleep(1)
-    runCommand("hdiutil create -volname 'Universal MacPython %s' -srcfolder %s %s"%(
+    runCommand("hdiutil create -volname 'Univeral MacPython %s' -srcfolder %s %s"%(
             getFullVersion(),
             shellQuote(os.path.join(WORKDIR, 'installer')),
             shellQuote(imagepath)))
index 5f674fec756ca4b75358aebd0a2ee902113295b4..234854b7939955af2c3c308f73ed400814d629e0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,31 +15,16 @@ Core and builtins
 
 - patch #1630975: Fix crash when replacing sys.stdout in sitecustomize.py
 
-- Bug #1590891: random.randrange don't return correct value for big number
-
-- Bug #1542016: make sys.callstats() match its docstring and return an
-  11-tuple (only relevant when Python is compiled with -DCALL_PROFILE).
-
 Extension Modules
 -----------------
 
 Library
 -------
 
-- Issue #1336: fix a race condition in subprocess.Popen if the garbage
-  collector kicked in at the wrong time that would cause the process
-  to hang when the child wrote to stderr.
-
-- Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it
-  reads a file that ends with incomplete sequence and sizehint argument
-  for .read() is specified.
-
 - HTML-escape the plain traceback in cgitb's HTML output, to prevent
   the traceback inadvertently or maliciously closing the comment and
   injecting HTML into the error page.
 
-- idle: Honor the "Cancel" action in the save dialog (Debian bug #299092).
-
 Tests
 -----
 
@@ -204,9 +189,6 @@ Extension Modules
 Library
 -------
 
-- Patch 1571379: Make trace's --ignore-dir facility work in the face of
-  relative directory names.
-
 - Bug #1545341: The 'classifier' keyword argument to the Distutils setup()
   function now accepts tuples as well as lists.
 
index b69eefff0a90c114e1b53928ab15e3990e8c0c74..7d2d15ebfb78e04e8be8d1f0ad0bfcf9e3e99216 100644 (file)
@@ -705,8 +705,6 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
        cres = NULL;
 
        for (;;) {
-               int endoffile;
-
                if (sizehint < 0)
                        cres = PyObject_CallMethod(self->stream,
                                        (char *)method, NULL);
@@ -723,8 +721,6 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
                        goto errorexit;
                }
 
-               endoffile = (PyString_GET_SIZE(cres) == 0);
-
                if (self->pendingsize > 0) {
                        PyObject *ctr;
                        char *ctrdata;
@@ -776,7 +772,7 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
                                        goto errorexit;
                        }
 
-               if (endoffile || sizehint < 0) { /* end of file */
+               if (rsize == 0 || sizehint < 0) { /* end of file */
                        if (buf.inbuf < buf.inbuf_end &&
                            multibytecodec_decerror(self->codec, &self->state,
                                        &buf, self->errors, MBERR_TOOFEW))
index 358346c968418218e36cf7c94d134cc30b554869..04dda2552c386f4539c99bf412270adaea29763f 100644 (file)
@@ -179,10 +179,10 @@ static int pcall[PCALL_NUM];
 PyObject *
 PyEval_GetCallStats(PyObject *self)
 {
-       return Py_BuildValue("iiiiiiiiiii",
+       return Py_BuildValue("iiiiiiiiii",
                             pcall[0], pcall[1], pcall[2], pcall[3],
                             pcall[4], pcall[5], pcall[6], pcall[7],
-                            pcall[8], pcall[9], pcall[10]);
+                            pcall[8], pcall[9]);
 }
 #else
 #define PCALL(O)
@@ -4073,10 +4073,8 @@ import_all_from(PyObject *locals, PyObject *v)
                value = PyObject_GetAttr(v, name);
                if (value == NULL)
                        err = -1;
-               else if (PyDict_CheckExact(locals))
-                       err = PyDict_SetItem(locals, name, value);
                else
-                       err = PyObject_SetItem(locals, name, value);
+                       err = PyDict_SetItem(locals, name, value);
                Py_DECREF(name);
                Py_XDECREF(value);
                if (err != 0)