From fdrake at users.sourceforge.net Wed Oct 1 00:03:56 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Oct 1 00:03:58 2003 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv7708 Modified Files: mkhowto Log Message: We're long past worrying about Python versions older than 1.5.2; remove old compatibility definition of os.path.abspath(). Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** mkhowto 27 Sep 2003 19:35:37 -0000 1.41 --- mkhowto 1 Oct 2003 04:03:54 -0000 1.42 *************** *** 47,61 **** - if not hasattr(os.path, "abspath"): - # Python 1.5.1 or earlier - def abspath(path): - """Return an absolute path.""" - if not os.path.isabs(path): - path = os.path.join(os.getcwd(), path) - return os.path.normpath(path) - - os.path.abspath = abspath - - MYDIR = os.path.abspath(sys.path[0]) TOPDIR = os.path.dirname(MYDIR) --- 47,50 ---- From fdrake at users.sourceforge.net Wed Oct 1 00:07:47 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Oct 1 00:07:49 2003 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv8694 Modified Files: mkhowto Log Message: no longer assign into sys; "print chevron" is the way to go Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** mkhowto 1 Oct 2003 04:03:54 -0000 1.42 --- mkhowto 1 Oct 2003 04:07:44 -0000 1.43 *************** *** 65,76 **** ! def usage(options): ! print __doc__ % options def error(options, message, err=2): ! sys.stdout = sys.stderr ! print message ! print ! usage(options) sys.exit(2) --- 65,75 ---- ! def usage(options, file): ! print >>file, __doc__ % options def error(options, message, err=2): ! print >>sys.stderr, message ! print >>sys.stderr ! usage(options, sys.stderr) sys.exit(2) *************** *** 152,156 **** self.dvips_safe = "ps" in self.formats elif opt in ("-H", "--help"): ! usage(self) sys.exit() elif opt == "--iconserver": --- 151,155 ---- self.dvips_safe = "ps" in self.formats elif opt in ("-H", "--help"): ! usage(self, sys.stdout) sys.exit() elif opt == "--iconserver": From fdrake at users.sourceforge.net Wed Oct 1 00:15:11 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Oct 1 00:15:14 2003 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.77,1.78 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1:/tmp/cvs-serv9820 Modified Files: doc.tex Log Message: Various minor updates in the description of mkhowto. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** doc.tex 27 Sep 2003 07:18:52 -0000 1.77 --- doc.tex 1 Oct 2003 04:15:09 -0000 1.78 *************** *** 1773,1779 **** symbolic link to it or run it in place; the actual script file must be stored as part of the documentation source tree, ! though it may be used to format documents outside the ! tree. Use \program{mkhowto} \longprogramopt{help} ! for a list of command line options. --- 1773,1778 ---- symbolic link to it or run it in place; the actual script file must be stored as part of the documentation source tree, ! though it may be used to format documents outside the tree. ! Use \program{mkhowto} \longprogramopt{help} for a list of command line options. *************** *** 1781,1785 **** \code{manual} class documents. It is usually a good idea to always use the latest version of this tool rather than a ! version from an older source release of Python. XXX Need more here. --- 1780,1790 ---- \code{manual} class documents. It is usually a good idea to always use the latest version of this tool rather than a ! version from an older source release of Python. It can be ! used to generate DVI, HTML, PDF, PostScript, and plain text ! documents. The GNU info and iSilo formats will be supported ! by this script in some future version. ! ! Use the \longprogramopt{help} option on this script's command ! line to get a summary of options for this script. XXX Need more here. *************** *** 1820,1824 **** \end{verbatim} ! You should now be able to build at least the HTML, PDF, and PostScript versions of the formatted documentation. --- 1825,1829 ---- \end{verbatim} ! You should now be able to build at least the DVI, HTML, PDF, and PostScript versions of the formatted documentation. From anthonybaxter at users.sourceforge.net Wed Oct 1 02:02:07 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 02:02:10 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libbsddb.tex, 1.11.10.1, 1.11.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26858 Modified Files: Tag: release23-maint libbsddb.tex Log Message: added a warning from Greg about legacy mode with threads. Index: libbsddb.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbsddb.tex,v retrieving revision 1.11.10.1 retrieving revision 1.11.10.2 diff -C2 -d -r1.11.10.1 -r1.11.10.2 *** libbsddb.tex 16 Sep 2003 21:42:13 -0000 1.11.10.1 --- libbsddb.tex 1 Oct 2003 06:02:05 -0000 1.11.10.2 *************** *** 32,35 **** --- 32,43 ---- pybsddb URL. + \begin{notice}[warning] + This legacy interface is not thread safe in python 2.3.x or earlier. + Data corruption, core dumps or deadlocks may occur if you attempt + multi-threaded access. You must use the modern pybsddb interface + linked to above if you need multi-threaded or multi-process database + access. + \end{notice} + The \module{bsddb} module defines the following functions that create objects that access the appropriate type of Berkeley DB file. The From anthonybaxter at users.sourceforge.net Wed Oct 1 02:07:34 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 02:07:37 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.55,1.831.4.56 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv27775 Modified Files: Tag: release23-maint NEWS Log Message: post 2.3.2c1 news Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.55 retrieving revision 1.831.4.56 diff -C2 -d -r1.831.4.55 -r1.831.4.56 *** NEWS 30 Sep 2003 09:15:55 -0000 1.831.4.55 --- NEWS 1 Oct 2003 06:07:32 -0000 1.831.4.56 *************** *** 5,8 **** --- 5,30 ---- (editors: check NEWS.help for information about editing NEWS using ReST.) + What's New in Python 2.3.2 (final)? + =================================== + + *Release date: XX-XXX-XXXX* + + Core and builtins + ----------------- + + - A workaround for an OpenBSD compiler bug that meant python failed to + detect floating point overflow in some cases. + + Tools/Demos + ----------- + + - Tools/scripts/md5sum.py opens files in binary mode by default. Opening + in text mode is almost certainly not what you want. + + Extension modules + ----------------- + + - The documentation for bsddb now warns strongly about using the legacy + API in multi-threaded applications. What's New in Python 2.3.2c1? From anthonybaxter at users.sourceforge.net Wed Oct 1 02:47:50 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 02:47:55 2003 Subject: [Python-checkins] python/dist/src README,1.177.4.4,1.177.4.5 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv1263 Modified Files: Tag: release23-maint README Log Message: doing the dance of the release. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.177.4.4 retrieving revision 1.177.4.5 diff -C2 -d -r1.177.4.4 -r1.177.4.5 *** README 30 Sep 2003 07:10:25 -0000 1.177.4.4 --- README 1 Oct 2003 06:47:48 -0000 1.177.4.5 *************** *** 1,4 **** ! This is Python version 2.3.2c1 ! ============================== Copyright (c) 2001, 2002, 2003 Python Software Foundation. --- 1,4 ---- ! This is Python version 2.3.2 ! ============================ Copyright (c) 2001, 2002, 2003 Python Software Foundation. From anthonybaxter at users.sourceforge.net Wed Oct 1 02:47:50 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 02:47:56 2003 Subject: [Python-checkins] python/dist/src/Include patchlevel.h, 2.74.4.3, 2.74.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv1263/Include Modified Files: Tag: release23-maint patchlevel.h Log Message: doing the dance of the release. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.74.4.3 retrieving revision 2.74.4.4 diff -C2 -d -r2.74.4.3 -r2.74.4.4 *** patchlevel.h 27 Sep 2003 18:10:41 -0000 2.74.4.3 --- patchlevel.h 1 Oct 2003 06:47:48 -0000 2.74.4.4 *************** *** 23,31 **** #define PY_MINOR_VERSION 3 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.3.2c1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 23,31 ---- #define PY_MINOR_VERSION 3 #define PY_MICRO_VERSION 2 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL ! #define PY_RELEASE_SERIAL 0 /* Version as a string */ ! #define PY_VERSION "2.3.2" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From anthonybaxter at users.sourceforge.net Wed Oct 1 02:47:50 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 02:47:58 2003 Subject: [Python-checkins] python/dist/src/Misc/RPM python-2.3.spec, 1.2.12.2, 1.2.12.3 Message-ID: Update of /cvsroot/python/python/dist/src/Misc/RPM In directory sc8-pr-cvs1:/tmp/cvs-serv1263/Misc/RPM Modified Files: Tag: release23-maint python-2.3.spec Log Message: doing the dance of the release. Index: python-2.3.spec =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/RPM/python-2.3.spec,v retrieving revision 1.2.12.2 retrieving revision 1.2.12.3 diff -C2 -d -r1.2.12.2 -r1.2.12.3 *** python-2.3.spec 30 Sep 2003 07:10:26 -0000 1.2.12.2 --- python-2.3.spec 1 Oct 2003 06:47:48 -0000 1.2.12.3 *************** *** 31,35 **** %define name python ! %define version 2.3.2c1 %define libvers 2.3 %define release 1pydotorg --- 31,35 ---- %define name python ! %define version 2.3.2 %define libvers 2.3 %define release 1pydotorg From greg at users.sourceforge.net Wed Oct 1 02:48:53 2003 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Wed Oct 1 02:48:56 2003 Subject: [Python-checkins] python/dist/src/Lib/bsddb/test test_basics.py, 1.8, 1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb/test In directory sc8-pr-cvs1:/tmp/cvs-serv1442/bsddb/test Modified Files: test_basics.py Log Message: bsddb3 4.2.2, adds DBCursor.get_current_size() method to return the length of the current value without reading the value itself. Index: test_basics.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_basics.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_basics.py 21 Sep 2003 00:08:14 -0000 1.8 --- test_basics.py 1 Oct 2003 06:48:51 -0000 1.9 *************** *** 50,53 **** --- 50,55 ---- envsetflags = 0 + _numKeys = 1002 # PRIVATE. NOTE: must be an even value + def setUp(self): if self.useEnv: *************** *** 107,121 **** ! def populateDB(self): d = self.d ! for x in range(500): ! key = '%04d' % (1000 - x) # insert keys in reverse order data = self.makeData(key) ! d.put(key, data) ! for x in range(500): key = '%04d' % x # and now some in forward order data = self.makeData(key) ! d.put(key, data) num = len(d) --- 109,129 ---- ! def populateDB(self, _txn=None): d = self.d ! ! for x in range(self._numKeys/2): ! key = '%04d' % (self._numKeys - x) # insert keys in reverse order data = self.makeData(key) ! d.put(key, data, _txn) ! d.put('empty value', '', _txn) ! ! for x in range(self._numKeys/2-1): key = '%04d' % x # and now some in forward order data = self.makeData(key) ! d.put(key, data, _txn) ! ! if _txn: ! _txn.commit() num = len(d) *************** *** 237,254 **** print data ! assert len(d) == 1000 keys = d.keys() ! assert len(keys) == 1000 assert type(keys) == type([]) d['new record'] = 'a new record' ! assert len(d) == 1001 keys = d.keys() ! assert len(keys) == 1001 d['new record'] = 'a replacement record' ! assert len(d) == 1001 keys = d.keys() ! assert len(keys) == 1001 if verbose: --- 245,262 ---- print data ! assert len(d) == self._numKeys keys = d.keys() ! assert len(keys) == self._numKeys assert type(keys) == type([]) d['new record'] = 'a new record' ! assert len(d) == self._numKeys+1 keys = d.keys() ! assert len(keys) == self._numKeys+1 d['new record'] = 'a replacement record' ! assert len(d) == self._numKeys+1 keys = d.keys() ! assert len(keys) == self._numKeys+1 if verbose: *************** *** 262,266 **** items = d.items() ! assert len(items) == 1001 assert type(items) == type([]) assert type(items[0]) == type(()) --- 270,274 ---- items = d.items() ! assert len(items) == self._numKeys+1 assert type(items) == type([]) assert type(items[0]) == type(()) *************** *** 272,276 **** values = d.values() ! assert len(values) == 1001 assert type(values) == type([]) --- 280,284 ---- values = d.values() ! assert len(values) == self._numKeys+1 assert type(values) == type([]) *************** *** 294,298 **** txn = None c = self.d.cursor(txn=txn) ! rec = c.first() count = 0 --- 302,306 ---- txn = None c = self.d.cursor(txn=txn) ! rec = c.first() count = 0 *************** *** 310,315 **** else: self.fail("unexpected DBNotFoundError") ! ! assert count == 1000 --- 318,324 ---- else: self.fail("unexpected DBNotFoundError") ! assert c.get_current_size() == len(c.current()[1]), "%s != len(%r)" % (c.get_current_size(), c.current()[1]) ! ! assert count == self._numKeys *************** *** 330,334 **** self.fail("unexpected DBNotFoundError") ! assert count == 1000 rec = c.set('0505') --- 339,343 ---- self.fail("unexpected DBNotFoundError") ! assert count == self._numKeys rec = c.set('0505') *************** *** 337,341 **** --- 346,356 ---- assert rec[0] == '0505' assert rec[1] == self.makeData('0505') + assert c.get_current_size() == len(rec[1]) + # make sure we get empty values properly + rec = c.set('empty value') + assert rec[1] == '' + assert c.get_current_size() == 0 + try: n = c.set('bad key') *************** *** 576,596 **** def populateDB(self): - d = self.d txn = self.env.txn_begin() ! for x in range(500): ! key = '%04d' % (1000 - x) # insert keys in reverse order ! data = self.makeData(key) ! d.put(key, data, txn) ! ! for x in range(500): ! key = '%04d' % x # and now some in forward order ! data = self.makeData(key) ! d.put(key, data, txn) ! ! txn.commit() ! ! num = len(d) ! if verbose: ! print "created %d records" % num self.txn = self.env.txn_begin() --- 591,596 ---- def populateDB(self): txn = self.env.txn_begin() ! BasicTestCase.populateDB(self, _txn=txn) self.txn = self.env.txn_begin() *************** *** 627,631 **** print rec rec = c.next() ! assert count == 1001 c.close() # Cursors *MUST* be closed before commit! --- 627,631 ---- print rec rec = c.next() ! assert count == self._numKeys+1 c.close() # Cursors *MUST* be closed before commit! *************** *** 856,860 **** print rec rec = c1.next() ! assert count == 1000 count = 0 --- 856,860 ---- print rec rec = c1.next() ! assert count == self._numKeys count = 0 From greg at users.sourceforge.net Wed Oct 1 02:48:53 2003 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Wed Oct 1 02:48:58 2003 Subject: [Python-checkins] python/dist/src/Modules _bsddb.c,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1442/extsrc Modified Files: _bsddb.c Log Message: bsddb3 4.2.2, adds DBCursor.get_current_size() method to return the length of the current value without reading the value itself. Index: _bsddb.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** _bsddb.c 21 Sep 2003 23:29:41 -0000 1.20 --- _bsddb.c 1 Oct 2003 06:48:51 -0000 1.21 *************** *** 94,98 **** #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR) ! #define PY_BSDDB_VERSION "4.2.1" static char *rcs_id = "$Id$"; --- 94,98 ---- #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR) ! #define PY_BSDDB_VERSION "4.2.2" static char *rcs_id = "$Id$"; *************** *** 2982,2985 **** --- 2982,3018 ---- } + /* Return size of entry */ + static PyObject* + DBC_get_current_size(DBCursorObject* self, PyObject* args) + { + int err, flags=DB_CURRENT; + PyObject* retval = NULL; + DBT key, data; + + if (!PyArg_ParseTuple(args, ":get_current_size")) + return NULL; + CHECK_CURSOR_NOT_CLOSED(self); + CLEAR_DBT(key); + CLEAR_DBT(data); + + /* We don't allocate any memory, forcing a ENOMEM error and thus + getting the record size. */ + data.flags = DB_DBT_USERMEM; + data.ulen = 0; + MYDB_BEGIN_ALLOW_THREADS; + err = self->dbc->c_get(self->dbc, &key, &data, flags); + MYDB_END_ALLOW_THREADS; + if (err == ENOMEM || !err) { + /* ENOMEM means positive size, !err means zero length value */ + retval = PyInt_FromLong((long)data.size); + err = 0; + } + + FREE_DBT(key); + FREE_DBT(data); + RETURN_IF_ERR(); + return retval; + } + static PyObject* DBC_set_both(DBCursorObject* self, PyObject* args) *************** *** 4080,4083 **** --- 4113,4117 ---- {"set_range", (PyCFunction)DBC_set_range, METH_VARARGS|METH_KEYWORDS}, {"get_both", (PyCFunction)DBC_get_both, METH_VARARGS}, + {"get_current_size",(PyCFunction)DBC_get_current_size, METH_VARARGS}, {"set_both", (PyCFunction)DBC_set_both, METH_VARARGS}, {"set_recno", (PyCFunction)DBC_set_recno, METH_VARARGS|METH_KEYWORDS}, From anthonybaxter at users.sourceforge.net Wed Oct 1 03:24:56 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 03:25:00 2003 Subject: [Python-checkins] python/dist/src README,1.178,1.179 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv7501 Modified Files: README Log Message: updated HPUX notes. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** README 23 Sep 2003 15:01:49 -0000 1.178 --- README 1 Oct 2003 07:24:54 -0000 1.179 *************** *** 364,372 **** CC="xlC" without thread support). ! HP-UX: When using threading, you may have to add -D_REENTRANT to the OPT variable in the top-level Makefile; reported by Pat Knight, this seems to make a difference (at least for HP-UX 10.20) ! even though pyconfig.h defines it. Experience seems to show that ! building with HP's compiler works best if you set CC="cc -Ae". HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117) --- 364,379 ---- CC="xlC" without thread support). ! HP-UX: When using threading, you may have to add -D_REENTRANT to the OPT variable in the top-level Makefile; reported by Pat Knight, this seems to make a difference (at least for HP-UX 10.20) ! even though pyconfig.h defines it. This seems unnecessary when ! using HP/UX 11 and later - threading seems to work "out of the ! box". ! ! HP-UX ia64: When building on the ia64 (Itanium) platform using HP's ! compiler, some experience has shown that the compiler's ! optimiser produces a completely broken version of python ! (see http://www.python.org/sf/814976). To work around this, ! edit the Makefile and remove -O from the OPT line. HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117) From anthonybaxter at users.sourceforge.net Wed Oct 1 03:25:33 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 1 03:25:37 2003 Subject: [Python-checkins] python/dist/src README,1.177.4.5,1.177.4.6 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv7620 Modified Files: Tag: release23-maint README Log Message: updated HPUX notes. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.177.4.5 retrieving revision 1.177.4.6 diff -C2 -d -r1.177.4.5 -r1.177.4.6 *** README 1 Oct 2003 06:47:48 -0000 1.177.4.5 --- README 1 Oct 2003 07:25:31 -0000 1.177.4.6 *************** *** 370,377 **** OPT variable in the top-level Makefile; reported by Pat Knight, this seems to make a difference (at least for HP-UX 10.20) ! even though pyconfig.h defines it. There appears to be a problem ! with HP-UX's interactions with autoconf that causes breakage. ! The workaround is to edit the generated pyconfig.h after running ! configure - see http://www.python.org/2.3.1/bugs.html for details. HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117) --- 370,381 ---- OPT variable in the top-level Makefile; reported by Pat Knight, this seems to make a difference (at least for HP-UX 10.20) ! even though pyconfig.h defines it. This seems unnecessary when ! using HP/UX 11 and later - threading works "out of the box". ! ! HP-UX ia64: When building on the ia64 (Itanium) platform using HP's ! compiler, some experience has shown that the compiler's ! optimiser produces a completely broken version of python ! (see http://www.python.org/sf/814976). To work around this, ! edit the Makefile and remove -O from the OPT line. HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117) From theller at users.sourceforge.net Wed Oct 1 13:35:04 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 1 13:35:08 2003 Subject: [Python-checkins] python/dist/src/PC python_nt.rc, 1.27.4.2, 1.27.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv31301 Modified Files: Tag: release23-maint python_nt.rc Log Message: Prepare for the release of 2.3.2. I hope 3-Oct-2003 will be the release date. Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.27.4.2 retrieving revision 1.27.4.3 diff -C2 -d -r1.27.4.2 -r1.27.4.3 *** python_nt.rc 27 Sep 2003 20:01:34 -0000 1.27.4.2 --- python_nt.rc 1 Oct 2003 17:35:01 -0000 1.27.4.3 *************** *** 34,45 **** * following comment and #define are output from PCbuild\field3.py: * ! * For 2.3.2c1, * PY_MICRO_VERSION = 2 ! * PY_RELEASE_LEVEL = 'candidate' = 0xc ! * PY_RELEASE_SERIAL = 1 * ! * and 2*1000 + 12*10 + 1 = 2121 */ ! #define FIELD3 2121 /* e.g., 2.1a2 --- 34,45 ---- * following comment and #define are output from PCbuild\field3.py: * ! * For 2.3.2, * PY_MICRO_VERSION = 2 ! * PY_RELEASE_LEVEL = 'final' = 0xf ! * PY_RELEASE_SERIAL = 0 * ! * and 2*1000 + 15*10 + 0 = 2150 */ ! #define FIELD3 2150 /* e.g., 2.1a2 From theller at users.sourceforge.net Wed Oct 1 13:35:09 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 1 13:35:13 2003 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.dsp, 1.48.4.2, 1.48.4.3 BUILDno.txt, 1.51.4.2, 1.51.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv31355 Modified Files: Tag: release23-maint pythoncore.dsp BUILDno.txt Log Message: Prepare for the release of 2.3.2. I hope 3-Oct-2003 will be the release date. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.48.4.2 retrieving revision 1.48.4.3 diff -C2 -d -r1.48.4.2 -r1.48.4.3 *** pythoncore.dsp 27 Sep 2003 20:02:42 -0000 1.48.4.2 --- pythoncore.dsp 1 Oct 2003 17:35:07 -0000 1.48.4.3 *************** *** 259,263 **** SOURCE=..\Modules\getbuildinfo.c ! # ADD CPP /D BUILD=48 # End Source File # Begin Source File --- 259,263 ---- SOURCE=..\Modules\getbuildinfo.c ! # ADD CPP /D BUILD=49 # End Source File # Begin Source File Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.51.4.2 retrieving revision 1.51.4.3 diff -C2 -d -r1.51.4.2 -r1.51.4.3 *** BUILDno.txt 27 Sep 2003 20:02:42 -0000 1.51.4.2 --- BUILDno.txt 1 Oct 2003 17:35:07 -0000 1.51.4.3 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 49 2.3.2 (final) + 3-Oct-2003 48 2.3.2c1 30-Sep-2003 From theller at users.sourceforge.net Wed Oct 1 13:36:47 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 1 13:36:51 2003 Subject: [Python-checkins] python/dist/src/PCbuild BUILDno.txt,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv31740 Modified Files: BUILDno.txt Log Message: Release 2.3.2 (final) has a windows build number of 49. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** BUILDno.txt 27 Sep 2003 20:03:59 -0000 1.53 --- BUILDno.txt 1 Oct 2003 17:36:45 -0000 1.54 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 49 2.3.2 (final) + 3-Oct-2003 48 2.3.2c1 30-Sep-2003 From theller at users.sourceforge.net Wed Oct 1 14:24:08 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 1 14:24:11 2003 Subject: [Python-checkins] python/dist/src/PCbuild python20.wse, 1.133.4.2, 1.133.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv10543 Modified Files: Tag: release23-maint python20.wse Log Message: Prepare for the release of 2.3.2. Remove the Wise "Progress Message" when compiling Python files to pyc, the DOS box is message enough. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.133.4.2 retrieving revision 1.133.4.3 diff -C2 -d -r1.133.4.2 -r1.133.4.3 *** python20.wse 29 Sep 2003 10:09:38 -0000 1.133.4.2 --- python20.wse 1 Oct 2003 18:24:06 -0000 1.133.4.3 *************** *** 2,6 **** item: Global Version=9.0 ! Title=Python 2.3.2c1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=9.0 ! Title=Python 2.3.2 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 21,27 **** MIF PDF Version=1.0 MIF SMS Version=2.0 ! EXE Filename=Python-2.3.2c1.exe Dialogs Version=8 ! Version File=2.3.2c1 Version Description=Python Programming Language Version Copyright=©2001-2003 Python Software Foundation --- 21,27 ---- MIF PDF Version=1.0 MIF SMS Version=2.0 ! EXE Filename=Python-2.3.2.exe Dialogs Version=8 ! Version File=2.3.2 Version Description=Python Programming Language Version Copyright=©2001-2003 Python Software Foundation *************** *** 77,81 **** item: Set Variable Variable=PYVER_STRING ! Value=2.3.2c1 end item: Remark --- 77,81 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.3.2 end item: Remark *************** *** 3029,3051 **** Value=C Flags=00000010 - end - item: Custom Script Item - Filename=Display Progress Message.wse - Variable Name1=_CENTER_ - Variable Value1=AB - Variable Name2=_WIDTH_ - Variable Value2=320 - Variable Name3=_MSG_TITLE_ - Variable Value3=Compiling Python files - Variable Name4=HELPFILE - Variable Value4=C:\Programme\Wise for Windows Installer\HELP\Express.chm - Variable Name5=_OPTION_ - Variable Value5=B - Variable Name6=_HEIGHT_ - Variable Value6=80 - Variable Name7=_MSG_TEXT_ - Variable Value7=Please wait while Python modules are compiled - Variable Name8=_Y_POS_ - Variable Name9=_X_POS_ end item: Execute Program --- 3029,3032 ---- From fdrake at users.sourceforge.net Wed Oct 1 14:49:58 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Oct 1 14:50:03 2003 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.271,1.272 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv15606 Modified Files: Makefile Log Message: Make sure the trunk Makefile doesn't require mkhowto to be "installed" as described in "Documenting Python". Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** Makefile 28 Sep 2003 16:25:43 -0000 1.271 --- Makefile 1 Oct 2003 18:49:55 -0000 1.272 *************** *** 95,100 **** # built using the second flavor, where the preferred version is from # the Python CVS trunk. ! #MKHOWTO= TEXINPUTS=$(TEXINPUTS) $(PYTHON) $(PWD)/tools/mkhowto ! MKHOWTO= TEXINPUTS=$(TEXINPUTS) mkhowto MKDVI= $(MKHOWTO) --paper=$(PAPER) --dvi --- 95,100 ---- # built using the second flavor, where the preferred version is from # the Python CVS trunk. ! MKHOWTO= TEXINPUTS=$(TEXINPUTS) $(PYTHON) $(PWD)/tools/mkhowto ! #MKHOWTO= TEXINPUTS=$(TEXINPUTS) mkhowto MKDVI= $(MKHOWTO) --paper=$(PAPER) --dvi From anthonybaxter at users.sourceforge.net Thu Oct 2 08:50:21 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Thu Oct 2 08:50:27 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.56,1.831.4.57 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv2123/Misc Modified Files: Tag: release23-maint NEWS Log Message: tagging for tomorrows release Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.56 retrieving revision 1.831.4.57 diff -C2 -d -r1.831.4.56 -r1.831.4.57 *** NEWS 1 Oct 2003 06:07:32 -0000 1.831.4.56 --- NEWS 2 Oct 2003 12:50:18 -0000 1.831.4.57 *************** *** 8,12 **** =================================== ! *Release date: XX-XXX-XXXX* Core and builtins --- 8,12 ---- =================================== ! *Release date: 03-Oct-2003* Core and builtins From fdrake at users.sourceforge.net Thu Oct 2 11:39:25 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Oct 2 11:39:30 2003 Subject: [Python-checkins] python/nondist/peps pep-0101.txt,1.42,1.43 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv31030 Modified Files: pep-0101.txt Log Message: Add instructions for updating the doc/ are of the website. This probably needs further elaboration; I'm not sure this really even belongs in the PEP, though. Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** pep-0101.txt 30 Sep 2003 04:49:33 -0000 1.42 --- pep-0101.txt 2 Oct 2003 15:39:21 -0000 1.43 *************** *** 235,241 **** $ scp *-$VERSION.* creosote.python.org:$TARGET ! XXX What's needed to describe posting the documentation on the ! website should be added here, or there should be a link to a ! document in the python.org site management documentation. ___ Thomas grabs the HTML to build the Windows helpfile. --- 235,320 ---- $ scp *-$VERSION.* creosote.python.org:$TARGET ! ___ For final releases, publish the documentation on python.org. ! This must be done by someone with write access to the python.org ! CVS repository. ! ! Start by creating a new directory and filling it with the ! standard boilerplate. $VERSION is the same as for uploading the ! documentation, above; $OLDVERSION is the most recently published ! version on the site. ! ! $ cd .../pydotorg/doc/ ! $ mkdir $VERSION ! $ cvs add $VERSION ! $ cd $OLDVERSION ! $ cp .cvsignore Makefile index.ht download.ht ../$VERSION ! $ cd ../$VERSION ! $ cvs add .cvsignore Makefile *.ht ! ! Now make the following edits: ! ! - in Makefile, change the value of ROOT_OFFSET to doc/$VERSION ! ! - in index.ht, change: ! - the version number to $VERSION in two places: the Title: ! header, and the

at the top of the page ! - the release date, in the

at the top of the page ! - if the minor release number changed (for example, from 2.3 ! to 2.4), the title and link to the "What's New" document ! (search for "whatsnew") ! ! - in download.ht, change: ! - the version number to $VERSION in two places: the Title: ! header, and the

at the top of the page ! - the release date, in the

at the top of the page ! - if the minor release number changed (for example, from 2.3 ! to 2.4), the title and link to the "What's New" document ! (search for "whatsnew") ! - replace the large table of downloads with the content of the ! pkglist.html file generated by the documentation build ! process ! ! Now, the web content has all been prepared, but there's still ! some dancing to do to make it all work right. To be safe, we ! can commit the new files to CVS, but we're *not* ready to ! install them on the site yet: ! ! $ cvs commit -m \ ! "Add website content for Python $VERSION documentation." ! ! Log into creosote.python.org using SSH and unpack a copy of the ! documentation into place: ! ! # on creosote: ! $ cd /ftp/www.python.org/doc ! $ tar xjf \ ! /ftp/ftp.python.org/pub/python/doc/$VERSION/html-$VERSION.tar.bz2 ! $ mv Python-Docs-$VERSION $VERSION ! ! Now head back to your pydotorg checkout on your workstation, and ! push website content into place: ! ! $ cd .../pydotorg/doc/$VERSION ! $ make install ! ! Point your browser at this URL and check it out: ! ! http://www.python.org/doc/$VERSION/ ! ! There are three more changes that need to happen in the ! top-level doc/ directory of the website content. The first of ! these can happen any time after what's already happened in this ! process, and the last two should happen as soon as the release ! announcement has been made. ! ! At this time, edit the versions.ht file in doc/ to make add the ! new release at the top. The previous latest release should drop ! down to the top of the long list of released versions, and the ! new release should replace the previous most recent release. ! There should be a blank line between the link to the development ! documentation and the most recent release, and another blank ! line between the most recent release and the long list of older ! releases. (Is should be fairly easy to figure this out while ! looking at the file.) ___ Thomas grabs the HTML to build the Windows helpfile. *************** *** 461,464 **** --- 540,564 ---- Feel free to remove any old news items. + + ___ Make the last two changes to the documentation area on + python.org. (Remember those from the documentation items above? + It's time now.) + + In your pydotorg checkout, edit the file doc/index.ht to update + to the right version number and release date. Commit the + changes to CVS and push the file to the website: + + $ cd .../pydotorg/doc/ + $ make install + + This will cause the doc/index.html file to claim to point to the + new docs, but they won't. Run (don't walk!) to + creosote.python.org, and update a symlink in the doc/ tree: + + # on creosote: + $ cd /ftp/www.python.org/doc/ + $ rm current && ln -s $VERSION current + + Good. Stop running. Now it's time to do some cleaning up. These steps are very important! From fdrake at users.sourceforge.net Thu Oct 2 12:30:19 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Oct 2 12:30:22 2003 Subject: [Python-checkins] python/dist/src/Doc/tools rewrite.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv7125 Modified Files: rewrite.py Log Message: normalize whitespace Index: rewrite.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/rewrite.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rewrite.py 16 Oct 2002 15:27:02 -0000 1.2 --- rewrite.py 2 Oct 2003 16:30:17 -0000 1.3 *************** *** 20,24 **** d["DATE"] = date return d ! def main(): --- 20,24 ---- d["DATE"] = date return d ! def main(): From anthonybaxter at users.sourceforge.net Fri Oct 3 04:35:13 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Fri Oct 3 04:35:17 2003 Subject: [Python-checkins] python/nondist/peps pep-0101.txt,1.43,1.44 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv20946 Modified Files: pep-0101.txt Log Message: reading Fred's mind for fun and profit Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** pep-0101.txt 2 Oct 2003 15:39:21 -0000 1.43 --- pep-0101.txt 3 Oct 2003 08:35:10 -0000 1.44 *************** *** 318,321 **** --- 318,327 ---- looking at the file.) + Edit index.ht in doc/ to refer to the new version. + + Log onto creosote and move the symlink 'current' in the + /usr/local/www/www.python.org/doc directory to point to the + new version's documentation. + ___ Thomas grabs the HTML to build the Windows helpfile. The HTML files are unpacked into a new src/html directory, and From loewis at users.sourceforge.net Fri Oct 3 09:47:47 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:47:50 2003 Subject: [Python-checkins] python/dist/src configure, 1.426, 1.427 configure.in, 1.436, 1.437 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv17789 Modified Files: configure configure.in Log Message: Patch #814764: Undefine xopen_source on OpenBSD 3.4. Backported to 2.3. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.426 retrieving revision 1.427 diff -C2 -d -r1.426 -r1.427 *** configure 27 Sep 2003 09:12:27 -0000 1.426 --- configure 3 Oct 2003 13:47:32 -0000 1.427 *************** *** 1438,1443 **** # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm. ! OpenBSD/2.* | OpenBSD/3.[0123]) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage --- 1438,1443 ---- # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. ! OpenBSD/2.* | OpenBSD/3.[01234]) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.436 retrieving revision 1.437 diff -C2 -d -r1.436 -r1.437 *** configure.in 25 Sep 2003 14:49:15 -0000 1.436 --- configure.in 3 Oct 2003 13:47:44 -0000 1.437 *************** *** 136,141 **** # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm. ! OpenBSD/2.* | OpenBSD/3.@<:@0123@:>@) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage --- 136,141 ---- # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. ! OpenBSD/2.* | OpenBSD/3.@<:@01234@:>@) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage From loewis at users.sourceforge.net Fri Oct 3 09:48:32 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:48:35 2003 Subject: [Python-checkins] python/dist/src configure, 1.416.4.7, 1.416.4.8 configure.in, 1.427.4.6, 1.427.4.7 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv18291 Modified Files: Tag: release23-maint configure configure.in Log Message: Patch #814764: Undefine xopen_source on OpenBSD 3.4. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.416.4.7 retrieving revision 1.416.4.8 diff -C2 -d -r1.416.4.7 -r1.416.4.8 *** configure 27 Sep 2003 08:58:55 -0000 1.416.4.7 --- configure 3 Oct 2003 13:48:26 -0000 1.416.4.8 *************** *** 1438,1443 **** # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm. ! OpenBSD/2.* | OpenBSD/3.[0123]) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage --- 1438,1443 ---- # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. ! OpenBSD/2.* | OpenBSD/3.[01234]) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.427.4.6 retrieving revision 1.427.4.7 diff -C2 -d -r1.427.4.6 -r1.427.4.7 *** configure.in 25 Sep 2003 15:21:00 -0000 1.427.4.6 --- configure.in 3 Oct 2003 13:48:28 -0000 1.427.4.7 *************** *** 136,141 **** # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm. ! OpenBSD/2.* | OpenBSD/3.@<:@0123@:>@) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage --- 136,141 ---- # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. ! # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. ! OpenBSD/2.* | OpenBSD/3.@<:@01234@:>@) define_xopen_source=no;; # On Solaris 2.6, sys/wait.h is inconsistent in the usage From loewis at users.sourceforge.net Fri Oct 3 09:55:39 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:55:43 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.2, 1.271.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20322/Modules Modified Files: Tag: release23-maint socketmodule.c Log Message: Patch #813445: Add missing socket.IPPROTO_IPV6. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.2 retrieving revision 1.271.6.3 diff -C2 -d -r1.271.6.2 -r1.271.6.3 *** socketmodule.c 7 Aug 2003 11:56:22 -0000 1.271.6.2 --- socketmodule.c 3 Oct 2003 13:55:37 -0000 1.271.6.3 *************** *** 3750,3753 **** --- 3750,3756 ---- PyModule_AddIntConstant(m, "IPPROTO_IPV4", IPPROTO_IPV4); #endif + #ifdef IPPROTO_IPV6 + PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6); + #endif #ifdef IPPROTO_IPIP PyModule_AddIntConstant(m, "IPPROTO_IPIP", IPPROTO_IPIP); From loewis at users.sourceforge.net Fri Oct 3 09:55:40 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:55:51 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.57,1.831.4.58 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20322/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #813445: Add missing socket.IPPROTO_IPV6. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.57 retrieving revision 1.831.4.58 diff -C2 -d -r1.831.4.57 -r1.831.4.58 *** NEWS 2 Oct 2003 12:50:18 -0000 1.831.4.57 --- NEWS 3 Oct 2003 13:55:37 -0000 1.831.4.58 *************** *** 5,8 **** --- 5,18 ---- (editors: check NEWS.help for information about editing NEWS using ReST.) + What's New in Python 2.3.3c1? + =================================== + + *Release date: XXX * + + Extension modules + ----------------- + + - Patch #813445: Add missing socket.IPPROTO_IPV6. + What's New in Python 2.3.2 (final)? =================================== From loewis at users.sourceforge.net Fri Oct 3 09:56:23 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:56:27 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.273, 1.274 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20466/Modules Modified Files: socketmodule.c Log Message: Patch #813445: Add missing socket.IPPROTO_IPV6. Backported to 2.3. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.273 retrieving revision 1.274 diff -C2 -d -r1.273 -r1.274 *** socketmodule.c 7 Aug 2003 11:55:15 -0000 1.273 --- socketmodule.c 3 Oct 2003 13:56:20 -0000 1.274 *************** *** 3750,3753 **** --- 3750,3756 ---- PyModule_AddIntConstant(m, "IPPROTO_IPV4", IPPROTO_IPV4); #endif + #ifdef IPPROTO_IPV6 + PyModule_AddIntConstant(m, "IPPROTO_IPV6", IPPROTO_IPV6); + #endif #ifdef IPPROTO_IPIP PyModule_AddIntConstant(m, "IPPROTO_IPIP", IPPROTO_IPIP); From loewis at users.sourceforge.net Fri Oct 3 09:57:40 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 09:57:47 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.861,1.862 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20830/Misc Modified Files: NEWS Log Message: Patch #813445: Add IPPROTO_IPV6 option to the socketmodule. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.861 retrieving revision 1.862 diff -C2 -d -r1.861 -r1.862 *** NEWS 23 Sep 2003 20:21:00 -0000 1.861 --- NEWS 3 Oct 2003 13:57:37 -0000 1.862 *************** *** 34,37 **** --- 34,39 ---- ----------------- + - socket.IPPROTO_IPV6 was added. + - readline.clear_history was added. From montanaro at users.sourceforge.net Fri Oct 3 10:03:03 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Oct 3 10:03:07 2003 Subject: [Python-checkins] python/dist/src/Lib csv.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv20930/Lib Modified Files: csv.py Log Message: Make the fieldnames argument optional in the DictReader. If self.fieldnames is None, the next row read is used as the fieldnames. In the common case, this means the programmer doesn't need to know the fieldnames ahead of time. The first row of the file will be used. In the uncommon case, this means the programmer can set the reader's fieldnames attribute to None at any time and have the next row read as the next set of fieldnames, so a csv file can contain several "sections", each with different fieldnames. Index: csv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/csv.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** csv.py 6 Sep 2003 19:52:12 -0000 1.9 --- csv.py 3 Oct 2003 14:03:01 -0000 1.10 *************** *** 93,97 **** class DictReader: ! def __init__(self, f, fieldnames, restkey=None, restval=None, dialect="excel", *args, **kwds): self.fieldnames = fieldnames # list of keys for the dict --- 93,97 ---- class DictReader: ! def __init__(self, f, fieldnames=None, restkey=None, restval=None, dialect="excel", *args, **kwds): self.fieldnames = fieldnames # list of keys for the dict *************** *** 105,108 **** --- 105,112 ---- def next(self): row = self.reader.next() + if self.fieldnames is None: + self.fieldnames = row + row = self.reader.next() + # unlike the basic reader, we prefer not to return blanks, # because we will typically wind up with a dict full of None From montanaro at users.sourceforge.net Fri Oct 3 10:03:03 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Oct 3 10:03:09 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20930/Doc/lib Modified Files: libcsv.tex Log Message: Make the fieldnames argument optional in the DictReader. If self.fieldnames is None, the next row read is used as the fieldnames. In the common case, this means the programmer doesn't need to know the fieldnames ahead of time. The first row of the file will be used. In the uncommon case, this means the programmer can set the reader's fieldnames attribute to None at any time and have the next row read as the next set of fieldnames, so a csv file can contain several "sections", each with different fieldnames. Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libcsv.tex 10 Sep 2003 18:54:49 -0000 1.9 --- libcsv.tex 3 Oct 2003 14:03:01 -0000 1.10 *************** *** 118,129 **** The \module{csv} module defines the following classes: ! \begin{classdesc}{DictReader}{csvfile, fieldnames\optional{, restkey=\constant{None}\optional{, restval=\constant{None}\optional{, dialect=\code{'excel'}\optional{, ! fmtparam}}}}} Create an object which operates like a regular reader but maps the ! information read into a dict whose keys are given by the \var{fieldnames} ! parameter. If the row read has fewer fields than the fieldnames sequence, the value of \var{restval} will be used as the default value. If the row read has more fields than the fieldnames sequence, the remaining data is --- 118,133 ---- The \module{csv} module defines the following classes: ! \begin{classdesc}{DictReader}{csvfile\optional{, ! fieldnames=\constant{None},\optional{, restkey=\constant{None}\optional{, restval=\constant{None}\optional{, dialect=\code{'excel'}\optional{, ! fmtparam}}}}}} Create an object which operates like a regular reader but maps the ! information read into a dict whose keys are given by the optional ! {} \var{fieldnames} ! parameter. If the \var{fieldnames} parameter is omitted, the values in ! the first row of the \var{csvfile} will be used as the fieldnames. ! If the row read has fewer fields than the fieldnames sequence, the value of \var{restval} will be used as the default value. If the row read has more fields than the fieldnames sequence, the remaining data is *************** *** 150,153 **** --- 154,164 ---- \code{'ignore'}, extra values in the dictionary are ignored. All other parameters are interpreted as for \class{writer} objects. + + Note that unlike the \class{DictReader} class, the \var{fieldnames} + parameter of the \class{DictWriter} is not optional. Since Python's + \class{dict} objects are not ordered, there is not enough information + available to deduce the order in which the row should be written to the + \var{csvfile}. + \end{classdesc} From montanaro at users.sourceforge.net Fri Oct 3 10:03:04 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Oct 3 10:03:12 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_csv.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv20930/Lib/test Modified Files: test_csv.py Log Message: Make the fieldnames argument optional in the DictReader. If self.fieldnames is None, the next row read is used as the fieldnames. In the common case, this means the programmer doesn't need to know the fieldnames ahead of time. The first row of the file will be used. In the uncommon case, this means the programmer can set the reader's fieldnames attribute to None at any time and have the next row read as the next set of fieldnames, so a csv file can contain several "sections", each with different fieldnames. Index: test_csv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_csv.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_csv.py 6 Sep 2003 19:52:12 -0000 1.10 --- test_csv.py 3 Oct 2003 14:03:01 -0000 1.11 *************** *** 383,387 **** self.readerAssertEqual('"abc\\,def"\r\n', [['abc,def']]) - # Disabled, pending support in csv.utils module class TestDictFields(unittest.TestCase): ### "long" means the row is longer than the number of fieldnames --- 383,386 ---- *************** *** 402,405 **** --- 401,408 ---- self.assertEqual(reader.next(), {"f1": '1', "f2": '2', "f3": 'abc'}) + def test_read_dict_no_fieldnames(self): + reader = csv.DictReader(StringIO("f1,f2,f3\r\n1,2,abc\r\n")) + self.assertEqual(reader.next(), {"f1": '1', "f2": '2', "f3": 'abc'}) + def test_read_long(self): reader = csv.DictReader(StringIO("1,2,abc,4,5,6\r\n"), *************** *** 411,414 **** --- 414,423 ---- reader = csv.DictReader(StringIO("1,2,abc,4,5,6\r\n"), fieldnames=["f1", "f2"], restkey="_rest") + self.assertEqual(reader.next(), {"f1": '1', "f2": '2', + "_rest": ["abc", "4", "5", "6"]}) + + def test_read_long_with_rest_no_fieldnames(self): + reader = csv.DictReader(StringIO("f1,f2\r\n1,2,abc,4,5,6\r\n"), + restkey="_rest") self.assertEqual(reader.next(), {"f1": '1', "f2": '2', "_rest": ["abc", "4", "5", "6"]}) From montanaro at users.sourceforge.net Fri Oct 3 10:05:28 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Oct 3 10:05:31 2003 Subject: [Python-checkins] python/dist/src/Lib string.py,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv22704/Lib Modified Files: string.py Log Message: tweak the docstring to not be so focused on 1.6. Index: string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** string.py 10 Apr 2003 22:35:31 -0000 1.68 --- string.py 3 Oct 2003 14:05:26 -0000 1.69 *************** *** 1,8 **** ! """A collection of string operations (most are no longer used in Python 1.6). ! Warning: most of the code you see here isn't normally used nowadays. With ! Python 1.6, many of these functions are implemented as methods on the ! standard string object. They used to be implemented by a built-in module ! called strop, but strop is now obsolete itself. Public module variables: --- 1,8 ---- ! """A collection of string operations (most are no longer used). ! Warning: most of the code you see here isn't normally used nowadays. ! Beginning with Python 1.6, many of these functions are implemented as ! methods on the standard string object. They used to be implemented by ! a built-in module called strop, but strop is now obsolete itself. Public module variables: From fdrake at users.sourceforge.net Fri Oct 3 10:06:13 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Oct 3 10:06:17 2003 Subject: [Python-checkins] python/nondist/peps pep-0101.txt,1.44,1.45 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv22860 Modified Files: pep-0101.txt Log Message: remove duplicate description of the final changes made in the documentation release, and add a note that they're described in a separate step (down near "send the release announcement") Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** pep-0101.txt 3 Oct 2003 08:35:10 -0000 1.44 --- pep-0101.txt 3 Oct 2003 14:06:10 -0000 1.45 *************** *** 306,310 **** these can happen any time after what's already happened in this process, and the last two should happen as soon as the release ! announcement has been made. At this time, edit the versions.ht file in doc/ to make add the --- 306,311 ---- these can happen any time after what's already happened in this process, and the last two should happen as soon as the release ! announcement has been made. Those are described in a separate ! step of this checklist. At this time, edit the versions.ht file in doc/ to make add the *************** *** 317,326 **** releases. (Is should be fairly easy to figure this out while looking at the file.) - - Edit index.ht in doc/ to refer to the new version. - - Log onto creosote and move the symlink 'current' in the - /usr/local/www/www.python.org/doc directory to point to the - new version's documentation. ___ Thomas grabs the HTML to build the Windows helpfile. --- 318,321 ---- From montanaro at users.sourceforge.net Fri Oct 3 10:07:09 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Oct 3 10:07:16 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.862,1.863 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv22951/Misc Modified Files: NEWS Log Message: forgot the NEWS blurb about the change to csv.DictReader Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.862 retrieving revision 1.863 diff -C2 -d -r1.862 -r1.863 *** NEWS 3 Oct 2003 13:57:37 -0000 1.862 --- NEWS 3 Oct 2003 14:07:07 -0000 1.863 *************** *** 49,52 **** --- 49,56 ---- ------- + - The fieldnames argument to the csv module's DictReader constructor is now + optional. If omitted, the first row of the file will be used as the + list of fieldnames. + - encodings.bz2_codec was added for access to bz2 compression using "a long string".encode('bz2') From fdrake at users.sourceforge.net Fri Oct 3 11:20:32 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Oct 3 11:20:36 2003 Subject: [Python-checkins] python/dist/src/Doc/tools mksourcepkg, 1.6, 1.6.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv6620 Modified Files: Tag: release23-maint mksourcepkg Log Message: - don't re-write a SourceForge authenticated CVS root into the anonymous flavor unless the user asks for it on the command line - decompose SourceForge authenticated CVS roots correctly Index: mksourcepkg =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mksourcepkg,v retrieving revision 1.6 retrieving revision 1.6.16.1 diff -C2 -d -r1.6 -r1.6.16.1 *** mksourcepkg 9 Aug 2002 20:20:50 -0000 1.6 --- mksourcepkg 3 Oct 2003 15:20:30 -0000 1.6.16.1 *************** *** 29,33 **** quiet = 0 ! rx = re.compile(r":ext:(?:[a-zA-Z0-9]+)@cvs\.([a-zA-Z0-9]+).sourceforge.net:" r"/cvsroot/\1") --- 29,33 ---- quiet = 0 ! rx = re.compile(r":ext:(?:[a-zA-Z0-9]+@)?cvs\.([a-zA-Z0-9]+).sourceforge.net:" r"/cvsroot/\1") *************** *** 35,42 **** def main(): global quiet try: ! opts, args = getopt.getopt(sys.argv[1:], "abgtzq", ["all", "bzip2", "gzip", "tools", "zip", ! "quiet"]) except getopt.error, e: usage(warning=str(e)) --- 35,43 ---- def main(): global quiet + anonymous = False try: ! opts, args = getopt.getopt(sys.argv[1:], "Aabgtzq", ["all", "bzip2", "gzip", "tools", "zip", ! "quiet", "anonymous"]) except getopt.error, e: usage(warning=str(e)) *************** *** 62,65 **** --- 63,68 ---- formats["gzip"] = 1 formats["zip"] = 1 + elif opt in ("-A", "--anonymous"): + anonymous = True if formats: # make order human-predictable *************** *** 81,85 **** cvsroot = info.get_cvsroot() m = rx.match(cvsroot) ! if m: # If this is an authenticated SourceForge repository, convert to # anonymous usage for the export/checkout, since that avoids the --- 84,88 ---- cvsroot = info.get_cvsroot() m = rx.match(cvsroot) ! if m and anonymous: # If this is an authenticated SourceForge repository, convert to # anonymous usage for the export/checkout, since that avoids the From fdrake at users.sourceforge.net Fri Oct 3 11:21:40 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Oct 3 11:21:43 2003 Subject: [Python-checkins] python/dist/src/Doc/tools mksourcepkg,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv6924 Modified Files: mksourcepkg Log Message: - don't re-write a SourceForge authenticated CVS root into the anonymous flavor unless the user asks for it on the command line - decompose SourceForge authenticated CVS roots correctly Index: mksourcepkg =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mksourcepkg,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mksourcepkg 27 Sep 2003 22:07:04 -0000 1.7 --- mksourcepkg 3 Oct 2003 15:21:38 -0000 1.8 *************** *** 37,41 **** quiet = 0 ! rx = re.compile(r":ext:(?:[a-zA-Z0-9]+)@cvs\.([a-zA-Z0-9]+).sourceforge.net:" r"/cvsroot/\1") --- 37,41 ---- quiet = 0 ! rx = re.compile(r":ext:(?:[a-zA-Z0-9]+@)?cvs\.([a-zA-Z0-9]+).sourceforge.net:" r"/cvsroot/\1") *************** *** 43,50 **** def main(): global quiet try: ! opts, args = getopt.getopt(sys.argv[1:], "abgtzq", ["all", "bzip2", "gzip", "tools", "zip", ! "quiet"]) except getopt.error, e: usage(warning=str(e)) --- 43,51 ---- def main(): global quiet + anonymous = False try: ! opts, args = getopt.getopt(sys.argv[1:], "Aabgtzq", ["all", "bzip2", "gzip", "tools", "zip", ! "quiet", "anonymous"]) except getopt.error, e: usage(warning=str(e)) *************** *** 70,73 **** --- 71,76 ---- formats["gzip"] = 1 formats["zip"] = 1 + elif opt in ("-A", "--anonymous"): + anonymous = True if formats: # make order human-predictable *************** *** 89,93 **** cvsroot = info.get_cvsroot() m = rx.match(cvsroot) ! if m: # If this is an authenticated SourceForge repository, convert to # anonymous usage for the export/checkout, since that avoids the --- 92,96 ---- cvsroot = info.get_cvsroot() m = rx.match(cvsroot) ! if m and anonymous: # If this is an authenticated SourceForge repository, convert to # anonymous usage for the export/checkout, since that avoids the From fdrake at users.sourceforge.net Fri Oct 3 11:31:38 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Oct 3 11:31:43 2003 Subject: [Python-checkins] python/nondist/peps pep-0101.txt,1.45,1.46 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv9603 Modified Files: pep-0101.txt Log Message: add note to update links in the navigation sidebar on the home page Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** pep-0101.txt 3 Oct 2003 14:06:10 -0000 1.45 --- pep-0101.txt 3 Oct 2003 15:31:36 -0000 1.46 *************** *** 476,480 **** ___ Also on the ../index.ht file (still the python.org home page), update the link information so that the release status is ! correct. Still do NOT do a "make install"! ___ Now we're waiting for the scp to creosote to finish. Da de da, --- 476,481 ---- ___ Also on the ../index.ht file (still the python.org home page), update the link information so that the release status is ! correct. Update the links in the left-hand navigation ! sidebar. Still do NOT do a "make install"! ___ Now we're waiting for the scp to creosote to finish. Da de da, From loewis at users.sourceforge.net Fri Oct 3 13:11:47 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 13:11:51 2003 Subject: [Python-checkins] python/dist/src/Modules _tkinter.c, 1.161, 1.161.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv30330/Modules Modified Files: Tag: release23-maint _tkinter.c Log Message: Check for TclError when reading variables. Fixes #807314. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.161 retrieving revision 1.161.8.1 diff -C2 -d -r1.161 -r1.161.8.1 *** _tkinter.c 14 Jun 2003 21:34:32 -0000 1.161 --- _tkinter.c 3 Oct 2003 17:11:45 -0000 1.161.8.1 *************** *** 1648,1656 **** tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP ! if (((TkappObject*)self)->wantobjects) { ! res = FromObj(self, tres); ! } ! else { ! res = PyString_FromString(Tcl_GetString(tres)); } LEAVE_OVERLAP_TCL --- 1648,1660 ---- tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP ! if (tres == NULL) { ! PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); ! } else { ! if (((TkappObject*)self)->wantobjects) { ! res = FromObj(self, tres); ! } ! else { ! res = PyString_FromString(Tcl_GetString(tres)); ! } } LEAVE_OVERLAP_TCL From loewis at users.sourceforge.net Fri Oct 3 13:11:47 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 13:11:53 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.58,1.831.4.59 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv30330/Misc Modified Files: Tag: release23-maint NEWS Log Message: Check for TclError when reading variables. Fixes #807314. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.58 retrieving revision 1.831.4.59 diff -C2 -d -r1.831.4.58 -r1.831.4.59 *** NEWS 3 Oct 2003 13:55:37 -0000 1.831.4.58 --- NEWS 3 Oct 2003 17:11:43 -0000 1.831.4.59 *************** *** 15,18 **** --- 15,21 ---- - Patch #813445: Add missing socket.IPPROTO_IPV6. + - Bug #807314: Properly raise an exception if non-existent Tcl + variable is accessed. + What's New in Python 2.3.2 (final)? =================================== From loewis at users.sourceforge.net Fri Oct 3 13:12:28 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 3 13:12:32 2003 Subject: [Python-checkins] python/dist/src/Modules _tkinter.c,1.161,1.162 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv30502/Modules Modified Files: _tkinter.c Log Message: Check for TclError when reading variables. Fixes #807314. Backported to 2.3. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** _tkinter.c 14 Jun 2003 21:34:32 -0000 1.161 --- _tkinter.c 3 Oct 2003 17:12:26 -0000 1.162 *************** *** 1648,1656 **** tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP ! if (((TkappObject*)self)->wantobjects) { ! res = FromObj(self, tres); ! } ! else { ! res = PyString_FromString(Tcl_GetString(tres)); } LEAVE_OVERLAP_TCL --- 1648,1660 ---- tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); ENTER_OVERLAP ! if (tres == NULL) { ! PyErr_SetString(Tkinter_TclError, Tcl_GetStringResult(Tkapp_Interp(self))); ! } else { ! if (((TkappObject*)self)->wantobjects) { ! res = FromObj(self, tres); ! } ! else { ! res = PyString_FromString(Tcl_GetString(tres)); ! } } LEAVE_OVERLAP_TCL From jhylton at users.sourceforge.net Fri Oct 3 16:56:18 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Oct 3 16:56:21 2003 Subject: [Python-checkins] python/dist/src/Misc gdbinit,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv3137 Modified Files: gdbinit Log Message: A helper to dump info about the current frame, assuming it is the variable f. Index: gdbinit =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/gdbinit,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gdbinit 24 Jan 2001 04:18:13 -0000 1.2 --- gdbinit 3 Oct 2003 20:56:15 -0000 1.3 *************** *** 26,27 **** --- 26,36 ---- print _PyGC_Dump($arg0) end + + # If you are in an eval_frame() function, calling pyframe with no + # arguments will print the filename, function name, and line number. + # It assumes that f is the name of the current frame. + define pyframe + x/s ((PyStringObject*)f->f_code->co_filename)->ob_sval + x/s ((PyStringObject*)f->f_code->co_name)->ob_sval + p f->f_lineno + end From bwarsaw at users.sourceforge.net Fri Oct 3 22:28:33 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Fri Oct 3 22:28:36 2003 Subject: [Python-checkins] python/dist/src/Lib gettext.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv29770 Modified Files: gettext.py Log Message: GNUTranslations._parse(): Initialize local variable k so that if the first line of a header section isn't an RFC-ish header, it's just ignored instead of throwing an UnboundLocalError. Backport candidate. Index: gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gettext.py 20 May 2003 17:26:48 -0000 1.21 --- gettext.py 4 Oct 2003 02:28:31 -0000 1.22 *************** *** 262,266 **** if mlen == 0: # Catalog description ! lastk = None for item in tmsg.splitlines(): item = item.strip() --- 262,266 ---- if mlen == 0: # Catalog description ! lastk = k = None for item in tmsg.splitlines(): item = item.strip() From bwarsaw at users.sourceforge.net Fri Oct 3 22:39:13 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Fri Oct 3 22:39:16 2003 Subject: [Python-checkins] python/dist/src/Lib gettext.py,1.21,1.21.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv32501 Modified Files: Tag: release23-maint gettext.py Log Message: GNUTranslations._parse(): Initialize local variable k so that if the first line of a header section isn't an RFC-ish header, it's just ignored instead of throwing an UnboundLocalError. Backported. Index: gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v retrieving revision 1.21 retrieving revision 1.21.8.1 diff -C2 -d -r1.21 -r1.21.8.1 *** gettext.py 20 May 2003 17:26:48 -0000 1.21 --- gettext.py 4 Oct 2003 02:39:11 -0000 1.21.8.1 *************** *** 262,266 **** if mlen == 0: # Catalog description ! lastk = None for item in tmsg.splitlines(): item = item.strip() --- 262,266 ---- if mlen == 0: # Catalog description ! lastk = k = None for item in tmsg.splitlines(): item = item.strip() From anthonybaxter at users.sourceforge.net Fri Oct 3 22:53:12 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Fri Oct 3 22:53:16 2003 Subject: [Python-checkins] python/dist/src/Include patchlevel.h, 2.74.4.4, 2.74.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv3481 Modified Files: Tag: release23-maint patchlevel.h Log Message: post-release. was going to hold off til Jack got a chance to decide on a Mac release, but given the checkins of the last 12 hours, a bit late. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.74.4.4 retrieving revision 2.74.4.5 diff -C2 -d -r2.74.4.4 -r2.74.4.5 *** patchlevel.h 1 Oct 2003 06:47:48 -0000 2.74.4.4 --- patchlevel.h 4 Oct 2003 02:53:10 -0000 2.74.4.5 *************** *** 27,31 **** /* Version as a string */ ! #define PY_VERSION "2.3.2" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 27,31 ---- /* Version as a string */ ! #define PY_VERSION "2.3.2+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From anthonybaxter at users.sourceforge.net Sat Oct 4 02:55:35 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 02:55:40 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.3, 1.271.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv13660 Modified Files: Tag: release23-maint socketmodule.c Log Message: made the SGI INET_ADDRSTRLEN apply for any compiler on Irix. Both the SGI compiler and GCC seem to need this. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.3 retrieving revision 1.271.6.4 diff -C2 -d -r1.271.6.3 -r1.271.6.4 *** socketmodule.c 3 Oct 2003 13:55:37 -0000 1.271.6.3 --- socketmodule.c 4 Oct 2003 06:55:33 -0000 1.271.6.4 *************** *** 195,204 **** #define _SGIAPI 1 - #ifndef ENABLE_IPV6 - #define INET_ADDRSTRLEN 16 - #endif - #define HAVE_INET_PTON #include #endif --- 195,207 ---- #define _SGIAPI 1 #define HAVE_INET_PTON #include + #endif + + /* Irix 6.5 fails to define this variable at all. This is needed + for both GCC and SGI's compiler. I'd say that the SGI headers + are just busted. */ + #if defined(__sgi) && !defined(INET_ADDRSTRLEN) + #define INET_ADDRSTRLEN 16 #endif From anthonybaxter at users.sourceforge.net Sat Oct 4 03:46:25 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 03:46:29 2003 Subject: [Python-checkins] python/dist/src configure, 1.427, 1.428 configure.in, 1.437, 1.438 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv19011 Modified Files: configure configure.in Log Message: FreeBSD 4.8 and MacOS X 10.2 have a broken ncurses.h - if you don't define _XOPEN_EXTENDED_SOURCE, the bug isn't triggered. Testing on FreeBSD shows that nothing is broken by this change. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.427 retrieving revision 1.428 diff -C2 -d -r1.427 -r1.428 *** configure 3 Oct 2003 13:47:32 -0000 1.427 --- configure 4 Oct 2003 07:46:20 -0000 1.428 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.436 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.437 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 1452,1455 **** --- 1452,1461 ---- # but used in struct sockaddr.sa_family. Reported by Tim Rice. SCO_SV/3.2) + define_xopen_source=no;; + # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that + # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently, + # this is fixed in 10.3, which identifies itself as Darwin/7.* + # This should hopefully be fixed in FreeBSD 4.9 + FreeBSD/4.8* | Darwin/6* ) define_xopen_source=no;; esac Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.437 retrieving revision 1.438 diff -C2 -d -r1.437 -r1.438 *** configure.in 3 Oct 2003 13:47:44 -0000 1.437 --- configure.in 4 Oct 2003 07:46:23 -0000 1.438 *************** *** 151,154 **** --- 151,160 ---- SCO_SV/3.2) define_xopen_source=no;; + # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that + # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently, + # this is fixed in 10.3, which identifies itself as Darwin/7.* + # This should hopefully be fixed in FreeBSD 4.9 + FreeBSD/4.8* | Darwin/6* ) + define_xopen_source=no;; esac From anthonybaxter at users.sourceforge.net Sat Oct 4 03:56:18 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 03:56:21 2003 Subject: [Python-checkins] python/dist/src configure, 1.416.4.8, 1.416.4.9 configure.in, 1.427.4.7, 1.427.4.8 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv20067 Modified Files: Tag: release23-maint configure configure.in Log Message: FreeBSD 4.8 and MacOS X 10.2 have a broken ncurses.h - if you don't define _XOPEN_EXTENDED_SOURCE, the bug isn't triggered. Testing on FreeBSD shows that nothing is broken by this change. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.416.4.8 retrieving revision 1.416.4.9 diff -C2 -d -r1.416.4.8 -r1.416.4.9 *** configure 3 Oct 2003 13:48:26 -0000 1.416.4.8 --- configure 4 Oct 2003 07:56:12 -0000 1.416.4.9 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.427.4.6 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.427.4.7 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. *************** *** 1452,1455 **** --- 1452,1461 ---- # but used in struct sockaddr.sa_family. Reported by Tim Rice. SCO_SV/3.2) + define_xopen_source=no;; + # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that + # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently, + # this is fixed in 10.3, which identifies itself as Darwin/7.* + # This should hopefully be fixed in FreeBSD 4.9 + FreeBSD/4.8* | Darwin/6* ) define_xopen_source=no;; esac Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.427.4.7 retrieving revision 1.427.4.8 diff -C2 -d -r1.427.4.7 -r1.427.4.8 *** configure.in 3 Oct 2003 13:48:28 -0000 1.427.4.7 --- configure.in 4 Oct 2003 07:56:14 -0000 1.427.4.8 *************** *** 151,154 **** --- 151,160 ---- SCO_SV/3.2) define_xopen_source=no;; + # On FreeBSD 4.8 and MacOS X 10.2, a bug in ncurses.h means that + # it craps out if _XOPEN_EXTENDED_SOURCE is defined. Apparently, + # this is fixed in 10.3, which identifies itself as Darwin/7.* + # This should hopefully be fixed in FreeBSD 4.9 + FreeBSD/4.8* | Darwin/6* ) + define_xopen_source=no;; esac From anthonybaxter at users.sourceforge.net Sat Oct 4 04:00:52 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 04:00:57 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.274, 1.275 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20395 Modified Files: socketmodule.c Log Message: made the SGI INET_ADDRSTRLEN define apply for any compiler on Irix. Both the SGI compiler and GCC seem to need this. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.274 retrieving revision 1.275 diff -C2 -d -r1.274 -r1.275 *** socketmodule.c 3 Oct 2003 13:56:20 -0000 1.274 --- socketmodule.c 4 Oct 2003 08:00:49 -0000 1.275 *************** *** 195,204 **** #define _SGIAPI 1 - #ifndef ENABLE_IPV6 - #define INET_ADDRSTRLEN 16 - #endif - #define HAVE_INET_PTON #include #endif --- 195,207 ---- #define _SGIAPI 1 #define HAVE_INET_PTON #include + #endif + + /* Irix 6.5 fails to define this variable at all. This is needed + for both GCC and SGI's compiler. I'd say that the SGI headers + are just busted. */ + #if defined(__sgi) && !defined(INET_ADDRSTRLEN) + #define INET_ADDRSTRLEN 16 #endif From anthonybaxter at users.sourceforge.net Sat Oct 4 04:03:36 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 04:03:42 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.59,1.831.4.60 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20886 Modified Files: Tag: release23-maint NEWS Log Message: two bugfixes Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.59 retrieving revision 1.831.4.60 diff -C2 -d -r1.831.4.59 -r1.831.4.60 *** NEWS 3 Oct 2003 17:11:43 -0000 1.831.4.59 --- NEWS 4 Oct 2003 08:03:33 -0000 1.831.4.60 *************** *** 18,21 **** --- 18,25 ---- variable is accessed. + - Bug #811028: ncurses.h breakage on FreeBSD/MacOS X + + - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI + What's New in Python 2.3.2 (final)? =================================== From anthonybaxter at users.sourceforge.net Sat Oct 4 04:04:07 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Sat Oct 4 04:04:13 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.863,1.864 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20928 Modified Files: NEWS Log Message: two bugfixes Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.863 retrieving revision 1.864 diff -C2 -d -r1.863 -r1.864 *** NEWS 3 Oct 2003 14:07:07 -0000 1.863 --- NEWS 4 Oct 2003 08:04:04 -0000 1.864 *************** *** 46,49 **** --- 46,53 ---- - curses module now supports use_default_colors(). [patch #739124] + - Bug #811028: ncurses.h breakage on FreeBSD/MacOS X + + - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI + Library ------- From rhettinger at users.sourceforge.net Sun Oct 5 05:09:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 05:09:20 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.864,1.865 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv30780/Misc Modified Files: NEWS Log Message: SF bug #812202: randint is always even * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.864 retrieving revision 1.865 diff -C2 -d -r1.864 -r1.865 *** NEWS 4 Oct 2003 08:04:04 -0000 1.864 --- NEWS 5 Oct 2003 09:09:13 -0000 1.865 *************** *** 85,88 **** --- 85,96 ---- that successive runs are more likely to produce different sequences. + - random.Random has a new method, getrandbits(k), which returns an int + with k random bits. This method is now an optional part of the API + for user defined generators. Any generator that defines genrandbits() + can now use randrange() for ranges with a length >= 2**53. Formerly, + randrange would return only even numbers for ranges that large (see + SF bug #812202). Generators that do not define genrandbits() now + issue a warning when randrange() is called with a range that large. + - itertools.izip() with no arguments now returns an empty iterator instead of raising a TypeError exception. From rhettinger at users.sourceforge.net Sun Oct 5 05:09:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 05:09:22 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30780/Lib Modified Files: random.py Log Message: SF bug #812202: randint is always even * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** random.py 6 Sep 2003 04:25:54 -0000 1.55 --- random.py 5 Oct 2003 09:09:14 -0000 1.56 *************** *** 40,43 **** --- 40,45 ---- """ + from warnings import warn as _warn + from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethodType from math import log as _log, exp as _exp, pi as _pi, e as _e from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin *************** *** 48,52 **** "expovariate","vonmisesvariate","gammavariate", "gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) --- 50,55 ---- "expovariate","vonmisesvariate","gammavariate", "gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead", "WichmannHill", "getrandbits", ! "Random"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) *************** *** 54,57 **** --- 57,61 ---- LOG4 = _log(4.0) SG_MAGICCONST = 1.0 + _log(4.5) + BPF = 53 # Number of bits in a float # Translated by Guido van Rossum from C source provided by *************** *** 73,76 **** --- 77,82 ---- generator of your own devising: in that case, override the following methods: random(), seed(), getstate(), setstate() and jumpahead(). + Optionally, implement a getrandombits() method so that randrange() + can cover arbitrarily large ranges. """ *************** *** 132,141 **** ## -------------------- integer methods ------------------- ! def randrange(self, start, stop=None, step=1, int=int, default=None): """Choose a random item from range(start, stop[, step]). This fixes the problem with randint() which includes the endpoint; in Python this is usually not what you want. ! Do not supply the 'int' and 'default' arguments. """ --- 138,148 ---- ## -------------------- integer methods ------------------- ! def randrange(self, start, stop=None, step=1, int=int, default=None, ! maxwidth=1L< 0: + if istart >= maxwidth: + return self._randbelow(istart) return int(self.random() * istart) raise ValueError, "empty range for randrange()" *************** *** 154,160 **** if istop != stop: raise ValueError, "non-integer stop for randrange()" ! if step == 1 and istart < istop: # Note that ! # int(istart + self.random()*(istop - istart)) # instead would be incorrect. For example, consider istart # = -2 and istop = 0. Then the guts would be in --- 163,170 ---- if istop != stop: raise ValueError, "non-integer stop for randrange()" ! width = istop - istart ! if step == 1 and width > 0: # Note that ! # int(istart + self.random()*width) # instead would be incorrect. For example, consider istart # = -2 and istop = 0. Then the guts would be in *************** *** 162,173 **** # might return 0.0), and because int() truncates toward 0, the # final result would be -1 or 0 (instead of -2 or -1). ! # istart + int(self.random()*(istop - istart)) # would also be incorrect, for a subtler reason: the RHS # can return a long, and then randrange() would also return # a long, but we're supposed to return an int (for backward # compatibility). ! return int(istart + int(self.random()*(istop - istart))) if step == 1: ! raise ValueError, "empty range for randrange()" # Non-unit step argument supplied. --- 172,186 ---- # might return 0.0), and because int() truncates toward 0, the # final result would be -1 or 0 (instead of -2 or -1). ! # istart + int(self.random()*width) # would also be incorrect, for a subtler reason: the RHS # can return a long, and then randrange() would also return # a long, but we're supposed to return an int (for backward # compatibility). ! ! if width >= maxwidth: ! return int(istart + self._randbelow(width)) ! return int(istart + int(self.random()*width)) if step == 1: ! raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width) # Non-unit step argument supplied. *************** *** 176,182 **** raise ValueError, "non-integer step for randrange()" if istep > 0: ! n = (istop - istart + istep - 1) / istep elif istep < 0: ! n = (istop - istart + istep + 1) / istep else: raise ValueError, "zero step for randrange()" --- 189,195 ---- raise ValueError, "non-integer step for randrange()" if istep > 0: ! n = (width + istep - 1) / istep elif istep < 0: ! n = (width + istep + 1) / istep else: raise ValueError, "zero step for randrange()" *************** *** 184,187 **** --- 197,203 ---- if n <= 0: raise ValueError, "empty range for randrange()" + + if n >= maxwidth: + return istart + self._randbelow(n) return istart + istep*int(self.random() * n) *************** *** 192,195 **** --- 208,238 ---- return self.randrange(a, b+1) + def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L< n-1 > 2**(k-2) + r = getrandbits(k) + while r >= n: + r = getrandbits(k) + return r + if n >= _maxwidth: + _warn("Underlying random() generator does not supply \n" + "enough bits to choose from a population range this large") + return int(self.random() * n) + ## -------------------- sequence methods ------------------- *************** *** 758,761 **** --- 801,805 ---- setstate = _inst.setstate jumpahead = _inst.jumpahead + getrandbits = _inst.getrandbits if __name__ == '__main__': From rhettinger at users.sourceforge.net Sun Oct 5 05:09:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 05:09:24 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_random.py, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv30780/Lib/test Modified Files: test_random.py Log Message: SF bug #812202: randint is always even * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population. Index: test_random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_random.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_random.py 6 Sep 2003 04:25:54 -0000 1.14 --- test_random.py 5 Oct 2003 09:09:15 -0000 1.15 *************** *** 5,8 **** --- 5,9 ---- import time import pickle + import warnings from math import log, exp, sqrt, pi from sets import Set *************** *** 154,157 **** --- 155,165 ---- self.assertEqual(y1, y2) + def test_bigrand(self): + # Verify warnings are raised when randrange is too large for random() + oldfilters = warnings.filters[:] + warnings.filterwarnings("error", "Underlying random") + self.assertRaises(UserWarning, self.gen.randrange, 2**60) + warnings.filters[:] = oldfilters + class MersenneTwister_TestBasicOps(TestBasicOps): gen = random.Random() *************** *** 219,222 **** --- 227,300 ---- seed = (1L << (10000 * 8)) - 1 # about 10K bytes self.gen.seed(seed) + + def test_53_bits_per_float(self): + # This should pass whenever a C double has 53 bit precision. + span = 2 ** 53 + cum = 0 + for i in xrange(100): + cum |= int(self.gen.random() * span) + self.assertEqual(cum, span-1) + + def test_bigrand(self): + # The randrange routine should build-up the required number of bits + # in stages so that all bit positions are active. + span = 2 ** 500 + cum = 0 + for i in xrange(100): + r = self.gen.randrange(span) + self.assert_(0 <= r < span) + cum |= r + self.assertEqual(cum, span-1) + + def test_bigrand_ranges(self): + for i in [40,80, 160, 200, 211, 250, 375, 512, 550]: + start = self.gen.randrange(2 ** i) + stop = self.gen.randrange(2 ** (i-2)) + if stop <= start: + return + self.assert_(start <= self.gen.randrange(start, stop) < stop) + + def test_rangelimits(self): + for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]: + self.assertEqual(Set(range(start,stop)), + Set([self.gen.randrange(start,stop) for i in xrange(100)])) + + def test_genrandbits(self): + # Verify cross-platform repeatability + self.gen.seed(1234567) + self.assertEqual(self.gen.getrandbits(100), + 97904845777343510404718956115L) + # Verify ranges + for k in xrange(1, 1000): + self.assert_(0 <= self.gen.getrandbits(k) < 2**k) + + # Verify all bits active + getbits = self.gen.getrandbits + for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]: + cum = 0 + for i in xrange(100): + cum |= getbits(span) + self.assertEqual(cum, 2**span-1) + + def test_randbelow_logic(self, _log=log, int=int): + # check bitcount transition points: 2**i and 2**(i+1)-1 + # show that: k = int(1.001 + _log(n, 2)) + # is equal to or one greater than the number of bits in n + for i in xrange(1, 1000): + n = 1L << i # check an exact power of two + numbits = i+1 + k = int(1.00001 + _log(n, 2)) + self.assertEqual(k, numbits) + self.assert_(n == 2**(k-1)) + + n += n - 1 # check 1 below the next power of two + k = int(1.00001 + _log(n, 2)) + self.assert_(k in [numbits, numbits+1]) + self.assert_(2**k > n > 2**(k-2)) + + n -= n >> 15 # check a little farther below the next power of two + k = int(1.00001 + _log(n, 2)) + self.assertEqual(k, numbits) # note the stronger assertion + self.assert_(2**k > n > 2**(k-1)) # note the stronger assertion _gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289, From rhettinger at users.sourceforge.net Sun Oct 5 05:09:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 05:09:26 2003 Subject: [Python-checkins] python/dist/src/Doc/lib librandom.tex,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30780/Doc/lib Modified Files: librandom.tex Log Message: SF bug #812202: randint is always even * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population. Index: librandom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librandom.tex,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** librandom.tex 5 Aug 2003 12:23:19 -0000 1.34 --- librandom.tex 5 Oct 2003 09:09:15 -0000 1.35 *************** *** 42,45 **** --- 42,49 ---- the \method{random()}, \method{seed()}, \method{getstate()}, \method{setstate()} and \method{jumpahead()} methods. + Optionally, a new generator can supply a \method{getrandombits()} + method --- this allows \method{randrange()} to produce selections + over an arbitrarily large range. + \versionadded[the \method{getrandombits()} method]{2.4} As an example of subclassing, the \module{random} module provides *************** *** 93,96 **** --- 97,108 ---- \end{funcdesc} + \begin{funcdesc}{getrandbits}{k} + Returns a python \class{long} int with \var{k} random bits. + This method is supplied with the MersenneTwister generator and some + other generators may also provide it as an optional part of the API. + When available, \method{getrandbits()} enables \method{randrange()} + to handle arbitrarily large ranges. + \versionadded{2.4} + \end{funcdesc} Functions for integers: From rhettinger at users.sourceforge.net Sun Oct 5 05:09:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 05:09:28 2003 Subject: [Python-checkins] python/dist/src/Modules _randommodule.c,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv30780/Modules Modified Files: _randommodule.c Log Message: SF bug #812202: randint is always even * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population. Index: _randommodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_randommodule.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** _randommodule.c 23 May 2003 03:55:41 -0000 1.6 --- _randommodule.c 5 Oct 2003 09:09:15 -0000 1.7 *************** *** 436,439 **** --- 436,480 ---- static PyObject * + random_getrandbits(RandomObject *self, PyObject *args) + { + int k, i, bytes; + unsigned long r; + unsigned char *bytearray; + PyObject *result; + + if (!PyArg_ParseTuple(args, "i:getrandbits", &k)) + return NULL; + + if (k <= 0) { + PyErr_SetString(PyExc_ValueError, + "number of bits must be greater than zero"); + return NULL; + } + + bytes = ((k - 1) / 32 + 1) * 4; + bytearray = (unsigned char *)PyMem_Malloc(bytes); + if (bytearray == NULL) { + PyErr_NoMemory(); + return NULL; + } + + /* Fill-out whole words, byte-by-byte to avoid endianness issues */ + for (i=0 ; i>= (32 - k); + bytearray[i+0] = (unsigned char)r; + bytearray[i+1] = (unsigned char)(r >> 8); + bytearray[i+2] = (unsigned char)(r >> 16); + bytearray[i+3] = (unsigned char)(r >> 24); + } + + /* little endian order to match bytearray assignment order */ + result = _PyLong_FromByteArray(bytearray, bytes, 1, 0); + PyMem_Free(bytearray); + return result; + } + + static PyObject * random_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { *************** *** 465,468 **** --- 506,512 ---- PyDoc_STR("jumpahead(int) -> None. Create new state from " "existing state and integer.")}, + {"getrandbits", (PyCFunction)random_getrandbits, METH_VARARGS, + PyDoc_STR("getrandbits(k) -> x. Generates a long int with " + "k random bits.")}, {NULL, NULL} /* sentinel */ }; From rhettinger at users.sourceforge.net Sun Oct 5 12:47:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 12:47:42 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.17, 1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv10364/Doc/lib Modified Files: libitertools.tex Log Message: Adopt Christian Stork's suggested argument order for the logic quantifiers. Adopt Jeremy Fincher's suggested function name, "any", instead of "some". Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** libitertools.tex 22 Sep 2003 15:00:55 -0000 1.17 --- libitertools.tex 5 Oct 2003 16:47:36 -0000 1.18 *************** *** 345,361 **** return list(islice(iterable, n, n+1)) ! def all(pred, seq): "Returns True if pred(x) is True for every element in the iterable" return False not in imap(pred, seq) ! def some(pred, seq): "Returns True if pred(x) is True at least one element in the iterable" return True in imap(pred, seq) ! def no(pred, seq): "Returns True if pred(x) is False for every element in the iterable" return True not in imap(pred, seq) ! def quantify(pred, seq): "Count how many times the predicate is True in the sequence" return sum(imap(pred, seq)) --- 345,361 ---- return list(islice(iterable, n, n+1)) ! def all(seq, pred=bool): "Returns True if pred(x) is True for every element in the iterable" return False not in imap(pred, seq) ! def any(seq, pred=bool): "Returns True if pred(x) is True at least one element in the iterable" return True in imap(pred, seq) ! def no(seq, pred=bool): "Returns True if pred(x) is False for every element in the iterable" return True not in imap(pred, seq) ! def quantify(seq, pred=bool): "Count how many times the predicate is True in the sequence" return sum(imap(pred, seq)) From rhettinger at users.sourceforge.net Sun Oct 5 12:47:38 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 12:47:44 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.20, 1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv10364/Lib/test Modified Files: test_itertools.py Log Message: Adopt Christian Stork's suggested argument order for the logic quantifiers. Adopt Jeremy Fincher's suggested function name, "any", instead of "some". Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_itertools.py 13 Sep 2003 01:01:34 -0000 1.20 --- test_itertools.py 5 Oct 2003 16:47:36 -0000 1.21 *************** *** 505,521 **** ... return list(islice(iterable, n, n+1)) ! >>> def all(pred, seq): ... "Returns True if pred(x) is True for every element in the iterable" ... return False not in imap(pred, seq) ! >>> def some(pred, seq): ... "Returns True if pred(x) is True for at least one element in the iterable" ... return True in imap(pred, seq) ! >>> def no(pred, seq): ... "Returns True if pred(x) is False for every element in the iterable" ... return True not in imap(pred, seq) ! >>> def quantify(pred, seq): ... "Count how many times the predicate is True in the sequence" ... return sum(imap(pred, seq)) --- 505,521 ---- ... return list(islice(iterable, n, n+1)) ! >>> def all(seq, pred=bool): ... "Returns True if pred(x) is True for every element in the iterable" ... return False not in imap(pred, seq) ! >>> def any(seq, pred=bool): ... "Returns True if pred(x) is True for at least one element in the iterable" ... return True in imap(pred, seq) ! >>> def no(seq, pred=bool): ... "Returns True if pred(x) is False for every element in the iterable" ... return True not in imap(pred, seq) ! >>> def quantify(seq, pred=bool): ... "Count how many times the predicate is True in the sequence" ... return sum(imap(pred, seq)) *************** *** 572,594 **** ['d'] ! >>> all(lambda x: x%2==0, [2, 4, 6, 8]) True ! >>> all(lambda x: x%2==0, [2, 3, 6, 8]) False ! >>> some(lambda x: x%2==0, [2, 4, 6, 8]) True ! >>> some(lambda x: x%2==0, [1, 3, 5, 9]) False ! >>> no(lambda x: x%2==0, [1, 3, 5, 9]) True ! >>> no(lambda x: x%2==0, [1, 2, 5, 9]) False ! >>> quantify(lambda x: x%2==0, xrange(99)) 50 --- 572,594 ---- ['d'] ! >>> all([2, 4, 6, 8], lambda x: x%2==0) True ! >>> all([2, 3, 6, 8], lambda x: x%2==0) False ! >>> any([2, 4, 6, 8], lambda x: x%2==0) True ! >>> any([1, 3, 5, 9], lambda x: x%2==0,) False ! >>> no([1, 3, 5, 9], lambda x: x%2==0) True ! >>> no([1, 2, 5, 9], lambda x: x%2==0) False ! >>> quantify(xrange(99), lambda x: x%2==0) 50 From rhettinger at users.sourceforge.net Sun Oct 5 19:05:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 19:06:01 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.15.6.3, 1.15.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv13802/Lib/test Modified Files: Tag: release23-maint test_itertools.py Log Message: Adopt Christian Stork's suggested argument order for quantifier examples. Adopt Jeremy Fincher's suggested function name, "any", instead of "some". Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.15.6.3 retrieving revision 1.15.6.4 diff -C2 -d -r1.15.6.3 -r1.15.6.4 *** test_itertools.py 2 Sep 2003 04:19:02 -0000 1.15.6.3 --- test_itertools.py 5 Oct 2003 23:05:55 -0000 1.15.6.4 *************** *** 502,518 **** ... return list(islice(iterable, n, n+1)) ! >>> def all(pred, seq): ... "Returns True if pred(x) is True for every element in the iterable" ... return False not in imap(pred, seq) ! >>> def some(pred, seq): ... "Returns True if pred(x) is True for at least one element in the iterable" ... return True in imap(pred, seq) ! >>> def no(pred, seq): ... "Returns True if pred(x) is False for every element in the iterable" ... return True not in imap(pred, seq) ! >>> def quantify(pred, seq): ... "Count how many times the predicate is True in the sequence" ... return sum(imap(pred, seq)) --- 502,518 ---- ... return list(islice(iterable, n, n+1)) ! >>> def all(seq, pred=bool): ... "Returns True if pred(x) is True for every element in the iterable" ... return False not in imap(pred, seq) ! >>> def any(seq, pred=bool): ... "Returns True if pred(x) is True for at least one element in the iterable" ... return True in imap(pred, seq) ! >>> def no(seq, pred=bool): ... "Returns True if pred(x) is False for every element in the iterable" ... return True not in imap(pred, seq) ! >>> def quantify(seq, pred=bool): ... "Count how many times the predicate is True in the sequence" ... return sum(imap(pred, seq)) *************** *** 555,577 **** ['d'] ! >>> all(lambda x: x%2==0, [2, 4, 6, 8]) True ! >>> all(lambda x: x%2==0, [2, 3, 6, 8]) False ! >>> some(lambda x: x%2==0, [2, 4, 6, 8]) True ! >>> some(lambda x: x%2==0, [1, 3, 5, 9]) False ! >>> no(lambda x: x%2==0, [1, 3, 5, 9]) True ! >>> no(lambda x: x%2==0, [1, 2, 5, 9]) False ! >>> quantify(lambda x: x%2==0, xrange(99)) 50 --- 555,577 ---- ['d'] ! >>> all([2, 4, 6, 8], lambda x: x%2==0) True ! >>> all([2, 3, 6, 8], lambda x: x%2==0) False ! >>> any([2, 4, 6, 8], lambda x: x%2==0) True ! >>> any([1, 3, 5, 9], lambda x: x%2==0,) False ! >>> no([1, 3, 5, 9], lambda x: x%2==0) True ! >>> no([1, 2, 5, 9], lambda x: x%2==0) False ! >>> quantify(xrange(99), lambda x: x%2==0) 50 From rhettinger at users.sourceforge.net Sun Oct 5 19:05:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 19:06:03 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12.6.5, 1.12.6.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13802/Doc/lib Modified Files: Tag: release23-maint libitertools.tex Log Message: Adopt Christian Stork's suggested argument order for quantifier examples. Adopt Jeremy Fincher's suggested function name, "any", instead of "some". Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12.6.5 retrieving revision 1.12.6.6 diff -C2 -d -r1.12.6.5 -r1.12.6.6 *** libitertools.tex 22 Sep 2003 15:50:51 -0000 1.12.6.5 --- libitertools.tex 5 Oct 2003 23:05:56 -0000 1.12.6.6 *************** *** 345,361 **** return list(islice(iterable, n, n+1)) ! def all(pred, seq): "Returns True if pred(x) is True for every element in the iterable" return False not in imap(pred, seq) ! def some(pred, seq): "Returns True if pred(x) is True at least one element in the iterable" return True in imap(pred, seq) ! def no(pred, seq): "Returns True if pred(x) is False for every element in the iterable" return True not in imap(pred, seq) ! def quantify(pred, seq): "Count how many times the predicate is True in the sequence" return sum(imap(pred, seq)) --- 345,361 ---- return list(islice(iterable, n, n+1)) ! def all(seq, pred=bool): "Returns True if pred(x) is True for every element in the iterable" return False not in imap(pred, seq) ! def any(seq, pred=bool): "Returns True if pred(x) is True at least one element in the iterable" return True in imap(pred, seq) ! def no(seq, pred=bool): "Returns True if pred(x) is False for every element in the iterable" return True not in imap(pred, seq) ! def quantify(seq, pred=bool): "Count how many times the predicate is True in the sequence" return sum(imap(pred, seq)) From goodger at users.sourceforge.net Sun Oct 5 19:34:59 2003 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sun Oct 5 19:35:02 2003 Subject: [Python-checkins] python/nondist/peps pep-0754.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv17848 Modified Files: pep-0754.txt Log Message: updated from author Index: pep-0754.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0754.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0754.txt 14 May 2003 22:23:07 -0000 1.2 --- pep-0754.txt 5 Oct 2003 23:34:56 -0000 1.3 *************** *** 172,176 **** .. [1] Further information on the reference package is available at ! http://software.biostat.washington.edu/statsoft/snake/fpconst. --- 172,176 ---- .. [1] Further information on the reference package is available at ! http://www.analytics.washington.edu/Zope/projects/fpconst/ From rhettinger at users.sourceforge.net Sun Oct 5 19:35:40 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 19:35:44 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.51.8.3,1.51.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv17515/Lib Modified Files: Tag: release23-maint random.py Log Message: SF bug #812202: randint is always even * Extend rangrange() to return meaningful results when the range is larger than 2**53. Only applies to the MersenneTwister. WichmannHill was left alone in the absence of a proof showing how multiple calls could be combined to produce long bit streams. * WichmannHill was missing from __all__. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.51.8.3 retrieving revision 1.51.8.4 diff -C2 -d -r1.51.8.3 -r1.51.8.4 *** random.py 8 Sep 2003 19:15:43 -0000 1.51.8.3 --- random.py 5 Oct 2003 23:35:38 -0000 1.51.8.4 *************** *** 39,43 **** """ ! from math import log as _log, exp as _exp, pi as _pi, e as _e from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin --- 39,43 ---- """ ! from types import BuiltinMethodType as _BuiltinMethodType from math import log as _log, exp as _exp, pi as _pi, e as _e from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin *************** *** 48,52 **** "cunifvariate","expovariate","vonmisesvariate","gammavariate", "stdgamma","gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) --- 48,52 ---- "cunifvariate","expovariate","vonmisesvariate","gammavariate", "stdgamma","gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead", "WichmannHill"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) *************** *** 54,57 **** --- 54,58 ---- LOG4 = _log(4.0) SG_MAGICCONST = 1.0 + _log(4.5) + BPF = 53 # Number of bits in a float # Translated by Guido van Rossum from C source provided by *************** *** 132,141 **** ## -------------------- integer methods ------------------- ! def randrange(self, start, stop=None, step=1, int=int, default=None): """Choose a random item from range(start, stop[, step]). This fixes the problem with randint() which includes the endpoint; in Python this is usually not what you want. ! Do not supply the 'int' and 'default' arguments. """ --- 133,143 ---- ## -------------------- integer methods ------------------- ! def randrange(self, start, stop=None, step=1, int=int, default=None, ! maxwidth=1L< 0: + if istart >= maxwidth and type(self.random) is _BuiltinMethod: + return self._randbelow(istart) return int(self.random() * istart) raise ValueError, "empty range for randrange()" *************** *** 154,158 **** if istop != stop: raise ValueError, "non-integer stop for randrange()" ! if step == 1 and istart < istop: # Note that # int(istart + self.random()*(istop - istart)) --- 158,163 ---- if istop != stop: raise ValueError, "non-integer stop for randrange()" ! width = istop - istart ! if step == 1 and width > 0: # Note that # int(istart + self.random()*(istop - istart)) *************** *** 167,171 **** # a long, but we're supposed to return an int (for backward # compatibility). ! return int(istart + int(self.random()*(istop - istart))) if step == 1: raise ValueError, "empty range for randrange()" --- 172,178 ---- # a long, but we're supposed to return an int (for backward # compatibility). ! if width >= maxwidth and type(self.random) is _BuiltinMethod: ! return int(istart + self._randbelow(width)) ! return int(istart + int(self.random()*width)) if step == 1: raise ValueError, "empty range for randrange()" *************** *** 176,182 **** raise ValueError, "non-integer step for randrange()" if istep > 0: ! n = (istop - istart + istep - 1) / istep elif istep < 0: ! n = (istop - istart + istep + 1) / istep else: raise ValueError, "zero step for randrange()" --- 183,189 ---- raise ValueError, "non-integer step for randrange()" if istep > 0: ! n = (width + istep - 1) / istep elif istep < 0: ! n = (width + istep + 1) / istep else: raise ValueError, "zero step for randrange()" *************** *** 184,187 **** --- 191,197 ---- if n <= 0: raise ValueError, "empty range for randrange()" + + if n >= maxwidth and type(self.random) is _BuiltinMethod: + return istart + self._randbelow(n) return istart + istep*int(self.random() * n) *************** *** 191,194 **** --- 201,227 ---- return self.randrange(a, b+1) + + def _randbelow(self, n, bpf=BPF, maxwidth=1L< n-1 >= 2**(k-2) + + random = self.random + r = n + while r >= n: + # In Py2.4, this section becomes: r = self.getrandbits(k) + r = long(random() * maxwidth) + bits = bpf + while bits < k: + r = (r << bpf) | (long(random() * maxwidth)) + bits += bpf + r >>= (bits - k) + return r ## -------------------- sequence methods ------------------- From rhettinger at users.sourceforge.net Sun Oct 5 19:35:40 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 19:35:45 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_random.py, 1.12.8.2, 1.12.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv17515/Lib/test Modified Files: Tag: release23-maint test_random.py Log Message: SF bug #812202: randint is always even * Extend rangrange() to return meaningful results when the range is larger than 2**53. Only applies to the MersenneTwister. WichmannHill was left alone in the absence of a proof showing how multiple calls could be combined to produce long bit streams. * WichmannHill was missing from __all__. Index: test_random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_random.py,v retrieving revision 1.12.8.2 retrieving revision 1.12.8.3 diff -C2 -d -r1.12.8.2 -r1.12.8.3 *** test_random.py 5 Sep 2003 21:40:30 -0000 1.12.8.2 --- test_random.py 5 Oct 2003 23:35:38 -0000 1.12.8.3 *************** *** 221,224 **** --- 221,256 ---- self.gen.seed(seed) + def test_53_bits_per_float(self): + # This should pass whenever a C double has 53 bit precision. + span = 2 ** 53 + cum = 0 + for i in xrange(100): + cum |= int(self.gen.random() * span) + self.assertEqual(cum, span-1) + + def test_bigrand(self): + # The randrange routine should build-up the required number of bits + # in stages so that all bit positions are active. + span = 2 ** 500 + cum = 0 + for i in xrange(100): + r = self.gen.randrange(span) + self.assert_(0 <= r < span) + cum |= r + self.assertEqual(cum, span-1) + + def test_bigrand_ranges(self): + for i in [40,80, 160, 200, 211, 250, 375, 512, 550]: + start = self.gen.randrange(2 ** i) + stop = self.gen.randrange(2 ** (i-2)) + if stop <= start: + return + self.assert_(start <= self.gen.randrange(start, stop) < stop) + + def test_rangelimits(self): + for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]: + self.assertEqual(Set(range(start,stop)), + Set([self.gen.randrange(start,stop) for i in xrange(100)])) + _gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289, 771.3234287757674, -176.6150291498386, 12.50734324009056, From rhettinger at users.sourceforge.net Sun Oct 5 19:35:40 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 5 19:35:47 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.60,1.831.4.61 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv17515/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF bug #812202: randint is always even * Extend rangrange() to return meaningful results when the range is larger than 2**53. Only applies to the MersenneTwister. WichmannHill was left alone in the absence of a proof showing how multiple calls could be combined to produce long bit streams. * WichmannHill was missing from __all__. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.60 retrieving revision 1.831.4.61 diff -C2 -d -r1.831.4.60 -r1.831.4.61 *** NEWS 4 Oct 2003 08:03:33 -0000 1.831.4.60 --- NEWS 5 Oct 2003 23:35:38 -0000 1.831.4.61 *************** *** 22,25 **** --- 22,31 ---- - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI + Library + ------- + + - Bug #812202: random.randrange() returned only even numbers + for range lengths above 2**53. + What's New in Python 2.3.2 (final)? =================================== From jhylton at users.sourceforge.net Mon Oct 6 01:08:28 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon Oct 6 01:08:31 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.198, 2.199 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv28712/Objects Modified Files: unicodeobject.c Log Message: Fix for SF bug [ 817156 ] invalid \U escape gives 0=length unistr. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.198 retrieving revision 2.199 diff -C2 -d -r2.198 -r2.199 *** unicodeobject.c 16 Sep 2003 20:30:58 -0000 2.198 --- unicodeobject.c 6 Oct 2003 05:08:26 -0000 2.199 *************** *** 1751,1755 **** } s += i; ! if (chr == 0xffffffff) /* _decoding_error will have already written into the target buffer. */ --- 1751,1755 ---- } s += i; ! if (chr == 0xffffffff && PyErr_Occurred()) /* _decoding_error will have already written into the target buffer. */ From jhylton at users.sourceforge.net Mon Oct 6 01:08:28 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon Oct 6 01:08:34 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py, 1.85, 1.86 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv28712/Lib/test Modified Files: test_unicode.py Log Message: Fix for SF bug [ 817156 ] invalid \U escape gives 0=length unistr. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** test_unicode.py 5 Aug 2003 06:19:47 -0000 1.85 --- test_unicode.py 6 Oct 2003 05:08:26 -0000 1.86 *************** *** 34,37 **** --- 34,44 ---- self.assert_(object is not realresult) + def test_literals(self): + self.assertEqual(u'\xff', u'\u00ff') + self.assertEqual(u'\uffff', u'\U0000ffff') + self.assertRaises(UnicodeError, eval, 'u\'\\Ufffffffe\'') + self.assertRaises(UnicodeError, eval, 'u\'\\Uffffffff\'') + self.assertRaises(UnicodeError, eval, 'u\'\\U%08x\'' % 0x110000) + def test_repr(self): if not sys.platform.startswith('java'): From jhylton at users.sourceforge.net Mon Oct 6 01:15:16 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon Oct 6 01:15:22 2003 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv29488/Lib Modified Files: urllib2.py Log Message: SF patch [ 816787 ] urllib2.URLError don't calll IOError.__init__ Not sure if this fix is great, but it's probably a small improvement. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** urllib2.py 12 Jul 2003 07:33:32 -0000 1.53 --- urllib2.py 6 Oct 2003 05:15:13 -0000 1.54 *************** *** 146,151 **** class URLError(IOError): # URLError is a sub-type of IOError, but it doesn't share any of ! # the implementation. need to override __init__ and __str__ def __init__(self, reason): self.reason = reason --- 146,155 ---- class URLError(IOError): # URLError is a sub-type of IOError, but it doesn't share any of ! # the implementation. need to override __init__ and __str__. ! # It sets self.args for compatibility with other EnvironmentError ! # subclasses, but args doesn't have the typical format with errno in ! # slot 0 and strerror in slot 1. This may be better than nothing. def __init__(self, reason): + self.args = reason, self.reason = reason From fdrake at users.sourceforge.net Mon Oct 6 11:24:28 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Oct 6 11:24:31 2003 Subject: [Python-checkins] python/nondist/peps pep-0101.txt,1.46,1.47 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv22734 Modified Files: pep-0101.txt Log Message: when documentation is unpacked on the python.org server, directory permissions must be updated so the other webmasters can help manage the content Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** pep-0101.txt 3 Oct 2003 15:31:36 -0000 1.46 --- pep-0101.txt 6 Oct 2003 15:24:25 -0000 1.47 *************** *** 291,294 **** --- 291,295 ---- /ftp/ftp.python.org/pub/python/doc/$VERSION/html-$VERSION.tar.bz2 $ mv Python-Docs-$VERSION $VERSION + $ find $VERSION -type d | xargs chmod g+s Now head back to your pydotorg checkout on your workstation, and From loewis at users.sourceforge.net Mon Oct 6 17:34:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 6 17:34:22 2003 Subject: [Python-checkins] python/dist/src/Lib popen2.py,1.27,1.27.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv21437 Modified Files: Tag: release23-maint popen2.py Log Message: Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Index: popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v retrieving revision 1.27 retrieving revision 1.27.6.1 diff -C2 -d -r1.27 -r1.27.6.1 *** popen2.py 7 Jul 2003 21:36:19 -0000 1.27 --- popen2.py 6 Oct 2003 21:34:14 -0000 1.27.6.1 *************** *** 12,16 **** __all__ = ["popen2", "popen3", "popen4"] ! MAXFD = 256 # Max number of file descriptors (os.getdtablesize()???) _active = [] --- 12,19 ---- __all__ = ["popen2", "popen3", "popen4"] ! try: ! MAXFD = os.sysconf('SC_OPEN_MAX') ! except (AttributeError, ValueError): ! MAXFD = 256 _active = [] From loewis at users.sourceforge.net Mon Oct 6 17:34:35 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 6 17:34:39 2003 Subject: [Python-checkins] python/dist/src/Lib popen2.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv21578 Modified Files: popen2.py Log Message: Patch #817329: Use SC_OPEN_MAX to determine MAXFD. Backported to 2.3. Index: popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** popen2.py 7 Jul 2003 21:36:19 -0000 1.27 --- popen2.py 6 Oct 2003 21:34:33 -0000 1.28 *************** *** 12,16 **** __all__ = ["popen2", "popen3", "popen4"] ! MAXFD = 256 # Max number of file descriptors (os.getdtablesize()???) _active = [] --- 12,19 ---- __all__ = ["popen2", "popen3", "popen4"] ! try: ! MAXFD = os.sysconf('SC_OPEN_MAX') ! except (AttributeError, ValueError): ! MAXFD = 256 _active = [] From akuchling at users.sourceforge.net Tue Oct 7 08:16:06 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Oct 7 08:16:09 2003 Subject: [Python-checkins] python/nondist/peps pep-0321.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv15789 Modified Files: pep-0321.txt Log Message: Record a relevant link Index: pep-0321.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0321.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0321.txt 16 Sep 2003 12:07:56 -0000 1.1 --- pep-0321.txt 7 Oct 2003 12:16:04 -0000 1.2 *************** *** 103,106 **** --- 103,111 ---- d = datetime.datetime(...) print d.rfc822_time() + + + Relevant functionality in other languages includes the `PHP date`_ + function (Python implementation by Simon Willison at + http://simon.incutio.com/archive/2003/10/07/dateInPython) *************** *** 115,118 **** --- 120,125 ---- .. _ctime: http://www.opengroup.org/onlinepubs/007908799/xsh/asctime.html + + .. _PHP date: http://www.php.net/date Other useful links: From theller at users.sourceforge.net Wed Oct 8 08:01:36 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 8 08:01:39 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex,1.57,1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv11003 Modified Files: dist.tex Log Message: Fix a typo, discovered by Joonas Paalasmaa. Backported to 2.3 Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** dist.tex 17 Sep 2003 17:11:01 -0000 1.57 --- dist.tex 8 Oct 2003 12:01:33 -0000 1.58 *************** *** 556,561 **** \begin{verbatim} Extension(..., ! define_macros=[('NDEBUG', '1')], ! ('HAVE_STRFTIME', None), undef_macros=['HAVE_FOO', 'HAVE_BAR']) \end{verbatim} --- 556,561 ---- \begin{verbatim} Extension(..., ! define_macros=[('NDEBUG', '1'), ! ('HAVE_STRFTIME', None)], undef_macros=['HAVE_FOO', 'HAVE_BAR']) \end{verbatim} From theller at users.sourceforge.net Wed Oct 8 08:02:47 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 8 08:02:51 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex, 1.56.8.1, 1.56.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv11134 Modified Files: Tag: release23-maint dist.tex Log Message: Fix a typo, discovered by Joonas Paalasmaa. Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.56.8.1 retrieving revision 1.56.8.2 diff -C2 -d -r1.56.8.1 -r1.56.8.2 *** dist.tex 17 Sep 2003 17:12:31 -0000 1.56.8.1 --- dist.tex 8 Oct 2003 12:02:44 -0000 1.56.8.2 *************** *** 556,561 **** \begin{verbatim} Extension(..., ! define_macros=[('NDEBUG', '1')], ! ('HAVE_STRFTIME', None), undef_macros=['HAVE_FOO', 'HAVE_BAR']) \end{verbatim} --- 556,561 ---- \begin{verbatim} Extension(..., ! define_macros=[('NDEBUG', '1'), ! ('HAVE_STRFTIME', None)], undef_macros=['HAVE_FOO', 'HAVE_BAR']) \end{verbatim} From gvanrossum at users.sourceforge.net Wed Oct 8 17:05:41 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed Oct 8 17:05:45 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.244,2.245 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv28149 Modified Files: typeobject.c Log Message: SF patch #820195 by Wojtek Walczak (gminick at users.sourceforge.net): make obj.__contains__() returns True/False instead of 1/0. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.244 retrieving revision 2.245 diff -C2 -d -r2.244 -r2.245 *** typeobject.c 15 Aug 2003 13:07:46 -0000 2.244 --- typeobject.c 8 Oct 2003 21:05:38 -0000 2.245 *************** *** 3570,3574 **** objobjproc func = (objobjproc)wrapped; int res; ! PyObject *value; if (!PyArg_ParseTuple(args, "O", &value)) --- 3570,3574 ---- objobjproc func = (objobjproc)wrapped; int res; ! PyObject *value, *ret; if (!PyArg_ParseTuple(args, "O", &value)) *************** *** 3577,3581 **** if (res == -1 && PyErr_Occurred()) return NULL; ! return PyInt_FromLong((long)res); } --- 3577,3583 ---- if (res == -1 && PyErr_Occurred()) return NULL; ! ret = PyObject_IsTrue(PyInt_FromLong((long)res)) ? Py_True : Py_False; ! Py_INCREF(ret); ! return ret; } From gvanrossum at users.sourceforge.net Wed Oct 8 17:08:32 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed Oct 8 17:08:35 2003 Subject: [Python-checkins] python/dist/src/Misc ACKS, 1.247, 1.248 NEWS, 1.865, 1.866 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv29291 Modified Files: ACKS NEWS Log Message: SF patch #820195 by Wojtek Walczak (gminick at users.sourceforge.net): make obj.__contains__() returns True/False instead of 1/0. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.247 retrieving revision 1.248 diff -C2 -d -r1.247 -r1.248 *** ACKS 2 Sep 2003 02:13:42 -0000 1.247 --- ACKS 8 Oct 2003 21:08:29 -0000 1.248 *************** *** 573,576 **** --- 573,577 ---- Richard Walker Larry Wall + Wojtek Walczak Greg Ward Barry Warsaw Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.865 retrieving revision 1.866 diff -C2 -d -r1.865 -r1.866 *** NEWS 5 Oct 2003 09:09:13 -0000 1.865 --- NEWS 8 Oct 2003 21:08:29 -0000 1.866 *************** *** 31,34 **** --- 31,37 ---- a TypeError exception. + - obj.__contains__() now returns True/False instead of 1/0. SF patch + 820195. + Extension modules ----------------- From gvanrossum at users.sourceforge.net Wed Oct 8 23:46:38 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed Oct 8 23:46:41 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.245,2.246 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv27690 Modified Files: typeobject.c Log Message: Fix leak introduced by previous typeobject.c checkin. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.245 retrieving revision 2.246 diff -C2 -d -r2.245 -r2.246 *** typeobject.c 8 Oct 2003 21:05:38 -0000 2.245 --- typeobject.c 9 Oct 2003 03:46:35 -0000 2.246 *************** *** 3570,3574 **** objobjproc func = (objobjproc)wrapped; int res; ! PyObject *value, *ret; if (!PyArg_ParseTuple(args, "O", &value)) --- 3570,3574 ---- objobjproc func = (objobjproc)wrapped; int res; ! PyObject *value; if (!PyArg_ParseTuple(args, "O", &value)) *************** *** 3577,3583 **** if (res == -1 && PyErr_Occurred()) return NULL; ! ret = PyObject_IsTrue(PyInt_FromLong((long)res)) ? Py_True : Py_False; ! Py_INCREF(ret); ! return ret; } --- 3577,3582 ---- if (res == -1 && PyErr_Occurred()) return NULL; ! else ! return PyBool_FromLong(res); } From gvanrossum at users.sourceforge.net Wed Oct 8 23:47:10 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed Oct 8 23:47:13 2003 Subject: [Python-checkins] python/dist/src/Objects descrobject.c,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv27765 Modified Files: descrobject.c Log Message: Return a bool rather than an int from proxy_has_key(). Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** descrobject.c 1 Sep 2003 22:12:07 -0000 2.36 --- descrobject.c 9 Oct 2003 03:47:08 -0000 2.37 *************** *** 710,714 **** proxy_has_key(proxyobject *pp, PyObject *key) { ! return PyInt_FromLong(PySequence_Contains(pp->dict, key)); } --- 710,717 ---- proxy_has_key(proxyobject *pp, PyObject *key) { ! int res = PySequence_Contains(pp->dict, key); ! if (res < 0) ! return NULL; ! return PyBool_FromLong(res); } From rhettinger at users.sourceforge.net Thu Oct 9 16:51:09 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 9 16:51:12 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.61,1.831.4.62 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20144/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF patch #820195: make object.__contains__() returns True or False instead of 1 or 0. Backport Guido's fix to the default __contains__() and to proxy_has_key() so they will properly return booleans instead of integers. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.61 retrieving revision 1.831.4.62 diff -C2 -d -r1.831.4.61 -r1.831.4.62 *** NEWS 5 Oct 2003 23:35:38 -0000 1.831.4.61 --- NEWS 9 Oct 2003 20:51:06 -0000 1.831.4.62 *************** *** 10,13 **** --- 10,19 ---- *Release date: XXX * + Core and builtins + ----------------- + + - Patch #820195: object.__contains__() now returns True or False instead + of 1 or 0. + Extension modules ----------------- From rhettinger at users.sourceforge.net Thu Oct 9 16:51:09 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 9 16:51:15 2003 Subject: [Python-checkins] python/dist/src/Objects descrobject.c, 2.35.10.1, 2.35.10.2 typeobject.c, 2.241.6.1, 2.241.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv20144/Objects Modified Files: Tag: release23-maint descrobject.c typeobject.c Log Message: SF patch #820195: make object.__contains__() returns True or False instead of 1 or 0. Backport Guido's fix to the default __contains__() and to proxy_has_key() so they will properly return booleans instead of integers. Index: descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.35.10.1 retrieving revision 2.35.10.2 diff -C2 -d -r2.35.10.1 -r2.35.10.2 *** descrobject.c 1 Sep 2003 22:14:42 -0000 2.35.10.1 --- descrobject.c 9 Oct 2003 20:51:07 -0000 2.35.10.2 *************** *** 710,714 **** proxy_has_key(proxyobject *pp, PyObject *key) { ! return PyInt_FromLong(PySequence_Contains(pp->dict, key)); } --- 710,717 ---- proxy_has_key(proxyobject *pp, PyObject *key) { ! int res = PySequence_Contains(pp->dict, key); ! if (res < 0) ! return NULL; ! return PyBool_FromLong(res); } Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241.6.1 retrieving revision 2.241.6.2 diff -C2 -d -r2.241.6.1 -r2.241.6.2 *** typeobject.c 7 Aug 2003 15:08:55 -0000 2.241.6.1 --- typeobject.c 9 Oct 2003 20:51:07 -0000 2.241.6.2 *************** *** 3563,3567 **** if (res == -1 && PyErr_Occurred()) return NULL; ! return PyInt_FromLong((long)res); } --- 3563,3568 ---- if (res == -1 && PyErr_Occurred()) return NULL; ! else ! return PyBool_FromLong(res); } From bwarsaw at users.sourceforge.net Thu Oct 9 18:44:07 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu Oct 9 18:44:10 2003 Subject: [Python-checkins] python/dist/src/Lib SocketServer.py,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv9483 Modified Files: SocketServer.py Log Message: TCPServer: Fixed typo in class docstring. Backport candidate. Index: SocketServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SocketServer.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** SocketServer.py 2 Jan 2003 03:07:48 -0000 1.35 --- SocketServer.py 9 Oct 2003 22:44:05 -0000 1.36 *************** *** 305,309 **** - socket_type - request_queue_size (only for stream sockets) ! - reuse_address Instance variables: --- 305,309 ---- - socket_type - request_queue_size (only for stream sockets) ! - allow_reuse_address Instance variables: From bwarsaw at users.sourceforge.net Thu Oct 9 19:48:54 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu Oct 9 19:50:18 2003 Subject: [Python-checkins] python/dist/src/Lib SocketServer.py,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19486 Modified Files: SocketServer.py Log Message: TCPServer: Fixed typo in class docstring. Index: SocketServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SocketServer.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** SocketServer.py 9 Oct 2003 22:44:05 -0000 1.36 --- SocketServer.py 9 Oct 2003 23:48:52 -0000 1.37 *************** *** 174,178 **** - address_family - socket_type ! - reuse_address Instance variables: --- 174,178 ---- - address_family - socket_type ! - allow_reuse_address Instance variables: From bwarsaw at users.sourceforge.net Thu Oct 9 19:49:26 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Thu Oct 9 19:50:25 2003 Subject: [Python-checkins] python/dist/src/Lib SocketServer.py, 1.35, 1.35.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19585 Modified Files: Tag: release23-maint SocketServer.py Log Message: BaseServer, TCPServer: Fixed typo in class docstring. Index: SocketServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SocketServer.py,v retrieving revision 1.35 retrieving revision 1.35.12.1 diff -C2 -d -r1.35 -r1.35.12.1 *** SocketServer.py 2 Jan 2003 03:07:48 -0000 1.35 --- SocketServer.py 9 Oct 2003 23:49:24 -0000 1.35.12.1 *************** *** 174,178 **** - address_family - socket_type ! - reuse_address Instance variables: --- 174,178 ---- - address_family - socket_type ! - allow_reuse_address Instance variables: *************** *** 305,309 **** - socket_type - request_queue_size (only for stream sockets) ! - reuse_address Instance variables: --- 305,309 ---- - socket_type - request_queue_size (only for stream sockets) ! - allow_reuse_address Instance variables: From theller at users.sourceforge.net Fri Oct 10 12:57:42 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Oct 10 12:57:45 2003 Subject: [Python-checkins] python/dist/src/PC make_versioninfo.c, NONE, 1.1 .cvsignore, NONE, 1.1 python_nt.rc, 1.28, 1.29 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv26801 Modified Files: python_nt.rc Added Files: make_versioninfo.c .cvsignore Log Message: To build on windows, the manual editing of the python_nt.rc file to change the version number is no longer required. Instead, a make_versioninfo.exe is compiled, which spits out an include file for python_nt.rc. Will backport to 2.3 --- NEW FILE: make_versioninfo.c --- #include #include "patchlevel.h" /* * This program prints out an include file containing fields required to build * the version info resource of pythonxx.dll because the resource compiler * cannot do the arithmetic. */ /* * FIELD3 is the third field of the version number. * This is what we'd like FIELD3 to be: * * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) * * but that neither gives an error nor comes anywhere close to working. * * For 2.4a0, * PY_MICRO_VERSION = 0 * PY_RELEASE_LEVEL = 'alpha' = 0xa * PY_RELEASE_SERIAL = 0 * * gives FIELD3 = 0*1000 + 10*10 + 0 = 100 */ int main(int argc, char **argv) { printf("/* This file created by make_versioninfo.exe */\n"); printf("#define FIELD3 %d\n", PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL); printf("#define MS_DLL_ID \"%d.%d\"\n", PY_MAJOR_VERSION, PY_MINOR_VERSION); printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n", PY_MAJOR_VERSION, PY_MINOR_VERSION); return 0; } --- NEW FILE: .cvsignore --- pythonnt_rc.h pythonnt_rc_d.h Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** python_nt.rc 31 Jul 2003 02:06:22 -0000 1.28 --- python_nt.rc 10 Oct 2003 16:57:40 -0000 1.29 *************** *** 7,45 **** #include "modsupport.h" #include "patchlevel.h" ! ! /* Across releases, change: ! * MS_DLL_ID if the minor version number changes. ! * PYTHON_DLL_NAME ditto. ! * MS_DLL_ID must match PY_VERSION in the Windows install script. ! */ ! #define MS_DLL_ID "2.4" ! ! #ifndef PYTHON_DLL_NAME ! #define PYTHON_DLL_NAME "python24.dll" #endif - - /* Nothing below this should need to be changed except for copyright - * notices, company name, and FIELD3. Unfortunately, all attempts - * to get the resource compiler to do arithmetic in macros have - * failed miserably -- it gives syntax errors, ignores operators, - * or does stuff that's simply bizarre. - */ - - - /* This is what we'd like FIELD3 to be: - * - * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) - * - * but that neither gives an error nor comes anywhere close to working. The - * following comment and #define are output from PCbuild\field3.py: - * - * For 2.4a0, - * PY_MICRO_VERSION = 0 - * PY_RELEASE_LEVEL = 'alpha' = 0xa - * PY_RELEASE_SERIAL = 0 - * - * and 0*1000 + 10*10 + 0 = 100 - */ - #define FIELD3 100 /* e.g., 2.1a2 --- 7,15 ---- #include "modsupport.h" #include "patchlevel.h" ! #ifdef _DEBUG ! # include "pythonnt_rc_d.h" ! #else ! # include "pythonnt_rc.h" #endif /* e.g., 2.1a2 From theller at users.sourceforge.net Fri Oct 10 12:57:47 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Oct 10 12:57:56 2003 Subject: [Python-checkins] python/dist/src/PCbuild make_versioninfo.dsp, NONE, 1.1 pcbuild.dsw, 1.34, 1.35 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv26825 Modified Files: pcbuild.dsw Added Files: make_versioninfo.dsp Log Message: To build on windows, the manual editing of the python_nt.rc file to change the version number is no longer required. Instead, a make_versioninfo.exe is compiled, which spits out an include file for python_nt.rc. Will backport to 2.3 --- NEW FILE: make_versioninfo.dsp --- # Microsoft Developer Studio Project File - Name="make_versioninfo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=make_versioninfo - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "make_versioninfo.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "make_versioninfo.mak" CFG="make_versioninfo - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "make_versioninfo - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "make_versioninfo - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "make_versioninfo" # PROP Scc_LocalPath ".." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "make_versioninfo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo.exe >..\PC\pythonnt_rc.h # End Custom Build !ELSEIF "$(CFG)" == "make_versioninfo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 /out:"./make_versioninfo_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo_d.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo_d.exe >..\PC\pythonnt_rc_d.h # End Custom Build !ENDIF # Begin Target # Name "make_versioninfo - Win32 Release" # Name "make_versioninfo - Win32 Debug" # Begin Source File SOURCE=..\PC\make_versioninfo.c # End Source File # End Target # End Project Index: pcbuild.dsw =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pcbuild.dsw,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** pcbuild.dsw 21 Mar 2003 01:55:41 -0000 1.34 --- pcbuild.dsw 10 Oct 2003 16:57:45 -0000 1.35 *************** *** 160,163 **** --- 160,175 ---- ############################################################################### + Project: "make_versioninfo"=.\make_versioninfo.dsp - Package Owner=<4> + + Package=<5> + {{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### + Project: "mmap"=.\mmap.dsp - Package Owner=<4> *************** *** 228,231 **** --- 240,246 ---- Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name make_versioninfo + End Project Dependency }}} From gvanrossum at users.sourceforge.net Fri Oct 10 19:02:04 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri Oct 10 19:02:08 2003 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv376 Modified Files: trace.py Log Message: The fullmodname() function chopped off the first character if the module existed in the current directory. Fix this. Backport candidate (I presume). Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** trace.py 15 Jul 2003 10:34:02 -0000 1.12 --- trace.py 10 Oct 2003 23:02:01 -0000 1.13 *************** *** 181,185 **** longest = dir ! base = path[len(longest) + 1:].replace("/", ".") filename, ext = os.path.splitext(base) return filename --- 181,189 ---- longest = dir ! if longest: ! base = path[len(longest) + 1:] ! else: ! base = path ! base = base.replace("/", ".") filename, ext = os.path.splitext(base) return filename *************** *** 292,295 **** --- 296,302 ---- """Return a coverage results file in path.""" + print "path =", `path` + if "/arse" in path: + import pdb; pdb.set_trace() try: outfile = open(path, "w") From gvanrossum at users.sourceforge.net Fri Oct 10 19:05:43 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri Oct 10 19:05:46 2003 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv891 Modified Files: trace.py Log Message: Ouch. Remove debug code containing obscenities. :-) Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** trace.py 10 Oct 2003 23:02:01 -0000 1.13 --- trace.py 10 Oct 2003 23:05:41 -0000 1.14 *************** *** 296,302 **** """Return a coverage results file in path.""" - print "path =", `path` - if "/arse" in path: - import pdb; pdb.set_trace() try: outfile = open(path, "w") --- 296,299 ---- From fdrake at users.sourceforge.net Sat Oct 11 01:25:27 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Sat Oct 11 01:25:30 2003 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.78,1.79 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1:/tmp/cvs-serv24866 Modified Files: doc.tex Log Message: add some information about using graphics with the Python document classes Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** doc.tex 1 Oct 2003 04:15:09 -0000 1.78 --- doc.tex 11 Oct 2003 05:25:24 -0000 1.79 *************** *** 1829,1832 **** --- 1829,1925 ---- + \section{Including Graphics \label{graphics}} + + The standard documentation included with Python makes no use of + diagrams or images; this is intentional. The outside tools used to + format the documentation have not always been suited to working with + graphics. As the tools have evolved and been improved by their + maintainers, support for graphics has improved. + + The internal tools, starting with the \program{mkhowto} script, do + not provide any direct support for graphics. However, + \program{mkhowto} will not interfere with graphics support in the + external tools. + + Experience using graphics together with these tools and the + \code{howto} and \code{manual} document classes is not extensive, + but has been known to work. The basic approach is this: + + \begin{enumerate} + \item Create the image or graphic using your favorite + application. + + \item Convert the image to a format supported by the conversion to + your desired output format. If you want to generate HTML or + PostScript, you can convert the image or graphic to + encapsulated PostScript (a \file{.eps} file); \LaTeX2HTML + can convert that to a \file{.gif} file; it may be possible + to provide a \file{.gif} file directly. If you want to + generate PDF, you need to provide an ``encapsulated'' PDF + file. This can be generated from encapsulated PostScript + using the \program{epstopdf} tool provided with the te\TeX{} + distribution on Linux and \UNIX. + + \item In your document, add this line to ``import'' the general + graphics support package \code{graphicx}: + + \begin{verbatim} + \usepackage{graphicx} + \end{verbatim} + + \item Where you want to include your graphic or image, include + markup similar to this: + + \begin{verbatim} + \begin{figure} + \centering + \includegraphics[width=5in]{myimage} + \caption{Description of my image} + \end{figure} + \end{verbatim} + + In particular, note for the \macro{includegraphics} macro + that no file extension is provided. If you're only + interested in one target format, you can include the + extension of the appropriate input file, but to allow + support for multiple formats, omitting the extension makes + life easier. + + \item Run \program{mkhowto} normally. + \end{enumerate} + + If you're working on systems which support some sort of + \program{make} facility, you can use that to ensure the intermediate + graphic formats are kept up to date. This example shows a + \file{Makefile} used to format a document containing a diagram + created using the \program{dia} application: + + \begin{verbatim} + default: pdf + all: html pdf ps + + html: mydoc/mydoc.html + pdf: mydoc.pdf + ps: mydoc.ps + + mydoc/mydoc.html: mydoc.tex mygraphic.eps + mkhowto --html $< + + mydoc.pdf: mydoc.tex mygraphic.pdf + mkhowto --pdf $< + + mydoc.ps: mydoc.tex mygraphic.eps + mkhowto --postscript $< + + .SUFFIXES: .dia .eps .pdf + + .dia.eps: + dia --nosplash --export $@ $< + + .eps.pdf: + epstopdf $< + \end{verbatim} % $ <-- bow to font-lock + + \section{Future Directions \label{futures}} From rhettinger at users.sourceforge.net Sat Oct 11 13:29:07 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 11 13:29:10 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.246,2.247 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv7531 Modified Files: typeobject.c Log Message: SF bug #820397: __nonzero__() returns 1/0 Altered to return a PyBool instead of a PyInt. Backport candidate. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.246 retrieving revision 2.247 diff -C2 -d -r2.246 -r2.247 *** typeobject.c 9 Oct 2003 03:46:35 -0000 2.246 --- typeobject.c 11 Oct 2003 17:29:04 -0000 2.247 *************** *** 3327,3330 **** --- 3327,3344 ---- static PyObject * + wrap_inquirypred(PyObject *self, PyObject *args, void *wrapped) + { + inquiry func = (inquiry)wrapped; + int res; + + if (!PyArg_ParseTuple(args, "")) + return NULL; + res = (*func)(self); + if (res == -1 && PyErr_Occurred()) + return NULL; + return PyBool_FromLong((long)res); + } + + static PyObject * wrap_binaryfunc(PyObject *self, PyObject *args, void *wrapped) { *************** *** 4915,4919 **** UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, "abs(x)"), ! UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquiry, "x != 0"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), --- 4929,4933 ---- UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, "abs(x)"), ! UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquirypred, "x != 0"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), From rhettinger at users.sourceforge.net Sat Oct 11 15:32:20 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 11 15:32:25 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.247,2.248 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv25355 Modified Files: typeobject.c Log Message: Use the simpler and faster PyArg_UnpackTuple() instead of PyArg_ParseTuple() where possible. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.247 retrieving revision 2.248 diff -C2 -d -r2.247 -r2.248 *** typeobject.c 11 Oct 2003 17:29:04 -0000 2.247 --- typeobject.c 11 Oct 2003 19:32:18 -0000 2.248 *************** *** 3318,3322 **** int res; ! if (!PyArg_ParseTuple(args, "")) return NULL; res = (*func)(self); --- 3318,3322 ---- int res; ! if (!PyArg_UnpackTuple(args, "", 0, 0)) return NULL; res = (*func)(self); *************** *** 3332,3336 **** int res; ! if (!PyArg_ParseTuple(args, "")) return NULL; res = (*func)(self); --- 3332,3336 ---- int res; ! if (!PyArg_UnpackTuple(args, "", 0, 0)) return NULL; res = (*func)(self); *************** *** 3346,3350 **** PyObject *other; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; return (*func)(self, other); --- 3346,3350 ---- PyObject *other; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; return (*func)(self, other); *************** *** 3357,3361 **** PyObject *other; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; if (!(self->ob_type->tp_flags & Py_TPFLAGS_CHECKTYPES) && --- 3357,3361 ---- PyObject *other; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; if (!(self->ob_type->tp_flags & Py_TPFLAGS_CHECKTYPES) && *************** *** 3373,3377 **** PyObject *other; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; if (!(self->ob_type->tp_flags & Py_TPFLAGS_CHECKTYPES) && --- 3373,3377 ---- PyObject *other; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; if (!(self->ob_type->tp_flags & Py_TPFLAGS_CHECKTYPES) && *************** *** 3390,3394 **** int ok; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; ok = func(&self, &other); --- 3390,3394 ---- int ok; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; ok = func(&self, &other); *************** *** 3419,3423 **** /* Note: This wrapper only works for __pow__() */ ! if (!PyArg_ParseTuple(args, "O|O", &other, &third)) return NULL; return (*func)(self, other, third); --- 3419,3423 ---- /* Note: This wrapper only works for __pow__() */ ! if (!PyArg_UnpackTuple(args, "", 1, 2, &other, &third)) return NULL; return (*func)(self, other, third); *************** *** 3433,3437 **** /* Note: This wrapper only works for __pow__() */ ! if (!PyArg_ParseTuple(args, "O|O", &other, &third)) return NULL; return (*func)(other, self, third); --- 3433,3437 ---- /* Note: This wrapper only works for __pow__() */ ! if (!PyArg_UnpackTuple(args, "", 1, 2, &other, &third)) return NULL; return (*func)(other, self, third); *************** *** 3443,3447 **** unaryfunc func = (unaryfunc)wrapped; ! if (!PyArg_ParseTuple(args, "")) return NULL; return (*func)(self); --- 3443,3447 ---- unaryfunc func = (unaryfunc)wrapped; ! if (!PyArg_UnpackTuple(args, "", 0, 0)) return NULL; return (*func)(self); *************** *** 3493,3497 **** return (*func)(self, i); } ! PyArg_ParseTuple(args, "O", &arg); assert(PyErr_Occurred()); return NULL; --- 3493,3497 ---- return (*func)(self, i); } ! PyArg_UnpackTuple(args, "", 1, 1, &arg); assert(PyErr_Occurred()); return NULL; *************** *** 3516,3520 **** PyObject *arg, *value; ! if (!PyArg_ParseTuple(args, "OO", &arg, &value)) return NULL; i = getindex(self, arg); --- 3516,3520 ---- PyObject *arg, *value; ! if (!PyArg_UnpackTuple(args, "", 2, 2, &arg, &value)) return NULL; i = getindex(self, arg); *************** *** 3535,3539 **** PyObject *arg; ! if (!PyArg_ParseTuple(args, "O", &arg)) return NULL; i = getindex(self, arg); --- 3535,3539 ---- PyObject *arg; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &arg)) return NULL; i = getindex(self, arg); *************** *** 3586,3590 **** PyObject *value; ! if (!PyArg_ParseTuple(args, "O", &value)) return NULL; res = (*func)(self, value); --- 3586,3590 ---- PyObject *value; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &value)) return NULL; res = (*func)(self, value); *************** *** 3602,3606 **** PyObject *key, *value; ! if (!PyArg_ParseTuple(args, "OO", &key, &value)) return NULL; res = (*func)(self, key, value); --- 3602,3606 ---- PyObject *key, *value; ! if (!PyArg_UnpackTuple(args, "", 2, 2, &key, &value)) return NULL; res = (*func)(self, key, value); *************** *** 3618,3622 **** PyObject *key; ! if (!PyArg_ParseTuple(args, "O", &key)) return NULL; res = (*func)(self, key, NULL); --- 3618,3622 ---- PyObject *key; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &key)) return NULL; res = (*func)(self, key, NULL); *************** *** 3634,3638 **** PyObject *other; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; if (other->ob_type->tp_compare != func && --- 3634,3638 ---- PyObject *other; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; if (other->ob_type->tp_compare != func && *************** *** 3677,3681 **** PyObject *name, *value; ! if (!PyArg_ParseTuple(args, "OO", &name, &value)) return NULL; if (!hackcheck(self, func, "__setattr__")) --- 3677,3681 ---- PyObject *name, *value; ! if (!PyArg_UnpackTuple(args, "", 2, 2, &name, &value)) return NULL; if (!hackcheck(self, func, "__setattr__")) *************** *** 3695,3699 **** PyObject *name; ! if (!PyArg_ParseTuple(args, "O", &name)) return NULL; if (!hackcheck(self, func, "__delattr__")) --- 3695,3699 ---- PyObject *name; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &name)) return NULL; if (!hackcheck(self, func, "__delattr__")) *************** *** 3712,3716 **** long res; ! if (!PyArg_ParseTuple(args, "")) return NULL; res = (*func)(self); --- 3712,3716 ---- long res; ! if (!PyArg_UnpackTuple(args, "", 0, 0)) return NULL; res = (*func)(self); *************** *** 3734,3738 **** PyObject *other; ! if (!PyArg_ParseTuple(args, "O", &other)) return NULL; return (*func)(self, other, op); --- 3734,3738 ---- PyObject *other; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &other)) return NULL; return (*func)(self, other, op); *************** *** 3760,3764 **** PyObject *res; ! if (!PyArg_ParseTuple(args, "")) return NULL; res = (*func)(self); --- 3760,3764 ---- PyObject *res; ! if (!PyArg_UnpackTuple(args, "", 0, 0)) return NULL; res = (*func)(self); *************** *** 3775,3779 **** PyObject *type = NULL; ! if (!PyArg_ParseTuple(args, "O|O", &obj, &type)) return NULL; if (obj == Py_None) --- 3775,3779 ---- PyObject *type = NULL; ! if (!PyArg_UnpackTuple(args, "", 1, 2, &obj, &type)) return NULL; if (obj == Py_None) *************** *** 3796,3800 **** int ret; ! if (!PyArg_ParseTuple(args, "OO", &obj, &value)) return NULL; ret = (*func)(self, obj, value); --- 3796,3800 ---- int ret; ! if (!PyArg_UnpackTuple(args, "", 2, 2, &obj, &value)) return NULL; ret = (*func)(self, obj, value); *************** *** 3812,3816 **** int ret; ! if (!PyArg_ParseTuple(args, "O", &obj)) return NULL; ret = (*func)(self, obj, NULL); --- 3812,3816 ---- int ret; ! if (!PyArg_UnpackTuple(args, "", 1, 1, &obj)) return NULL; ret = (*func)(self, obj, NULL); From rhettinger at users.sourceforge.net Sat Oct 11 22:02:19 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 11 22:02:23 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libtarfile.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14865 Modified Files: libtarfile.tex Log Message: SF patch #819955: Erroneous \seemodule in tarfile docs (Contributed by Johannes Gijsbers.) Index: libtarfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtarfile.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** libtarfile.tex 5 Jan 2003 23:19:42 -0000 1.1 --- libtarfile.tex 12 Oct 2003 02:02:16 -0000 1.2 *************** *** 126,130 **** \begin{seealso} ! \seemodule[module-zipfile]{zipfile}{Documentation of the \code{zipfile} standard module.} --- 126,130 ---- \begin{seealso} ! \seemodule{zipfile}{Documentation of the \code{zipfile} standard module.} From rhettinger at users.sourceforge.net Sat Oct 11 22:03:09 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 11 22:03:11 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libtarfile.tex, 1.1, 1.1.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv15024 Modified Files: Tag: release23-maint libtarfile.tex Log Message: SF patch #819955: Erroneous \seemodule in tarfile docs (Contributed by Johannes Gijsbers.) Index: libtarfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtarfile.tex,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -C2 -d -r1.1 -r1.1.16.1 *** libtarfile.tex 5 Jan 2003 23:19:42 -0000 1.1 --- libtarfile.tex 12 Oct 2003 02:03:06 -0000 1.1.16.1 *************** *** 126,130 **** \begin{seealso} ! \seemodule[module-zipfile]{zipfile}{Documentation of the \code{zipfile} standard module.} --- 126,130 ---- \begin{seealso} ! \seemodule{zipfile}{Documentation of the \code{zipfile} standard module.} From bcannon at users.sourceforge.net Sun Oct 12 00:29:12 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:29:16 2003 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.248,1.249 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv31050/Misc Modified Files: ACKS Log Message: Misc/NEWS Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.248 retrieving revision 1.249 diff -C2 -d -r1.248 -r1.249 *** ACKS 8 Oct 2003 21:08:29 -0000 1.248 --- ACKS 12 Oct 2003 04:29:10 -0000 1.249 *************** *** 520,523 **** --- 520,524 ---- Greg Stein Chris Stern + Michael Stone Dan Stromberg Nathan Sullivan From bcannon at users.sourceforge.net Sun Oct 12 00:29:12 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:29:18 2003 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv31050/Lib Modified Files: urlparse.py Log Message: Misc/NEWS Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** urlparse.py 30 Mar 2003 16:28:26 -0000 1.40 --- urlparse.py 12 Oct 2003 04:29:10 -0000 1.41 *************** *** 158,168 **** return urlunparse((scheme, netloc, path, params, query, fragment)) ! if not path: ! if not params: ! params = bparams ! if not query: ! query = bquery return urlunparse((scheme, netloc, bpath, ! params, query, fragment)) segments = bpath.split('/')[:-1] + path.split('/') # XXX The stuff below is bogus in various ways... --- 158,164 ---- return urlunparse((scheme, netloc, path, params, query, fragment)) ! if not (path or params or query): return urlunparse((scheme, netloc, bpath, ! bparams, bquery, fragment)) segments = bpath.split('/')[:-1] + path.split('/') # XXX The stuff below is bogus in various ways... From bcannon at users.sourceforge.net Sun Oct 12 00:29:13 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:29:20 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_urlparse.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv31050/Lib/test Modified Files: test_urlparse.py Log Message: Misc/NEWS Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_urlparse.py 6 Jan 2003 20:27:03 -0000 1.11 --- test_urlparse.py 12 Oct 2003 04:29:10 -0000 1.12 *************** *** 62,66 **** self.checkJoin(RFC1808_BASE, '/g', 'http://a/g') self.checkJoin(RFC1808_BASE, '//g', 'http://g') - self.checkJoin(RFC1808_BASE, '?y', 'http://a/b/c/d;p?y') self.checkJoin(RFC1808_BASE, 'g?y', 'http://a/b/c/g?y') self.checkJoin(RFC1808_BASE, 'g?y/./x', 'http://a/b/c/g?y/./x') --- 62,65 ---- *************** *** 69,73 **** self.checkJoin(RFC1808_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x') self.checkJoin(RFC1808_BASE, 'g?y#s', 'http://a/b/c/g?y#s') - self.checkJoin(RFC1808_BASE, ';x', 'http://a/b/c/d;x') self.checkJoin(RFC1808_BASE, 'g;x', 'http://a/b/c/g;x') self.checkJoin(RFC1808_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s') --- 68,71 ---- *************** *** 104,110 **** # cases from RFC 2396 ! ### urlparse.py as of v 1.32 fails on these two ! #self.checkJoin(RFC2396_BASE, '?y', 'http://a/b/c/?y') ! #self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x') self.checkJoin(RFC2396_BASE, 'g:h', 'g:h') --- 102,107 ---- # cases from RFC 2396 ! self.checkJoin(RFC2396_BASE, '?y', 'http://a/b/c/?y') ! self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x') self.checkJoin(RFC2396_BASE, 'g:h', 'g:h') From bcannon at users.sourceforge.net Sun Oct 12 00:36:20 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:36:22 2003 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.249,1.250 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv31760/Misc Modified Files: ACKS Log Message: (just for comment to fix previous commit comment) Add Michael Stone for helping with bug #450225 (making urlparse RFC 2396 compliant). Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.249 retrieving revision 1.250 diff -C2 -d -r1.249 -r1.250 From bcannon at users.sourceforge.net Sun Oct 12 00:38:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:38:11 2003 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv31845/Lib Modified Files: urlparse.py Log Message: (revision purely to add comment) Make urlparse RFC 2396 compliant. Closes bug #450225 (thanks Michael Stone). Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 From bcannon at users.sourceforge.net Sun Oct 12 00:38:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:38:13 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_urlparse.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv31845/Lib/test Modified Files: test_urlparse.py Log Message: (revision purely to add comment) Make urlparse RFC 2396 compliant. Closes bug #450225 (thanks Michael Stone). Index: test_urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urlparse.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 From bcannon at users.sourceforge.net Sun Oct 12 00:38:50 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 12 00:38:53 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.866,1.867 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv32009/Misc Modified Files: NEWS Log Message: Add mention of urlparse becoming RFC 2396 compliant. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.866 retrieving revision 1.867 diff -C2 -d -r1.866 -r1.867 *** NEWS 8 Oct 2003 21:08:29 -0000 1.866 --- NEWS 12 Oct 2003 04:38:48 -0000 1.867 *************** *** 56,59 **** --- 56,61 ---- ------- + - urlparse is RFC 2396 compliant. + - The fieldnames argument to the csv module's DictReader constructor is now optional. If omitted, the first row of the file will be used as the From fdrake at acm.org Sun Oct 12 10:43:08 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Sun Oct 12 10:43:15 2003 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.41,1.42 In-Reply-To: References: Message-ID: <16265.26748.451661.390136@grendel.zope.com> bcannon@users.sourceforge.net writes: > Log Message: > (revision purely to add comment) You can use "cvs admin" to fix broken comments. It doesn't generate an email, but it avoids an extra entry in the history. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From rhettinger at users.sourceforge.net Sun Oct 12 13:14:14 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 13:14:19 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv13177 Modified Files: random.py Log Message: Minor fixup. "Random" was listed twice in __all__. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** random.py 5 Oct 2003 09:09:14 -0000 1.56 --- random.py 12 Oct 2003 17:14:11 -0000 1.57 *************** *** 50,55 **** "expovariate","vonmisesvariate","gammavariate", "gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead", "WichmannHill", "getrandbits", ! "Random"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) --- 50,54 ---- "expovariate","vonmisesvariate","gammavariate", "gauss","betavariate","paretovariate","weibullvariate", ! "getstate","setstate","jumpahead", "WichmannHill", "getrandbits"] NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) From loewis at users.sourceforge.net Sun Oct 12 13:37:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 12 13:37:07 2003 Subject: [Python-checkins] python/dist/src/Lib tempfile.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv17091/Lib Modified Files: tempfile.py Log Message: Patch #810914: Return absolute path for mkstemp. Fixes #810408. This should not be backported to 2.3, as it might break backwards compatibility. Index: tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tempfile.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** tempfile.py 22 Jul 2003 02:50:01 -0000 1.56 --- tempfile.py 12 Oct 2003 17:37:01 -0000 1.57 *************** *** 215,219 **** fd = _os.open(file, flags, 0600) _set_cloexec(fd) ! return (fd, file) except OSError, e: if e.errno == _errno.EEXIST: --- 215,219 ---- fd = _os.open(file, flags, 0600) _set_cloexec(fd) ! return (fd, _os.path.abspath(file)) except OSError, e: if e.errno == _errno.EEXIST: From loewis at users.sourceforge.net Sun Oct 12 13:37:04 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 12 13:37:08 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.867,1.868 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv17091/Misc Modified Files: NEWS Log Message: Patch #810914: Return absolute path for mkstemp. Fixes #810408. This should not be backported to 2.3, as it might break backwards compatibility. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.867 retrieving revision 1.868 diff -C2 -d -r1.867 -r1.868 *** NEWS 12 Oct 2003 04:38:48 -0000 1.867 --- NEWS 12 Oct 2003 17:37:01 -0000 1.868 *************** *** 56,59 **** --- 56,61 ---- ------- + - tmpfile.mkstemp now returns an absolute path even if dir is relative. + - urlparse is RFC 2396 compliant. From loewis at users.sourceforge.net Sun Oct 12 13:37:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 12 13:37:11 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_tempfile.py, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv17091/Lib/test Modified Files: test_tempfile.py Log Message: Patch #810914: Return absolute path for mkstemp. Fixes #810408. This should not be backported to 2.3, as it might break backwards compatibility. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_tempfile.py 1 May 2003 17:45:51 -0000 1.14 --- test_tempfile.py 12 Oct 2003 17:37:01 -0000 1.15 *************** *** 50,54 **** nsuf = nbase[len(nbase)-len(suf):] ! self.assertEqual(ndir, dir, "file '%s' not in directory '%s'" % (name, dir)) self.assertEqual(npre, pre, --- 50,55 ---- nsuf = nbase[len(nbase)-len(suf):] ! # check for equality of the absolute paths! ! self.assertEqual(os.path.abspath(ndir), os.path.abspath(dir), "file '%s' not in directory '%s'" % (name, dir)) self.assertEqual(npre, pre, *************** *** 385,388 **** --- 386,393 ---- try: (fd, name) = tempfile.mkstemp(dir=dir, prefix=pre, suffix=suf) + (ndir, nbase) = os.path.split(name) + adir = os.path.abspath(dir) + self.assertEqual(adir, ndir, + "Directory '%s' incorrectly returned as '%s'" % (adir, ndir)) except: self.failOnException("mkstemp") *************** *** 401,404 **** --- 406,410 ---- self.do_create(pre="a", suf="b") self.do_create(pre="aa", suf=".txt") + self.do_create(dir=".") def test_choose_directory(self): From rhettinger at users.sourceforge.net Sun Oct 12 14:24:36 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 14:24:39 2003 Subject: [Python-checkins] python/dist/src/Include tupleobject.h,2.28,2.29 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv25726/Include Modified Files: tupleobject.h Log Message: Extended tuple's C API to include a new function, PyTuple_Pack() that is useful for rapidly building argument tuples without having to invoke the more sophisticated machinery of Py_BuildValue(). Index: tupleobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/tupleobject.h,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** tupleobject.h 12 Aug 2002 07:21:57 -0000 2.28 --- tupleobject.h 12 Oct 2003 18:24:33 -0000 2.29 *************** *** 36,39 **** --- 36,40 ---- PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, int, int); PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, int); + PyAPI_FUNC(PyObject *) PyTuple_Pack(int, ...); /* Macro, trading safety for speed */ From rhettinger at users.sourceforge.net Sun Oct 12 14:24:35 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 14:24:41 2003 Subject: [Python-checkins] python/dist/src/Objects tupleobject.c,2.81,2.82 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv25726/Objects Modified Files: tupleobject.c Log Message: Extended tuple's C API to include a new function, PyTuple_Pack() that is useful for rapidly building argument tuples without having to invoke the more sophisticated machinery of Py_BuildValue(). Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.81 retrieving revision 2.82 diff -C2 -d -r2.81 -r2.82 *** tupleobject.c 7 May 2003 01:28:47 -0000 2.81 --- tupleobject.c 12 Oct 2003 18:24:33 -0000 2.82 *************** *** 131,134 **** --- 131,156 ---- } + PyObject * + PyTuple_Pack(int n, ...) + { + int i; + PyObject *o; + PyObject *result; + va_list vargs; + + va_start(vargs, n); + result = PyTuple_New(n); + if (result == NULL) + return NULL; + for (i = 0; i < n; i++) { + o = va_arg(vargs, PyObject *); + Py_INCREF(o); + PyTuple_SET_ITEM(result, i, o); + } + va_end(vargs); + return result; + } + + /* Methods */ From rhettinger at users.sourceforge.net Sun Oct 12 14:24:36 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 14:24:43 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.868,1.869 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv25726/Misc Modified Files: NEWS Log Message: Extended tuple's C API to include a new function, PyTuple_Pack() that is useful for rapidly building argument tuples without having to invoke the more sophisticated machinery of Py_BuildValue(). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.868 retrieving revision 1.869 diff -C2 -d -r1.868 -r1.869 *** NEWS 12 Oct 2003 17:37:01 -0000 1.868 --- NEWS 12 Oct 2003 18:24:34 -0000 1.869 *************** *** 141,144 **** --- 141,149 ---- ----- + - Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a + variable length argument list of Python objects without having to invoke + the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c) + is equivalent to Py_BuildValue("(OOO)", a, b, c). + New platforms ------------- From rhettinger at users.sourceforge.net Sun Oct 12 14:24:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 14:24:46 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv25726/Doc/api Modified Files: concrete.tex Log Message: Extended tuple's C API to include a new function, PyTuple_Pack() that is useful for rapidly building argument tuples without having to invoke the more sophisticated machinery of Py_BuildValue(). Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** concrete.tex 23 Aug 2003 03:38:11 -0000 1.26 --- concrete.tex 12 Oct 2003 18:24:34 -0000 1.27 *************** *** 974,978 **** names. This variable should be treated as read-only: On some systems, it will be a pointer to a static string, on others, it will change at ! run-time, e.g. when the application invokes setlocale. Error handling is set by errors which may also be set to \NULL{} --- 974,978 ---- names. This variable should be treated as read-only: On some systems, it will be a pointer to a static string, on others, it will change at ! run-time (such as when the application invokes setlocale). Error handling is set by errors which may also be set to \NULL{} *************** *** 1583,1586 **** --- 1583,1594 ---- \begin{cfuncdesc}{PyObject*}{PyTuple_New}{int len} Return a new tuple object of size \var{len}, or \NULL{} on failure. + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyTuple_Pack}{int n, \moreargs} + Return a new tuple object of size \var{n}, or \NULL{} on failure. + The tuple values are initialized to the subsequent \var{n} C arguments + pointing to Python objects. \samp{PyTuple_Pack(2, \var{a}, \var{b})} + is equivalent to \samp{Py_BuildValue("(OO)", \var{a}, \var{b})}. + \versionadded{2.4} \end{cfuncdesc} From rhettinger at users.sourceforge.net Sun Oct 12 15:09:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 15:09:43 2003 Subject: [Python-checkins] python/dist/src/Objects classobject.c, 2.171, 2.172 complexobject.c, 2.69, 2.70 fileobject.c, 2.183, 2.184 typeobject.c, 2.248, 2.249 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv411/Objects Modified Files: classobject.c complexobject.c fileobject.c typeobject.c Log Message: Simplify and speedup uses of Py_BuildValue(): * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a) Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.171 retrieving revision 2.172 diff -C2 -d -r2.171 -r2.172 *** classobject.c 16 Sep 2003 07:11:46 -0000 2.171 --- classobject.c 12 Oct 2003 19:09:37 -0000 2.172 *************** *** 751,755 **** return NULL; PyErr_Clear(); ! args = Py_BuildValue("(OO)", inst, name); if (args == NULL) return NULL; --- 751,755 ---- return NULL; PyErr_Clear(); ! args = PyTuple_Pack(2, inst, name); if (args == NULL) return NULL; *************** *** 848,854 **** return instance_setattr1(inst, name, v); if (v == NULL) ! args = Py_BuildValue("(OO)", inst, name); else ! args = Py_BuildValue("(OOO)", inst, name, v); if (args == NULL) return -1; --- 848,854 ---- return instance_setattr1(inst, name, v); if (v == NULL) ! args = PyTuple_Pack(2, inst, name); else ! args = PyTuple_Pack(3, inst, name, v); if (args == NULL) return -1; *************** *** 1039,1043 **** if (func == NULL) return NULL; ! arg = Py_BuildValue("(O)", key); if (arg == NULL) { Py_DECREF(func); --- 1039,1043 ---- if (func == NULL) return NULL; ! arg = PyTuple_Pack(1, key); if (arg == NULL) { Py_DECREF(func); *************** *** 1070,1076 **** return -1; if (value == NULL) ! arg = Py_BuildValue("(O)", key); else ! arg = Py_BuildValue("(OO)", key, value); if (arg == NULL) { Py_DECREF(func); --- 1070,1076 ---- return -1; if (value == NULL) ! arg = PyTuple_Pack(1, key); else ! arg = PyTuple_Pack(2, key, value); if (arg == NULL) { Py_DECREF(func); *************** *** 1282,1286 **** PyObject *res; int ret; ! PyObject *arg = Py_BuildValue("(O)", member); if(arg == NULL) { Py_DECREF(func); --- 1282,1286 ---- PyObject *res; int ret; ! PyObject *arg = PyTuple_Pack(1, member); if(arg == NULL) { Py_DECREF(func); *************** *** 1347,1351 **** return Py_NotImplemented; } ! args = Py_BuildValue("(O)", w); if (args == NULL) { Py_DECREF(func); --- 1347,1351 ---- return Py_NotImplemented; } ! args = PyTuple_Pack(1, w); if (args == NULL) { Py_DECREF(func); *************** *** 1390,1394 **** } ! args = Py_BuildValue("(O)", w); if (args == NULL) { Py_DECREF(coercefunc); --- 1390,1394 ---- } ! args = PyTuple_Pack(1, w); if (args == NULL) { Py_DECREF(coercefunc); *************** *** 1475,1479 **** } /* Has __coerce__ method: call it */ ! args = Py_BuildValue("(O)", w); if (args == NULL) { return -1; --- 1475,1479 ---- } /* Has __coerce__ method: call it */ ! args = PyTuple_Pack(1, w); if (args == NULL) { return -1; *************** *** 1588,1592 **** } ! args = Py_BuildValue("(O)", w); if (args == NULL) { Py_DECREF(cmp_func); --- 1588,1592 ---- } ! args = PyTuple_Pack(1, w); if (args == NULL) { Py_DECREF(cmp_func); *************** *** 1748,1752 **** if (func == NULL) return NULL; ! args = Py_BuildValue("(OO)", w, z); if (args == NULL) { Py_DECREF(func); --- 1748,1752 ---- if (func == NULL) return NULL; ! args = PyTuple_Pack(2, w, z); if (args == NULL) { Py_DECREF(func); *************** *** 1787,1791 **** return instance_pow(v, w, z); } ! args = Py_BuildValue("(OO)", w, z); if (args == NULL) { Py_DECREF(func); --- 1787,1791 ---- return instance_pow(v, w, z); } ! args = PyTuple_Pack(2, w, z); if (args == NULL) { Py_DECREF(func); *************** *** 1860,1864 **** } ! args = Py_BuildValue("(O)", w); if (args == NULL) { Py_DECREF(method); --- 1860,1864 ---- } ! args = PyTuple_Pack(1, w); if (args == NULL) { Py_DECREF(method); Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.69 retrieving revision 2.70 diff -C2 -d -r2.69 -r2.70 *** complexobject.c 30 Aug 2003 23:57:36 -0000 2.69 --- complexobject.c 12 Oct 2003 19:09:37 -0000 2.70 *************** *** 440,444 **** d = PyComplex_FromCComplex(div); m = PyComplex_FromCComplex(mod); ! z = Py_BuildValue("(OO)", d, m); Py_XDECREF(d); Py_XDECREF(m); --- 440,444 ---- d = PyComplex_FromCComplex(div); m = PyComplex_FromCComplex(mod); ! z = PyTuple_Pack(2, d, m); Py_XDECREF(d); Py_XDECREF(m); *************** *** 866,870 **** PyErr_Clear(); else { ! PyObject *args = Py_BuildValue("()"); if (args == NULL) return NULL; --- 866,870 ---- PyErr_Clear(); else { ! PyObject *args = PyTuple_New(0); if (args == NULL) return NULL; Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.183 retrieving revision 2.184 diff -C2 -d -r2.183 -r2.184 *** fileobject.c 7 Sep 2003 20:42:29 -0000 2.183 --- fileobject.c 12 Oct 2003 19:09:37 -0000 2.184 *************** *** 1228,1232 **** return NULL; if (n <= 0) ! args = Py_BuildValue("()"); else args = Py_BuildValue("(i)", n); --- 1228,1232 ---- return NULL; if (n <= 0) ! args = PyTuple_New(0); else args = Py_BuildValue("(i)", n); *************** *** 2105,2109 **** return -1; } ! args = Py_BuildValue("(O)", value); if (args == NULL) { Py_DECREF(value); --- 2105,2109 ---- return -1; } ! args = PyTuple_Pack(1, value); if (args == NULL) { Py_DECREF(value); Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.248 retrieving revision 2.249 diff -C2 -d -r2.248 -r2.249 *** typeobject.c 11 Oct 2003 19:32:18 -0000 2.248 --- typeobject.c 12 Oct 2003 19:09:37 -0000 2.249 *************** *** 164,168 **** else { PyObject* tuple; ! tuple = Py_BuildValue("OO", subclass, old_mro); Py_DECREF(old_mro); if (!tuple) --- 164,168 ---- else { PyObject* tuple; ! tuple = PyTuple_Pack(2, subclass, old_mro); Py_DECREF(old_mro); if (!tuple) *************** *** 259,264 **** PyTypeObject* cls; PyObject* mro; ! PyArg_ParseTuple(PyList_GET_ITEM(temp, i), ! "OO", &cls, &mro); Py_DECREF(cls->tp_mro); cls->tp_mro = mro; --- 259,264 ---- PyTypeObject* cls; PyObject* mro; ! PyArg_UnpackTuple(PyList_GET_ITEM(temp, i), ! "", 2, 2, &cls, &mro); Py_DECREF(cls->tp_mro); cls->tp_mro = mro; *************** *** 1607,1611 **** /* Adjust for empty tuple bases */ if (nbases == 0) { ! bases = Py_BuildValue("(O)", &PyBaseObject_Type); if (bases == NULL) return NULL; --- 1607,1611 ---- /* Adjust for empty tuple bases */ if (nbases == 0) { ! bases = PyTuple_Pack(1, &PyBaseObject_Type); if (bases == NULL) return NULL; *************** *** 1651,1655 **** /* Make it into a tuple */ if (PyString_Check(slots)) ! slots = Py_BuildValue("(O)", slots); else slots = PySequence_Tuple(slots); --- 1651,1655 ---- /* Make it into a tuple */ if (PyString_Check(slots)) ! slots = PyTuple_Pack(1, slots); else slots = PySequence_Tuple(slots); *************** *** 2645,2650 **** } ! res = Py_BuildValue("(OOOOO)", ! newobj, args2, state, listitems, dictitems); end: --- 2645,2649 ---- } ! res = PyTuple_Pack(5, newobj, args2, state, listitems, dictitems); end: *************** *** 3143,3147 **** bases = PyTuple_New(0); else ! bases = Py_BuildValue("(O)", base); if (bases == NULL) goto error; --- 3142,3146 ---- bases = PyTuple_New(0); else ! bases = PyTuple_Pack(1, base); if (bases == NULL) goto error; *************** *** 4128,4132 **** func = lookup_maybe(self, "__contains__", &contains_str); if (func != NULL) { ! args = Py_BuildValue("(O)", value); if (args == NULL) res = NULL; --- 4127,4131 ---- func = lookup_maybe(self, "__contains__", &contains_str); if (func != NULL) { ! args = PyTuple_Pack(1, value); if (args == NULL) res = NULL; *************** *** 4343,4347 **** } else { ! args = Py_BuildValue("(O)", other); if (args == NULL) res = NULL; --- 4342,4346 ---- } else { ! args = PyTuple_Pack(1, other); if (args == NULL) res = NULL; *************** *** 4572,4576 **** return Py_NotImplemented; } ! args = Py_BuildValue("(O)", other); if (args == NULL) res = NULL; --- 4571,4575 ---- return Py_NotImplemented; } ! args = PyTuple_Pack(1, other); if (args == NULL) res = NULL; From rhettinger at users.sourceforge.net Sun Oct 12 15:09:40 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 15:09:45 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.297, 2.298 ceval.c, 2.367, 2.368 compile.c, 2.295, 2.296 errors.c, 2.78, 2.79 exceptions.c, 1.47, 1.48 pythonrun.c, 2.197, 2.198 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv411/Python Modified Files: bltinmodule.c ceval.c compile.c errors.c exceptions.c pythonrun.c Log Message: Simplify and speedup uses of Py_BuildValue(): * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a) Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.297 retrieving revision 2.298 diff -C2 -d -r2.297 -r2.298 *** bltinmodule.c 16 Sep 2003 03:17:16 -0000 2.297 --- bltinmodule.c 12 Oct 2003 19:09:37 -0000 2.298 *************** *** 324,328 **** if (PyNumber_Coerce(&v, &w) < 0) return NULL; ! res = Py_BuildValue("(OO)", v, w); Py_DECREF(v); Py_DECREF(w); --- 324,328 ---- if (PyNumber_Coerce(&v, &w) < 0) return NULL; ! res = PyTuple_Pack(2, v, w); Py_DECREF(v); Py_DECREF(w); *************** *** 2186,2190 **** } else { ! PyObject *arg = Py_BuildValue("(O)", item); if (arg == NULL) { Py_DECREF(item); --- 2186,2190 ---- } else { ! PyObject *arg = PyTuple_Pack(1, item); if (arg == NULL) { Py_DECREF(item); *************** *** 2253,2257 **** } else { PyObject *arg, *good; ! arg = Py_BuildValue("(O)", item); if (arg == NULL) { Py_DECREF(item); --- 2253,2257 ---- } else { PyObject *arg, *good; ! arg = PyTuple_Pack(1, item); if (arg == NULL) { Py_DECREF(item); *************** *** 2347,2351 **** ok = 1; } else { ! arg = Py_BuildValue("(O)", item); if (arg == NULL) { Py_DECREF(item); --- 2347,2351 ---- ok = 1; } else { ! arg = PyTuple_Pack(1, item); if (arg == NULL) { Py_DECREF(item); Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.367 retrieving revision 2.368 diff -C2 -d -r2.367 -r2.368 *** ceval.c 29 Jun 2003 14:48:32 -0000 2.367 --- ceval.c 12 Oct 2003 19:09:37 -0000 2.368 *************** *** 1474,1478 **** } if (err == 0) { ! x = Py_BuildValue("(O)", v); if (x == NULL) err = -1; --- 1474,1478 ---- } if (err == 0) { ! x = PyTuple_Pack(1, v); if (x == NULL) err = -1; *************** *** 1982,1986 **** } u = TOP(); ! w = Py_BuildValue("(OOOO)", w, f->f_globals, --- 1982,1986 ---- } u = TOP(); ! w = PyTuple_Pack(4, w, f->f_globals, *************** *** 3000,3004 **** Py_INCREF(value); } ! arg = Py_BuildValue("(OOO)", type, value, traceback); if (arg == NULL) { PyErr_Restore(type, value, traceback); --- 3000,3004 ---- Py_INCREF(value); } ! arg = PyTuple_Pack(3, type, value, traceback); if (arg == NULL) { PyErr_Restore(type, value, traceback); Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.295 retrieving revision 2.296 diff -C2 -d -r2.295 -r2.296 *** compile.c 22 Sep 2003 04:26:44 -0000 2.295 --- compile.c 12 Oct 2003 19:09:37 -0000 2.296 *************** *** 611,615 **** if (t == NULL) goto exit; ! w = Py_BuildValue("(OO)", v, t); if (w == NULL) goto exit; --- 611,615 ---- if (t == NULL) goto exit; ! w = PyTuple_Pack(2, v, t); if (w == NULL) goto exit; *************** *** 970,974 **** long n; ! t = Py_BuildValue("(OO)", v, v->ob_type); if (t == NULL) goto fail; --- 970,974 ---- long n; ! t = PyTuple_Pack(2, v, v->ob_type); if (t == NULL) goto fail; Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.78 retrieving revision 2.79 diff -C2 -d -r2.78 -r2.79 *** errors.c 15 Jul 2003 23:03:55 -0000 2.78 --- errors.c 12 Oct 2003 19:09:37 -0000 2.79 *************** *** 160,164 **** if (value == Py_None) ! args = Py_BuildValue("()"); else if (PyTuple_Check(value)) { Py_INCREF(value); --- 160,164 ---- if (value == Py_None) ! args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); *************** *** 166,170 **** } else ! args = Py_BuildValue("(O)", value); if (args == NULL) --- 166,170 ---- } else ! args = PyTuple_Pack(1, value); if (args == NULL) *************** *** 561,565 **** if (classname == NULL) goto failure; ! bases = Py_BuildValue("(O)", base); if (bases == NULL) goto failure; --- 561,565 ---- if (classname == NULL) goto failure; ! bases = PyTuple_Pack(1, base); if (bases == NULL) goto failure; Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** exceptions.c 14 Aug 2003 20:59:07 -0000 1.47 --- exceptions.c 12 Oct 2003 19:09:37 -0000 1.48 *************** *** 1822,1826 **** /* Now we need to pre-allocate a MemoryError instance */ ! args = Py_BuildValue("()"); if (!args || !(PyExc_MemoryErrorInst = PyEval_CallObject(PyExc_MemoryError, args))) --- 1822,1826 ---- /* Now we need to pre-allocate a MemoryError instance */ ! args = PyTuple_New(0); if (!args || !(PyExc_MemoryErrorInst = PyEval_CallObject(PyExc_MemoryError, args))) Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.197 retrieving revision 2.198 diff -C2 -d -r2.197 -r2.198 *** pythonrun.c 11 Aug 2003 12:20:24 -0000 2.197 --- pythonrun.c 12 Oct 2003 19:09:37 -0000 2.198 *************** *** 1038,1042 **** hook = PySys_GetObject("excepthook"); if (hook) { ! PyObject *args = Py_BuildValue("(OOO)", exception, v ? v : Py_None, tb ? tb : Py_None); PyObject *result = PyEval_CallObject(hook, args); --- 1038,1042 ---- hook = PySys_GetObject("excepthook"); if (hook) { ! PyObject *args = PyTuple_Pack(3, exception, v ? v : Py_None, tb ? tb : Py_None); PyObject *result = PyEval_CallObject(hook, args); From rhettinger at users.sourceforge.net Sun Oct 12 15:09:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 15:09:47 2003 Subject: [Python-checkins] python/dist/src/Modules _sre.c, 2.99, 2.100 almodule.c, 1.38, 1.39 arraymodule.c, 2.91, 2.92 cPickle.c, 2.147, 2.148 cStringIO.c, 2.44, 2.45 datetimemodule.c, 1.67, 1.68 flmodule.c, 1.51, 1.52 mathmodule.c, 2.71, 2.72 posixmodule.c, 2.304, 2.305 pyexpat.c, 2.83, 2.84 regexmodule.c, 1.49, 1.50 selectmodule.c, 2.74, 2.75 socketmodule.c, 1.275, 1.276 svmodule.c, 2.19, 2.20 symtablemodule.c, 1.7, 1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv411/Modules Modified Files: _sre.c almodule.c arraymodule.c cPickle.c cStringIO.c datetimemodule.c flmodule.c mathmodule.c posixmodule.c pyexpat.c regexmodule.c selectmodule.c socketmodule.c svmodule.c symtablemodule.c Log Message: Simplify and speedup uses of Py_BuildValue(): * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a) Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.99 retrieving revision 2.100 diff -C2 -d -r2.99 -r2.100 *** _sre.c 26 Jun 2003 14:41:08 -0000 2.99 --- _sre.c 12 Oct 2003 19:09:36 -0000 2.100 *************** *** 1908,1912 **** copy = call( "copy", "deepcopy", ! Py_BuildValue("OO", *object, memo) ); if (!copy) --- 1908,1912 ---- copy = call( "copy", "deepcopy", ! PyTuple_Pack(2, *object, memo) ); if (!copy) *************** *** 1969,1973 **** result = call( "string", "join", ! Py_BuildValue("OO", list, joiner) ); #endif --- 1969,1973 ---- result = call( "string", "join", ! PyTuple_Pack(2, list, joiner) ); #endif *************** *** 2256,2260 **** filter = call( SRE_MODULE, "_subx", ! Py_BuildValue("OO", self, template) ); if (!filter) --- 2256,2260 ---- filter = call( SRE_MODULE, "_subx", ! PyTuple_Pack(2, self, template) ); if (!filter) *************** *** 2322,2326 **** if (!match) goto error; ! args = Py_BuildValue("(O)", match); if (!args) { Py_DECREF(match); --- 2322,2326 ---- if (!match) goto error; ! args = PyTuple_Pack(1, match); if (!args) { Py_DECREF(match); *************** *** 2611,2615 **** return call( SRE_MODULE, "_expand", ! Py_BuildValue("OOO", self->pattern, self, template) ); } --- 2611,2615 ---- return call( SRE_MODULE, "_expand", ! PyTuple_Pack(3, self->pattern, self, template) ); } Index: almodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** almodule.c 30 Mar 2003 21:49:18 -0000 1.38 --- almodule.c 12 Oct 2003 19:09:36 -0000 1.39 *************** *** 902,906 **** return NULL; } ! ret = Py_BuildValue("(OO)", v0, v1); Py_DECREF(v0); Py_DECREF(v1); --- 902,906 ---- return NULL; } ! ret = PyTuple_Pack(2, v0, v1); Py_DECREF(v0); Py_DECREF(v1); Index: arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.91 retrieving revision 2.92 diff -C2 -d -r2.91 -r2.92 *** arraymodule.c 5 Aug 2003 11:23:59 -0000 2.91 --- arraymodule.c 12 Oct 2003 19:09:36 -0000 2.92 *************** *** 1771,1775 **** } } else if (initial != NULL && PyString_Check(initial)) { ! PyObject *t_initial = Py_BuildValue("(O)", initial); PyObject *v = --- 1771,1775 ---- } } else if (initial != NULL && PyString_Check(initial)) { ! PyObject *t_initial = PyTuple_Pack(1, initial); PyObject *v = Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.147 retrieving revision 2.148 diff -C2 -d -r2.147 -r2.148 *** cPickle.c 11 Jul 2003 19:42:49 -0000 2.147 --- cPickle.c 12 Oct 2003 19:09:36 -0000 2.148 *************** *** 3628,3632 **** PyErr_Fetch(&tp, &v, &tb); ! if ((r=Py_BuildValue("OOO",v,cls,args))) { Py_XDECREF(v); v=r; --- 3628,3632 ---- PyErr_Fetch(&tp, &v, &tb); ! if ((r=PyTuple_Pack(3,v,cls,args))) { Py_XDECREF(v); v=r; Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -d -r2.44 -r2.45 *** cStringIO.c 11 Aug 2003 14:51:15 -0000 2.44 --- cStringIO.c 12 Oct 2003 19:09:36 -0000 2.45 *************** *** 440,444 **** UNLESS (tmp) return NULL; ! args = Py_BuildValue("(O)", tmp); Py_DECREF(tmp); UNLESS (args) return NULL; --- 440,444 ---- UNLESS (tmp) return NULL; ! args = PyTuple_Pack(1, tmp); Py_DECREF(tmp); UNLESS (args) return NULL; Index: datetimemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** datetimemodule.c 27 Jun 2003 08:14:17 -0000 1.67 --- datetimemodule.c 12 Oct 2003 19:09:36 -0000 1.68 *************** *** 3373,3379 **** if (basestate != NULL) { if (! HASTZINFO(self) || self->tzinfo == Py_None) ! result = Py_BuildValue("(O)", basestate); else ! result = Py_BuildValue("OO", basestate, self->tzinfo); Py_DECREF(basestate); } --- 3373,3379 ---- if (basestate != NULL) { if (! HASTZINFO(self) || self->tzinfo == Py_None) ! result = PyTuple_Pack(1, basestate); else ! result = PyTuple_Pack(2, basestate, self->tzinfo); Py_DECREF(basestate); } *************** *** 4351,4357 **** if (basestate != NULL) { if (! HASTZINFO(self) || self->tzinfo == Py_None) ! result = Py_BuildValue("(O)", basestate); else ! result = Py_BuildValue("OO", basestate, self->tzinfo); Py_DECREF(basestate); } --- 4351,4357 ---- if (basestate != NULL) { if (! HASTZINFO(self) || self->tzinfo == Py_None) ! result = PyTuple_Pack(1, basestate); else ! result = PyTuple_Pack(2, basestate, self->tzinfo); Py_DECREF(basestate); } Index: flmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/flmodule.c,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** flmodule.c 2 Aug 2002 02:27:13 -0000 1.51 --- flmodule.c 12 Oct 2003 19:09:36 -0000 1.52 *************** *** 1715,1719 **** return ((PyObject *) g); } ! arg = Py_BuildValue("(OO)", (PyObject *)g, g->ob_callback_arg); if (arg == NULL) return NULL; --- 1715,1719 ---- return ((PyObject *) g); } ! arg = PyTuple_Pack(2, (PyObject *)g, g->ob_callback_arg); if (arg == NULL) return NULL; Index: mathmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v retrieving revision 2.71 retrieving revision 2.72 diff -C2 -d -r2.71 -r2.72 *** mathmodule.c 29 Dec 2002 16:31:06 -0000 2.71 --- mathmodule.c 12 Oct 2003 19:09:36 -0000 2.72 *************** *** 260,268 **** return loghelper(args, log, "d:log", arg); ! newargs = PyTuple_New(1); if (newargs == NULL) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(newargs, 0, arg); num = loghelper(newargs, log, "d:log", arg); Py_DECREF(newargs); --- 260,266 ---- return loghelper(args, log, "d:log", arg); ! newargs = PyTuple_Pack(1, arg); if (newargs == NULL) return NULL; num = loghelper(newargs, log, "d:log", arg); Py_DECREF(newargs); *************** *** 270,280 **** return NULL; ! newargs = PyTuple_New(1); if (newargs == NULL) { Py_DECREF(num); return NULL; } - Py_INCREF(base); - PyTuple_SET_ITEM(newargs, 0, base); den = loghelper(newargs, log, "d:log", base); Py_DECREF(newargs); --- 268,276 ---- return NULL; ! newargs = PyTuple_Pack(1, base); if (newargs == NULL) { Py_DECREF(num); return NULL; } den = loghelper(newargs, log, "d:log", base); Py_DECREF(newargs); Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.304 retrieving revision 2.305 diff -C2 -d -r2.304 -r2.305 *** posixmodule.c 20 Sep 2003 11:20:30 -0000 2.304 --- posixmodule.c 12 Oct 2003 19:09:36 -0000 2.305 *************** *** 3377,3384 **** if ((p_f[2] = PyFile_FromFile(p_s[2], cmdstring, rd_mode, _PyPclose)) != NULL) PyFile_SetBufSize(p_f[0], bufsize); ! f = Py_BuildValue("OOO", p_f[0], p_f[1], p_f[2]); } else ! f = Py_BuildValue("OO", p_f[0], p_f[1]); /* --- 3377,3384 ---- if ((p_f[2] = PyFile_FromFile(p_s[2], cmdstring, rd_mode, _PyPclose)) != NULL) PyFile_SetBufSize(p_f[0], bufsize); ! f = PyTuple_Pack(3, p_f[0], p_f[1], p_f[2]); } else ! f = PyTuple_Pack(2, p_f[0], p_f[1]); /* *************** *** 4070,4074 **** CloseHandle(hChildStderrRdDup); ! f = Py_BuildValue("OO",p1,p2); Py_XDECREF(p1); Py_XDECREF(p2); --- 4070,4074 ---- CloseHandle(hChildStderrRdDup); ! f = PyTuple_Pack(2,p1,p2); Py_XDECREF(p1); Py_XDECREF(p2); *************** *** 4102,4106 **** PyFile_SetBufSize(p2, 0); PyFile_SetBufSize(p3, 0); ! f = Py_BuildValue("OOO",p1,p2,p3); Py_XDECREF(p1); Py_XDECREF(p2); --- 4102,4106 ---- PyFile_SetBufSize(p2, 0); PyFile_SetBufSize(p3, 0); ! f = PyTuple_Pack(3,p1,p2,p3); Py_XDECREF(p1); Py_XDECREF(p2); Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.83 retrieving revision 2.84 diff -C2 -d -r2.83 -r2.84 *** pyexpat.c 21 Jul 2003 17:22:43 -0000 2.83 --- pyexpat.c 12 Oct 2003 19:09:37 -0000 2.84 *************** *** 337,341 **** Py_INCREF(value); } ! arg = Py_BuildValue("(OOO)", type, value, traceback); if (arg == NULL) { PyErr_Restore(type, value, traceback); --- 337,341 ---- Py_INCREF(value); } ! arg = PyTuple_Pack(3, type, value, traceback); if (arg == NULL) { PyErr_Restore(type, value, traceback); Index: regexmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/regexmodule.c,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** regexmodule.c 2 Aug 2002 02:27:13 -0000 1.49 --- regexmodule.c 12 Oct 2003 19:09:37 -0000 1.50 *************** *** 552,556 **** update_cache(PyObject *pat) { ! PyObject *tuple = Py_BuildValue("(O)", pat); int status = 0; --- 552,556 ---- update_cache(PyObject *pat) { ! PyObject *tuple = PyTuple_Pack(1, pat); int status = 0; Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.74 retrieving revision 2.75 diff -C2 -d -r2.74 -r2.75 *** selectmodule.c 10 Sep 2003 19:37:42 -0000 2.74 --- selectmodule.c 12 Oct 2003 19:09:37 -0000 2.75 *************** *** 285,289 **** ifdlist = PyList_New(0); if (ifdlist) { ! ret = Py_BuildValue("OOO", ifdlist, ifdlist, ifdlist); Py_DECREF(ifdlist); } --- 285,289 ---- ifdlist = PyList_New(0); if (ifdlist) { ! ret = PyTuple_Pack(3, ifdlist, ifdlist, ifdlist); Py_DECREF(ifdlist); } *************** *** 300,304 **** ret = NULL; else ! ret = Py_BuildValue("OOO", ifdlist, ofdlist, efdlist); Py_DECREF(ifdlist); --- 300,304 ---- ret = NULL; else ! ret = PyTuple_Pack(3, ifdlist, ofdlist, efdlist); Py_DECREF(ifdlist); Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.275 retrieving revision 1.276 diff -C2 -d -r1.275 -r1.276 *** socketmodule.c 4 Oct 2003 08:00:49 -0000 1.275 --- socketmodule.c 12 Oct 2003 19:09:37 -0000 1.276 *************** *** 1162,1166 **** goto finally; ! res = Py_BuildValue("OO", sock, addr); finally: --- 1162,1166 ---- goto finally; ! res = PyTuple_Pack(2, sock, addr); finally: *************** *** 1912,1916 **** goto finally; ! ret = Py_BuildValue("OO", buf, addr); finally: --- 1912,1916 ---- goto finally; ! ret = PyTuple_Pack(2, buf, addr); finally: Index: svmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/svmodule.c,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -d -r2.19 -r2.20 *** svmodule.c 17 Jan 2002 23:15:58 -0000 2.19 --- svmodule.c 12 Oct 2003 19:09:37 -0000 2.20 *************** *** 158,162 **** fieldsize))) goto finally; ! ret = Py_BuildValue("(OO)", f1, f2); finally: --- 158,162 ---- fieldsize))) goto finally; ! ret = PyTuple_Pack(2, f1, f2); finally: Index: symtablemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/symtablemodule.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** symtablemodule.c 13 Aug 2002 22:20:40 -0000 1.7 --- symtablemodule.c 12 Oct 2003 19:09:37 -0000 1.8 *************** *** 32,36 **** if (st == NULL) return NULL; ! t = Py_BuildValue("O", st->st_symbols); PyMem_Free((void *)st->st_future); PySymtable_Free(st); --- 32,37 ---- if (st == NULL) return NULL; ! t = st->st_symbols; ! Py_INCREF(t); PyMem_Free((void *)st->st_future); PySymtable_Free(st); From jvr at users.sourceforge.net Sun Oct 12 15:27:26 2003 From: jvr at users.sourceforge.net (jvr@users.sourceforge.net) Date: Sun Oct 12 15:27:30 2003 Subject: [Python-checkins] python/dist/src/Mac/Tools/IDE PyConsole.py, 1.17, 1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory sc8-pr-cvs1:/tmp/cvs-serv4435 Modified Files: PyConsole.py Log Message: fix for bug [819860]: make sure the buffer gets emptied, even if WEInsert() fails Index: PyConsole.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyConsole.py 9 May 2003 11:47:23 -0000 1.17 --- PyConsole.py 12 Oct 2003 19:27:24 -0000 1.18 *************** *** 128,135 **** stuff = string.join(stuff, '\r') self.setselection_at_end() ! self.ted.WEInsert(stuff, None, None) selstart, selend = self.getselection() self._inputstart = selstart - self._buf = "" self.ted.WEClearUndo() self.updatescrollbars() --- 128,137 ---- stuff = string.join(stuff, '\r') self.setselection_at_end() ! try: ! self.ted.WEInsert(stuff, None, None) ! finally: ! self._buf = "" selstart, selend = self.getselection() self._inputstart = selstart self.ted.WEClearUndo() self.updatescrollbars() *************** *** 330,335 **** self.w.outputtext.setselection(end, end) self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0) ! self.w.outputtext.ted.WEInsert(stuff, None, None) ! self._buf = "" self.w.outputtext.updatescrollbars() self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) --- 332,339 ---- self.w.outputtext.setselection(end, end) self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0) ! try: ! self.w.outputtext.ted.WEInsert(stuff, None, None) ! finally: ! self._buf = "" self.w.outputtext.updatescrollbars() self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) From bac at OCF.Berkeley.EDU Sun Oct 12 16:05:21 2003 From: bac at OCF.Berkeley.EDU (Brett C.) Date: Sun Oct 12 16:05:31 2003 Subject: [Python-checkins] python/dist/src/Lib urlparse.py,1.41,1.42 In-Reply-To: <16265.26748.451661.390136@grendel.zope.com> References: <16265.26748.451661.390136@grendel.zope.com> Message-ID: <3F89B401.6070601@ocf.berkeley.edu> Fred L. Drake, Jr. wrote: > bcannon@users.sourceforge.net writes: > > Log Message: > > (revision purely to add comment) > > You can use "cvs admin" to fix broken comments. It doesn't generate > an email, but it avoids an extra entry in the history. > OK, good to know. I think I will add that to the dev FAQ. -Brett From rhettinger at users.sourceforge.net Sun Oct 12 19:41:24 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 12 19:41:28 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c, 2.241.6.2, 2.241.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv21086 Modified Files: Tag: release23-maint typeobject.c Log Message: Backport fix to SF bug #820397: __nonzero__() returns 1/0 Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241.6.2 retrieving revision 2.241.6.3 diff -C2 -d -r2.241.6.2 -r2.241.6.3 *** typeobject.c 9 Oct 2003 20:51:07 -0000 2.241.6.2 --- typeobject.c 12 Oct 2003 23:41:21 -0000 2.241.6.3 *************** *** 3313,3316 **** --- 3313,3330 ---- static PyObject * + wrap_inquirypred(PyObject *self, PyObject *args, void *wrapped) + { + inquiry func = (inquiry)wrapped; + int res; + + if (!PyArg_ParseTuple(args, "")) + return NULL; + res = (*func)(self); + if (res == -1 && PyErr_Occurred()) + return NULL; + return PyBool_FromLong((long)res); + } + + static PyObject * wrap_binaryfunc(PyObject *self, PyObject *args, void *wrapped) { *************** *** 4901,4905 **** UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, "abs(x)"), ! UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquiry, "x != 0"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), --- 4915,4919 ---- UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, "abs(x)"), ! UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquirypred, "x != 0"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), From bcannon at users.sourceforge.net Mon Oct 13 00:27:49 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Oct 13 00:27:53 2003 Subject: [Python-checkins] python/dist/src/Lib/test regrtest.py,1.146,1.147 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv25155/Lib/test Modified Files: regrtest.py Log Message: Add test__locale to expected skip list for Darwin. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** regrtest.py 20 Sep 2003 22:06:13 -0000 1.146 --- regrtest.py 13 Oct 2003 04:27:47 -0000 1.147 *************** *** 766,769 **** --- 766,770 ---- 'darwin': """ + test__locale test_al test_bsddb From jvr at users.sourceforge.net Mon Oct 13 08:44:25 2003 From: jvr at users.sourceforge.net (jvr@users.sourceforge.net) Date: Mon Oct 13 08:44:28 2003 Subject: [Python-checkins] python/dist/src/Mac/Tools/IDE PyConsole.py, 1.17, 1.17.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory sc8-pr-cvs1:/tmp/cvs-serv2587 Modified Files: Tag: release23-maint PyConsole.py Log Message: backport of fix for [819860] Index: PyConsole.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v retrieving revision 1.17 retrieving revision 1.17.8.1 diff -C2 -d -r1.17 -r1.17.8.1 *** PyConsole.py 9 May 2003 11:47:23 -0000 1.17 --- PyConsole.py 13 Oct 2003 12:44:22 -0000 1.17.8.1 *************** *** 128,135 **** stuff = string.join(stuff, '\r') self.setselection_at_end() ! self.ted.WEInsert(stuff, None, None) selstart, selend = self.getselection() self._inputstart = selstart - self._buf = "" self.ted.WEClearUndo() self.updatescrollbars() --- 128,137 ---- stuff = string.join(stuff, '\r') self.setselection_at_end() ! try: ! self.ted.WEInsert(stuff, None, None) ! finally: ! self._buf = "" selstart, selend = self.getselection() self._inputstart = selstart self.ted.WEClearUndo() self.updatescrollbars() *************** *** 330,335 **** self.w.outputtext.setselection(end, end) self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0) ! self.w.outputtext.ted.WEInsert(stuff, None, None) ! self._buf = "" self.w.outputtext.updatescrollbars() self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) --- 332,339 ---- self.w.outputtext.setselection(end, end) self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0) ! try: ! self.w.outputtext.ted.WEInsert(stuff, None, None) ! finally: ! self._buf = "" self.w.outputtext.updatescrollbars() self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) From nnorwitz at users.sourceforge.net Mon Oct 13 13:47:32 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Mon Oct 13 13:47:36 2003 Subject: [Python-checkins] python/dist/src/Doc/api intro.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv27137 Modified Files: intro.tex Log Message: SF #822262, Typo in Doc/api/intro.tex Index: intro.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/intro.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** intro.tex 28 Nov 2001 07:26:14 -0000 1.3 --- intro.tex 13 Oct 2003 17:47:30 -0000 1.4 *************** *** 281,285 **** It is important to realize that whether you own a reference returned by a function depends on which function you call only --- \emph{the ! plumage} (the type of the type of the object passed as an argument to the function) \emph{doesn't enter into it!} Thus, if you extract an item from a list using \cfunction{PyList_GetItem()}, you --- 281,285 ---- It is important to realize that whether you own a reference returned by a function depends on which function you call only --- \emph{the ! plumage} (the type of the object passed as an argument to the function) \emph{doesn't enter into it!} Thus, if you extract an item from a list using \cfunction{PyList_GetItem()}, you From nnorwitz at users.sourceforge.net Mon Oct 13 13:48:25 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Mon Oct 13 13:48:28 2003 Subject: [Python-checkins] python/dist/src/Doc/api intro.tex,1.3,1.3.24.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv27309 Modified Files: Tag: release23-maint intro.tex Log Message: SF #822262, Typo in Doc/api/intro.tex Index: intro.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/intro.tex,v retrieving revision 1.3 retrieving revision 1.3.24.1 diff -C2 -d -r1.3 -r1.3.24.1 *** intro.tex 28 Nov 2001 07:26:14 -0000 1.3 --- intro.tex 13 Oct 2003 17:48:23 -0000 1.3.24.1 *************** *** 281,285 **** It is important to realize that whether you own a reference returned by a function depends on which function you call only --- \emph{the ! plumage} (the type of the type of the object passed as an argument to the function) \emph{doesn't enter into it!} Thus, if you extract an item from a list using \cfunction{PyList_GetItem()}, you --- 281,285 ---- It is important to realize that whether you own a reference returned by a function depends on which function you call only --- \emph{the ! plumage} (the type of the object passed as an argument to the function) \emph{doesn't enter into it!} Thus, if you extract an item from a list using \cfunction{PyList_GetItem()}, you From rhettinger at users.sourceforge.net Mon Oct 13 13:52:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 13 13:52:40 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.149,1.150 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28045 Modified Files: libfuncs.tex Log Message: SF bug #821701: reduce docs neglect a very important piece of information. Add a note showing which argument is the accumulator. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** libfuncs.tex 22 Sep 2003 15:00:54 -0000 1.149 --- libfuncs.tex 13 Oct 2003 17:52:35 -0000 1.150 *************** *** 817,821 **** \var{sequence}, from left to right, so as to reduce the sequence to a single value. For example, \code{reduce(lambda x, y: x+y, [1, 2, ! 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. If the optional \var{initializer} is present, it is placed before the items of the sequence in the calculation, and serves as a default when the --- 817,823 ---- \var{sequence}, from left to right, so as to reduce the sequence to a single value. For example, \code{reduce(lambda x, y: x+y, [1, 2, ! 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. The left argument, ! \var{x}, is the accumulated value and the right argument, \var{y}, ! is the update value from the \var{sequence}. If the optional \var{initializer} is present, it is placed before the items of the sequence in the calculation, and serves as a default when the From rhettinger at users.sourceforge.net Mon Oct 13 13:54:49 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 13 13:54:51 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex, 1.143.8.5, 1.143.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28970 Modified Files: Tag: release23-maint libfuncs.tex Log Message: SF bug #821701: reduce docs neglect a very important piece of information. Add a note showing which argument is the accumulator. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.143.8.5 retrieving revision 1.143.8.6 diff -C2 -d -r1.143.8.5 -r1.143.8.6 *** libfuncs.tex 22 Sep 2003 15:50:51 -0000 1.143.8.5 --- libfuncs.tex 13 Oct 2003 17:54:46 -0000 1.143.8.6 *************** *** 817,821 **** \var{sequence}, from left to right, so as to reduce the sequence to a single value. For example, \code{reduce(lambda x, y: x+y, [1, 2, ! 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. If the optional \var{initializer} is present, it is placed before the items of the sequence in the calculation, and serves as a default when the --- 817,823 ---- \var{sequence}, from left to right, so as to reduce the sequence to a single value. For example, \code{reduce(lambda x, y: x+y, [1, 2, ! 3, 4, 5])} calculates \code{((((1+2)+3)+4)+5)}. The left argument, ! \var{x}, is the accumulated value and the right argument, \var{y}, ! is the update value from the \var{sequence}. If the optional \var{initializer} is present, it is placed before the items of the sequence in the calculation, and serves as a default when the From jhylton at users.sourceforge.net Tue Oct 14 16:12:08 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Oct 14 16:12:12 2003 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv18103 Modified Files: trace.py Log Message: Open results files, which contain binary pickles, in binary mode. Remove fallback code that tries to read marshal data from a results file, since this module never writes marshal data. Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** trace.py 10 Oct 2003 23:05:41 -0000 1.14 --- trace.py 14 Oct 2003 20:12:06 -0000 1.15 *************** *** 205,215 **** # Try to merge existing counts file. try: ! counts, calledfuncs = pickle.load(open(self.infile, 'r')) self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err: print >> sys.stderr, ("Skipping counts file %r: %s" % (self.infile, err)) - except pickle.UnpicklingError: - self.update(self.__class__(marshal.load(open(self.infile)))) def update(self, other): --- 205,213 ---- # Try to merge existing counts file. try: ! counts, calledfuncs = pickle.load(open(self.infile, 'rb')) self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err: print >> sys.stderr, ("Skipping counts file %r: %s" % (self.infile, err)) def update(self, other): *************** *** 289,293 **** try: pickle.dump((self.counts, self.calledfuncs), ! open(self.outfile, 'w'), 1) except IOError, err: print >> sys.stderr, "Can't save counts files because %s" % err --- 287,291 ---- try: pickle.dump((self.counts, self.calledfuncs), ! open(self.outfile, 'wb'), 1) except IOError, err: print >> sys.stderr, "Can't save counts files because %s" % err From bcannon at users.sourceforge.net Tue Oct 14 17:46:01 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Oct 14 17:46:06 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libplatform.tex, NONE, 1.1 lib.tex, 1.223, 1.224 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5359 Modified Files: lib.tex Added Files: libplatform.tex Log Message: Initial checkin of docs for Lib/platform.py . Closes patch #785752 and bug #726911. Should be backported after correctness and such has been verified by Fred. --- NEW FILE: libplatform.tex --- \section{\module{platform} --- Access to underlying platform's identifying data.} \declaremodule{standard}{platform} \modulesynopsis{Retrieves as much platform identifying data as possible.} \moduleauthor{Marc-Andre Lemburg}{mal@egenix.com} \sectionauthor{Bjorn Pettersen}{bpettersen@corp.fairisaac.com} \versionadded{2.3} \begin{notice}[note] Specific platforms listed alphabetically, with Linux included in the \UNIX section. \end{notice} \subsection{Cross Platform} \begin{funcdesc}{architecture}{executable=sys.executable, bits='', linkage=''} Queries the given executable (defaults to the Python interpreter binary) for various architecture informations. Returns a tuple \code{(bits, linkage)} which contain information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are returned as given by the parameter presets. If bits is given as \code{''}, the \cfunction{sizeof(pointer)} (or \cfunction{sizeof(long)} on Python version < 1.5.2) is used as indicator for the supported pointer size. The function relies on the system's \file{file} command to do the actual work. This is available on most if not all \UNIX{} platforms and some non-\UNIX{} platforms and then only if the executable points to the Python interpreter. Reasonable defaults are used when the above needs are not met. \end{funcdesc} \begin{funcdesc}{machine}{} Returns the machine type, e.g. \code{'i386'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{node}{} Returns the computer's network name (may not be fully qualified!) An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{platform}{aliased=0, terse=0} Returns a single string identifying the underlying platform with as much useful information as possible. The output is intended to be \emph{human readable} rather than machine parseable. It may look different on different platforms and this is intended. If \code{aliased} is true, the function will use aliases for various platforms that report system names which differ from their common names, e.g. SunOS will be reported as Solaris. The \function{system_alias()} function is used to implement this. Setting terse to true causes the function to return only the absolute minimum information needed to identify the platform. \end{funcdesc} \begin{funcdesc}{processor}{} Returns the (real) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for \function{machine()}, e.g. NetBSD does this. \end{funcdesc} \begin{funcdesc}{python_build}{} Returns a tuple \code{(buildno, builddate)} stating the Python build number and date as strings. \end{funcdesc} \begin{funcdesc}{python_compiler}{} Returns a string identifying the compiler used for compiling Python. \end{funcdesc} \begin{funcdesc}{python_version}{} Returns the Python version as string \code{'major.minor.patchlevel'} Note that unlike the Python \code{sys.version}, the returned value will always include the patchlevel (it defaults to 0). \end{funcdesc} \begin{funcdesc}{python_version_tuple}{} Returns the Python version as tuple \code{(major, minor, patchlevel)} of strings. Note that unlike the Python \code{sys.version}, the returned value will always include the patchlevel (it defaults to 0). \end{funcdesc} \begin{funcdesc}{release}{} Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'} An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system}{} Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'}, or \code{'Java'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system_alias}{system, release, version} Returns \code{(system, release, version)} aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion. \end{funcdesc} \begin{funcdesc}{version}{} Returns the system's release version, e.g. \code{'#3 on degas'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{uname}{} Fairly portable uname interface. Returns a tuple of strings \code{(system, node, release, version, machine, processor)} identifying the underlying platform. Note that unlike the \function{os.uname()} function this also returns possible processor information as additional tuple entry. Entries which cannot be determined are set to \code{''}. \end{funcdesc} \subsection{Java Platform} \begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''), osinfo=('','','')} Version interface for JPython. Returns a tuple \code{(release, vendor, vminfo, osinfo)} with vminfo being a tuple \code{(vm_name, vm_release, vm_vendor)} and osinfo being a tuple \code{(os_name, os_version, os_arch)}. Values which cannot be determined are set to the defaults given as parameters (which all default to \code{''}). \end{funcdesc} \subsection{Windows Platform} \begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''} Get additional version information from the Windows Registry and return a tuple \code{(version, csd, ptype)} referring to version number, CSD level and OS type (multi/single processor). As a hint: ptype returns \code{'Uniprocessor Free'} on single processor NT machines and \code{'Multiprocessor Free'} on multi processor machines. The \emph{'Free'} refers to the OS version being free of debugging code. It could also state \emph{'Checked'} which means the OS version uses debugging code, i.e. code that checks arguments, ranges, etc. \begin{notice}[note] This function only works if Mark Hammond's \module{win32all} package is installed and (obviously) only runs on Win32 compatible platforms. \end{notice} \end{funcdesc} \subsubsection{Win95/98 specific} \begin{funcdesc}{popen}{cmd, mode='r', bufsize=None} Portable \function{popen()} interface. Find a working popen implementation preferring \function{win32pipe.popen}. On NT \function{win32pipe} should work; on Win9x it hangs due to bugs in the MS C lib. \seetext{MS KnowledgeBase article Q150956.} \end{funcdesc} \subsection{Mac Platform} \begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''} Get MacOS version information and return it as tuple \code{(release, versioninfo, machine)} with versioninfo being a tuple \code{(version, dev_stage, non_release_version)}. Entries which cannot be determined are set to \code{''}. All tuple entries are strings. Documentation for the underlying gestalt() API is available online at \url{http://www.rgaros.nl/gestalt/} \end{funcdesc} \subsection{\UNIX{} Platforms} \begin{funcdesc}{dist}{distname='',version='',id='',supported_dists=('SuSE','debian','redhat','mandrake')} Tries to determine the name of the OS distribution name Returns a tuple \code{(distname, version, id)} which defaults to the args given as parameters. \end{funcdesc} \begin{funcdesc}{libc_ver}{executable=sys.executable, lib='', version='', chunksize=2048} Tries to determine the libc version against which the file executable (defaults to the Python interpreter) is linked. Returns a tuple of strings \code{(lib, version)} which default to the given parameters in case the lookup fails. Note that the function has intimate knowledge of how different libc versions add symbols to the executable is probably only useable for executables compiled using \emph{gcc}. The file is read and scanned in chunks of chunksize bytes. \end{funcdesc} Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.223 retrieving revision 1.224 diff -C2 -d -r1.223 -r1.224 *** lib.tex 14 Jul 2003 12:13:27 -0000 1.223 --- lib.tex 14 Oct 2003 21:45:59 -0000 1.224 *************** *** 164,167 **** --- 164,168 ---- \input{libgettext} \input{liblogging} + \input{libplatform} \input{libsomeos} % Optional Operating System Services From bcannon at users.sourceforge.net Tue Oct 14 17:47:30 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Oct 14 17:47:33 2003 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.250,1.251 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv5863/Misc Modified Files: ACKS Log Message: Added Bjorn Pettersen for initial conversion of Lib/platform.py's docstring to LaTeX. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.250 retrieving revision 1.251 diff -C2 -d -r1.250 -r1.251 *** ACKS 12 Oct 2003 04:36:18 -0000 1.250 --- ACKS 14 Oct 2003 21:47:28 -0000 1.251 *************** *** 425,428 **** --- 425,429 ---- Tim Peters Chris Petrilli + Bjorn Pettersen Geoff Philbrick Gavrie Philipson From bcannon at users.sourceforge.net Tue Oct 14 18:32:36 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Oct 14 18:32:40 2003 Subject: [Python-checkins] python/dist/src/Lib platform.py,1.5,1.5.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv14867/Lib Modified Files: Tag: release23-maint platform.py Log Message: Backport of rev. 1.6 and 1.7 from head. 1.6 was docstring clean-up. 1.7 was a fix for bug #780461 (platform.mac_ver() failing under OS X) and was flagged as a backport candidate. Index: platform.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/platform.py,v retrieving revision 1.5 retrieving revision 1.5.8.1 diff -C2 -d -r1.5 -r1.5.8.1 *** platform.py 29 Jun 2003 04:17:45 -0000 1.5 --- platform.py 14 Oct 2003 22:32:34 -0000 1.5.8.1 *************** *** 1,5 **** #!/usr/bin/env python ! """ This module tries to retrieve as much platform identifying data as possible. It makes this information available via function APIs. --- 1,5 ---- #!/usr/bin/env python ! """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. *************** *** 21,25 **** # * support for additional Linux distributions # ! # Many thanks to all those who helped adding platform specific # checks (in no particular order): # --- 21,25 ---- # * support for additional Linux distributions # ! # Many thanks to all those who helped adding platform-specific # checks (in no particular order): # *************** *** 119,124 **** chunksize=2048): ! """ Tries to determine the libc version against which the ! file executable (defaults to the Python interpreter) is linked. Returns a tuple of strings (lib,version) which default to the --- 119,124 ---- chunksize=2048): ! """ Tries to determine the libc version that the file executable ! (which defaults to the Python interpreter) is linked against. Returns a tuple of strings (lib,version) which default to the *************** *** 126,131 **** Note that the function has intimate knowledge of how different ! libc versions add symbols to the executable is probably only ! useable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes. --- 126,131 ---- Note that the function has intimate knowledge of how different ! libc versions add symbols to the executable and thus is probably ! only useable for executables compiled using gcc. The file is read and scanned in chunks of chunksize bytes. *************** *** 220,224 **** supported_dists=('SuSE','debian','redhat','mandrake')): ! """ Tries to determine the name of the OS distribution name The function first looks for a distribution release file in --- 220,224 ---- supported_dists=('SuSE','debian','redhat','mandrake')): ! """ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in *************** *** 226,230 **** suitable files are found. ! Returns a tuple distname,version,id which default to the args given as parameters. --- 226,230 ---- suitable files are found. ! Returns a tuple (distname,version,id) which default to the args given as parameters. *************** *** 352,356 **** def _norm_version(version,build=''): ! """ Normalize the version and build strings and return a sinlge vesion string using the format major.minor.build (or patchlevel). """ --- 352,356 ---- def _norm_version(version,build=''): ! """ Normalize the version and build strings and return a single vesion string using the format major.minor.build (or patchlevel). """ *************** *** 526,529 **** --- 526,530 ---- from gestalt import gestalt + import MacOS l = [] append = l.append *************** *** 531,535 **** try: append(gestalt(selector)) ! except RuntimeError: append(default) return l --- 532,536 ---- try: append(gestalt(selector)) ! except (RuntimeError, MacOS.Error): append(default) return l *************** *** 545,550 **** dev_stage, non_release_version). ! Entries which cannot be determined are set to ''. All tuple ! entries are strings. Thanks to Mark R. Levinson for mailing documentation links and --- 546,551 ---- dev_stage, non_release_version). ! Entries which cannot be determined are set to the paramter values ! which default to ''. All tuple entries are strings. Thanks to Mark R. Levinson for mailing documentation links and *************** *** 558,561 **** --- 559,563 ---- try: import gestalt + import MacOS except ImportError: return release,versioninfo,machine *************** *** 596,600 **** def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')): ! """ Version interface for JPython. Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being --- 598,602 ---- def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')): ! """ Version interface for Jython. Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being *************** *** 816,822 **** """ Queries the given executable (defaults to the Python interpreter ! binary) for various architecture informations. ! Returns a tuple (bits,linkage) which contain information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. --- 818,824 ---- """ Queries the given executable (defaults to the Python interpreter ! binary) for various architecture information. ! Returns a tuple (bits,linkage) which contains information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. *************** *** 829,835 **** The function relies on the system's "file" command to do the actual work. This is available on most if not all Unix ! platforms. On some non-Unix platforms and then only if the ! executable points to the Python interpreter defaults from ! _default_architecture are used. """ --- 831,837 ---- The function relies on the system's "file" command to do the actual work. This is available on most if not all Unix ! platforms. On some non-Unix platforms where the "file" command ! does not exist and the executable is set to the Python interpreter ! binary defaults from _default_architecture are used. """ *************** *** 906,910 **** Note that unlike the os.uname function this also returns ! possible processor information as additional tuple entry. Entries which cannot be determined are set to ''. --- 908,912 ---- Note that unlike the os.uname function this also returns ! possible processor information as an additional tuple entry. Entries which cannot be determined are set to ''. *************** *** 1014,1018 **** def node(): ! """ Returns the computer's network name (may not be fully qualified !) An empty string is returned if the value cannot be determined. --- 1016,1021 ---- def node(): ! """ Returns the computer's network name (which may not be fully ! qualified) An empty string is returned if the value cannot be determined. From bcannon at users.sourceforge.net Tue Oct 14 18:44:53 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Oct 14 18:44:57 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.62,1.831.4.63 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv18148/Misc Modified Files: Tag: release23-maint NEWS Log Message: Add mention of fix of bug #780461 for Lib/platform.py . Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.62 retrieving revision 1.831.4.63 diff -C2 -d -r1.831.4.62 -r1.831.4.63 *** NEWS 9 Oct 2003 20:51:06 -0000 1.831.4.62 --- NEWS 14 Oct 2003 22:44:51 -0000 1.831.4.63 *************** *** 31,34 **** --- 31,36 ---- ------- + - Bug #780461: platform.mac_ver() raised MacOSError exception under OS X. + - Bug #812202: random.randrange() returned only even numbers for range lengths above 2**53. From bcannon at users.sourceforge.net Wed Oct 15 02:19:33 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Wed Oct 15 02:19:36 2003 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.33,1.1.2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv24133/Python Modified Files: Tag: ast-branch ast.c Log Message: Fix bug where 'else' clause was not being detected when there was an 'elif' in the 'if' statement. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.33 retrieving revision 1.1.2.34 diff -C2 -d -r1.1.2.33 -r1.1.2.34 *** ast.c 21 Sep 2003 00:17:48 -0000 1.1.2.33 --- ast.c 15 Oct 2003 06:19:31 -0000 1.1.2.34 *************** *** 1780,1785 **** asdl_seq *orelse = NULL; n_elif = NCH(n) - 4; ! if (TYPE(CHILD(n, n_elif)) == NAME ! && STR(CHILD(n, n_elif))[2] == 's') { has_else = 1; n_elif -= 3; --- 1780,1787 ---- asdl_seq *orelse = NULL; n_elif = NCH(n) - 4; ! /* must reference the child n_elif+1 since 'else' token is third, ! not fourth, child from the end. */ ! if (TYPE(CHILD(n, (n_elif + 1))) == NAME ! && STR(CHILD(n, (n_elif + 1)))[2] == 's') { has_else = 1; n_elif -= 3; From bcannon at users.sourceforge.net Wed Oct 15 02:26:15 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Wed Oct 15 02:26:18 2003 Subject: [Python-checkins] python/dist/src/Python compile.txt, 1.1.2.7, 1.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv25167/Python Modified Files: Tag: ast-branch compile.txt Log Message: Add some comments about node * items. Index: compile.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/compile.txt,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** compile.txt 15 Sep 2003 00:25:48 -0000 1.1.2.7 --- compile.txt 15 Oct 2003 06:26:13 -0000 1.1.2.8 *************** *** 86,90 **** The parser generates a concrete syntax tree represented by a ``node ! *`` defined in ``Include/node.h``. The abstract syntax is generated from the concrete syntax in ``Python/ast.c`` using the function:: --- 86,95 ---- The parser generates a concrete syntax tree represented by a ``node ! *`` defined in ``Include/node.h``. Node indexing starts at 0. Every ! token that can have whitespace surrounding it is its own token. This ! means that something like "else:" is actually two tokens: 'else' and ! ':'. ! ! The abstract syntax is generated from the concrete syntax in ``Python/ast.c`` using the function:: From anthonybaxter at users.sourceforge.net Wed Oct 15 11:05:46 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 15 11:07:02 2003 Subject: [Python-checkins] python/nondist/sandbox/digestauth - New directory Message-ID: Update of /cvsroot/python/python/nondist/sandbox/digestauth In directory sc8-pr-cvs1:/tmp/cvs-serv9509/digestauth Log Message: Directory /cvsroot/python/python/nondist/sandbox/digestauth added to the repository From anthonybaxter at users.sourceforge.net Wed Oct 15 11:06:43 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Wed Oct 15 11:07:11 2003 Subject: [Python-checkins] python/nondist/sandbox/digestauth .cvsignore, NONE, 1.1 digestauth.py, NONE, 1.1 httpclient.py, NONE, 1.1 httpserver.py, NONE, 1.1 urllib2.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/digestauth In directory sc8-pr-cvs1:/tmp/cvs-serv9670 Added Files: .cvsignore digestauth.py httpclient.py httpserver.py urllib2.py Log Message: sandbox for digest auth support --- NEW FILE: .cvsignore --- *.pyc --- NEW FILE: digestauth.py --- import md5, sha, time, random def generate_nonce(bits, randomness=None): "This could be stronger" if bits%8 != 0: raise ValueError, "bits must be a multiple of 8" nonce = sha.new(str(randomness) + str(time.time()) + str(random.random()) ).hexdigest() nonce = nonce[:bits/4] return nonce def parse_keqv_list(l): """Parse list of key=value strings where keys are not duplicated.""" parsed = {} for elt in l: k, v = elt.split('=', 1) if v[0] == '"' and v[-1] == '"': v = v[1:-1] parsed[k] = v return parsed class DigestAuthServer: def __init__(self, default_realm, algorithm="MD5"): self.default_realm = default_realm if algorithm != 'MD5': raise ValueError, "Don't know about algorithm %s"%(MD5) self.algorithm = algorithm self._user_hashes = {} def get_algorithm_impls(self, algorithm=None): # lambdas assume digest modules are imported at the top level if algorithm is None: algorithm = self.algorithm if algorithm == 'MD5': H = lambda x: md5.new(x).hexdigest() elif algorithm == 'SHA': H = lambda x: sha.new(x).hexdigest() # XXX MD5-sess KD = lambda s, d, H=H: H("%s:%s" % (s, d)) return H, KD def add_user(self, user, password, realm=None): "add the given user and password" H, KD = self.get_algorithm_impls() if realm is None: realm = self.default_realm A1 = H('%s:%s:%s'%(user, realm, password)) self._user_hashes[(user, realm)] = A1 def add_user_hash(self, user, A1, realm=None): "add the given user with the stated hash" if realm is None: realm = self.default_realm self._user_hashes[(user, realm)] = A1 def parse_apache_digest_authfile(self, filename): "Parse a password file, as generated by htdigest" for line in open(filename, 'rU'): line = line.strip() user, realm, hash = line.split(':') self.add_user_hash(user, hash, realm) def generate_challenge(self, realm=None): if realm is None: realm = self.default_realm # We should save off the nonce to make sure it's one we've # offered already. And check for replay attacks :-( chal = 'realm="%s", nonce="%s", ' \ 'algorithm=%s, qop="auth"'%(realm, generate_nonce(bits=208), self.algorithm) return chal # Firebird # username="anthony", realm="TestAuth", # nonce="9da7db19648f95bd71f26a07b3423d91917b5205", uri="/test/foo", # algorithm=MD5, response="f61ca0cb8a85e9bd985b7ab808978f1e", # qop=auth, nc=00000001, cnonce="424a1ed1ddaa76ca" # Konqi # username="anthony", realm="TestAuth", # nonce="7c8bdda0ed44db7de74bee97cec8dfd4fb59af0f", uri="/test/foo", # algorithm="MD5", qop="auth", cnonce="ODQwMTk=", nc=00000001, # response="1bebadb47d2aa5eab53cb419b94599f3" def check_auth(self, header, method='GET'): "Check a response to our auth challenge" from urllib2 import parse_http_list H, KD = self.get_algorithm_impls() resp = parse_keqv_list(parse_http_list(header)) if resp.get('algorithm', 'MD5').upper() != self.algorithm: return False, "unknown algo %s"%algorithm user = resp['username'] realm = resp['realm'] nonce = resp['nonce'] # XXX Check the nonce is something we've issued HA1 = self._user_hashes.get((user,realm)) if not HA1: return False, "unknown user/realm %s/%s"%(user, realm) qop = resp.get('qop') if qop != 'auth': return False, "unknown qop %r"%(qop) cnonce, ncvalue = resp.get('cnonce'), resp.get('nc') if not cnonce or not ncvalue: return False, "failed to provide cnonce" # Check the URI is correct! A2 = '%s:%s'%(method, resp['uri']) noncebit = "%s:%s:%s:%s:%s" % (nonce,ncvalue,cnonce,qop,H(A2)) respdig = KD(HA1, noncebit) if respdig != resp['response']: return False, "response incorrect" print "all ok" return True, "OK" --- NEW FILE: httpclient.py --- import urllib2 #URL='http://localhost/test/' URL='http://localhost:8000/test' auth = urllib2.HTTPPasswordMgr() auth.add_password('TestAuth', URL, 'anthony', 'arbadmin2') opener = urllib2.build_opener( urllib2.HTTPDigestAuthHandler(auth) ) u = opener.open(URL) u = opener.open(URL) u = opener.open(URL) print u.readlines() --- NEW FILE: httpserver.py --- import SimpleHTTPServer, BaseHTTPServer import digestauth digester = digestauth.DigestAuthServer(default_realm='TestAuth') digester.parse_apache_digest_authfile('/var/www/passwords') class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self, *args): path = self.path if path.startswith("/test"): if not self.headers.has_key('Authorization'): self.send_auth('auth required') return else: auth = self.headers['Authorization'] if auth.split()[0].lower() == 'digest': ok, reason = digester.check_auth(auth[7:]) if not ok: self.send_auth('auth failed: %s'%reason) return else: self.send_response(200) self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write("all good: %s\n"%path) def send_auth(self, text): self.send_response(401) chal = digester.generate_challenge() self.send_header('WWW-Authenticate', 'Digest %s'%(chal)) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('

'+text+'\n\n

') return def run(server_class=BaseHTTPServer.HTTPServer, handler_class=Handler): server_address = ('', 8000) httpd = server_class(server_address, handler_class) httpd.serve_forever() run() --- NEW FILE: urllib2.py --- """An extensible library for opening URLs using a variety of protocols The simplest way to use this module is to call the urlopen function, which accepts a string containing a URL or a Request object (described below). It opens the URL and returns the results as file-like object; the returned object has some extra methods described below. The OpenerDirector manages a collection of Handler objects that do all the actual work. Each Handler implements a particular protocol or option. The OpenerDirector is a composite object that invokes the Handlers needed to open the requested URL. For example, the HTTPHandler performs HTTP GET and POST requests and deals with non-error returns. The HTTPRedirectHandler automatically deals with HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler deals with digest authentication. urlopen(url, data=None) -- basic usage is that same as original urllib. pass the url and optionally data to post to an HTTP URL, and get a file-like object back. One difference is that you can also pass [...1143 lines suppressed...] install_opener(build_opener(cfh, GopherHandler)) for url in urls: if isinstance(url, tuple): url, req = url else: req = None print url try: f = urlopen(url, req) except IOError, err: print "IOError:", err except socket.error, err: print "socket.error:", err else: buf = f.read() f.close() print "read %d bytes" % len(buf) print time.sleep(0.1) From rhettinger at users.sourceforge.net Wed Oct 15 23:41:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 15 23:41:16 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.133, 1.134 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22643/Doc/lib Modified Files: libstdtypes.tex Log Message: * list.sort() now supports three keyword arguments: cmp, key, and reverse. key provides C support for the decorate-sort-undecorate pattern. reverse provide a stable sort of the list with the comparisions reversed. * Amended the docs to guarantee sort stability. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** libstdtypes.tex 12 Sep 2003 00:02:37 -0000 1.133 --- libstdtypes.tex 16 Oct 2003 03:41:09 -0000 1.134 *************** *** 971,975 **** \lineiii{\var{s}.reverse()} {reverses the items of \var{s} in place}{(7)} ! \lineiii{\var{s}.sort(\optional{\var{cmpfunc=None}})} {sort the items of \var{s} in place}{(7), (8), (9), (10)} \end{tableiii} --- 971,976 ---- \lineiii{\var{s}.reverse()} {reverses the items of \var{s} in place}{(7)} ! \lineiii{\var{s}.sort(\optional{\var{cmp}=None\optional{, \var{key}=None ! \optional{, \var{reverse}=False}}})} {sort the items of \var{s} in place}{(7), (8), (9), (10)} \end{tableiii} *************** *** 1022,1066 **** the sorted or reversed list. ! \item[(8)] The \method{sort()} method takes an optional argument ! specifying a comparison function of two arguments (list items) which ! should return a negative, zero or positive number depending on whether ! the first argument is considered smaller than, equal to, or larger ! than the second argument. Note that this slows the sorting process ! down considerably; for example to sort a list in reverse order it is much ! faster to call \method{sort()} followed by \method{reverse()} ! than to use \method{sort()} with a comparison function that ! reverses the ordering of the elements. Passing \constant{None} as the ! comparison function is semantically equivalent to calling ! \method{sort()} with no comparison function. ! \versionchanged[Support for \code{None} as an equivalent to omitting ! \var{cmpfunc} was added]{2.3} ! As an example of using the \var{cmpfunc} argument to the ! \method{sort()} method, consider sorting a list of sequences by the ! second element of that list: ! \begin{verbatim} ! def mycmp(a, b): ! return cmp(a[1], b[1]) ! mylist.sort(mycmp) ! \end{verbatim} ! A more time-efficient approach for reasonably-sized data structures can ! often be used: ! \begin{verbatim} ! tmplist = [(x[1], x) for x in mylist] ! tmplist.sort() ! mylist = [x for (key, x) in tmplist] ! \end{verbatim} ! \item[(9)] Whether the \method{sort()} method is stable is not defined by ! the language (a sort is stable if it guarantees not to change the ! relative order of elements that compare equal). In the C ! implementation of Python, sorts were stable only by accident through ! Python 2.2. The C implementation of Python 2.3 introduced a stable ! \method{sort()} method, but code that intends to be portable across ! implementations and versions must not rely on stability. \item[(10)] While a list is being sorted, the effect of attempting to --- 1023,1058 ---- the sorted or reversed list. ! \item[(8)] The \method{sort()} method takes optional arguments for ! controlling the comparisions. ! \var{cmp} specifies a custom comparison function of two arguments ! (list items) which should return a negative, zero or positive number ! depending on whether the first argument is considered smaller than, ! equal to, or larger than the second argument: ! \samp{\var{cmp}=\keyword{lambda} \var{x},\var{y}: ! \function{cmp}(x.lower(), y.lower())} ! ! \var{key} specifies a function of one argument that is used to ! extract a comparison key from each list element: ! \samp{\var{cmp}=\function{str.lower}} ! \var{reverse} is a boolean value. If set to \code{True}, then the ! list elements are sorted as if each comparison were reversed. ! In general, the \var{key} and \var{reverse} conversion processes are ! much faster than specifying an equivalent \var{cmp} function. This is ! because \var{cmp} is called multiple times for each list element while ! \var{key} and \{reverse} touch each element only once. ! \versionchanged[Support for \code{None} as an equivalent to omitting ! \var{cmpfunc} was added]{2.3} ! \versionadded[Support for \var{key} and \var{reverse} was added]{2.4} ! \item[(9)] Starting with Python 2.3, the \method{sort()} method is ! guaranteed to be stable. A sort is stable if it guarantees not to ! change the relative order of elements that compare equal --- this is ! helpful for sorting in multiple passes (for example, sort by ! department, then by salary grade). \item[(10)] While a list is being sorted, the effect of attempting to From rhettinger at users.sourceforge.net Wed Oct 15 23:41:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 15 23:41:19 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_sort.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv22643/Lib/test Modified Files: test_sort.py Log Message: * list.sort() now supports three keyword arguments: cmp, key, and reverse. key provides C support for the decorate-sort-undecorate pattern. reverse provide a stable sort of the list with the comparisions reversed. * Amended the docs to guarantee sort stability. Index: test_sort.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sort.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_sort.py 2 Jan 2003 20:51:04 -0000 1.4 --- test_sort.py 16 Oct 2003 03:41:09 -0000 1.5 *************** *** 117,171 **** check("stability", x, s) - def bug453523(): - global nerrors - from random import random ! # If this fails, the most likely outcome is a core dump. ! if verbose: ! print "Testing bug 453523 -- list.sort() crasher." ! class C: ! def __lt__(self, other): ! if L and random() < 0.75: ! pop() ! else: ! push(3) ! return random() < 0.5 ! L = [C() for i in range(50)] ! pop = L.pop ! push = L.append ! try: ! L.sort() ! except ValueError: ! pass ! else: ! print " Mutation during list.sort() wasn't caught." ! nerrors += 1 ! bug453523() ! def cmpNone(): ! global nerrors ! if verbose: ! print "Testing None as a comparison function." ! L = range(50) ! random.shuffle(L) ! try: L.sort(None) ! except TypeError: ! print " Passing None as cmpfunc failed." ! nerrors += 1 ! else: ! if L != range(50): ! print " Passing None as cmpfunc failed." ! nerrors += 1 - cmpNone() - if nerrors: - print "Test failed", nerrors - elif verbose: - print "Test passed -- no errors." --- 117,227 ---- check("stability", x, s) ! import unittest ! from test import test_support ! import sys ! #============================================================================== ! class TestBugs(unittest.TestCase): ! def test_bug453523(self): ! # bug 453523 -- list.sort() crasher. ! # If this fails, the most likely outcome is a core dump. ! # Mutations during a list sort should raise a ValueError. ! class C: ! def __lt__(self, other): ! if L and random.random() < 0.75: ! L.pop() ! else: ! L.append(3) ! return random.random() < 0.5 ! L = [C() for i in range(50)] ! self.assertRaises(ValueError, L.sort) ! def test_cmpNone(self): ! # Testing None as a comparison function. ! ! L = range(50) ! random.shuffle(L) L.sort(None) ! self.assertEqual(L, range(50)) ! ! #============================================================================== ! ! class TestDecorateSortUndecorate(unittest.TestCase): ! ! def test_decorated(self): ! data = 'The quick Brown fox Jumped over The lazy Dog'.split() ! copy = data[:] ! random.shuffle(data) ! data.sort(key=str.lower) ! copy.sort(cmp=lambda x,y: cmp(x.lower(), y.lower())) ! ! def test_baddecorator(self): ! data = 'The quick Brown fox Jumped over The lazy Dog'.split() ! self.assertRaises(TypeError, data.sort, None, lambda x,y: 0) ! ! def test_stability(self): ! data = [(random.randrange(100), i) for i in xrange(200)] ! copy = data[:] ! data.sort(key=lambda (x,y): x) # sort on the random first field ! copy.sort() # sort using both fields ! self.assertEqual(data, copy) # should get the same result ! ! def test_cmp_and_key_combination(self): ! # Verify that the wrapper has been removed ! def compare(x, y): ! self.assertEqual(type(x), str) ! self.assertEqual(type(x), str) ! return cmp(x, y) ! data = 'The quick Brown fox Jumped over The lazy Dog'.split() ! data.sort(cmp=compare, key=str.lower) ! ! def test_badcmp_with_key(self): ! # Verify that the wrapper has been removed ! data = 'The quick Brown fox Jumped over The lazy Dog'.split() ! self.assertRaises(TypeError, data.sort, "bad", str.lower) ! ! def test_reverse(self): ! data = range(100) ! random.shuffle(data) ! data.sort(reverse=True) ! self.assertEqual(data, range(99,-1,-1)) ! ! def test_reverse_stability(self): ! data = [(random.randrange(100), i) for i in xrange(200)] ! copy1 = data[:] ! copy2 = data[:] ! data.sort(cmp=lambda x,y: cmp(x[0],y[0]), reverse=True) ! copy1.sort(cmp=lambda x,y: cmp(y[0],x[0])) ! self.assertEqual(data, copy1) ! copy2.sort(key=lambda x: x[0], reverse=True) ! self.assertEqual(data, copy2) ! ! #============================================================================== ! ! def test_main(verbose=None): ! test_classes = ( ! TestDecorateSortUndecorate, ! TestBugs, ! ) ! ! test_support.run_unittest(*test_classes) ! ! # verify reference counting ! if verbose and hasattr(sys, "gettotalrefcount"): ! import gc ! counts = [None] * 5 ! for i in xrange(len(counts)): ! test_support.run_unittest(*test_classes) ! gc.collect() ! counts[i] = sys.gettotalrefcount() ! print counts ! ! if __name__ == "__main__": ! test_main(verbose=True) From rhettinger at users.sourceforge.net Wed Oct 15 23:41:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 15 23:41:21 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.158,2.159 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv22643/Objects Modified Files: listobject.c Log Message: * list.sort() now supports three keyword arguments: cmp, key, and reverse. key provides C support for the decorate-sort-undecorate pattern. reverse provide a stable sort of the list with the comparisions reversed. * Amended the docs to guarantee sort stability. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.158 retrieving revision 2.159 diff -C2 -d -r2.158 -r2.159 *** listobject.c 15 Aug 2003 12:06:41 -0000 2.158 --- listobject.c 16 Oct 2003 03:41:09 -0000 2.159 *************** *** 1657,1660 **** --- 1657,1833 ---- } + /* Special wrapper to support stable sorting using the decorate-sort-undecorate + pattern. Holds a key which is used for comparisions and the original record + which is returned during the undecorate phase. By exposing only the key + during comparisons, the underlying sort stability characteristics are left + unchanged. Also, if a custom comparison function is used, it will only see + the key instead of a full record. */ + + typedef struct { + PyObject_HEAD + PyObject *key; + PyObject *value; + } sortwrapperobject; + + static PyTypeObject sortwrapper_type; + + static PyObject * + sortwrapper_richcompare(sortwrapperobject *a, sortwrapperobject *b, int op) + { + if (!PyObject_TypeCheck(b, &sortwrapper_type)) { + PyErr_SetString(PyExc_TypeError, + "expected a sortwrapperobject"); + return NULL; + } + return PyObject_RichCompare(a->key, b->key, op); + } + + static void + sortwrapper_dealloc(sortwrapperobject *so) + { + Py_XDECREF(so->key); + Py_XDECREF(so->value); + PyObject_Del(so); + } + + PyDoc_STRVAR(sortwrapper_doc, "Object wrapper with a custom sort key."); + + static PyTypeObject sortwrapper_type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ + "sortwrapper", /* tp_name */ + sizeof(sortwrapperobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)sortwrapper_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | + Py_TPFLAGS_HAVE_RICHCOMPARE, /* tp_flags */ + sortwrapper_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + (richcmpfunc)sortwrapper_richcompare, /* tp_richcompare */ + }; + + /* Returns a new reference to a sortwrapper. + Consumes the references to the two underlying objects. */ + + static PyObject * + build_sortwrapper(PyObject *key, PyObject *value) + { + sortwrapperobject *so; + + so = PyObject_New(sortwrapperobject, &sortwrapper_type); + if (so == NULL) + return NULL; + so->key = key; + so->value = value; + return (PyObject *)so; + } + + /* Returns a new reference to the value underlying the wrapper. */ + static PyObject * + sortwrapper_getvalue(PyObject *so) + { + PyObject *value; + + if (!PyObject_TypeCheck(so, &sortwrapper_type)) { + PyErr_SetString(PyExc_TypeError, + "expected a sortwrapperobject"); + return NULL; + } + value = ((sortwrapperobject *)so)->value; + Py_INCREF(value); + return value; + } + + /* Wrapper for user specified cmp functions in combination with a + specified key function. Makes sure the cmp function is presented + with the actual key instead of the sortwrapper */ + + typedef struct { + PyObject_HEAD + PyObject *func; + } cmpwrapperobject; + + static void + cmpwrapper_dealloc(cmpwrapperobject *co) + { + Py_XDECREF(co->func); + PyObject_Del(co); + } + + static PyObject * + cmpwrapper_call(cmpwrapperobject *co, PyObject *args, PyObject *kwds) + { + PyObject *x, *y, *xx, *yy; + + if (!PyArg_UnpackTuple(args, "", 2, 2, &x, &y)) + return NULL; + if (!PyObject_TypeCheck(x, &sortwrapper_type) || + !PyObject_TypeCheck(x, &sortwrapper_type)) { + PyErr_SetString(PyExc_TypeError, + "expected a sortwrapperobject"); + return NULL; + } + xx = ((sortwrapperobject *)x)->key; + yy = ((sortwrapperobject *)y)->key; + return PyObject_CallFunctionObjArgs(co->func, xx, yy, NULL); + } + + PyDoc_STRVAR(cmpwrapper_doc, "cmp() wrapper for sort with custom keys."); + + static PyTypeObject cmpwrapper_type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ + "cmpwrapper", /* tp_name */ + sizeof(cmpwrapperobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)cmpwrapper_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + (ternaryfunc)cmpwrapper_call, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + cmpwrapper_doc, /* tp_doc */ + }; + + static PyObject * + build_cmpwrapper(PyObject *cmpfunc) + { + cmpwrapperobject *co; + + co = PyObject_New(cmpwrapperobject, &cmpwrapper_type); + if (co == NULL) + return NULL; + Py_INCREF(cmpfunc); + co->func = cmpfunc; + return (PyObject *)co; + } + /* An adaptive, stable, natural mergesort. See listsort.txt. * Returns Py_None on success, NULL on error. Even in case of error, the *************** *** 1663,1667 **** */ static PyObject * ! listsort(PyListObject *self, PyObject *args) { MergeState ms; --- 1836,1840 ---- */ static PyObject * ! listsort(PyListObject *self, PyObject *args, PyObject *kwds) { MergeState ms; *************** *** 1674,1685 **** PyObject *compare = NULL; PyObject *result = NULL; /* guilty until proved innocent */ assert(self != NULL); if (args != NULL) { ! if (!PyArg_UnpackTuple(args, "sort", 0, 1, &compare)) return NULL; } if (compare == Py_None) compare = NULL; merge_init(&ms, compare); --- 1847,1892 ---- PyObject *compare = NULL; PyObject *result = NULL; /* guilty until proved innocent */ + int reverse = 0; + PyObject *keyfunc = NULL; + int i, n; + PyObject *key, *value, *kvpair; + static char *kwlist[] = {"cmp", "key", "reverse", 0}; assert(self != NULL); + assert (PyList_Check(self)); if (args != NULL) { ! if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOi:sort", ! kwlist, &compare, &keyfunc, &reverse)) return NULL; } if (compare == Py_None) compare = NULL; + if (keyfunc == Py_None) + keyfunc = NULL; + if (compare != NULL && keyfunc != NULL) { + compare = build_cmpwrapper(compare); + if (compare == NULL) + goto dsu_fail; + } else + Py_XINCREF(compare); + + if (keyfunc != NULL) { + n = PyList_GET_SIZE(self); + for (i=0 ; iob_size > 1) + reverse_slice(self->ob_item, self->ob_item + self->ob_size); merge_init(&ms, compare); *************** *** 1759,1762 **** --- 1966,1984 ---- self->ob_item = saved_ob_item; merge_freemem(&ms); + + if (keyfunc != NULL) { + for (i=0 ; iob_size > 1) + reverse_slice(self->ob_item, self->ob_item + self->ob_size); + + dsu_fail: + Py_XDECREF(compare); Py_XINCREF(result); return result; *************** *** 1772,1776 **** return -1; } ! v = listsort((PyListObject *)v, (PyObject *)NULL); if (v == NULL) return -1; --- 1994,1998 ---- return -1; } ! v = listsort((PyListObject *)v, (PyObject *)NULL, (PyObject *)NULL); if (v == NULL) return -1; *************** *** 2112,2116 **** "L.reverse() -- reverse *IN PLACE*"); PyDoc_STRVAR(sort_doc, ! "L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1"); static PyMethodDef list_methods[] = { --- 2334,2339 ---- "L.reverse() -- reverse *IN PLACE*"); PyDoc_STRVAR(sort_doc, ! "L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;\n\ ! cmp(x, y) -> -1, 0, 1"); static PyMethodDef list_methods[] = { *************** *** 2123,2127 **** {"count", (PyCFunction)listcount, METH_O, count_doc}, {"reverse", (PyCFunction)listreverse, METH_NOARGS, reverse_doc}, ! {"sort", (PyCFunction)listsort, METH_VARARGS, sort_doc}, {NULL, NULL} /* sentinel */ }; --- 2346,2350 ---- {"count", (PyCFunction)listcount, METH_O, count_doc}, {"reverse", (PyCFunction)listreverse, METH_NOARGS, reverse_doc}, ! {"sort", (PyCFunction)listsort, METH_VARARGS | METH_KEYWORDS, sort_doc}, {NULL, NULL} /* sentinel */ }; From rhettinger at users.sourceforge.net Wed Oct 15 23:41:12 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 15 23:41:24 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.869,1.870 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv22643/Misc Modified Files: NEWS Log Message: * list.sort() now supports three keyword arguments: cmp, key, and reverse. key provides C support for the decorate-sort-undecorate pattern. reverse provide a stable sort of the list with the comparisions reversed. * Amended the docs to guarantee sort stability. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.869 retrieving revision 1.870 diff -C2 -d -r1.869 -r1.870 *** NEWS 12 Oct 2003 18:24:34 -0000 1.869 --- NEWS 16 Oct 2003 03:41:09 -0000 1.870 *************** *** 13,16 **** --- 13,25 ---- ----------------- + - list.sort() now supports three keyword arguments: cmp, key, and reverse. + The key argument can be a function of one argument that extracts a + comparison key from the original record: mylist.sort(key=str.lower). + The reverse argument is a boolean value and if True will change the + sort order as if the comparison arguments were reversed. In addition, + the documentation has been amended to provide a guarantee that all sorts + starting with Py2.3 are guaranteed to be stable (the relative order of + records with equal keys is unchanged). + - Added test whether wchar_t is signed or not. A signed wchar_t is not usable as internal unicode type base for Py_UNICODE since the From rhettinger at users.sourceforge.net Thu Oct 16 01:53:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 16 01:53:23 2003 Subject: [Python-checkins] python/dist/src/Lib SimpleHTTPServer.py, 1.19, 1.20 UserList.py, 1.19, 1.20 _strptime.py, 1.27, 1.28 difflib.py, 1.16, 1.17 inspect.py, 1.47, 1.48 pydoc.py, 1.87, 1.88 sre_constants.py, 1.32, 1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv10139 Modified Files: SimpleHTTPServer.py UserList.py _strptime.py difflib.py inspect.py pydoc.py sre_constants.py Log Message: Let library modules use the new keyword arguments for list.sort(). Index: SimpleHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SimpleHTTPServer.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SimpleHTTPServer.py 1 Jun 2002 14:18:45 -0000 1.19 --- SimpleHTTPServer.py 16 Oct 2003 05:53:16 -0000 1.20 *************** *** 100,104 **** self.send_error(404, "No permission to list directory") return None ! list.sort(lambda a, b: cmp(a.lower(), b.lower())) f = StringIO() f.write("Directory listing for %s\n" % self.path) --- 100,104 ---- self.send_error(404, "No permission to list directory") return None ! list.sort(key=lambda a: a.lower()) f = StringIO() f.write("Directory listing for %s\n" % self.path) Index: UserList.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserList.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** UserList.py 17 Jun 2003 05:05:49 -0000 1.19 --- UserList.py 16 Oct 2003 05:53:16 -0000 1.20 *************** *** 78,82 **** def index(self, item, *args): return self.data.index(item, *args) def reverse(self): self.data.reverse() ! def sort(self, *args): self.data.sort(*args) def extend(self, other): if isinstance(other, UserList): --- 78,82 ---- def index(self, item, *args): return self.data.index(item, *args) def reverse(self): self.data.reverse() ! def sort(self, *args, **kwds): self.data.sort(*args, **kwds) def extend(self, other): if isinstance(other, UserList): Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** _strptime.py 29 Aug 2003 02:28:53 -0000 1.27 --- _strptime.py 16 Oct 2003 05:53:16 -0000 1.28 *************** *** 53,57 **** def __init__(self): """Set all attributes. ! Order of methods called matters for dependency reasons. --- 53,57 ---- def __init__(self): """Set all attributes. ! Order of methods called matters for dependency reasons. *************** *** 69,73 **** not call tz.tzset . That is an issue for the programmer, though, since changing the timezone is worthless without that call. ! """ self.lang = _getlang() --- 69,73 ---- not call tz.tzset . That is an issue for the programmer, though, since changing the timezone is worthless without that call. ! """ self.lang = _getlang() *************** *** 156,160 **** self.LC_date_time = date_time[0] self.LC_date = date_time[1] ! self.LC_time = date_time[2] def __calc_timezone(self): --- 156,160 ---- self.LC_date_time = date_time[0] self.LC_date = date_time[1] ! self.LC_time = date_time[2] def __calc_timezone(self): *************** *** 179,185 **** def __init__(self, locale_time=None): """Create keys/values. ! Order of execution is important for dependency reasons. ! """ if locale_time: --- 179,185 ---- def __init__(self, locale_time=None): """Create keys/values. ! Order of execution is important for dependency reasons. ! """ if locale_time: *************** *** 220,229 **** def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching a directive. ! Want possible matching values to be from longest to shortest. This prevents the possibility of a match occuring for a value that also a substring of a larger value that should have matched (e.g., 'abc' matching when 'abcdef' should have been the match). ! """ for value in to_convert: --- 220,229 ---- def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching a directive. ! Want possible matching values to be from longest to shortest. This prevents the possibility of a match occuring for a value that also a substring of a larger value that should have matched (e.g., 'abc' matching when 'abcdef' should have been the match). ! """ for value in to_convert: *************** *** 232,239 **** else: return '' ! to_sort = [(len(item), item) for item in to_convert] ! to_sort.sort() ! to_sort.reverse() ! to_convert = [item for length, item in to_sort] regex = '|'.join(to_convert) regex = '(?P<%s>%s' % (directive, regex) --- 232,237 ---- else: return '' ! to_convert = to_convert[:] ! to_convert.sort(key=len, reverse=True) regex = '|'.join(to_convert) regex = '(?P<%s>%s' % (directive, regex) Index: difflib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** difflib.py 16 Jul 2003 04:32:32 -0000 1.16 --- difflib.py 16 Oct 2003 05:53:16 -0000 1.17 *************** *** 702,714 **** s.ratio() >= cutoff: result.append((s.ratio(), x)) - # Sort by score. - result.sort() - # Retain only the best n. - result = result[-n:] - # Move best-scorer to head of list. - result.reverse() - # Strip scores. - return [x for score, x in result] def _count_leading(line, ch): --- 702,710 ---- s.ratio() >= cutoff: result.append((s.ratio(), x)) + # Move the best scorers to head of list + result.sort(reverse=True) + # Strip scores for the best n matches + return [x for score, x in result[:n]] def _count_leading(line, ch): Index: inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** inspect.py 29 Jun 2003 05:46:53 -0000 1.47 --- inspect.py 16 Oct 2003 05:53:16 -0000 1.48 *************** *** 554,558 **** """Recursive helper function for getclasstree().""" results = [] ! classes.sort(lambda a, b: cmp(a.__name__, b.__name__)) for c in classes: results.append((c, c.__bases__)) --- 554,558 ---- """Recursive helper function for getclasstree().""" results = [] ! classes.sort(key=lambda c: c.__name__) for c in classes: results.append((c, c.__bases__)) Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** pydoc.py 10 Sep 2003 16:47:51 -0000 1.87 --- pydoc.py 16 Oct 2003 05:53:16 -0000 1.88 *************** *** 780,784 **** # Sort attrs by name. ! attrs.sort(lambda t1, t2: cmp(t1[0], t2[0])) # Pump out the attrs, segregated by kind. --- 780,784 ---- # Sort attrs by name. ! attrs.sort(key=lambda t: t[0]) # Pump out the attrs, segregated by kind. Index: sre_constants.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_constants.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** sre_constants.py 19 Apr 2003 12:56:07 -0000 1.32 --- sre_constants.py 16 Oct 2003 05:53:16 -0000 1.33 *************** *** 220,224 **** def dump(f, d, prefix): items = d.items() ! items.sort(lambda a, b: cmp(a[1], b[1])) for k, v in items: f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v)) --- 220,224 ---- def dump(f, d, prefix): items = d.items() ! items.sort(key=lambda a: a[1]) for k, v in items: f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v)) From neal at metaslash.com Thu Oct 16 11:52:12 2003 From: neal at metaslash.com (Neal Norwitz) Date: Thu Oct 16 11:52:17 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.158, 2.159 In-Reply-To: References: Message-ID: <20031016155212.GE30467@epoch.metaslash.com> On Wed, Oct 15, 2003 at 08:41:11PM -0700, rhettinger@users.sourceforge.net wrote: > > Index: listobject.c > =================================================================== > + static PyObject * > + cmpwrapper_call(cmpwrapperobject *co, PyObject *args, PyObject *kwds) > + { > + PyObject *x, *y, *xx, *yy; > + > + if (!PyArg_UnpackTuple(args, "", 2, 2, &x, &y)) > + return NULL; > + if (!PyObject_TypeCheck(x, &sortwrapper_type) || > + !PyObject_TypeCheck(x, &sortwrapper_type)) { The second line should be checking y, not x? Neal From python at rcn.com Thu Oct 16 13:09:22 2003 From: python at rcn.com (Raymond Hettinger) Date: Thu Oct 16 13:10:04 2003 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Objectslistobject.c, 2.158, 2.159 In-Reply-To: <20031016155212.GE30467@epoch.metaslash.com> Message-ID: <004501c39408$3eed63a0$e841fea9@oemcomputer> > > + !PyObject_TypeCheck(x, &sortwrapper_type)) { [Neal] > The second line should be checking y, not x? Yes. Will checkin a fix. Raymond From rhettinger at users.sourceforge.net Thu Oct 16 13:16:32 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 16 13:16:35 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.159,2.160 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv22719 Modified Files: listobject.c Log Message: Fix typo found by Neal Norwitz. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.159 retrieving revision 2.160 diff -C2 -d -r2.159 -r2.160 *** listobject.c 16 Oct 2003 03:41:09 -0000 2.159 --- listobject.c 16 Oct 2003 17:16:30 -0000 2.160 *************** *** 1779,1783 **** return NULL; if (!PyObject_TypeCheck(x, &sortwrapper_type) || ! !PyObject_TypeCheck(x, &sortwrapper_type)) { PyErr_SetString(PyExc_TypeError, "expected a sortwrapperobject"); --- 1779,1783 ---- return NULL; if (!PyObject_TypeCheck(x, &sortwrapper_type) || ! !PyObject_TypeCheck(y, &sortwrapper_type)) { PyErr_SetString(PyExc_TypeError, "expected a sortwrapperobject"); From theller at users.sourceforge.net Thu Oct 16 15:02:49 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Oct 16 15:02:52 2003 Subject: [Python-checkins] python/dist/src/PCbuild python20.wse, 1.133.4.3, 1.133.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv14051 Modified Files: Tag: release23-maint python20.wse Log Message: Never redistribute MS dlls from the system directory. So I removed all those \windows\system options. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.133.4.3 retrieving revision 1.133.4.4 diff -C2 -d -r1.133.4.3 -r1.133.4.4 *** python20.wse 1 Oct 2003 18:24:06 -0000 1.133.4.3 --- python20.wse 16 Oct 2003 19:02:46 -0000 1.133.4.4 *************** *** 44,53 **** Variable Flags3=00001001 Variable Name4=_SYS_ ! Variable Description4=System directory (where to find MSVCRT.DLL) ! Variable Default4=C:\Windows\System32 ! Variable Values4=C:\Windows\System ! Variable Values4=C:\WINNT\System32 Variable Values4=C:\Code\MSDLLs ! Variable Values4=C:\Windows\System32 Variable Flags4=00000010 Variable Name5=_PYMAJOR_ --- 44,53 ---- Variable Flags3=00001001 Variable Name4=_SYS_ ! Variable Description4=VC redistributables directory (where to find MSVCRT.DLL). ! Variable Description4= ! Variable Description4=NEVER USE A SYSTEM DIRECTORY! ! Variable Default4=C:\VCREDIST\VC6SP5 Variable Values4=C:\Code\MSDLLs ! Variable Values4=C:\VCREDIST\VC6SP5 Variable Flags4=00000010 Variable Name5=_PYMAJOR_ From theller at users.sourceforge.net Thu Oct 16 15:13:50 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Oct 16 15:13:52 2003 Subject: [Python-checkins] python/nondist/peps pep-0102.txt,1.17,1.18 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv16122 Modified Files: pep-0102.txt Log Message: Further explain the creation of the Wise installer, especially which MS dlls should be used and how to check their version numbers. Disasters should happen at most once! Index: pep-0102.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0102.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pep-0102.txt 30 Sep 2003 04:51:14 -0000 1.17 --- pep-0102.txt 16 Oct 2003 19:13:48 -0000 1.18 *************** *** 147,156 **** Basically, if it's in Doc/ Fred will take care of it. ! ___ Thomas compiles everything with MSVC 6.0, and moves the python23.chm file into the src/chm directory. The installer executable is then generated with Wise Installation System. ! He uploads this file to the starship. He then sends the RM a ! notice which includes the location and MD5 checksum of the Windows executable. --- 147,169 ---- Basically, if it's in Doc/ Fred will take care of it. ! ___ Thomas compiles everything with MSVC 6.0 SP5, and moves the python23.chm file into the src/chm directory. The installer executable is then generated with Wise Installation System. ! The installer includes the MSVC 6.0 runtime in the files ! MSVCRT.DLL and MSVCIRT.DLL. It leads to disaster if these files ! are taken from the system directory of the machine where the ! installer is built, instead it must be absolutely made sure that ! these files come from the VCREDIST.EXE redistributable package ! contained in the MSVC SP5 CD. VCREDIST.EXE must be unpacked ! with winzip, and the Wise Installation System prompts for the ! directory. ! ! After building the installer, it should be opened with winzip, ! and the MS dlls extracted again and check for the same version ! number as those unpacked from VCREDIST.EXE. ! ! Thomas uploads this file to the starship. He then sends the RM ! a notice which includes the location and MD5 checksum of the Windows executable. From theller at users.sourceforge.net Thu Oct 16 15:40:50 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Oct 16 15:40:54 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex,1.58,1.59 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv21898 Modified Files: dist.tex Log Message: Typo found by Lokasz Pankowski: dir_created -> directory_created Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** dist.tex 8 Oct 2003 12:01:33 -0000 1.58 --- dist.tex 16 Oct 2003 19:40:48 -0000 1.59 *************** *** 1462,1466 **** \begin{verbatim} ! dir_created(pathname) file_created(pathname) \end{verbatim} --- 1462,1466 ---- \begin{verbatim} ! directory_created(pathname) file_created(pathname) \end{verbatim} From theller at users.sourceforge.net Thu Oct 16 15:42:15 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Oct 16 15:42:19 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex, 1.56.8.2, 1.56.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv22151 Modified Files: Tag: release23-maint dist.tex Log Message: Fix typo found by Lukasz Pankowski: dir_created -> directory_created Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.56.8.2 retrieving revision 1.56.8.3 diff -C2 -d -r1.56.8.2 -r1.56.8.3 *** dist.tex 8 Oct 2003 12:02:44 -0000 1.56.8.2 --- dist.tex 16 Oct 2003 19:42:13 -0000 1.56.8.3 *************** *** 1462,1466 **** \begin{verbatim} ! dir_created(pathname) file_created(pathname) \end{verbatim} --- 1462,1466 ---- \begin{verbatim} ! directory_created(pathname) file_created(pathname) \end{verbatim} From niemeyer at users.sourceforge.net Fri Oct 17 18:13:18 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Fri Oct 17 18:13:24 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex,1.106,1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv19832/Doc/lib Modified Files: libre.tex Log Message: Implemented non-recursive SRE matching. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** libre.tex 10 Sep 2003 18:45:12 -0000 1.106 --- libre.tex 17 Oct 2003 22:13:16 -0000 1.107 *************** *** 298,301 **** --- 298,310 ---- assertions may match at the beginning of the string being searched. + \item[\code{(?(\var{id/name})yes-pattern|no-pattern)}] Will try to match + with \regexp{yes-pattern} if the group with given \var{id} or \var{name} + exists, and with \regexp{no-pattern} if it doesn't. \regexp{|no-pattern} + is optional and can be omitted. For example, + \regexp{(<)?(\e w+@\e w+(?:\e .\e w+)+)(?(1)>)} is a poor email matching + pattern, which will match with \code{''} as well as + \code{'user@host.com'}, but not with \code{' Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv19832/Lib/test Modified Files: test_re.py Log Message: Implemented non-recursive SRE matching. Index: test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** test_re.py 2 Jul 2003 20:03:04 -0000 1.45 --- test_re.py 17 Oct 2003 22:13:16 -0000 1.46 *************** *** 170,174 **** def test_re_groupref_exists(self): - return # not yet self.assertEqual(re.match('^(\()?([^()]+)(?(1)\))$', '(a)').groups(), ('(', 'a')) --- 170,173 ---- *************** *** 406,411 **** 20003) self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001) ! # non-simple '*?' still recurses and hits the recursion limit ! self.assertRaises(RuntimeError, re.search, '(a|b)*?c', 10000*'ab'+'cd') def test_bug_612074(self): --- 405,411 ---- 20003) self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001) ! # non-simple '*?' still used to hit the recursion limit, before the ! # non-recursive scheme was implemented. ! self.assertEqual(re.search('(a|b)*?c', 10000*'ab'+'cd').end(0), 20001) def test_bug_612074(self): *************** *** 414,422 **** def test_stack_overflow(self): ! # nasty case that overflows the straightforward recursive # implementation of repeated groups. ! self.assertRaises(RuntimeError, re.match, '(x)*', 50000*'x') ! self.assertRaises(RuntimeError, re.match, '(x)*y', 50000*'x'+'y') ! self.assertRaises(RuntimeError, re.match, '(x)*?y', 50000*'x'+'y') def test_scanner(self): --- 414,422 ---- def test_stack_overflow(self): ! # nasty cases that used to overflow the straightforward recursive # implementation of repeated groups. ! self.assertEqual(re.match('(x)*', 50000*'x').group(1), 'x') ! self.assertEqual(re.match('(x)*y', 50000*'x'+'y').group(1), 'x') ! self.assertEqual(re.match('(x)*?y', 50000*'x'+'y').group(1), 'x') def test_scanner(self): From niemeyer at users.sourceforge.net Fri Oct 17 18:13:18 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Fri Oct 17 18:13:30 2003 Subject: [Python-checkins] python/dist/src/Lib sre_compile.py, 1.49, 1.50 sre_constants.py, 1.33, 1.34 sre_parse.py, 1.57, 1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19832/Lib Modified Files: sre_compile.py sre_constants.py sre_parse.py Log Message: Implemented non-recursive SRE matching. Index: sre_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_compile.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** sre_compile.py 2 Jul 2003 21:37:16 -0000 1.49 --- sre_compile.py 17 Oct 2003 22:13:16 -0000 1.50 *************** *** 146,149 **** --- 146,162 ---- emit(OPCODES[op]) emit(av-1) + elif op is GROUPREF_EXISTS: + emit(OPCODES[op]) + emit((av[0]-1)*2) + skipyes = len(code); emit(0) + _compile(code, av[1], flags) + if av[2]: + emit(OPCODES[JUMP]) + skipno = len(code); emit(0) + code[skipyes] = len(code) - skipyes + 1 + _compile(code, av[2], flags) + code[skipno] = len(code) - skipno + else: + code[skipyes] = len(code) - skipyes + 1 else: raise ValueError, ("unsupported operand type", op) Index: sre_constants.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_constants.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** sre_constants.py 16 Oct 2003 05:53:16 -0000 1.33 --- sre_constants.py 17 Oct 2003 22:13:16 -0000 1.34 *************** *** 14,18 **** # update when constants are added or removed ! MAGIC = 20030419 # max code word in this release --- 14,18 ---- # update when constants are added or removed ! MAGIC = 20031017 # max code word in this release *************** *** 43,46 **** --- 43,47 ---- GROUPREF = "groupref" GROUPREF_IGNORE = "groupref_ignore" + GROUPREF_EXISTS = "groupref_exists" IN = "in" IN_IGNORE = "in_ignore" *************** *** 109,113 **** CATEGORY, CHARSET, BIGCHARSET, ! GROUPREF, GROUPREF_IGNORE, IN, IN_IGNORE, INFO, --- 110,114 ---- CATEGORY, CHARSET, BIGCHARSET, ! GROUPREF, GROUPREF_EXISTS, GROUPREF_IGNORE, IN, IN_IGNORE, INFO, Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** sre_parse.py 19 Apr 2003 08:37:23 -0000 1.57 --- sre_parse.py 17 Oct 2003 22:13:16 -0000 1.58 *************** *** 365,368 **** --- 365,382 ---- return subpattern + def _parse_sub_cond(source, state, condgroup): + item_yes = _parse(source, state) + if source.match("|"): + item_no = _parse(source, state) + if source.match("|"): + raise error, "conditional backref with more than two branches" + else: + item_no = None + if source.next and not source.match(")", 0): + raise error, "pattern not properly closed" + subpattern = SubPattern(state) + subpattern.append((GROUPREF_EXISTS, (condgroup, item_yes, item_no))) + return subpattern + def _parse(source, state): # parse a simple pattern *************** *** 500,503 **** --- 514,518 ---- group = 1 name = None + condgroup = None if source.match("?"): group = 0 *************** *** 569,572 **** --- 584,607 ---- subpattern.append((ASSERT_NOT, (dir, p))) continue + elif source.match("("): + # conditional backreference group + condname = "" + while 1: + char = source.get() + if char is None: + raise error, "unterminated name" + if char == ")": + break + condname = condname + char + group = 2 + if isname(condname): + condgroup = state.groupdict.get(condname) + if condgroup is None: + raise error, "unknown group name" + else: + try: + condgroup = atoi(condname) + except ValueError: + raise error, "bad character in group name" else: # flags *************** *** 582,586 **** else: group = state.opengroup(name) ! p = _parse_sub(source, state) if not source.match(")"): raise error, "unbalanced parenthesis" --- 617,624 ---- else: group = state.opengroup(name) ! if condgroup: ! p = _parse_sub_cond(source, state, condgroup) ! else: ! p = _parse_sub(source, state) if not source.match(")"): raise error, "unbalanced parenthesis" From niemeyer at users.sourceforge.net Fri Oct 17 18:13:18 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Fri Oct 17 18:13:32 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.870,1.871 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv19832/Misc Modified Files: NEWS Log Message: Implemented non-recursive SRE matching. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.870 retrieving revision 1.871 diff -C2 -d -r1.870 -r1.871 *** NEWS 16 Oct 2003 03:41:09 -0000 1.870 --- NEWS 17 Oct 2003 22:13:16 -0000 1.871 *************** *** 62,65 **** --- 62,69 ---- - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI + - Implemented non-recursive SRE matching scheme (#757624). + + - Implemented (?(id/name)yes|no) support in SRE (#572936). + Library ------- From niemeyer at users.sourceforge.net Fri Oct 17 18:13:19 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Fri Oct 17 18:13:34 2003 Subject: [Python-checkins] python/dist/src/Modules _sre.c, 2.100, 2.101 sre.h, 2.22, 2.23 sre_constants.h, 2.15, 2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv19832/Modules Modified Files: _sre.c sre.h sre_constants.h Log Message: Implemented non-recursive SRE matching. Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.100 retrieving revision 2.101 diff -C2 -d -r2.100 -r2.101 *** _sre.c 12 Oct 2003 19:09:36 -0000 2.100 --- _sre.c 17 Oct 2003 22:13:16 -0000 2.101 *************** *** 22,25 **** --- 22,26 ---- * 2002-11-09 fl fixed empty sub/subn return type * 2003-04-18 mvl fully support 4-byte codes + * 2003-10-17 gn implemented non recursive scheme * * Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved. *************** *** 92,95 **** --- 93,99 ---- #endif [...1714 lines suppressed...] --- 1950,1954 ---- { Py_XDECREF(state->string); ! data_stack_dealloc(state); } *************** *** 1662,1666 **** index = (index - 1) * 2; ! if (string == Py_None || !state->mark[index] || !state->mark[index+1]) { if (empty) /* want empty string */ --- 1964,1968 ---- index = (index - 1) * 2; ! if (string == Py_None || index >= state->lastmark || !state->mark[index] || !state->mark[index+1]) { if (empty) /* want empty string */ Index: sre.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sre.h,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -d -r2.22 -r2.23 *** sre.h 18 Mar 2002 18:46:14 -0000 2.22 --- sre.h 17 Oct 2003 22:13:16 -0000 2.23 *************** *** 56,59 **** --- 56,60 ---- int count; SRE_CODE* pattern; /* points to REPEAT operator arguments */ + void* last_ptr; /* helper to check for infinite loops */ struct SRE_REPEAT_T *prev; /* points to previous repeat context */ } SRE_REPEAT; *************** *** 75,82 **** void* mark[SRE_MARK_SIZE]; /* dynamically allocated stuff */ ! void** mark_stack; ! int mark_stack_size; ! int mark_stack_base; ! SRE_REPEAT *repeat; /* current repeat context */ /* hooks */ SRE_TOLOWER_HOOK lower; --- 76,84 ---- void* mark[SRE_MARK_SIZE]; /* dynamically allocated stuff */ ! char* data_stack; ! int data_stack_size; ! int data_stack_base; ! /* current repeat context */ ! SRE_REPEAT *repeat; /* hooks */ SRE_TOLOWER_HOOK lower; Index: sre_constants.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sre_constants.h,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** sre_constants.h 19 Apr 2003 12:56:08 -0000 2.15 --- sre_constants.h 17 Oct 2003 22:13:16 -0000 2.16 *************** *** 12,16 **** */ ! #define SRE_MAGIC 20030419 #define SRE_OP_FAILURE 0 #define SRE_OP_SUCCESS 1 --- 12,16 ---- */ ! #define SRE_MAGIC 20031017 #define SRE_OP_FAILURE 0 #define SRE_OP_SUCCESS 1 *************** *** 26,47 **** #define SRE_OP_BIGCHARSET 11 #define SRE_OP_GROUPREF 12 ! #define SRE_OP_GROUPREF_IGNORE 13 ! #define SRE_OP_IN 14 ! #define SRE_OP_IN_IGNORE 15 ! #define SRE_OP_INFO 16 ! #define SRE_OP_JUMP 17 ! #define SRE_OP_LITERAL 18 ! #define SRE_OP_LITERAL_IGNORE 19 ! #define SRE_OP_MARK 20 ! #define SRE_OP_MAX_UNTIL 21 ! #define SRE_OP_MIN_UNTIL 22 ! #define SRE_OP_NOT_LITERAL 23 ! #define SRE_OP_NOT_LITERAL_IGNORE 24 ! #define SRE_OP_NEGATE 25 ! #define SRE_OP_RANGE 26 ! #define SRE_OP_REPEAT 27 ! #define SRE_OP_REPEAT_ONE 28 ! #define SRE_OP_SUBPATTERN 29 ! #define SRE_OP_MIN_REPEAT_ONE 30 #define SRE_AT_BEGINNING 0 #define SRE_AT_BEGINNING_LINE 1 --- 26,48 ---- #define SRE_OP_BIGCHARSET 11 #define SRE_OP_GROUPREF 12 ! #define SRE_OP_GROUPREF_EXISTS 13 ! #define SRE_OP_GROUPREF_IGNORE 14 ! #define SRE_OP_IN 15 ! #define SRE_OP_IN_IGNORE 16 ! #define SRE_OP_INFO 17 ! #define SRE_OP_JUMP 18 ! #define SRE_OP_LITERAL 19 ! #define SRE_OP_LITERAL_IGNORE 20 ! #define SRE_OP_MARK 21 ! #define SRE_OP_MAX_UNTIL 22 ! #define SRE_OP_MIN_UNTIL 23 ! #define SRE_OP_NOT_LITERAL 24 ! #define SRE_OP_NOT_LITERAL_IGNORE 25 ! #define SRE_OP_NEGATE 26 ! #define SRE_OP_RANGE 27 ! #define SRE_OP_REPEAT 28 ! #define SRE_OP_REPEAT_ONE 29 ! #define SRE_OP_SUBPATTERN 30 ! #define SRE_OP_MIN_REPEAT_ONE 31 #define SRE_AT_BEGINNING 0 #define SRE_AT_BEGINNING_LINE 1 From loewis at users.sourceforge.net Sat Oct 18 05:37:14 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:37:17 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129.8.4, 1.129.8.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13026/Doc/lib Modified Files: Tag: release23-maint libstdtypes.tex Log Message: Patch #809535: Mention behaviour of seek on text files. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129.8.4 retrieving revision 1.129.8.5 diff -C2 -d -r1.129.8.4 -r1.129.8.5 *** libstdtypes.tex 12 Sep 2003 00:03:56 -0000 1.129.8.4 --- libstdtypes.tex 18 Oct 2003 09:37:11 -0000 1.129.8.5 *************** *** 1346,1350 **** file is only opened for writing in append mode (mode \code{'a'}), this method is essentially a no-op, but it remains useful for files ! opened in append mode with reading enabled (mode \code{'a+'}). \end{methoddesc} --- 1346,1355 ---- file is only opened for writing in append mode (mode \code{'a'}), this method is essentially a no-op, but it remains useful for files ! opened in append mode with reading enabled (mode \code{'a+'}). If the ! file is opened in text mode (mode \code{'t'}), only offsets returned ! by \method{tell()} are legal. Use of other offsets causes undefined ! behavior. ! ! Note that not all file objects are seekable. \end{methoddesc} From loewis at users.sourceforge.net Sat Oct 18 05:37:14 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:37:20 2003 Subject: [Python-checkins] python/dist/src/Objects fileobject.c, 2.179.8.3, 2.179.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv13026/Objects Modified Files: Tag: release23-maint fileobject.c Log Message: Patch #809535: Mention behaviour of seek on text files. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.179.8.3 retrieving revision 2.179.8.4 diff -C2 -d -r2.179.8.3 -r2.179.8.4 *** fileobject.c 16 Sep 2003 05:29:50 -0000 2.179.8.3 --- fileobject.c 18 Oct 2003 09:37:12 -0000 2.179.8.4 *************** *** 1622,1626 **** "(move relative to current position, positive or negative), and 2 (move\n" "relative to end of file, usually negative, although many platforms allow\n" ! "seeking beyond the end of a file).\n" "\n" "Note that not all file objects are seekable."); --- 1622,1628 ---- "(move relative to current position, positive or negative), and 2 (move\n" "relative to end of file, usually negative, although many platforms allow\n" ! "seeking beyond the end of a file). If the file is opened in text mode,\n" ! "only offsets returned by tell() are legal. Use of other offsets causes\n" ! "undefined behavior." "\n" "Note that not all file objects are seekable."); From loewis at users.sourceforge.net Sat Oct 18 05:38:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:38:06 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.134, 1.135 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13120/Doc/lib Modified Files: libstdtypes.tex Log Message: Patch #809535: Mention behaviour of seek on text files. Backported to 2.3. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** libstdtypes.tex 16 Oct 2003 03:41:09 -0000 1.134 --- libstdtypes.tex 18 Oct 2003 09:38:01 -0000 1.135 *************** *** 1338,1342 **** file is only opened for writing in append mode (mode \code{'a'}), this method is essentially a no-op, but it remains useful for files ! opened in append mode with reading enabled (mode \code{'a+'}). \end{methoddesc} --- 1338,1347 ---- file is only opened for writing in append mode (mode \code{'a'}), this method is essentially a no-op, but it remains useful for files ! opened in append mode with reading enabled (mode \code{'a+'}). If the ! file is opened in text mode (mode \code{'t'}), only offsets returned ! by \method{tell()} are legal. Use of other offsets causes undefined ! behavior. ! ! Note that not all file objects are seekable. \end{methoddesc} From loewis at users.sourceforge.net Sat Oct 18 05:38:04 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:38:09 2003 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.184,2.185 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv13120/Objects Modified Files: fileobject.c Log Message: Patch #809535: Mention behaviour of seek on text files. Backported to 2.3. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.184 retrieving revision 2.185 diff -C2 -d -r2.184 -r2.185 *** fileobject.c 12 Oct 2003 19:09:37 -0000 2.184 --- fileobject.c 18 Oct 2003 09:38:01 -0000 2.185 *************** *** 1614,1618 **** "(move relative to current position, positive or negative), and 2 (move\n" "relative to end of file, usually negative, although many platforms allow\n" ! "seeking beyond the end of a file).\n" "\n" "Note that not all file objects are seekable."); --- 1614,1620 ---- "(move relative to current position, positive or negative), and 2 (move\n" "relative to end of file, usually negative, although many platforms allow\n" ! "seeking beyond the end of a file). If the file is opened in text mode,\n" ! "only offsets returned by tell() are legal. Use of other offsets causes\n" ! "undefined behavior." "\n" "Note that not all file objects are seekable."); From loewis at users.sourceforge.net Sat Oct 18 05:54:40 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:54:43 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129.8.5, 1.129.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv15005/Doc/lib Modified Files: Tag: release23-maint libstdtypes.tex Log Message: Patch #825679: Clarify semantics of .isfoo on empty strings. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129.8.5 retrieving revision 1.129.8.6 diff -C2 -d -r1.129.8.5 -r1.129.8.6 *** libstdtypes.tex 18 Oct 2003 09:37:11 -0000 1.129.8.5 --- libstdtypes.tex 18 Oct 2003 09:54:38 -0000 1.129.8.6 *************** *** 614,618 **** \begin{methoddesc}[string]{isdigit}{} ! Return true if there are only digit characters, false otherwise. \end{methoddesc} --- 614,619 ---- \begin{methoddesc}[string]{isdigit}{} ! Return true if all characters in the string are digits and there ! is at least one character, false otherwise. \end{methoddesc} *************** *** 624,634 **** \begin{methoddesc}[string]{isspace}{} Return true if there are only whitespace characters in the string and ! the string is not empty, false otherwise. \end{methoddesc} \begin{methoddesc}[string]{istitle}{} ! Return true if the string is a titlecased string: uppercase ! characters may only follow uncased characters and lowercase characters ! only cased ones. Return false otherwise. \end{methoddesc} --- 625,636 ---- \begin{methoddesc}[string]{isspace}{} Return true if there are only whitespace characters in the string and ! there is at least one character, false otherwise. \end{methoddesc} \begin{methoddesc}[string]{istitle}{} ! Return true if the string is a titlecased string and there is at least one ! character, i.e. uppercase characters may only follow uncased ! characters and lowercase characters only cased ones. Return false ! otherwise. \end{methoddesc} From loewis at users.sourceforge.net Sat Oct 18 05:54:40 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:54:45 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.209.8.1, 2.209.8.2 unicodeobject.c, 2.190.6.7, 2.190.6.8 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv15005/Objects Modified Files: Tag: release23-maint stringobject.c unicodeobject.c Log Message: Patch #825679: Clarify semantics of .isfoo on empty strings. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.209.8.1 retrieving revision 2.209.8.2 diff -C2 -d -r2.209.8.1 -r2.209.8.2 *** stringobject.c 27 Aug 2003 05:08:19 -0000 2.209.8.1 --- stringobject.c 18 Oct 2003 09:54:38 -0000 2.209.8.2 *************** *** 2734,2741 **** PyDoc_STRVAR(isspace__doc__, ! "S.isspace() -> bool\n" ! "\n" ! "Return True if there are only whitespace characters in S,\n" ! "False otherwise."); static PyObject* --- 2734,2741 ---- PyDoc_STRVAR(isspace__doc__, ! "S.isspace() -> bool\n\ ! \n\ ! Return True if all characters in S are whitespace\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 2767,2771 **** "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); --- 2767,2771 ---- "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); *************** *** 2798,2802 **** "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); --- 2798,2802 ---- "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); *************** *** 2829,2834 **** "S.isdigit() -> bool\n\ \n\ ! Return True if there are only digit characters in S,\n\ ! False otherwise."); static PyObject* --- 2829,2834 ---- "S.isdigit() -> bool\n\ \n\ ! Return True if all characters in S are digits\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 2894,2898 **** "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); --- 2894,2898 ---- "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); *************** *** 2928,2934 **** "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string, i.e. uppercase characters\n\ ! may only follow uncased characters and lowercase characters only cased\n\ ! ones. Return False otherwise."); static PyObject* --- 2928,2935 ---- "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string and there is at least one\n\ ! character in S, i.e. uppercase characters may only follow uncased\n\ ! characters and lowercase characters only cased ones. Return False\n\ ! otherwise."); static PyObject* Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.7 retrieving revision 2.190.6.8 diff -C2 -d -r2.190.6.7 -r2.190.6.8 *** unicodeobject.c 17 Sep 2003 03:22:27 -0000 2.190.6.7 --- unicodeobject.c 18 Oct 2003 09:54:38 -0000 2.190.6.8 *************** *** 4899,4903 **** "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); --- 4899,4903 ---- "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); *************** *** 4933,4939 **** "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string, i.e. upper- and titlecase\n\ ! characters may only follow uncased characters and lowercase characters\n\ ! only cased ones. Return False otherwise."); static PyObject* --- 4933,4940 ---- "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string and there is at least one\n\ ! character in S, i.e. upper- and titlecase characters may only\n\ ! follow uncased characters and lowercase characters only cased ones.\n\ ! Return False otherwise."); static PyObject* *************** *** 4980,4985 **** "S.isspace() -> bool\n\ \n\ ! Return True if there are only whitespace characters in S,\n\ ! False otherwise."); static PyObject* --- 4981,4986 ---- "S.isspace() -> bool\n\ \n\ ! Return True if all characters in S are whitespace\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 5009,5013 **** "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); --- 5010,5014 ---- "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); *************** *** 5038,5042 **** "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); --- 5039,5043 ---- "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); *************** *** 5096,5101 **** "S.isdigit() -> bool\n\ \n\ ! Return True if there are only digit characters in S,\n\ ! False otherwise."); static PyObject* --- 5097,5102 ---- "S.isdigit() -> bool\n\ \n\ ! Return True if all characters in S are digits\n\ ! and there is at least one character in S, False otherwise."); static PyObject* From loewis at users.sourceforge.net Sat Oct 18 05:55:10 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:55:15 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.135, 1.136 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv15131/Doc/lib Modified Files: libstdtypes.tex Log Message: Patch #825679: Clarify semantics of .isfoo on empty strings. Backported to 2.3. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** libstdtypes.tex 18 Oct 2003 09:38:01 -0000 1.135 --- libstdtypes.tex 18 Oct 2003 09:55:08 -0000 1.136 *************** *** 614,618 **** \begin{methoddesc}[string]{isdigit}{} ! Return true if there are only digit characters, false otherwise. \end{methoddesc} --- 614,619 ---- \begin{methoddesc}[string]{isdigit}{} ! Return true if all characters in the string are digits and there ! is at least one character, false otherwise. \end{methoddesc} *************** *** 624,634 **** \begin{methoddesc}[string]{isspace}{} Return true if there are only whitespace characters in the string and ! the string is not empty, false otherwise. \end{methoddesc} \begin{methoddesc}[string]{istitle}{} ! Return true if the string is a titlecased string: uppercase ! characters may only follow uncased characters and lowercase characters ! only cased ones. Return false otherwise. \end{methoddesc} --- 625,636 ---- \begin{methoddesc}[string]{isspace}{} Return true if there are only whitespace characters in the string and ! there is at least one character, false otherwise. \end{methoddesc} \begin{methoddesc}[string]{istitle}{} ! Return true if the string is a titlecased string and there is at least one ! character, i.e. uppercase characters may only follow uncased ! characters and lowercase characters only cased ones. Return false ! otherwise. \end{methoddesc} From loewis at users.sourceforge.net Sat Oct 18 05:55:11 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 05:55:18 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.210, 2.211 unicodeobject.c, 2.199, 2.200 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv15131/Objects Modified Files: stringobject.c unicodeobject.c Log Message: Patch #825679: Clarify semantics of .isfoo on empty strings. Backported to 2.3. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.210 retrieving revision 2.211 diff -C2 -d -r2.210 -r2.211 *** stringobject.c 27 Aug 2003 04:55:51 -0000 2.210 --- stringobject.c 18 Oct 2003 09:55:08 -0000 2.211 *************** *** 2734,2741 **** PyDoc_STRVAR(isspace__doc__, ! "S.isspace() -> bool\n" ! "\n" ! "Return True if there are only whitespace characters in S,\n" ! "False otherwise."); static PyObject* --- 2734,2741 ---- PyDoc_STRVAR(isspace__doc__, ! "S.isspace() -> bool\n\ ! \n\ ! Return True if all characters in S are whitespace\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 2767,2771 **** "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); --- 2767,2771 ---- "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); *************** *** 2798,2802 **** "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); --- 2798,2802 ---- "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); *************** *** 2829,2834 **** "S.isdigit() -> bool\n\ \n\ ! Return True if there are only digit characters in S,\n\ ! False otherwise."); static PyObject* --- 2829,2834 ---- "S.isdigit() -> bool\n\ \n\ ! Return True if all characters in S are digits\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 2894,2898 **** "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); --- 2894,2898 ---- "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); *************** *** 2928,2934 **** "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string, i.e. uppercase characters\n\ ! may only follow uncased characters and lowercase characters only cased\n\ ! ones. Return False otherwise."); static PyObject* --- 2928,2935 ---- "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string and there is at least one\n\ ! character in S, i.e. uppercase characters may only follow uncased\n\ ! characters and lowercase characters only cased ones. Return False\n\ ! otherwise."); static PyObject* Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.199 retrieving revision 2.200 diff -C2 -d -r2.199 -r2.200 *** unicodeobject.c 6 Oct 2003 05:08:26 -0000 2.199 --- unicodeobject.c 18 Oct 2003 09:55:08 -0000 2.200 *************** *** 4898,4902 **** "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); --- 4898,4902 ---- "S.isupper() -> bool\n\ \n\ ! Return True if all cased characters in S are uppercase and there is\n\ at least one cased character in S, False otherwise."); *************** *** 4932,4938 **** "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string, i.e. upper- and titlecase\n\ ! characters may only follow uncased characters and lowercase characters\n\ ! only cased ones. Return False otherwise."); static PyObject* --- 4932,4939 ---- "S.istitle() -> bool\n\ \n\ ! Return True if S is a titlecased string and there is at least one\n\ ! character in S, i.e. upper- and titlecase characters may only\n\ ! follow uncased characters and lowercase characters only cased ones.\n\ ! Return False otherwise."); static PyObject* *************** *** 4979,4984 **** "S.isspace() -> bool\n\ \n\ ! Return True if there are only whitespace characters in S,\n\ ! False otherwise."); static PyObject* --- 4980,4985 ---- "S.isspace() -> bool\n\ \n\ ! Return True if all characters in S are whitespace\n\ ! and there is at least one character in S, False otherwise."); static PyObject* *************** *** 5008,5012 **** "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); --- 5009,5013 ---- "S.isalpha() -> bool\n\ \n\ ! Return True if all characters in S are alphabetic\n\ and there is at least one character in S, False otherwise."); *************** *** 5037,5041 **** "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); --- 5038,5042 ---- "S.isalnum() -> bool\n\ \n\ ! Return True if all characters in S are alphanumeric\n\ and there is at least one character in S, False otherwise."); *************** *** 5095,5100 **** "S.isdigit() -> bool\n\ \n\ ! Return True if there are only digit characters in S,\n\ ! False otherwise."); static PyObject* --- 5096,5101 ---- "S.isdigit() -> bool\n\ \n\ ! Return True if all characters in S are digits\n\ ! and there is at least one character in S, False otherwise."); static PyObject* From loewis at users.sourceforge.net Sat Oct 18 06:20:44 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 06:20:47 2003 Subject: [Python-checkins] python/dist/src/Lib StringIO.py,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv18545/Lib Modified Files: StringIO.py Log Message: Patch #822994: Consolidate tests for self.closed. Index: StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** StringIO.py 31 Jan 2003 16:04:15 -0000 1.29 --- StringIO.py 18 Oct 2003 10:20:42 -0000 1.30 *************** *** 36,39 **** --- 36,43 ---- __all__ = ["StringIO"] + def _complain_ifclosed(closed): + if closed: + raise ValueError, "I/O operation on closed file" + class StringIO: """class StringIO([buffer]) *************** *** 56,60 **** self.buflist = [] self.pos = 0 ! self.closed = 0 self.softspace = 0 --- 60,64 ---- self.buflist = [] self.pos = 0 ! self.closed = False self.softspace = 0 *************** *** 74,88 **** """ if not self.closed: ! self.closed = 1 del self.buf, self.pos def isatty(self): ! if self.closed: ! raise ValueError, "I/O operation on closed file" return False def seek(self, pos, mode = 0): ! if self.closed: ! raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) --- 78,90 ---- """ if not self.closed: ! self.closed = True del self.buf, self.pos def isatty(self): ! _complain_ifclosed(self.closed) return False def seek(self, pos, mode = 0): ! _complain_ifclosed(self.closed) if self.buflist: self.buf += ''.join(self.buflist) *************** *** 95,105 **** def tell(self): ! if self.closed: ! raise ValueError, "I/O operation on closed file" return self.pos def read(self, n = -1): ! if self.closed: ! raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) --- 97,105 ---- def tell(self): ! _complain_ifclosed(self.closed) return self.pos def read(self, n = -1): ! _complain_ifclosed(self.closed) if self.buflist: self.buf += ''.join(self.buflist) *************** *** 114,119 **** def readline(self, length=None): ! if self.closed: ! raise ValueError, "I/O operation on closed file" if self.buflist: self.buf += ''.join(self.buflist) --- 114,118 ---- def readline(self, length=None): ! _complain_ifclosed(self.closed) if self.buflist: self.buf += ''.join(self.buflist) *************** *** 144,149 **** def truncate(self, size=None): ! if self.closed: ! raise ValueError, "I/O operation on closed file" if size is None: size = self.pos --- 143,147 ---- def truncate(self, size=None): ! _complain_ifclosed(self.closed) if size is None: size = self.pos *************** *** 155,160 **** def write(self, s): ! if self.closed: ! raise ValueError, "I/O operation on closed file" if not s: return # Force s to be a string or unicode --- 153,157 ---- def write(self, s): ! _complain_ifclosed(self.closed) if not s: return # Force s to be a string or unicode *************** *** 186,191 **** def flush(self): ! if self.closed: ! raise ValueError, "I/O operation on closed file" def getvalue(self): --- 183,187 ---- def flush(self): ! _complain_ifclosed(self.closed) def getvalue(self): From niemeyer at users.sourceforge.net Sat Oct 18 11:28:24 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Sat Oct 18 11:28:27 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex,1.107,1.108 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27145/Doc/lib Modified Files: libre.tex Log Message: Fixed \versionadded for the (?(id/name)yes|no) expression support. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** libre.tex 17 Oct 2003 22:13:16 -0000 1.107 --- libre.tex 18 Oct 2003 15:28:22 -0000 1.108 *************** *** 305,309 **** pattern, which will match with \code{''} as well as \code{'user@host.com'}, but not with \code{''} as well as \code{'user@host.com'}, but not with \code{' Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv19145 Modified Files: Tag: release23-maint test_tempfile.py Log Message: Patch #813200: Properly quote executable on Windows. Fixes #811082. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.14 retrieving revision 1.14.8.1 diff -C2 -d -r1.14 -r1.14.8.1 *** test_tempfile.py 1 May 2003 17:45:51 -0000 1.14 --- test_tempfile.py 18 Oct 2003 18:08:03 -0000 1.14.8.1 *************** *** 293,298 **** "tf_inherit_check.py") ! retval = os.spawnl(os.P_WAIT, sys.executable, ! sys.executable, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) --- 293,302 ---- "tf_inherit_check.py") ! # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted, ! # but an arg with embedded spaces should be decorated with double ! # quotes on each end ! decorated = '"%s"' % sys.executable ! tester = '"%s"' % tester ! retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) From loewis at users.sourceforge.net Sat Oct 18 14:09:20 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 14:09:23 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_tempfile.py, 1.14.8.1, 1.14.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv19341 Modified Files: Tag: release23-maint test_tempfile.py Log Message: Revert previous checkin, as it breaks on Unix. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.14.8.1 retrieving revision 1.14.8.2 diff -C2 -d -r1.14.8.1 -r1.14.8.2 *** test_tempfile.py 18 Oct 2003 18:08:03 -0000 1.14.8.1 --- test_tempfile.py 18 Oct 2003 18:09:18 -0000 1.14.8.2 *************** *** 293,302 **** "tf_inherit_check.py") ! # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted, ! # but an arg with embedded spaces should be decorated with double ! # quotes on each end ! decorated = '"%s"' % sys.executable ! tester = '"%s"' % tester ! retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) --- 293,298 ---- "tf_inherit_check.py") ! retval = os.spawnl(os.P_WAIT, sys.executable, ! sys.executable, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) From niemeyer at users.sourceforge.net Sat Oct 18 16:54:52 2003 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Sat Oct 18 16:55:01 2003 Subject: [Python-checkins] python/dist/src/Modules _sre.c,2.101,2.102 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv11246 Modified Files: _sre.c Log Message: Removing dead code. Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.101 retrieving revision 2.102 diff -C2 -d -r2.101 -r2.102 *** _sre.c 17 Oct 2003 22:13:16 -0000 2.101 --- _sre.c 18 Oct 2003 20:54:44 -0000 2.102 *************** *** 720,730 **** } while (0) - #define DATA_STACK_LOOKUP(state, type, ptr) \ - do { \ - TRACE(("looking up %s in %d (%d)\n", SFY(type), \ - state->data_stack_base-sizeof(type), sizeof(type))); \ - ptr = (type*)(state->data_stack+state->data_stack_base-sizeof(type)); \ - } while (0) - #define DATA_STACK_LOOKUP_AT(state, type, ptr, pos) \ do { \ --- 720,723 ---- *************** *** 767,778 **** #define DATA_POP(x) \ DATA_STACK_POP(state, (x), sizeof(*(x)), 1) - #define DATA_POP_KEEP(x) \ - DATA_STACK_POP(state, (x), sizeof(*(x)), 0) #define DATA_POP_DISCARD(x) \ DATA_STACK_POP_DISCARD(state, sizeof(*(x))) #define DATA_ALLOC(t,p) \ DATA_STACK_ALLOC(state, t, p) - #define DATA_LOOKUP(t,p) \ - DATA_STACK_LOOKUP(state, t, p) #define DATA_LOOKUP_AT(t,p,pos) \ DATA_STACK_LOOKUP_AT(state,t,p,pos) --- 760,767 ---- From loewis at users.sourceforge.net Sat Oct 18 18:05:28 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Oct 18 18:06:13 2003 Subject: [Python-checkins] python/dist/src/Python compile.c,2.296,2.297 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv22492/Python Modified Files: compile.c Log Message: Patch #792869: Clarify error message for parameters declared global, rename LOCAL_GLOBAL to PARAM_GLOBAL. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.296 retrieving revision 2.297 diff -C2 -d -r2.296 -r2.297 *** compile.c 12 Oct 2003 19:09:37 -0000 2.296 --- compile.c 18 Oct 2003 22:05:25 -0000 2.297 *************** *** 61,65 **** "name '%.400s' is used prior to global declaration" ! #define LOCAL_GLOBAL \ "name '%.400s' is a function parameter and declared global" --- 61,65 ---- "name '%.400s' is used prior to global declaration" ! #define PARAM_GLOBAL \ "name '%.400s' is a function parameter and declared global" *************** *** 4844,4848 **** else if (flags & DEF_GLOBAL) { if (flags & DEF_PARAM) { ! PyErr_Format(PyExc_SyntaxError, LOCAL_GLOBAL, PyString_AS_STRING(name)); symtable_error(st, 0); --- 4844,4848 ---- else if (flags & DEF_GLOBAL) { if (flags & DEF_PARAM) { ! PyErr_Format(PyExc_SyntaxError, PARAM_GLOBAL, PyString_AS_STRING(name)); symtable_error(st, 0); *************** *** 5593,5598 **** char buf[500]; if (flags & DEF_PARAM) { ! PyErr_Format(PyExc_SyntaxError, ! "name '%.400s' is local and global", name); symtable_error(st, 0); --- 5593,5597 ---- char buf[500]; if (flags & DEF_PARAM) { ! PyErr_Format(PyExc_SyntaxError, PARAM_GLOBAL, name); symtable_error(st, 0); From loewis at users.sourceforge.net Sun Oct 19 03:31:16 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:31:21 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex, 1.56.8.3, 1.56.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv25966/dist Modified Files: Tag: release23-maint dist.tex Log Message: Patch #821093: Fix various typos. Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.56.8.3 retrieving revision 1.56.8.4 diff -C2 -d -r1.56.8.3 -r1.56.8.4 *** dist.tex 16 Oct 2003 19:42:13 -0000 1.56.8.3 --- dist.tex 19 Oct 2003 07:31:14 -0000 1.56.8.4 *************** *** 806,810 **** variable can be set to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the ! full traceback in case an exception occurrs. \section{Writing the Setup Configuration File} --- 806,810 ---- variable can be set to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the ! full traceback in case an exception occurs. \section{Writing the Setup Configuration File} From loewis at users.sourceforge.net Sun Oct 19 03:31:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:31:24 2003 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.49,1.49.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory sc8-pr-cvs1:/tmp/cvs-serv25966/inst Modified Files: Tag: release23-maint inst.tex Log Message: Patch #821093: Fix various typos. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.49 retrieving revision 1.49.8.1 diff -C2 -d -r1.49 -r1.49.8.1 *** inst.tex 2 Jul 2003 14:33:11 -0000 1.49 --- inst.tex 19 Oct 2003 07:31:14 -0000 1.49.8.1 *************** *** 159,163 **** downloaded the archive file to \file{C:\textbackslash{}Temp}, then it would unpack into \file{C:\textbackslash{}Temp\textbackslash{}foo-1.0}; ! you can use either a archive manipulator with a grapical user interface (such as WinZip) or a command-line tool (such as \program{unzip} or \program{pkunzip}) to unpack the archive. Then, open a command prompt --- 159,163 ---- downloaded the archive file to \file{C:\textbackslash{}Temp}, then it would unpack into \file{C:\textbackslash{}Temp\textbackslash{}foo-1.0}; ! you can use either a archive manipulator with a graphical user interface (such as WinZip) or a command-line tool (such as \program{unzip} or \program{pkunzip}) to unpack the archive. Then, open a command prompt From loewis at users.sourceforge.net Sun Oct 19 03:31:16 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:31:27 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.25.10.1, 1.25.10.2 init.tex, 1.10.8.2, 1.10.8.3 newtypes.tex, 1.23.8.1, 1.23.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv25966/api Modified Files: Tag: release23-maint concrete.tex init.tex newtypes.tex Log Message: Patch #821093: Fix various typos. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25.10.1 retrieving revision 1.25.10.2 diff -C2 -d -r1.25.10.1 -r1.25.10.2 *** concrete.tex 23 Aug 2003 03:39:28 -0000 1.25.10.1 --- concrete.tex 19 Oct 2003 07:31:14 -0000 1.25.10.2 *************** *** 1113,1117 **** % --- Unicode-Escape Codecs ---------------------------------------------- ! These are the ``Unicode Esacpe'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeUnicodeEscape}{const char *s, --- 1113,1117 ---- % --- Unicode-Escape Codecs ---------------------------------------------- ! These are the ``Unicode Escape'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeUnicodeEscape}{const char *s, *************** *** 1139,1143 **** % --- Raw-Unicode-Escape Codecs ------------------------------------------ ! These are the ``Raw Unicode Esacpe'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeRawUnicodeEscape}{const char *s, --- 1139,1143 ---- % --- Raw-Unicode-Escape Codecs ------------------------------------------ ! These are the ``Raw Unicode Escape'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeRawUnicodeEscape}{const char *s, *************** *** 1145,1149 **** const char *errors} Creates a Unicode object by decoding \var{size} bytes of the ! Raw-Unicode-Esacpe encoded string \var{s}. Returns \NULL{} if an exception was raised by the codec. \end{cfuncdesc} --- 1145,1149 ---- const char *errors} Creates a Unicode object by decoding \var{size} bytes of the ! Raw-Unicode-Escape encoded string \var{s}. Returns \NULL{} if an exception was raised by the codec. \end{cfuncdesc} *************** *** 1326,1330 **** The following APIs are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return ! Unicode objects or integers as apporpriate. They all return \NULL{} or \code{-1} if an exception occurs. --- 1326,1330 ---- The following APIs are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return ! Unicode objects or integers as appropriate. They all return \NULL{} or \code{-1} if an exception occurs. Index: init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.10.8.2 retrieving revision 1.10.8.3 diff -C2 -d -r1.10.8.2 -r1.10.8.3 *** init.tex 7 Sep 2003 02:35:25 -0000 1.10.8.2 --- init.tex 19 Oct 2003 07:31:14 -0000 1.10.8.3 *************** *** 753,757 **** is called with this value for \var{what} when after any bytecode is processed after which the exception becomes set within the frame ! being executed. The effect of this is that as exception propogation causes the Python stack to unwind, the callback is called upon return to each frame as the exception propagates. Only trace --- 753,757 ---- is called with this value for \var{what} when after any bytecode is processed after which the exception becomes set within the frame ! being executed. The effect of this is that as exception propagation causes the Python stack to unwind, the callback is called upon return to each frame as the exception propagates. Only trace *************** *** 768,772 **** \begin{cvardesc}{int}{PyTrace_RETURN} The value for the \var{what} parameter to \ctype{Py_tracefunc} ! functions when a call is returning without propogating an exception. \end{cvardesc} --- 768,772 ---- \begin{cvardesc}{int}{PyTrace_RETURN} The value for the \var{what} parameter to \ctype{Py_tracefunc} ! functions when a call is returning without propagating an exception. \end{cvardesc} Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v retrieving revision 1.23.8.1 retrieving revision 1.23.8.2 diff -C2 -d -r1.23.8.1 -r1.23.8.2 *** newtypes.tex 25 Aug 2003 04:44:33 -0000 1.23.8.1 --- newtypes.tex 19 Oct 2003 07:31:14 -0000 1.23.8.2 *************** *** 499,503 **** The destructor function is called by the \cfunction{Py_DECREF()} and \cfunction{Py_XDECREF()} macros when the new reference count is ! zero. At this point, the instance is still in existance, but there are no references to it. The destructor function should free all references which the instance owns, free all memory buffers owned by --- 499,503 ---- The destructor function is called by the \cfunction{Py_DECREF()} and \cfunction{Py_XDECREF()} macros when the new reference count is ! zero. At this point, the instance is still in existence, but there are no references to it. The destructor function should free all references which the instance owns, free all memory buffers owned by *************** *** 1516,1520 **** ! \section{Supporting Cyclic Garbarge Collection \label{supporting-cycle-detection}} --- 1516,1520 ---- ! \section{Supporting Cyclic Garbage Collection \label{supporting-cycle-detection}} From loewis at users.sourceforge.net Sun Oct 19 03:31:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:31:29 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex, 1.114.4.2, 1.114.4.3 ref5.tex, 1.76, 1.76.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv25966/ref Modified Files: Tag: release23-maint ref3.tex ref5.tex Log Message: Patch #821093: Fix various typos. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.114.4.2 retrieving revision 1.114.4.3 diff -C2 -d -r1.114.4.2 -r1.114.4.3 *** ref3.tex 22 Sep 2003 15:36:00 -0000 1.114.4.2 --- ref3.tex 19 Oct 2003 07:31:14 -0000 1.114.4.3 *************** *** 1035,1039 **** initialization of the base class part of the instance; for example: \samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special ! contraint on constructors, no value may be returned; doing so will cause a \exception{TypeError} to be raised at runtime. \end{methoddesc} --- 1035,1039 ---- initialization of the base class part of the instance; for example: \samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special ! constraint on constructors, no value may be returned; doing so will cause a \exception{TypeError} to be raised at runtime. \end{methoddesc} Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.76 retrieving revision 1.76.10.1 diff -C2 -d -r1.76 -r1.76.10.1 *** ref5.tex 27 Jun 2003 17:12:43 -0000 1.76 --- ref5.tex 19 Oct 2003 07:31:15 -0000 1.76.10.1 *************** *** 1005,1009 **** \indexii{lambda}{expression} \indexii{lambda}{form} ! \indexii{anonmymous}{function} Lambda forms (lambda expressions) have the same syntactic position as --- 1005,1009 ---- \indexii{lambda}{expression} \indexii{lambda}{form} ! \indexii{anonymous}{function} Lambda forms (lambda expressions) have the same syntactic position as From loewis at users.sourceforge.net Sun Oct 19 03:31:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:31:31 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.5, 1.196.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv25966/tut Modified Files: Tag: release23-maint tut.tex Log Message: Patch #821093: Fix various typos. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.5 retrieving revision 1.196.8.6 diff -C2 -d -r1.196.8.5 -r1.196.8.6 *** tut.tex 30 Aug 2003 23:24:37 -0000 1.196.8.5 --- tut.tex 19 Oct 2003 07:31:15 -0000 1.196.8.6 *************** *** 2481,2485 **** efficiency or to provide access to operating system primitives such as system calls. The set of such modules is a configuration option which ! also dependson the underlying platform For example, the \module{amoeba} module is only provided on systems that somehow support Amoeba primitives. One particular module deserves some --- 2481,2485 ---- efficiency or to provide access to operating system primitives such as system calls. The set of such modules is a configuration option which ! also depends on the underlying platform For example, the \module{amoeba} module is only provided on systems that somehow support Amoeba primitives. One particular module deserves some *************** *** 2633,2637 **** \end{verbatim} ! When importing the package, Python searchs through the directories on \code{sys.path} looking for the package subdirectory. --- 2633,2637 ---- \end{verbatim} ! When importing the package, Python searches through the directories on \code{sys.path} looking for the package subdirectory. From loewis at users.sourceforge.net Sun Oct 19 03:32:26 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:32:30 2003 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory sc8-pr-cvs1:/tmp/cvs-serv26117/inst Modified Files: inst.tex Log Message: Patch #821093: Fix various typos. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** inst.tex 23 Aug 2003 02:09:18 -0000 1.50 --- inst.tex 19 Oct 2003 07:32:23 -0000 1.51 *************** *** 159,163 **** downloaded the archive file to \file{C:\textbackslash{}Temp}, then it would unpack into \file{C:\textbackslash{}Temp\textbackslash{}foo-1.0}; ! you can use either a archive manipulator with a grapical user interface (such as WinZip) or a command-line tool (such as \program{unzip} or \program{pkunzip}) to unpack the archive. Then, open a command prompt --- 159,163 ---- downloaded the archive file to \file{C:\textbackslash{}Temp}, then it would unpack into \file{C:\textbackslash{}Temp\textbackslash{}foo-1.0}; ! you can use either a archive manipulator with a graphical user interface (such as WinZip) or a command-line tool (such as \program{unzip} or \program{pkunzip}) to unpack the archive. Then, open a command prompt From loewis at users.sourceforge.net Sun Oct 19 03:32:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:32:32 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.27, 1.28 init.tex, 1.12, 1.13 newtypes.tex, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv26117/api Modified Files: concrete.tex init.tex newtypes.tex Log Message: Patch #821093: Fix various typos. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** concrete.tex 12 Oct 2003 18:24:34 -0000 1.27 --- concrete.tex 19 Oct 2003 07:32:23 -0000 1.28 *************** *** 1113,1117 **** % --- Unicode-Escape Codecs ---------------------------------------------- ! These are the ``Unicode Esacpe'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeUnicodeEscape}{const char *s, --- 1113,1117 ---- % --- Unicode-Escape Codecs ---------------------------------------------- ! These are the ``Unicode Escape'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeUnicodeEscape}{const char *s, *************** *** 1139,1143 **** % --- Raw-Unicode-Escape Codecs ------------------------------------------ ! These are the ``Raw Unicode Esacpe'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeRawUnicodeEscape}{const char *s, --- 1139,1143 ---- % --- Raw-Unicode-Escape Codecs ------------------------------------------ ! These are the ``Raw Unicode Escape'' codec APIs: \begin{cfuncdesc}{PyObject*}{PyUnicode_DecodeRawUnicodeEscape}{const char *s, *************** *** 1145,1149 **** const char *errors} Creates a Unicode object by decoding \var{size} bytes of the ! Raw-Unicode-Esacpe encoded string \var{s}. Returns \NULL{} if an exception was raised by the codec. \end{cfuncdesc} --- 1145,1149 ---- const char *errors} Creates a Unicode object by decoding \var{size} bytes of the ! Raw-Unicode-Escape encoded string \var{s}. Returns \NULL{} if an exception was raised by the codec. \end{cfuncdesc} *************** *** 1326,1330 **** The following APIs are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return ! Unicode objects or integers as apporpriate. They all return \NULL{} or \code{-1} if an exception occurs. --- 1326,1330 ---- The following APIs are capable of handling Unicode objects and strings on input (we refer to them as strings in the descriptions) and return ! Unicode objects or integers as appropriate. They all return \NULL{} or \code{-1} if an exception occurs. Index: init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** init.tex 7 Sep 2003 02:32:55 -0000 1.12 --- init.tex 19 Oct 2003 07:32:23 -0000 1.13 *************** *** 753,757 **** is called with this value for \var{what} when after any bytecode is processed after which the exception becomes set within the frame ! being executed. The effect of this is that as exception propogation causes the Python stack to unwind, the callback is called upon return to each frame as the exception propagates. Only trace --- 753,757 ---- is called with this value for \var{what} when after any bytecode is processed after which the exception becomes set within the frame ! being executed. The effect of this is that as exception propagation causes the Python stack to unwind, the callback is called upon return to each frame as the exception propagates. Only trace *************** *** 768,772 **** \begin{cvardesc}{int}{PyTrace_RETURN} The value for the \var{what} parameter to \ctype{Py_tracefunc} ! functions when a call is returning without propogating an exception. \end{cvardesc} --- 768,772 ---- \begin{cvardesc}{int}{PyTrace_RETURN} The value for the \var{what} parameter to \ctype{Py_tracefunc} ! functions when a call is returning without propagating an exception. \end{cvardesc} Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** newtypes.tex 25 Aug 2003 04:43:53 -0000 1.24 --- newtypes.tex 19 Oct 2003 07:32:23 -0000 1.25 *************** *** 499,503 **** The destructor function is called by the \cfunction{Py_DECREF()} and \cfunction{Py_XDECREF()} macros when the new reference count is ! zero. At this point, the instance is still in existance, but there are no references to it. The destructor function should free all references which the instance owns, free all memory buffers owned by --- 499,503 ---- The destructor function is called by the \cfunction{Py_DECREF()} and \cfunction{Py_XDECREF()} macros when the new reference count is ! zero. At this point, the instance is still in existence, but there are no references to it. The destructor function should free all references which the instance owns, free all memory buffers owned by *************** *** 1516,1520 **** ! \section{Supporting Cyclic Garbarge Collection \label{supporting-cycle-detection}} --- 1516,1520 ---- ! \section{Supporting Cyclic Garbage Collection \label{supporting-cycle-detection}} From loewis at users.sourceforge.net Sun Oct 19 03:32:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:32:35 2003 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex,1.59,1.60 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv26117/dist Modified Files: dist.tex Log Message: Patch #821093: Fix various typos. Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** dist.tex 16 Oct 2003 19:40:48 -0000 1.59 --- dist.tex 19 Oct 2003 07:32:23 -0000 1.60 *************** *** 806,810 **** variable can be set to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the ! full traceback in case an exception occurrs. \section{Writing the Setup Configuration File} --- 806,810 ---- variable can be set to anything except an empty string, and distutils will now print detailed information what it is doing, and prints the ! full traceback in case an exception occurs. \section{Writing the Setup Configuration File} From loewis at users.sourceforge.net Sun Oct 19 03:32:26 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:32:38 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex, 1.116, 1.117 ref5.tex, 1.77, 1.78 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv26117/ref Modified Files: ref3.tex ref5.tex Log Message: Patch #821093: Fix various typos. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** ref3.tex 22 Sep 2003 15:26:20 -0000 1.116 --- ref3.tex 19 Oct 2003 07:32:24 -0000 1.117 *************** *** 1035,1039 **** initialization of the base class part of the instance; for example: \samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special ! contraint on constructors, no value may be returned; doing so will cause a \exception{TypeError} to be raised at runtime. \end{methoddesc} --- 1035,1039 ---- initialization of the base class part of the instance; for example: \samp{BaseClass.__init__(\var{self}, [\var{args}...])}. As a special ! constraint on constructors, no value may be returned; doing so will cause a \exception{TypeError} to be raised at runtime. \end{methoddesc} Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** ref5.tex 6 Sep 2003 03:33:32 -0000 1.77 --- ref5.tex 19 Oct 2003 07:32:24 -0000 1.78 *************** *** 1005,1009 **** \indexii{lambda}{expression} \indexii{lambda}{form} ! \indexii{anonmymous}{function} Lambda forms (lambda expressions) have the same syntactic position as --- 1005,1009 ---- \indexii{lambda}{expression} \indexii{lambda}{form} ! \indexii{anonymous}{function} Lambda forms (lambda expressions) have the same syntactic position as From loewis at users.sourceforge.net Sun Oct 19 03:32:26 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 03:32:40 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.206,1.207 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv26117/tut Modified Files: tut.tex Log Message: Patch #821093: Fix various typos. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** tut.tex 24 Sep 2003 16:53:02 -0000 1.206 --- tut.tex 19 Oct 2003 07:32:24 -0000 1.207 *************** *** 2495,2499 **** efficiency or to provide access to operating system primitives such as system calls. The set of such modules is a configuration option which ! also dependson the underlying platform For example, the \module{amoeba} module is only provided on systems that somehow support Amoeba primitives. One particular module deserves some --- 2495,2499 ---- efficiency or to provide access to operating system primitives such as system calls. The set of such modules is a configuration option which ! also depends on the underlying platform For example, the \module{amoeba} module is only provided on systems that somehow support Amoeba primitives. One particular module deserves some *************** *** 2648,2652 **** \end{verbatim} ! When importing the package, Python searchs through the directories on \code{sys.path} looking for the package subdirectory. --- 2648,2652 ---- \end{verbatim} ! When importing the package, Python searches through the directories on \code{sys.path} looking for the package subdirectory. From loewis at users.sourceforge.net Sun Oct 19 14:30:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:30:06 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.871,1.872 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv29267/Misc Modified Files: NEWS Log Message: Make CObjects mutable. Fixes #477441. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.871 retrieving revision 1.872 diff -C2 -d -r1.871 -r1.872 *** NEWS 17 Oct 2003 22:13:16 -0000 1.871 --- NEWS 19 Oct 2003 18:30:01 -0000 1.872 *************** *** 13,16 **** --- 13,18 ---- ----------------- + - CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr. + - list.sort() now supports three keyword arguments: cmp, key, and reverse. The key argument can be a function of one argument that extracts a From loewis at users.sourceforge.net Sun Oct 19 14:30:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:30:09 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv29267/Doc/api Modified Files: concrete.tex Log Message: Make CObjects mutable. Fixes #477441. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** concrete.tex 19 Oct 2003 07:32:23 -0000 1.28 --- concrete.tex 19 Oct 2003 18:30:00 -0000 1.29 *************** *** 2480,2489 **** \begin{cfuncdesc}{int}{PyCObject_Check}{PyObject *p} ! Returns true if its argument is a \ctype{PyCObject}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyCObject_FromVoidPtr}{void* cobj, void (*destr)(void *)} ! Creates a \ctype{PyCObject} from the \code{void *}\var{cobj}. The \var{destr} function will be called when the object is reclaimed, unless it is \NULL. --- 2480,2489 ---- \begin{cfuncdesc}{int}{PyCObject_Check}{PyObject *p} ! Return true if its argument is a \ctype{PyCObject}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyCObject_FromVoidPtr}{void* cobj, void (*destr)(void *)} ! Create a \ctype{PyCObject} from the \code{void *}\var{cobj}. The \var{destr} function will be called when the object is reclaimed, unless it is \NULL. *************** *** 2492,2496 **** \begin{cfuncdesc}{PyObject*}{PyCObject_FromVoidPtrAndDesc}{void* cobj, void* desc, void (*destr)(void *, void *)} ! Creates a \ctype{PyCObject} from the \ctype{void *}\var{cobj}. The \var{destr} function will be called when the object is reclaimed. The \var{desc} argument can be used to pass extra callback data for --- 2492,2496 ---- \begin{cfuncdesc}{PyObject*}{PyCObject_FromVoidPtrAndDesc}{void* cobj, void* desc, void (*destr)(void *, void *)} ! Create a \ctype{PyCObject} from the \ctype{void *}\var{cobj}. The \var{destr} function will be called when the object is reclaimed. The \var{desc} argument can be used to pass extra callback data for *************** *** 2499,2509 **** \begin{cfuncdesc}{void*}{PyCObject_AsVoidPtr}{PyObject* self} ! Returns the object \ctype{void *} that the \ctype{PyCObject} \var{self} was created with. \end{cfuncdesc} \begin{cfuncdesc}{void*}{PyCObject_GetDesc}{PyObject* self} ! Returns the description \ctype{void *} that the \ctype{PyCObject} \var{self} was created with. \end{cfuncdesc} --- 2499,2515 ---- \begin{cfuncdesc}{void*}{PyCObject_AsVoidPtr}{PyObject* self} ! Return the object \ctype{void *} that the \ctype{PyCObject} \var{self} was created with. \end{cfuncdesc} \begin{cfuncdesc}{void*}{PyCObject_GetDesc}{PyObject* self} ! Return the description \ctype{void *} that the \ctype{PyCObject} \var{self} was created with. + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyCObject_SetVoidPtr}{PyObject* self, void* cobj} + Set the void pointer inside \var{self} to \var{cobj}. + The \ctype{PyCObject} must not have an associated destructor. + Return true on success, false on failure. \end{cfuncdesc} From loewis at users.sourceforge.net Sun Oct 19 14:30:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:30:12 2003 Subject: [Python-checkins] python/dist/src/Include cobject.h,2.11,2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv29267/Include Modified Files: cobject.h Log Message: Make CObjects mutable. Fixes #477441. Index: cobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/cobject.h,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** cobject.h 12 Aug 2002 07:21:56 -0000 2.11 --- cobject.h 19 Oct 2003 18:30:00 -0000 2.12 *************** *** 46,49 **** --- 46,52 ---- PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name); + /* Modify a C object. Fails (==0) if object has a destructor. */ + PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj); + #ifdef __cplusplus } From loewis at users.sourceforge.net Sun Oct 19 14:30:03 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:30:16 2003 Subject: [Python-checkins] python/dist/src/Objects cobject.c,2.15,2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv29267/Objects Modified Files: cobject.c Log Message: Make CObjects mutable. Fixes #477441. Index: cobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/cobject.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** cobject.c 11 Jul 2003 17:02:39 -0000 2.15 --- cobject.c 19 Oct 2003 18:30:01 -0000 2.16 *************** *** 100,103 **** --- 100,117 ---- } + int + PyCObject_SetVoidPtr(PyObject *_self, void *cobj) + { + PyCObject* self = (PyCObject*)_self; + if (self == NULL || !PyCObject_Check(self) || + self->destructor != NULL) { + PyErr_SetString(PyExc_TypeError, + "Invalid call to PyCObject_SetVoidPtr"); + return 0; + } + self->cobject = cobj; + return 1; + } + static void PyCObject_dealloc(PyCObject *self) From loewis at users.sourceforge.net Sun Oct 19 14:34:37 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:34:41 2003 Subject: [Python-checkins] python/dist/src/Misc/RPM python-2.3.spec, 1.2.12.3, 1.2.12.4 Message-ID: Update of /cvsroot/python/python/dist/src/Misc/RPM In directory sc8-pr-cvs1:/tmp/cvs-serv29804 Modified Files: Tag: release23-maint python-2.3.spec Log Message: Patch #823259: Update spec file: - skip building HTML documentation if it is not available. - Removal of patches, which can't be referenced from a build directly from the tar-file. - Using the RPM tmp directory macro for the buildroot location. - Ensuring that the clean directive doesn't accidentally delete the users root directory or another directory. - --enable-unicode=ucs4 in configure line. Index: python-2.3.spec =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/RPM/python-2.3.spec,v retrieving revision 1.2.12.3 retrieving revision 1.2.12.4 diff -C2 -d -r1.2.12.3 -r1.2.12.4 *** python-2.3.spec 1 Oct 2003 06:47:48 -0000 1.2.12.3 --- python-2.3.spec 19 Oct 2003 18:34:35 -0000 1.2.12.4 *************** *** 42,45 **** --- 42,48 ---- %define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) + # detect if documentation is available + %define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi) + Summary: An interpreted, interactive, object-oriented programming language. Name: %{name}%{binsuffix} *************** *** 49,54 **** Group: Development/Languages Source: Python-%{version}.tgz Source1: html-%{version}.tar.bz2 ! #Patch0: Python-2.1-pythonpath.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPrereq: expat-devel --- 52,58 ---- Group: Development/Languages Source: Python-%{version}.tgz + %if %{include_docs} Source1: html-%{version}.tar.bz2 ! %endif BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPrereq: expat-devel *************** *** 113,116 **** --- 117,121 ---- tkinter packages. + %if %{include_docs} %package docs Summary: Python-related documentation. *************** *** 120,125 **** --- 125,134 ---- Documentation relating to the Python programming language in HTML and info formats. + %endif %changelog + * Mon Oct 13 2003 Sean Reifschneider [2.3.2-1pydotorg] + - Adding code to detect wether documentation is available to build. + * Fri Sep 19 2003 Sean Reifschneider [2.3.1-1pydotorg] - Updating to the 2.3.1 release. *************** *** 178,182 **** %prep %setup -n Python-%{version} - #%patch0 -p1 ######## --- 187,190 ---- *************** *** 246,249 **** --- 254,258 ---- ###### # Docs + %if %{include_docs} mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python ( *************** *** 251,263 **** bunzip2 < %{SOURCE1} | tar x ) ! ! # clean up the /usr/local/bin/python references ! find "$RPM_BUILD_ROOT" -type f | xargs grep -l /usr/local/bin/python | while read file ! do ! rm -f /tmp/pypathtmp ! sed 's|/usr/local/bin/python|/usr/bin/python%{binsuffix}|g' <"$file" >/tmp/pypathtmp ! cat "$file" ! rm -f /tmp/pypathtmp ! done ######## --- 260,264 ---- bunzip2 < %{SOURCE1} | tar x ) ! %endif ######## *************** *** 265,271 **** ######## %clean ! #@@@ ! #rm -fr $RPM_BUILD_ROOT ! #rm -f mainpkg.files tools.files ######## --- 266,271 ---- ######## %clean ! [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT ! rm -f mainpkg.files tools.files ######## *************** *** 313,317 **** --- 313,319 ---- %endif + %if %{include_docs} %files docs %defattr(-,root,root) /var/www/html/python/* + %endif From loewis at users.sourceforge.net Sun Oct 19 14:34:54 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Oct 19 14:34:58 2003 Subject: [Python-checkins] python/dist/src/Misc/RPM python-2.3.spec,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Misc/RPM In directory sc8-pr-cvs1:/tmp/cvs-serv30122 Modified Files: python-2.3.spec Log Message: Patch #823259: Update spec file: - skip building HTML documentation if it is not available. - Removal of patches, which can't be referenced from a build directly from the tar-file. - Using the RPM tmp directory macro for the buildroot location. - Ensuring that the clean directive doesn't accidentally delete the users root directory or another directory. - --enable-unicode=ucs4 in configure line. Backported to 2.3. Index: python-2.3.spec =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/RPM/python-2.3.spec,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** python-2.3.spec 24 Feb 2003 17:55:37 -0000 1.2 --- python-2.3.spec 19 Oct 2003 18:34:52 -0000 1.3 *************** *** 31,35 **** %define name python ! %define version 2.3b1 %define libvers 2.3 %define release 1pydotorg --- 31,35 ---- %define name python ! %define version 2.3.2 %define libvers 2.3 %define release 1pydotorg *************** *** 42,45 **** --- 42,48 ---- %define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) + # detect if documentation is available + %define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi) + Summary: An interpreted, interactive, object-oriented programming language. Name: %{name}%{binsuffix} *************** *** 49,56 **** Group: Development/Languages Source: Python-%{version}.tgz Source1: html-%{version}.tar.bz2 ! Patch0: Python-2.1-pythonpath.patch ! #Patch1: Python-2.1-expat.patch ! BuildRoot: /var/tmp/%{name}-%{version}-root BuildPrereq: expat-devel BuildPrereq: db4-devel --- 52,59 ---- Group: Development/Languages Source: Python-%{version}.tgz + %if %{include_docs} Source1: html-%{version}.tar.bz2 ! %endif ! BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPrereq: expat-devel BuildPrereq: db4-devel *************** *** 114,117 **** --- 117,121 ---- tkinter packages. + %if %{include_docs} %package docs Summary: Python-related documentation. *************** *** 121,126 **** --- 125,137 ---- Documentation relating to the Python programming language in HTML and info formats. + %endif %changelog + * Mon Oct 13 2003 Sean Reifschneider [2.3.2-1pydotorg] + - Adding code to detect wether documentation is available to build. + + * Fri Sep 19 2003 Sean Reifschneider [2.3.1-1pydotorg] + - Updating to the 2.3.1 release. + * Mon Feb 24 2003 Sean Reifschneider [2.3b1-1pydotorg] - Updating to 2.3b1 release. *************** *** 176,181 **** %prep %setup -n Python-%{version} - %patch0 -p1 - #%patch1 ######## --- 187,190 ---- *************** *** 183,187 **** ######## %build ! ./configure %{ipv6} %{pymalloc} --prefix=%{__prefix} make --- 192,196 ---- ######## %build ! ./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix} make *************** *** 224,228 **** # Tools echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} ! echo 'exec %{_prefix}/bin/python%{binsuffix} /usr/lib/python%{libvers}/Tools/idle/idle.py' >>$RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers} --- 233,237 ---- # Tools echo '#!/bin/bash' >${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} ! echo 'exec %{_prefix}/bin/python%{binsuffix} /usr/lib/python%{libvers}/idlelib/idle.py' >>$RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} cp -a Tools $RPM_BUILD_ROOT%{_prefix}/lib/python%{libvers} *************** *** 238,247 **** rm -f tools.files ! find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f | ! sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files ###### # Docs mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python ( --- 247,258 ---- rm -f tools.files ! find "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/idlelib \ ! "$RPM_BUILD_ROOT""%{__prefix}"/lib/python%{libvers}/Tools -type f | ! sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files ###### # Docs + %if %{include_docs} mkdir -p "$RPM_BUILD_ROOT"/var/www/html/python ( *************** *** 249,252 **** --- 260,264 ---- bunzip2 < %{SOURCE1} | tar x ) + %endif ######## *************** *** 254,258 **** ######## %clean ! rm -fr $RPM_BUILD_ROOT rm -f mainpkg.files tools.files --- 266,270 ---- ######## %clean ! [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT rm -f mainpkg.files tools.files *************** *** 275,279 **** %{__prefix}/lib/python%{libvers}/distutils %{__prefix}/lib/python%{libvers}/encodings - %dir %{__prefix}/lib/python%{libvers}/lib-old %{__prefix}/lib/python%{libvers}/plat-linux2 %{__prefix}/lib/python%{libvers}/site-packages --- 287,290 ---- *************** *** 302,306 **** --- 313,319 ---- %endif + %if %{include_docs} %files docs %defattr(-,root,root) /var/www/html/python/* + %endif From bcannon at users.sourceforge.net Sun Oct 19 17:19:42 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 19 17:19:45 2003 Subject: [Python-checkins] python/dist/src/Include object.h, 2.121, 2.122 boolobject.h, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv22186/Include Modified Files: object.h boolobject.h Log Message: Defined macros Py_RETURN_(TRUE|FALSE|NONE) as helper functions for returning the specified value. All three Py_INCREF the singleton and then return it. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.121 retrieving revision 2.122 diff -C2 -d -r2.121 -r2.122 *** object.h 23 May 2003 12:47:36 -0000 2.121 --- object.h 19 Oct 2003 21:19:40 -0000 2.122 *************** *** 634,637 **** --- 634,640 ---- #define Py_None (&_Py_NoneStruct) + /* Macro for returning Py_None from a function */ + #define Py_RETURN_NONE Py_INCREF(Py_None); return Py_None; + /* Py_NotImplemented is a singleton used to signal that an operation is Index: boolobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/boolobject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** boolobject.h 12 Aug 2002 07:21:56 -0000 1.4 --- boolobject.h 19 Oct 2003 21:19:40 -0000 1.5 *************** *** 24,27 **** --- 24,31 ---- #define Py_True ((PyObject *) &_Py_TrueStruct) + /* Macros for returning Py_True or Py_False, respectively */ + #define Py_RETURN_TRUE Py_INCREF(Py_True); return Py_True; + #define Py_RETURN_FALSE Py_INCREF(Py_False); return Py_False; + /* Function to return a bool from a C long */ PyAPI_FUNC(PyObject *) PyBool_FromLong(long); From bcannon at users.sourceforge.net Sun Oct 19 17:31:45 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 19 17:31:48 2003 Subject: [Python-checkins] python/dist/src/Include boolobject.h, 1.5, 1.6 object.h, 2.122, 2.123 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv23831/Include Modified Files: boolobject.h object.h Log Message: Modified the Py_RETURN_* macros by having the statements surrounded by {} in order to prevent any unexpected surprises from someone using them in a conditional without using curly braces (e.g., ``if (foo) Py_RETURN_TRUE``. Index: boolobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/boolobject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** boolobject.h 19 Oct 2003 21:19:40 -0000 1.5 --- boolobject.h 19 Oct 2003 21:31:43 -0000 1.6 *************** *** 25,30 **** /* Macros for returning Py_True or Py_False, respectively */ ! #define Py_RETURN_TRUE Py_INCREF(Py_True); return Py_True; ! #define Py_RETURN_FALSE Py_INCREF(Py_False); return Py_False; /* Function to return a bool from a C long */ --- 25,30 ---- /* Macros for returning Py_True or Py_False, respectively */ ! #define Py_RETURN_TRUE {Py_INCREF(Py_True); return Py_True;} ! #define Py_RETURN_FALSE {Py_INCREF(Py_False); return Py_False;} /* Function to return a bool from a C long */ Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.122 retrieving revision 2.123 diff -C2 -d -r2.122 -r2.123 *** object.h 19 Oct 2003 21:19:40 -0000 2.122 --- object.h 19 Oct 2003 21:31:43 -0000 2.123 *************** *** 635,639 **** /* Macro for returning Py_None from a function */ ! #define Py_RETURN_NONE Py_INCREF(Py_None); return Py_None; /* --- 635,639 ---- /* Macro for returning Py_None from a function */ ! #define Py_RETURN_NONE {Py_INCREF(Py_None); return Py_None;} /* From bcannon at users.sourceforge.net Sun Oct 19 17:31:46 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 19 17:31:51 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.872,1.873 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv23831/Misc Modified Files: NEWS Log Message: Modified the Py_RETURN_* macros by having the statements surrounded by {} in order to prevent any unexpected surprises from someone using them in a conditional without using curly braces (e.g., ``if (foo) Py_RETURN_TRUE``. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.872 retrieving revision 1.873 diff -C2 -d -r1.872 -r1.873 *** NEWS 19 Oct 2003 18:30:01 -0000 1.872 --- NEWS 19 Oct 2003 21:31:43 -0000 1.873 *************** *** 156,159 **** --- 156,162 ---- ----- + - Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE. + Each return the singleton they mention after Py_INCREF()ing them. + - Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a variable length argument list of Python objects without having to invoke From bcannon at users.sourceforge.net Sun Oct 19 18:58:13 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Sun Oct 19 18:58:17 2003 Subject: [Python-checkins] python/dist/src/Include boolobject.h, 1.6, 1.7 object.h, 2.123, 2.124 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv5296/Include Modified Files: boolobject.h object.h Log Message: Modify the Py_RETURN_* macros to be of the form ``do {...} while (0)`` in order to handle situations like ``if (foo) Py_RETURN_NONE else ...``. Index: boolobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/boolobject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** boolobject.h 19 Oct 2003 21:31:43 -0000 1.6 --- boolobject.h 19 Oct 2003 22:58:10 -0000 1.7 *************** *** 25,30 **** /* Macros for returning Py_True or Py_False, respectively */ ! #define Py_RETURN_TRUE {Py_INCREF(Py_True); return Py_True;} ! #define Py_RETURN_FALSE {Py_INCREF(Py_False); return Py_False;} /* Function to return a bool from a C long */ --- 25,30 ---- /* Macros for returning Py_True or Py_False, respectively */ ! #define Py_RETURN_TRUE do {Py_INCREF(Py_True); return Py_True;} while (0) ! #define Py_RETURN_FALSE do {Py_INCREF(Py_False); return Py_False;} while (0) /* Function to return a bool from a C long */ Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.123 retrieving revision 2.124 diff -C2 -d -r2.123 -r2.124 *** object.h 19 Oct 2003 21:31:43 -0000 2.123 --- object.h 19 Oct 2003 22:58:11 -0000 2.124 *************** *** 635,639 **** /* Macro for returning Py_None from a function */ ! #define Py_RETURN_NONE {Py_INCREF(Py_None); return Py_None;} /* --- 635,639 ---- /* Macro for returning Py_None from a function */ ! #define Py_RETURN_NONE do {Py_INCREF(Py_None); return Py_None;} while (0) /* From doerwalter at users.sourceforge.net Mon Oct 20 10:01:57 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:01 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.249,2.250 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Objects Modified Files: typeobject.c Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.249 retrieving revision 2.250 diff -C2 -d -r2.249 -r2.250 *** typeobject.c 12 Oct 2003 19:09:37 -0000 2.249 --- typeobject.c 20 Oct 2003 14:01:54 -0000 2.250 *************** *** 5412,5416 **** "the instance invoking super(); may be None"}, {"__self_class__", T_OBJECT, offsetof(superobject, obj_type), READONLY, ! "the type of the the instance invoking super(); may be None"}, {0} }; --- 5412,5416 ---- "the instance invoking super(); may be None"}, {"__self_class__", T_OBJECT, offsetof(superobject, obj_type), READONLY, ! "the type of the instance invoking super(); may be None"}, {0} }; From doerwalter at users.sourceforge.net Mon Oct 20 10:01:57 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:05 2003 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv2359/PC Modified Files: pyconfig.h Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pyconfig.h 31 Jul 2003 02:06:22 -0000 1.20 --- pyconfig.h 20 Oct 2003 14:01:55 -0000 1.21 *************** *** 5,9 **** This is a manually maintained version used for the Watcom, ! Borland and and Microsoft Visual C++ compilers. It is a standard part of the Python distribution. --- 5,9 ---- This is a manually maintained version used for the Watcom, ! Borland and Microsoft Visual C++ compilers. It is a standard part of the Python distribution. From doerwalter at users.sourceforge.net Mon Oct 20 10:01:56 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:08 2003 Subject: [Python-checkins] python/dist/src/Modules _ssl.c, 1.13, 1.14 datetimemodule.c, 1.68, 1.69 main.c, 1.78, 1.79 md5c.c, 2.7, 2.8 posixmodule.c, 2.305, 2.306 pypcre.c, 2.25, 2.26 socketmodule.c, 1.276, 1.277 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Modules Modified Files: _ssl.c datetimemodule.c main.c md5c.c posixmodule.c pypcre.c socketmodule.c Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: _ssl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** _ssl.c 30 Jun 2003 03:25:19 -0000 1.13 --- _ssl.c 20 Oct 2003 14:01:52 -0000 1.14 *************** *** 225,229 **** SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */ ! /* If the socket is is non-blocking mode or timeout mode, set the BIO * to non-blocking mode (blocking is the default) */ --- 225,229 ---- SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */ ! /* If the socket is in non-blocking mode or timeout mode, set the BIO * to non-blocking mode (blocking is the default) */ Index: datetimemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** datetimemodule.c 12 Oct 2003 19:09:36 -0000 1.68 --- datetimemodule.c 20 Oct 2003 14:01:53 -0000 1.69 *************** *** 900,904 **** * returns None, call_dst returns 0 and sets *none to 1. If dst() & doesn't return None or timedelta, TypeError is raised and this ! * returns -1. If dst() returns an invalid timedelta for for a UTC offset, * ValueError is raised and this returns -1. Else *none is set to 0 and * the offset is returned (as an int # of minutes east of UTC). --- 900,904 ---- * returns None, call_dst returns 0 and sets *none to 1. If dst() & doesn't return None or timedelta, TypeError is raised and this ! * returns -1. If dst() returns an invalid timedelta for a UTC offset, * ValueError is raised and this returns -1. Else *none is set to 0 and * the offset is returned (as an int # of minutes east of UTC). *************** *** 4819,4823 **** Because we know z.d said z was in daylight time (else [5] would have held and we would have stopped then), and we know z.d != z'.d (else [8] would have held ! and we we have stopped then), and there are only 2 possible values dst() can return in Eastern, it follows that z'.d must be 0 (which it is in the example, but the reasoning doesn't depend on the example -- it depends on there being --- 4819,4823 ---- Because we know z.d said z was in daylight time (else [5] would have held and we would have stopped then), and we know z.d != z'.d (else [8] would have held ! and we would have stopped then), and there are only 2 possible values dst() can return in Eastern, it follows that z'.d must be 0 (which it is in the example, but the reasoning doesn't depend on the example -- it depends on there being Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** main.c 29 Jun 2003 17:07:06 -0000 1.78 --- main.c 20 Oct 2003 14:01:53 -0000 1.79 *************** *** 155,159 **** /* -c is the last option; following arguments that look like options are left for the ! the command to interpret. */ command = malloc(strlen(_PyOS_optarg) + 2); if (command == NULL) --- 155,159 ---- /* -c is the last option; following arguments that look like options are left for the ! command to interpret. */ command = malloc(strlen(_PyOS_optarg) + 2); if (command == NULL) Index: md5c.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5c.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** md5c.c 24 Sep 2001 17:14:40 -0000 2.7 --- md5c.c 20 Oct 2003 14:01:53 -0000 2.8 *************** *** 142,146 **** /* MD5 finalization. Ends an MD5 message-digest operation, writing the ! the message digest and zeroing the context. */ void --- 142,146 ---- /* MD5 finalization. Ends an MD5 message-digest operation, writing the ! message digest and zeroing the context. */ void Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.305 retrieving revision 2.306 diff -C2 -d -r2.305 -r2.306 *** posixmodule.c 12 Oct 2003 19:09:36 -0000 2.305 --- posixmodule.c 20 Oct 2003 14:01:53 -0000 2.306 *************** *** 3954,3958 **** /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits ! * the these handles; resulting in non-closeable handles to the pipes * being created. */ fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, --- 3954,3958 ---- /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits ! * these handles; resulting in non-closeable handles to the pipes * being created. */ fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, Index: pypcre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pypcre.c,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -d -r2.25 -r2.26 *** pypcre.c 26 Jun 2002 20:41:30 -0000 2.25 --- pypcre.c 20 Oct 2003 14:01:54 -0000 2.26 *************** *** 574,578 **** /* #define DEBUG */ ! /* Use a macro for debugging printing, 'cause that eliminates the the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented pre-processor statements. I suppose it's only been 10 years... */ --- 574,578 ---- /* #define DEBUG */ ! /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented pre-processor statements. I suppose it's only been 10 years... */ Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.276 retrieving revision 1.277 diff -C2 -d -r1.276 -r1.277 *** socketmodule.c 12 Oct 2003 19:09:37 -0000 1.276 --- socketmodule.c 20 Oct 2003 14:01:54 -0000 1.277 *************** *** 106,110 **** [*] not available on all platforms!"); ! /* XXX This is a terrible mess of of platform-dependent preprocessor hacks. I hope some day someone can clean this up please... */ --- 106,110 ---- [*] not available on all platforms!"); ! /* XXX This is a terrible mess of platform-dependent preprocessor hacks. I hope some day someone can clean this up please... */ From doerwalter at users.sourceforge.net Mon Oct 20 10:01:58 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:11 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts fixdiv.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Tools/scripts Modified Files: fixdiv.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: fixdiv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/fixdiv.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** fixdiv.py 13 May 2003 18:14:24 -0000 1.8 --- fixdiv.py 20 Oct 2003 14:01:56 -0000 1.9 *************** *** 57,61 **** A / operator was found for which no warnings were seen. This could ! be code that was never executed, or code that was only executed with with user-defined objects as arguments. You will have to investigate further. Note that // can be overloaded separately from --- 57,61 ---- A / operator was found for which no warnings were seen. This could ! be code that was never executed, or code that was only executed with user-defined objects as arguments. You will have to investigate further. Note that // can be overloaded separately from From doerwalter at users.sourceforge.net Mon Oct 20 10:01:58 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:14 2003 Subject: [Python-checkins] python/dist/src/Tools/freeze README,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/freeze In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Tools/freeze Modified Files: README Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/freeze/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** README 3 Jan 2001 23:50:59 -0000 1.9 --- README 20 Oct 2003 14:01:56 -0000 1.10 *************** *** 136,140 **** before Python can be started. Under Windows, the environment variable PATH is consulted, and under Unix, it may be the ! the environment variable LD_LIBRARY_PATH and/or the system shared library cache (ld.so). An additional preferred directory for finding the dynamic libraries is built into the .dll or .so files at --- 136,140 ---- before Python can be started. Under Windows, the environment variable PATH is consulted, and under Unix, it may be the ! environment variable LD_LIBRARY_PATH and/or the system shared library cache (ld.so). An additional preferred directory for finding the dynamic libraries is built into the .dll or .so files at From doerwalter at users.sourceforge.net Mon Oct 20 10:01:58 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:16 2003 Subject: [Python-checkins] python/dist/src/Tools/bgen/bgen bgenOutput.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Tools/bgen/bgen Modified Files: bgenOutput.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: bgenOutput.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenOutput.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bgenOutput.py 19 Jan 2003 21:53:57 -0000 1.5 --- bgenOutput.py 20 Oct 2003 14:01:55 -0000 1.6 *************** *** 59,63 **** def VaOutput(format, args): ! """Call this with a format string and and argument tuple for the format. A newline is always added. Each line in the output is indented --- 59,63 ---- def VaOutput(format, args): ! """Call this with a format string and argument tuple for the format. A newline is always added. Each line in the output is indented From doerwalter at users.sourceforge.net Mon Oct 20 10:01:57 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:19 2003 Subject: [Python-checkins] python/dist/src/Python import.c,2.223,2.224 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Python Modified Files: import.c Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.223 retrieving revision 2.224 diff -C2 -d -r2.223 -r2.224 *** import.c 4 Sep 2003 11:59:50 -0000 2.223 --- import.c 20 Oct 2003 14:01:55 -0000 2.224 *************** *** 554,558 **** /* Get the module object corresponding to a module name. First check the modules dictionary if there's one there, ! if not, create a new one and insert in in the modules dictionary. Because the former action is most common, THIS DOES NOT RETURN A 'NEW' REFERENCE! */ --- 554,558 ---- /* Get the module object corresponding to a module name. First check the modules dictionary if there's one there, ! if not, create a new one and insert it in the modules dictionary. Because the former action is most common, THIS DOES NOT RETURN A 'NEW' REFERENCE! */ From doerwalter at users.sourceforge.net Mon Oct 20 10:02:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:26 2003 Subject: [Python-checkins] python/dist/src/Demo/metaclasses index.html, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/metaclasses In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Demo/metaclasses Modified Files: index.html Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: index.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/metaclasses/index.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** index.html 20 Jan 2000 21:37:19 -0000 1.9 --- index.html 20 Oct 2003 14:01:45 -0000 1.10 *************** *** 548,552 ****
  • Implement a different way to store instance variables (e.g. in a ! list kept outside the the instance but indexed by the instance's id())

  • Automatically wrap or trap all or certain methods --- 548,552 ----
  • Implement a different way to store instance variables (e.g. in a ! list kept outside the instance but indexed by the instance's id())

  • Automatically wrap or trap all or certain methods From doerwalter at users.sourceforge.net Mon Oct 20 10:02:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:34 2003 Subject: [Python-checkins] python/dist/src/Doc/ext newtypes.tex,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Doc/ext Modified Files: newtypes.tex Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** newtypes.tex 7 Sep 2003 02:33:37 -0000 1.33 --- newtypes.tex 20 Oct 2003 14:01:46 -0000 1.34 *************** *** 686,690 **** it, it still has a reference from itself. It's reference count doesn't drop to zero. Fortunately, Python's cyclic-garbage collector will ! eventually figure out that that the list is garbage and free it. In the second version of the \class{Noddy} example, we allowed any --- 686,690 ---- it, it still has a reference from itself. It's reference count doesn't drop to zero. Fortunately, Python's cyclic-garbage collector will ! eventually figure out that the list is garbage and free it. In the second version of the \class{Noddy} example, we allowed any From doerwalter at users.sourceforge.net Mon Oct 20 10:02:19 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:37 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libprofile.tex, 1.42, 1.43 libregex.tex, 1.34, 1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Doc/lib Modified Files: libprofile.tex libregex.tex Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: libprofile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libprofile.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** libprofile.tex 25 Aug 2003 04:28:04 -0000 1.42 --- libprofile.tex 20 Oct 2003 14:01:46 -0000 1.43 *************** *** 408,412 **** When more than one key is provided, then additional keys are used as ! secondary criteria when the there is equality in all keys selected before them. For example, \samp{sort_stats('name', 'file')} will sort all the entries according to their function name, and resolve all ties --- 408,412 ---- When more than one key is provided, then additional keys are used as ! secondary criteria when there is equality in all keys selected before them. For example, \samp{sort_stats('name', 'file')} will sort all the entries according to their function name, and resolve all ties Index: libregex.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libregex.tex,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** libregex.tex 22 Sep 2003 15:00:55 -0000 1.34 --- libregex.tex 20 Oct 2003 14:01:47 -0000 1.35 *************** *** 248,252 **** objects are not affected.) The argument is an integer which is the OR of several flag bits. The return value is the previous value of ! the syntax flags. Names for the flags are defined in the standard module \code{regex_syntax}\refstmodindex{regex_syntax}; read the file \file{regex_syntax.py} for more information. --- 248,252 ---- objects are not affected.) The argument is an integer which is the OR of several flag bits. The return value is the previous value of ! the syntax flags. Names for the flags are defined in the standard module \code{regex_syntax}\refstmodindex{regex_syntax}; read the file \file{regex_syntax.py} for more information. From doerwalter at users.sourceforge.net Mon Oct 20 10:02:21 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:39 2003 Subject: [Python-checkins] python/dist/src/Include abstract.h,2.48,2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Include Modified Files: abstract.h Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** abstract.h 12 May 2003 21:41:39 -0000 2.48 --- abstract.h 20 Oct 2003 14:01:48 -0000 2.49 *************** *** 873,877 **** /* ! Returns the result of bitwise or or o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 |= o2. --- 873,877 ---- /* ! Returns the result of bitwise or of o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 |= o2. From doerwalter at users.sourceforge.net Mon Oct 20 10:02:20 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:42 2003 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.103, 1.104 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Doc/texinputs Modified Files: python.sty Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** python.sty 6 Sep 2003 04:19:43 -0000 1.103 --- python.sty 20 Oct 2003 14:01:48 -0000 1.104 *************** *** 1,4 **** % ! % python.sty for the Python docummentation [works only with with Latex2e] % --- 1,4 ---- % ! % python.sty for the Python docummentation [works only with Latex2e] % From doerwalter at users.sourceforge.net Mon Oct 20 10:02:20 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:45 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew20.tex, 1.48, 1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Doc/whatsnew Modified Files: whatsnew20.tex Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: whatsnew20.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew20.tex,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** whatsnew20.tex 2 Jul 2003 12:27:43 -0000 1.48 --- whatsnew20.tex 20 Oct 2003 14:01:48 -0000 1.49 *************** *** 1001,1005 **** data, and so forth. ! The advantage of the event-driven approach is that that the whole document doesn't have to be resident in memory at any one time, which matters if you are processing really huge documents. However, writing --- 1001,1005 ---- data, and so forth. ! The advantage of the event-driven approach is that the whole document doesn't have to be resident in memory at any one time, which matters if you are processing really huge documents. However, writing From doerwalter at users.sourceforge.net Mon Oct 20 10:02:23 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:50 2003 Subject: [Python-checkins] python/dist/src/Lib/distutils cmd.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Lib/distutils Modified Files: cmd.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** cmd.py 20 Feb 2003 02:10:08 -0000 1.34 --- cmd.py 20 Oct 2003 14:01:51 -0000 1.35 *************** *** 149,153 **** This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been ! done. Thus, this is the place to to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in --- 149,153 ---- This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been ! done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in From doerwalter at users.sourceforge.net Mon Oct 20 10:02:23 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:54 2003 Subject: [Python-checkins] python/dist/src/Lib/email Message.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Lib/email Modified Files: Message.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Message.py 3 Sep 2003 04:08:13 -0000 1.34 --- Message.py 20 Oct 2003 14:01:51 -0000 1.35 *************** *** 776,780 **** if not foundp: # The original Content-Type header had no boundary attribute. ! # Tack one one the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) --- 776,780 ---- if not foundp: # The original Content-Type header had no boundary attribute. ! # Tack one on the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) From doerwalter at users.sourceforge.net Mon Oct 20 10:02:24 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:02:56 2003 Subject: [Python-checkins] python/dist/src/Misc HISTORY,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Misc Modified Files: HISTORY Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: HISTORY =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/HISTORY,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** HISTORY 17 Sep 2002 20:55:31 -0000 1.11 --- HISTORY 20 Oct 2003 14:01:52 -0000 1.12 *************** *** 7054,7058 **** - The configure script can finally correctly find the readline library in a ! non-standard location. The LDFLAGS variable is passed on the the Makefiles from the configure script. --- 7054,7058 ---- - The configure script can finally correctly find the readline library in a ! non-standard location. The LDFLAGS variable is passed on the Makefiles from the configure script. *************** *** 9279,9283 **** /usr/include/sys/socket.h as input. ! cddb: interface to the database used the the CD player torgb: convert various image file types to rgb format (requires pbmplus) --- 9279,9283 ---- /usr/include/sys/socket.h as input. ! cddb: interface to the database used by the CD player torgb: convert various image file types to rgb format (requires pbmplus) From doerwalter at users.sourceforge.net Mon Oct 20 10:02:23 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:03:00 2003 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py, 1.59, 1.60 Cookie.py, 1.16, 1.17 asyncore.py, 1.40, 1.41 heapq.py, 1.17, 1.18 ihooks.py, 1.16, 1.17 mimetypes.py, 1.28, 1.29 ntpath.py, 1.57, 1.58 os2emxpath.py, 1.10, 1.11 pre.py, 1.14, 1.15 profile.doc, 1.2, 1.3 rlcompleter.py, 1.13, 1.14 site.py, 1.53, 1.54 urllib2.py, 1.54, 1.55 whichdb.py, 1.17, 1.18 xmlrpclib.py, 1.29, 1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Lib Modified Files: ConfigParser.py Cookie.py asyncore.py heapq.py ihooks.py mimetypes.py ntpath.py os2emxpath.py pre.py profile.doc rlcompleter.py site.py urllib2.py whichdb.py xmlrpclib.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ConfigParser.py 1 Sep 2003 23:30:44 -0000 1.59 --- ConfigParser.py 20 Oct 2003 14:01:49 -0000 1.60 *************** *** 20,24 **** class: ! ConfigParser -- responsible for for parsing a list of configuration files, and managing the parsed database. --- 20,24 ---- class: ! ConfigParser -- responsible for parsing a list of configuration files, and managing the parsed database. Index: Cookie.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Cookie.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Cookie.py 29 Dec 2002 16:44:31 -0000 1.16 --- Cookie.py 20 Oct 2003 14:01:49 -0000 1.17 *************** *** 77,81 **** appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed ! attributes by using the the .output() function >>> C = Cookie.SmartCookie() --- 77,81 ---- appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed ! attributes by using the .output() function >>> C = Cookie.SmartCookie() Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** asyncore.py 14 Feb 2003 01:13:01 -0000 1.40 --- asyncore.py 20 Oct 2003 14:01:49 -0000 1.41 *************** *** 498,502 **** # After a little research (reading man pages on various unixen, and # digging through the linux kernel), I've determined that select() ! # isn't meant for doing doing asynchronous file i/o. # Heartening, though - reading linux/mm/filemap.c shows that linux # supports asynchronous read-ahead. So _MOST_ of the time, the data --- 498,502 ---- # After a little research (reading man pages on various unixen, and # digging through the linux kernel), I've determined that select() ! # isn't meant for doing asynchronous file i/o. # Heartening, though - reading linux/mm/filemap.c shows that linux # supports asynchronous read-ahead. So _MOST_ of the time, the data Index: heapq.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** heapq.py 13 Nov 2002 14:38:17 -0000 1.17 --- heapq.py 20 Oct 2003 14:01:49 -0000 1.18 *************** *** 239,243 **** pos = childpos childpos = 2*pos + 1 ! # The leaf at pos is empty now. Put newitem there, and and bubble it up # to its final resting place (by sifting its parents down). heap[pos] = newitem --- 239,243 ---- pos = childpos childpos = 2*pos + 1 ! # The leaf at pos is empty now. Put newitem there, and bubble it up # to its final resting place (by sifting its parents down). heap[pos] = newitem Index: ihooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ihooks.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ihooks.py 27 Feb 2003 20:14:34 -0000 1.16 --- ihooks.py 20 Oct 2003 14:01:49 -0000 1.17 *************** *** 19,23 **** class for other hooks classes. ! 2) A "module loader" class provides an interface to to search for a module in a search path and to load it. It defines a method which searches for a module in a single directory; by overriding this method --- 19,23 ---- class for other hooks classes. ! 2) A "module loader" class provides an interface to search for a module in a search path and to load it. It defines a method which searches for a module in a single directory; by overriding this method Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** mimetypes.py 9 Jun 2003 22:27:40 -0000 1.28 --- mimetypes.py 20 Oct 2003 14:01:50 -0000 1.29 *************** *** 66,70 **** def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and and extension. When the extension is already known, the new --- 66,70 ---- def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and an extension. When the extension is already known, the new *************** *** 270,274 **** def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and and extension. When the extension is already known, the new --- 270,274 ---- def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and an extension. When the extension is already known, the new Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** ntpath.py 28 Mar 2003 22:23:24 -0000 1.57 --- ntpath.py 20 Oct 2003 14:01:50 -0000 1.58 *************** *** 302,306 **** # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # files files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. --- 302,306 ---- # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # of files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. Index: os2emxpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os2emxpath.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** os2emxpath.py 14 Feb 2003 19:35:30 -0000 1.10 --- os2emxpath.py 20 Oct 2003 14:01:50 -0000 1.11 *************** *** 261,265 **** # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # files files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. --- 261,265 ---- # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # of files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. Index: pre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pre.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pre.py 27 Feb 2003 20:14:37 -0000 1.14 --- pre.py 20 Oct 2003 14:01:50 -0000 1.15 *************** *** 608,612 **** corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string ! matching the the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group --- 608,612 ---- corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string ! matching the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group Index: profile.doc =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/profile.doc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** profile.doc 1 Aug 1994 11:28:51 -0000 1.2 --- profile.doc 20 Oct 2003 14:01:50 -0000 1.3 *************** *** 340,344 **** When more than one key is provided, then additional keys are used as ! secondary criteria when the there is equality in all keys selected before them. For example, sort_stats('name', 'file') will sort all the entries according to their function name, and resolve all ties --- 340,344 ---- When more than one key is provided, then additional keys are used as ! secondary criteria when there is equality in all keys selected before them. For example, sort_stats('name', 'file') will sort all the entries according to their function name, and resolve all ties *************** *** 465,469 **** accuracy. The most obvious restriction is that the underlying "clock" is only ticking at a rate (typically) of about .001 seconds. Hence no ! measurements will be more accurate that that underlying clock. If enough measurements are taken, then the "error" will tend to average out. Unfortunately, removing this first error induces a second source --- 465,469 ---- accuracy. The most obvious restriction is that the underlying "clock" is only ticking at a rate (typically) of about .001 seconds. Hence no ! measurements will be more accurate than that underlying clock. If enough measurements are taken, then the "error" will tend to average out. Unfortunately, removing this first error induces a second source Index: rlcompleter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rlcompleter.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** rlcompleter.py 3 Jun 2002 15:58:31 -0000 1.13 --- rlcompleter.py 20 Oct 2003 14:01:50 -0000 1.14 *************** *** 118,122 **** evaluatable in self.namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class ! instances, class members are are also considered.) WARNING: this can still invoke arbitrary C code, if an object --- 118,122 ---- evaluatable in self.namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class ! instances, class members are also considered.) WARNING: this can still invoke arbitrary C code, if an object Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** site.py 18 Jul 2003 17:45:33 -0000 1.53 --- site.py 20 Oct 2003 14:01:50 -0000 1.54 *************** *** 11,15 **** works). ! This will append site-specific paths to to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages as well as lib/site-python. --- 11,15 ---- works). ! This will append site-specific paths to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages as well as lib/site-python. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** urllib2.py 6 Oct 2003 05:15:13 -0000 1.54 --- urllib2.py 20 Oct 2003 14:01:50 -0000 1.55 *************** *** 803,807 **** # XXX Should rewrite do_open() to use the new httplib interface, ! # would would be a little simpler. def do_open(self, http_class, req): --- 803,807 ---- # XXX Should rewrite do_open() to use the new httplib interface, ! # would be a little simpler. def do_open(self, http_class, req): Index: whichdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** whichdb.py 11 Jul 2003 12:16:48 -0000 1.17 --- whichdb.py 20 Oct 2003 14:01:51 -0000 1.18 *************** *** 52,56 **** pass ! # Check for dumbdbm next -- this has a .dir and and a .dat file try: # First check for presence of files --- 52,56 ---- pass ! # Check for dumbdbm next -- this has a .dir and a .dat file try: # First check for presence of files Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** xmlrpclib.py 12 Jul 2003 07:53:04 -0000 1.29 --- xmlrpclib.py 20 Oct 2003 14:01:51 -0000 1.30 *************** *** 995,999 **** # # @param data An XML-RPC packet, given as an 8-bit string. ! # @return A tuple containing the the unpacked data, and the method name # (None if not present). # @see Fault --- 995,999 ---- # # @param data An XML-RPC packet, given as an 8-bit string. ! # @return A tuple containing the unpacked data, and the method name # (None if not present). # @see Fault From doerwalter at users.sourceforge.net Mon Oct 20 10:02:24 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:03:03 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_class.py, 1.10, 1.11 test_errno.py, 1.8, 1.9 test_os.py, 1.18, 1.19 test_stringprep.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Lib/test Modified Files: test_class.py test_errno.py test_os.py test_stringprep.py Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: test_class.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_class.py 29 Oct 2002 19:08:29 -0000 1.10 --- test_class.py 20 Oct 2003 14:01:51 -0000 1.11 *************** *** 203,207 **** hex(testme) else: ! # Jython enforced that the these methods return # a value of the expected type. print "__int__: ()" --- 203,207 ---- hex(testme) else: ! # Jython enforced that these methods return # a value of the expected type. print "__int__: ()" Index: test_errno.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_errno.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_errno.py 23 Jul 2002 19:03:51 -0000 1.8 --- test_errno.py 20 Oct 2003 14:01:51 -0000 1.9 *************** *** 35,39 **** # ! # This is is a wee bit bogus since the module only conditionally adds # errno constants if they have been defined by errno.h However, this # test seems to work on SGI, Sparc & intel Solaris, and linux. --- 35,39 ---- # ! # This is a wee bit bogus since the module only conditionally adds # errno constants if they have been defined by errno.h However, this # test seems to work on SGI, Sparc & intel Solaris, and linux. Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_os.py 1 May 2003 17:45:43 -0000 1.18 --- test_os.py 20 Oct 2003 14:01:51 -0000 1.19 *************** *** 1,5 **** # As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more ! # more portable than they had been thought to be. import os --- 1,5 ---- # As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more ! # portable than they had been thought to be. import os Index: test_stringprep.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_stringprep.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_stringprep.py 24 Apr 2003 16:02:53 -0000 1.2 --- test_stringprep.py 20 Oct 2003 14:01:52 -0000 1.3 *************** *** 72,76 **** # it is quite expensive, and only serves to detect changes in the # unicode database. Instead, stringprep.py asserts the version of ! # of the database. # predicates = [k for k in dir(stringprep) if k.startswith("in_table")] --- 72,76 ---- # it is quite expensive, and only serves to detect changes in the # unicode database. Instead, stringprep.py asserts the version of ! # the database. # predicates = [k for k in dir(stringprep) if k.startswith("in_table")] From doerwalter at users.sourceforge.net Mon Oct 20 10:34:49 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:34:51 2003 Subject: [Python-checkins] python/dist/src/Misc HISTORY,1.11.14.1,1.11.14.2 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Misc Modified Files: Tag: release23-maint HISTORY Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: HISTORY =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/HISTORY,v retrieving revision 1.11.14.1 retrieving revision 1.11.14.2 diff -C2 -d -r1.11.14.1 -r1.11.14.2 *** HISTORY 4 Aug 2003 22:49:46 -0000 1.11.14.1 --- HISTORY 20 Oct 2003 14:34:46 -0000 1.11.14.2 *************** *** 8483,8487 **** - The configure script can finally correctly find the readline library in a ! non-standard location. The LDFLAGS variable is passed on the the Makefiles from the configure script. --- 8483,8487 ---- - The configure script can finally correctly find the readline library in a ! non-standard location. The LDFLAGS variable is passed on the Makefiles from the configure script. *************** *** 10708,10712 **** /usr/include/sys/socket.h as input. ! cddb: interface to the database used the the CD player torgb: convert various image file types to rgb format (requires pbmplus) --- 10708,10712 ---- /usr/include/sys/socket.h as input. ! cddb: interface to the database used by the CD player torgb: convert various image file types to rgb format (requires pbmplus) From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:34:56 2003 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.19,1.19.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv9536/PC Modified Files: Tag: release23-maint pyconfig.h Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.19 retrieving revision 1.19.10.1 diff -C2 -d -r1.19 -r1.19.10.1 *** pyconfig.h 29 Mar 2003 10:04:55 -0000 1.19 --- pyconfig.h 20 Oct 2003 14:34:48 -0000 1.19.10.1 *************** *** 5,9 **** This is a manually maintained version used for the Watcom, ! Borland and and Microsoft Visual C++ compilers. It is a standard part of the Python distribution. --- 5,9 ---- This is a manually maintained version used for the Watcom, ! Borland and Microsoft Visual C++ compilers. It is a standard part of the Python distribution. From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:00 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c, 2.241.6.3, 2.241.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Objects Modified Files: Tag: release23-maint typeobject.c Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241.6.3 retrieving revision 2.241.6.4 diff -C2 -d -r2.241.6.3 -r2.241.6.4 *** typeobject.c 12 Oct 2003 23:41:21 -0000 2.241.6.3 --- typeobject.c 20 Oct 2003 14:34:47 -0000 2.241.6.4 *************** *** 5399,5403 **** "the instance invoking super(); may be None"}, {"__self_class__", T_OBJECT, offsetof(superobject, obj_type), READONLY, ! "the type of the the instance invoking super(); may be None"}, {0} }; --- 5399,5403 ---- "the instance invoking super(); may be None"}, {"__self_class__", T_OBJECT, offsetof(superobject, obj_type), READONLY, ! "the type of the instance invoking super(); may be None"}, {0} }; From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:06 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts fixdiv.py, 1.8, 1.8.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Tools/scripts Modified Files: Tag: release23-maint fixdiv.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: fixdiv.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/fixdiv.py,v retrieving revision 1.8 retrieving revision 1.8.8.1 diff -C2 -d -r1.8 -r1.8.8.1 *** fixdiv.py 13 May 2003 18:14:24 -0000 1.8 --- fixdiv.py 20 Oct 2003 14:34:48 -0000 1.8.8.1 *************** *** 57,61 **** A / operator was found for which no warnings were seen. This could ! be code that was never executed, or code that was only executed with with user-defined objects as arguments. You will have to investigate further. Note that // can be overloaded separately from --- 57,61 ---- A / operator was found for which no warnings were seen. This could ! be code that was never executed, or code that was only executed with user-defined objects as arguments. You will have to investigate further. Note that // can be overloaded separately from From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:09 2003 Subject: [Python-checkins] python/dist/src/Modules _ssl.c, 1.13, 1.13.6.1 datetimemodule.c, 1.67, 1.67.8.1 main.c, 1.78, 1.78.8.1 md5c.c, 2.7, 2.7.28.1 posixmodule.c, 2.300.8.2, 2.300.8.3 pypcre.c, 2.25, 2.25.16.1 socketmodule.c, 1.271.6.4, 1.271.6.5 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Modules Modified Files: Tag: release23-maint _ssl.c datetimemodule.c main.c md5c.c posixmodule.c pypcre.c socketmodule.c Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: _ssl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v retrieving revision 1.13 retrieving revision 1.13.6.1 diff -C2 -d -r1.13 -r1.13.6.1 *** _ssl.c 30 Jun 2003 03:25:19 -0000 1.13 --- _ssl.c 20 Oct 2003 14:34:46 -0000 1.13.6.1 *************** *** 225,229 **** SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */ ! /* If the socket is is non-blocking mode or timeout mode, set the BIO * to non-blocking mode (blocking is the default) */ --- 225,229 ---- SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */ ! /* If the socket is in non-blocking mode or timeout mode, set the BIO * to non-blocking mode (blocking is the default) */ Index: datetimemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v retrieving revision 1.67 retrieving revision 1.67.8.1 diff -C2 -d -r1.67 -r1.67.8.1 *** datetimemodule.c 27 Jun 2003 08:14:17 -0000 1.67 --- datetimemodule.c 20 Oct 2003 14:34:46 -0000 1.67.8.1 *************** *** 900,904 **** * returns None, call_dst returns 0 and sets *none to 1. If dst() & doesn't return None or timedelta, TypeError is raised and this ! * returns -1. If dst() returns an invalid timedelta for for a UTC offset, * ValueError is raised and this returns -1. Else *none is set to 0 and * the offset is returned (as an int # of minutes east of UTC). --- 900,904 ---- * returns None, call_dst returns 0 and sets *none to 1. If dst() & doesn't return None or timedelta, TypeError is raised and this ! * returns -1. If dst() returns an invalid timedelta for a UTC offset, * ValueError is raised and this returns -1. Else *none is set to 0 and * the offset is returned (as an int # of minutes east of UTC). *************** *** 4819,4823 **** Because we know z.d said z was in daylight time (else [5] would have held and we would have stopped then), and we know z.d != z'.d (else [8] would have held ! and we we have stopped then), and there are only 2 possible values dst() can return in Eastern, it follows that z'.d must be 0 (which it is in the example, but the reasoning doesn't depend on the example -- it depends on there being --- 4819,4823 ---- Because we know z.d said z was in daylight time (else [5] would have held and we would have stopped then), and we know z.d != z'.d (else [8] would have held ! and we would have stopped then), and there are only 2 possible values dst() can return in Eastern, it follows that z'.d must be 0 (which it is in the example, but the reasoning doesn't depend on the example -- it depends on there being Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.78 retrieving revision 1.78.8.1 diff -C2 -d -r1.78 -r1.78.8.1 *** main.c 29 Jun 2003 17:07:06 -0000 1.78 --- main.c 20 Oct 2003 14:34:47 -0000 1.78.8.1 *************** *** 155,159 **** /* -c is the last option; following arguments that look like options are left for the ! the command to interpret. */ command = malloc(strlen(_PyOS_optarg) + 2); if (command == NULL) --- 155,159 ---- /* -c is the last option; following arguments that look like options are left for the ! command to interpret. */ command = malloc(strlen(_PyOS_optarg) + 2); if (command == NULL) Index: md5c.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5c.c,v retrieving revision 2.7 retrieving revision 2.7.28.1 diff -C2 -d -r2.7 -r2.7.28.1 *** md5c.c 24 Sep 2001 17:14:40 -0000 2.7 --- md5c.c 20 Oct 2003 14:34:47 -0000 2.7.28.1 *************** *** 142,146 **** /* MD5 finalization. Ends an MD5 message-digest operation, writing the ! the message digest and zeroing the context. */ void --- 142,146 ---- /* MD5 finalization. Ends an MD5 message-digest operation, writing the ! message digest and zeroing the context. */ void Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.300.8.2 retrieving revision 2.300.8.3 diff -C2 -d -r2.300.8.2 -r2.300.8.3 *** posixmodule.c 1 Sep 2003 22:32:39 -0000 2.300.8.2 --- posixmodule.c 20 Oct 2003 14:34:47 -0000 2.300.8.3 *************** *** 3936,3940 **** /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits ! * the these handles; resulting in non-closeable handles to the pipes * being created. */ fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, --- 3936,3940 ---- /* Create new output read handle and the input write handle. Set * the inheritance properties to FALSE. Otherwise, the child inherits ! * these handles; resulting in non-closeable handles to the pipes * being created. */ fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, Index: pypcre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pypcre.c,v retrieving revision 2.25 retrieving revision 2.25.16.1 diff -C2 -d -r2.25 -r2.25.16.1 *** pypcre.c 26 Jun 2002 20:41:30 -0000 2.25 --- pypcre.c 20 Oct 2003 14:34:47 -0000 2.25.16.1 *************** *** 574,578 **** /* #define DEBUG */ ! /* Use a macro for debugging printing, 'cause that eliminates the the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented pre-processor statements. I suppose it's only been 10 years... */ --- 574,578 ---- /* #define DEBUG */ ! /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented pre-processor statements. I suppose it's only been 10 years... */ Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.4 retrieving revision 1.271.6.5 diff -C2 -d -r1.271.6.4 -r1.271.6.5 *** socketmodule.c 4 Oct 2003 06:55:33 -0000 1.271.6.4 --- socketmodule.c 20 Oct 2003 14:34:47 -0000 1.271.6.5 *************** *** 106,110 **** [*] not available on all platforms!"); ! /* XXX This is a terrible mess of of platform-dependent preprocessor hacks. I hope some day someone can clean this up please... */ --- 106,110 ---- [*] not available on all platforms!"); ! /* XXX This is a terrible mess of platform-dependent preprocessor hacks. I hope some day someone can clean this up please... */ From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:13 2003 Subject: [Python-checkins] python/dist/src/Python import.c,2.222,2.222.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Python Modified Files: Tag: release23-maint import.c Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.222 retrieving revision 2.222.6.1 diff -C2 -d -r2.222 -r2.222.6.1 *** import.c 11 Jul 2003 15:01:02 -0000 2.222 --- import.c 20 Oct 2003 14:34:48 -0000 2.222.6.1 *************** *** 554,558 **** /* Get the module object corresponding to a module name. First check the modules dictionary if there's one there, ! if not, create a new one and insert in in the modules dictionary. Because the former action is most common, THIS DOES NOT RETURN A 'NEW' REFERENCE! */ --- 554,558 ---- /* Get the module object corresponding to a module name. First check the modules dictionary if there's one there, ! if not, create a new one and insert it in the modules dictionary. Because the former action is most common, THIS DOES NOT RETURN A 'NEW' REFERENCE! */ From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:17 2003 Subject: [Python-checkins] python/dist/src/Tools/freeze README,1.9,1.9.38.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/freeze In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Tools/freeze Modified Files: Tag: release23-maint README Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/freeze/README,v retrieving revision 1.9 retrieving revision 1.9.38.1 diff -C2 -d -r1.9 -r1.9.38.1 *** README 3 Jan 2001 23:50:59 -0000 1.9 --- README 20 Oct 2003 14:34:48 -0000 1.9.38.1 *************** *** 136,140 **** before Python can be started. Under Windows, the environment variable PATH is consulted, and under Unix, it may be the ! the environment variable LD_LIBRARY_PATH and/or the system shared library cache (ld.so). An additional preferred directory for finding the dynamic libraries is built into the .dll or .so files at --- 136,140 ---- before Python can be started. Under Windows, the environment variable PATH is consulted, and under Unix, it may be the ! environment variable LD_LIBRARY_PATH and/or the system shared library cache (ld.so). An additional preferred directory for finding the dynamic libraries is built into the .dll or .so files at From doerwalter at users.sourceforge.net Mon Oct 20 10:34:50 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:35:24 2003 Subject: [Python-checkins] python/dist/src/Tools/bgen/bgen bgenOutput.py, 1.5, 1.5.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Tools/bgen/bgen Modified Files: Tag: release23-maint bgenOutput.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: bgenOutput.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenOutput.py,v retrieving revision 1.5 retrieving revision 1.5.14.1 diff -C2 -d -r1.5 -r1.5.14.1 *** bgenOutput.py 19 Jan 2003 21:53:57 -0000 1.5 --- bgenOutput.py 20 Oct 2003 14:34:48 -0000 1.5.14.1 *************** *** 59,63 **** def VaOutput(format, args): ! """Call this with a format string and and argument tuple for the format. A newline is always added. Each line in the output is indented --- 59,63 ---- def VaOutput(format, args): ! """Call this with a format string and argument tuple for the format. A newline is always added. Each line in the output is indented From doerwalter at users.sourceforge.net Mon Oct 20 10:35:16 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:36:56 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libprofile.tex, 1.41.8.1, 1.41.8.2 libregex.tex, 1.33.42.1, 1.33.42.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Doc/lib Modified Files: Tag: release23-maint libprofile.tex libregex.tex Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: libprofile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libprofile.tex,v retrieving revision 1.41.8.1 retrieving revision 1.41.8.2 diff -C2 -d -r1.41.8.1 -r1.41.8.2 *** libprofile.tex 25 Aug 2003 04:34:46 -0000 1.41.8.1 --- libprofile.tex 20 Oct 2003 14:34:44 -0000 1.41.8.2 *************** *** 408,412 **** When more than one key is provided, then additional keys are used as ! secondary criteria when the there is equality in all keys selected before them. For example, \samp{sort_stats('name', 'file')} will sort all the entries according to their function name, and resolve all ties --- 408,412 ---- When more than one key is provided, then additional keys are used as ! secondary criteria when there is equality in all keys selected before them. For example, \samp{sort_stats('name', 'file')} will sort all the entries according to their function name, and resolve all ties Index: libregex.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libregex.tex,v retrieving revision 1.33.42.1 retrieving revision 1.33.42.2 diff -C2 -d -r1.33.42.1 -r1.33.42.2 *** libregex.tex 22 Sep 2003 15:50:51 -0000 1.33.42.1 --- libregex.tex 20 Oct 2003 14:34:44 -0000 1.33.42.2 *************** *** 248,252 **** objects are not affected.) The argument is an integer which is the OR of several flag bits. The return value is the previous value of ! the syntax flags. Names for the flags are defined in the standard module \code{regex_syntax}\refstmodindex{regex_syntax}; read the file \file{regex_syntax.py} for more information. --- 248,252 ---- objects are not affected.) The argument is an integer which is the OR of several flag bits. The return value is the previous value of ! the syntax flags. Names for the flags are defined in the standard module \code{regex_syntax}\refstmodindex{regex_syntax}; read the file \file{regex_syntax.py} for more information. From doerwalter at users.sourceforge.net Mon Oct 20 10:35:16 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:36:59 2003 Subject: [Python-checkins] python/dist/src/Demo/metaclasses index.html, 1.9, 1.9.42.1 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/metaclasses In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Demo/metaclasses Modified Files: Tag: release23-maint index.html Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: index.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/metaclasses/index.html,v retrieving revision 1.9 retrieving revision 1.9.42.1 diff -C2 -d -r1.9 -r1.9.42.1 *** index.html 20 Jan 2000 21:37:19 -0000 1.9 --- index.html 20 Oct 2003 14:34:44 -0000 1.9.42.1 *************** *** 548,552 ****
  • Implement a different way to store instance variables (e.g. in a ! list kept outside the the instance but indexed by the instance's id())

  • Automatically wrap or trap all or certain methods --- 548,552 ----
  • Implement a different way to store instance variables (e.g. in a ! list kept outside the instance but indexed by the instance's id())

  • Automatically wrap or trap all or certain methods From doerwalter at users.sourceforge.net Mon Oct 20 10:35:16 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:03 2003 Subject: [Python-checkins] python/dist/src/Doc/ext newtypes.tex, 1.31.8.2, 1.31.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Doc/ext Modified Files: Tag: release23-maint newtypes.tex Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.31.8.2 retrieving revision 1.31.8.3 diff -C2 -d -r1.31.8.2 -r1.31.8.3 *** newtypes.tex 7 Sep 2003 02:34:58 -0000 1.31.8.2 --- newtypes.tex 20 Oct 2003 14:34:44 -0000 1.31.8.3 *************** *** 686,690 **** it, it still has a reference from itself. It's reference count doesn't drop to zero. Fortunately, Python's cyclic-garbage collector will ! eventually figure out that that the list is garbage and free it. In the second version of the \class{Noddy} example, we allowed any --- 686,690 ---- it, it still has a reference from itself. It's reference count doesn't drop to zero. Fortunately, Python's cyclic-garbage collector will ! eventually figure out that the list is garbage and free it. In the second version of the \class{Noddy} example, we allowed any From doerwalter at users.sourceforge.net Mon Oct 20 10:35:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:05 2003 Subject: [Python-checkins] python/dist/src/Lib/email Message.py, 1.32.10.2, 1.32.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Lib/email Modified Files: Tag: release23-maint Message.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.32.10.2 retrieving revision 1.32.10.3 diff -C2 -d -r1.32.10.2 -r1.32.10.3 *** Message.py 3 Sep 2003 04:21:29 -0000 1.32.10.2 --- Message.py 20 Oct 2003 14:34:46 -0000 1.32.10.3 *************** *** 776,780 **** if not foundp: # The original Content-Type header had no boundary attribute. ! # Tack one one the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) --- 776,780 ---- if not foundp: # The original Content-Type header had no boundary attribute. ! # Tack one on the end. BAW: should we raise an exception # instead??? newparams.append(('boundary', '"%s"' % boundary)) From doerwalter at users.sourceforge.net Mon Oct 20 10:35:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:07 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_class.py, 1.10, 1.10.16.1 test_errno.py, 1.8, 1.8.16.1 test_os.py, 1.18, 1.18.8.1 test_stringprep.py, 1.2, 1.2.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Lib/test Modified Files: Tag: release23-maint test_class.py test_errno.py test_os.py test_stringprep.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: test_class.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_class.py,v retrieving revision 1.10 retrieving revision 1.10.16.1 diff -C2 -d -r1.10 -r1.10.16.1 *** test_class.py 29 Oct 2002 19:08:29 -0000 1.10 --- test_class.py 20 Oct 2003 14:34:46 -0000 1.10.16.1 *************** *** 203,207 **** hex(testme) else: ! # Jython enforced that the these methods return # a value of the expected type. print "__int__: ()" --- 203,207 ---- hex(testme) else: ! # Jython enforced that these methods return # a value of the expected type. print "__int__: ()" Index: test_errno.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_errno.py,v retrieving revision 1.8 retrieving revision 1.8.16.1 diff -C2 -d -r1.8 -r1.8.16.1 *** test_errno.py 23 Jul 2002 19:03:51 -0000 1.8 --- test_errno.py 20 Oct 2003 14:34:46 -0000 1.8.16.1 *************** *** 35,39 **** # ! # This is is a wee bit bogus since the module only conditionally adds # errno constants if they have been defined by errno.h However, this # test seems to work on SGI, Sparc & intel Solaris, and linux. --- 35,39 ---- # ! # This is a wee bit bogus since the module only conditionally adds # errno constants if they have been defined by errno.h However, this # test seems to work on SGI, Sparc & intel Solaris, and linux. Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.18 retrieving revision 1.18.8.1 diff -C2 -d -r1.18 -r1.18.8.1 *** test_os.py 1 May 2003 17:45:43 -0000 1.18 --- test_os.py 20 Oct 2003 14:34:46 -0000 1.18.8.1 *************** *** 1,5 **** # As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more ! # more portable than they had been thought to be. import os --- 1,5 ---- # As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more ! # portable than they had been thought to be. import os Index: test_stringprep.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_stringprep.py,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** test_stringprep.py 24 Apr 2003 16:02:53 -0000 1.2 --- test_stringprep.py 20 Oct 2003 14:34:46 -0000 1.2.12.1 *************** *** 72,76 **** # it is quite expensive, and only serves to detect changes in the # unicode database. Instead, stringprep.py asserts the version of ! # of the database. # predicates = [k for k in dir(stringprep) if k.startswith("in_table")] --- 72,76 ---- # it is quite expensive, and only serves to detect changes in the # unicode database. Instead, stringprep.py asserts the version of ! # the database. # predicates = [k for k in dir(stringprep) if k.startswith("in_table")] From doerwalter at users.sourceforge.net Mon Oct 20 10:35:17 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:11 2003 Subject: [Python-checkins] python/dist/src/Include abstract.h,2.48,2.48.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Include Modified Files: Tag: release23-maint abstract.h Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.48 retrieving revision 2.48.8.1 diff -C2 -d -r2.48 -r2.48.8.1 *** abstract.h 12 May 2003 21:41:39 -0000 2.48 --- abstract.h 20 Oct 2003 14:34:45 -0000 2.48.8.1 *************** *** 873,877 **** /* ! Returns the result of bitwise or or o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 |= o2. --- 873,877 ---- /* ! Returns the result of bitwise or of o1 and o2, possibly in-place, or null on failure. This is the equivalent of the Python expression: o1 |= o2. From doerwalter at users.sourceforge.net Mon Oct 20 10:35:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:15 2003 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py, 1.58.8.1, 1.58.8.2 Cookie.py, 1.16, 1.16.14.1 asyncore.py, 1.40, 1.40.12.1 heapq.py, 1.17, 1.17.16.1 ihooks.py, 1.16, 1.16.10.1 mimetypes.py, 1.28, 1.28.8.1 ntpath.py, 1.57, 1.57.10.1 os2emxpath.py, 1.10, 1.10.12.1 pre.py, 1.14, 1.14.10.1 profile.doc, 1.2, 1.2.46.1 rlcompleter.py, 1.13, 1.13.16.1 site.py, 1.53, 1.53.6.1 urllib2.py, 1.53, 1.53.6.1 whichdb.py, 1.17, 1.17.6.1 xmlrpclib.py, 1.29, 1.29.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Lib Modified Files: Tag: release23-maint ConfigParser.py Cookie.py asyncore.py heapq.py ihooks.py mimetypes.py ntpath.py os2emxpath.py pre.py profile.doc rlcompleter.py site.py urllib2.py whichdb.py xmlrpclib.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.58.8.1 retrieving revision 1.58.8.2 diff -C2 -d -r1.58.8.1 -r1.58.8.2 *** ConfigParser.py 1 Sep 2003 23:31:39 -0000 1.58.8.1 --- ConfigParser.py 20 Oct 2003 14:34:45 -0000 1.58.8.2 *************** *** 20,24 **** class: ! ConfigParser -- responsible for for parsing a list of configuration files, and managing the parsed database. --- 20,24 ---- class: ! ConfigParser -- responsible for parsing a list of configuration files, and managing the parsed database. Index: Cookie.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Cookie.py,v retrieving revision 1.16 retrieving revision 1.16.14.1 diff -C2 -d -r1.16 -r1.16.14.1 *** Cookie.py 29 Dec 2002 16:44:31 -0000 1.16 --- Cookie.py 20 Oct 2003 14:34:45 -0000 1.16.14.1 *************** *** 77,81 **** appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed ! attributes by using the the .output() function >>> C = Cookie.SmartCookie() --- 77,81 ---- appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed ! attributes by using the .output() function >>> C = Cookie.SmartCookie() Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.40 retrieving revision 1.40.12.1 diff -C2 -d -r1.40 -r1.40.12.1 *** asyncore.py 14 Feb 2003 01:13:01 -0000 1.40 --- asyncore.py 20 Oct 2003 14:34:45 -0000 1.40.12.1 *************** *** 498,502 **** # After a little research (reading man pages on various unixen, and # digging through the linux kernel), I've determined that select() ! # isn't meant for doing doing asynchronous file i/o. # Heartening, though - reading linux/mm/filemap.c shows that linux # supports asynchronous read-ahead. So _MOST_ of the time, the data --- 498,502 ---- # After a little research (reading man pages on various unixen, and # digging through the linux kernel), I've determined that select() ! # isn't meant for doing asynchronous file i/o. # Heartening, though - reading linux/mm/filemap.c shows that linux # supports asynchronous read-ahead. So _MOST_ of the time, the data Index: heapq.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v retrieving revision 1.17 retrieving revision 1.17.16.1 diff -C2 -d -r1.17 -r1.17.16.1 *** heapq.py 13 Nov 2002 14:38:17 -0000 1.17 --- heapq.py 20 Oct 2003 14:34:45 -0000 1.17.16.1 *************** *** 239,243 **** pos = childpos childpos = 2*pos + 1 ! # The leaf at pos is empty now. Put newitem there, and and bubble it up # to its final resting place (by sifting its parents down). heap[pos] = newitem --- 239,243 ---- pos = childpos childpos = 2*pos + 1 ! # The leaf at pos is empty now. Put newitem there, and bubble it up # to its final resting place (by sifting its parents down). heap[pos] = newitem Index: ihooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ihooks.py,v retrieving revision 1.16 retrieving revision 1.16.10.1 diff -C2 -d -r1.16 -r1.16.10.1 *** ihooks.py 27 Feb 2003 20:14:34 -0000 1.16 --- ihooks.py 20 Oct 2003 14:34:45 -0000 1.16.10.1 *************** *** 19,23 **** class for other hooks classes. ! 2) A "module loader" class provides an interface to to search for a module in a search path and to load it. It defines a method which searches for a module in a single directory; by overriding this method --- 19,23 ---- class for other hooks classes. ! 2) A "module loader" class provides an interface to search for a module in a search path and to load it. It defines a method which searches for a module in a single directory; by overriding this method Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.28 retrieving revision 1.28.8.1 diff -C2 -d -r1.28 -r1.28.8.1 *** mimetypes.py 9 Jun 2003 22:27:40 -0000 1.28 --- mimetypes.py 20 Oct 2003 14:34:45 -0000 1.28.8.1 *************** *** 66,70 **** def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and and extension. When the extension is already known, the new --- 66,70 ---- def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and an extension. When the extension is already known, the new *************** *** 270,274 **** def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and and extension. When the extension is already known, the new --- 270,274 ---- def add_type(self, type, ext, strict=True): ! """Add a mapping between a type and an extension. When the extension is already known, the new Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.57 retrieving revision 1.57.10.1 diff -C2 -d -r1.57 -r1.57.10.1 *** ntpath.py 28 Mar 2003 22:23:24 -0000 1.57 --- ntpath.py 20 Oct 2003 14:34:45 -0000 1.57.10.1 *************** *** 302,306 **** # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # files files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. --- 302,306 ---- # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # of files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. Index: os2emxpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os2emxpath.py,v retrieving revision 1.10 retrieving revision 1.10.12.1 diff -C2 -d -r1.10 -r1.10.12.1 *** os2emxpath.py 14 Feb 2003 19:35:30 -0000 1.10 --- os2emxpath.py 20 Oct 2003 14:34:45 -0000 1.10.12.1 *************** *** 261,265 **** # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # files files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. --- 261,265 ---- # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list ! # of files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. Index: pre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pre.py,v retrieving revision 1.14 retrieving revision 1.14.10.1 diff -C2 -d -r1.14 -r1.14.10.1 *** pre.py 27 Feb 2003 20:14:37 -0000 1.14 --- pre.py 20 Oct 2003 14:34:45 -0000 1.14.10.1 *************** *** 608,612 **** corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string ! matching the the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group --- 608,612 ---- corresponding return value is the entire matching string; if it is in the inclusive range [1..99], it is the string ! matching the corresponding parenthesized group. If a group number is negative or larger than the number of groups defined in the pattern, an IndexError exception is raised. If a group Index: profile.doc =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/profile.doc,v retrieving revision 1.2 retrieving revision 1.2.46.1 diff -C2 -d -r1.2 -r1.2.46.1 *** profile.doc 1 Aug 1994 11:28:51 -0000 1.2 --- profile.doc 20 Oct 2003 14:34:45 -0000 1.2.46.1 *************** *** 340,344 **** When more than one key is provided, then additional keys are used as ! secondary criteria when the there is equality in all keys selected before them. For example, sort_stats('name', 'file') will sort all the entries according to their function name, and resolve all ties --- 340,344 ---- When more than one key is provided, then additional keys are used as ! secondary criteria when there is equality in all keys selected before them. For example, sort_stats('name', 'file') will sort all the entries according to their function name, and resolve all ties *************** *** 465,469 **** accuracy. The most obvious restriction is that the underlying "clock" is only ticking at a rate (typically) of about .001 seconds. Hence no ! measurements will be more accurate that that underlying clock. If enough measurements are taken, then the "error" will tend to average out. Unfortunately, removing this first error induces a second source --- 465,469 ---- accuracy. The most obvious restriction is that the underlying "clock" is only ticking at a rate (typically) of about .001 seconds. Hence no ! measurements will be more accurate than that underlying clock. If enough measurements are taken, then the "error" will tend to average out. Unfortunately, removing this first error induces a second source Index: rlcompleter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rlcompleter.py,v retrieving revision 1.13 retrieving revision 1.13.16.1 diff -C2 -d -r1.13 -r1.13.16.1 *** rlcompleter.py 3 Jun 2002 15:58:31 -0000 1.13 --- rlcompleter.py 20 Oct 2003 14:34:45 -0000 1.13.16.1 *************** *** 118,122 **** evaluatable in self.namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class ! instances, class members are are also considered.) WARNING: this can still invoke arbitrary C code, if an object --- 118,122 ---- evaluatable in self.namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class ! instances, class members are also considered.) WARNING: this can still invoke arbitrary C code, if an object Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.53 retrieving revision 1.53.6.1 diff -C2 -d -r1.53 -r1.53.6.1 *** site.py 18 Jul 2003 17:45:33 -0000 1.53 --- site.py 20 Oct 2003 14:34:46 -0000 1.53.6.1 *************** *** 11,15 **** works). ! This will append site-specific paths to to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages as well as lib/site-python. --- 11,15 ---- works). ! This will append site-specific paths to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages as well as lib/site-python. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.53 retrieving revision 1.53.6.1 diff -C2 -d -r1.53 -r1.53.6.1 *** urllib2.py 12 Jul 2003 07:33:32 -0000 1.53 --- urllib2.py 20 Oct 2003 14:34:46 -0000 1.53.6.1 *************** *** 799,803 **** # XXX Should rewrite do_open() to use the new httplib interface, ! # would would be a little simpler. def do_open(self, http_class, req): --- 799,803 ---- # XXX Should rewrite do_open() to use the new httplib interface, ! # would be a little simpler. def do_open(self, http_class, req): Index: whichdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v retrieving revision 1.17 retrieving revision 1.17.6.1 diff -C2 -d -r1.17 -r1.17.6.1 *** whichdb.py 11 Jul 2003 12:16:48 -0000 1.17 --- whichdb.py 20 Oct 2003 14:34:46 -0000 1.17.6.1 *************** *** 52,56 **** pass ! # Check for dumbdbm next -- this has a .dir and and a .dat file try: # First check for presence of files --- 52,56 ---- pass ! # Check for dumbdbm next -- this has a .dir and a .dat file try: # First check for presence of files Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.29 retrieving revision 1.29.6.1 diff -C2 -d -r1.29 -r1.29.6.1 *** xmlrpclib.py 12 Jul 2003 07:53:04 -0000 1.29 --- xmlrpclib.py 20 Oct 2003 14:34:46 -0000 1.29.6.1 *************** *** 995,999 **** # # @param data An XML-RPC packet, given as an 8-bit string. ! # @return A tuple containing the the unpacked data, and the method name # (None if not present). # @see Fault --- 995,999 ---- # # @param data An XML-RPC packet, given as an 8-bit string. ! # @return A tuple containing the unpacked data, and the method name # (None if not present). # @see Fault From doerwalter at users.sourceforge.net Mon Oct 20 10:35:18 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:19 2003 Subject: [Python-checkins] python/dist/src/Lib/distutils cmd.py, 1.34, 1.34.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Lib/distutils Modified Files: Tag: release23-maint cmd.py Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v retrieving revision 1.34 retrieving revision 1.34.10.1 diff -C2 -d -r1.34 -r1.34.10.1 *** cmd.py 20 Feb 2003 02:10:08 -0000 1.34 --- cmd.py 20 Oct 2003 14:34:46 -0000 1.34.10.1 *************** *** 149,153 **** This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been ! done. Thus, this is the place to to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in --- 149,153 ---- This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been ! done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in From doerwalter at users.sourceforge.net Mon Oct 20 10:35:17 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:22 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew20.tex, 1.48, 1.48.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Doc/whatsnew Modified Files: Tag: release23-maint whatsnew20.tex Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: whatsnew20.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew20.tex,v retrieving revision 1.48 retrieving revision 1.48.8.1 diff -C2 -d -r1.48 -r1.48.8.1 *** whatsnew20.tex 2 Jul 2003 12:27:43 -0000 1.48 --- whatsnew20.tex 20 Oct 2003 14:34:45 -0000 1.48.8.1 *************** *** 1001,1005 **** data, and so forth. ! The advantage of the event-driven approach is that that the whole document doesn't have to be resident in memory at any one time, which matters if you are processing really huge documents. However, writing --- 1001,1005 ---- data, and so forth. ! The advantage of the event-driven approach is that the whole document doesn't have to be resident in memory at any one time, which matters if you are processing really huge documents. However, writing From doerwalter at users.sourceforge.net Mon Oct 20 10:35:17 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:26 2003 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.102, 1.102.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Doc/texinputs Modified Files: Tag: release23-maint python.sty Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.102 retrieving revision 1.102.8.1 diff -C2 -d -r1.102 -r1.102.8.1 *** python.sty 16 Jul 2003 14:01:56 -0000 1.102 --- python.sty 20 Oct 2003 14:34:45 -0000 1.102.8.1 *************** *** 1,4 **** % ! % python.sty for the Python docummentation [works only with with Latex2e] % --- 1,4 ---- % ! % python.sty for the Python docummentation [works only with Latex2e] % From doerwalter at users.sourceforge.net Mon Oct 20 10:35:17 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 10:37:29 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref6.tex,1.68,1.68.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv9536/Doc/ref Modified Files: Tag: release23-maint ref6.tex Log Message: Backport checkin: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.68 retrieving revision 1.68.8.1 diff -C2 -d -r1.68 -r1.68.8.1 *** ref6.tex 15 Jul 2003 22:02:21 -0000 1.68 --- ref6.tex 20 Oct 2003 14:34:44 -0000 1.68.8.1 *************** *** 150,154 **** \item If the target list is a comma-separated list of targets: The object ! must be a sequence with the same number of items as the there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of --- 150,154 ---- \item If the target list is a comma-separated list of targets: The object ! must be a sequence with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of From doerwalter at users.sourceforge.net Mon Oct 20 10:02:20 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Oct 20 12:46:53 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref6.tex,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv2359/Doc/ref Modified Files: ref6.tex Log Message: Fix a bunch of typos in documentation, docstrings and comments. (From SF patch #810751) Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** ref6.tex 15 Jul 2003 22:02:21 -0000 1.68 --- ref6.tex 20 Oct 2003 14:01:47 -0000 1.69 *************** *** 150,154 **** \item If the target list is a comma-separated list of targets: The object ! must be a sequence with the same number of items as the there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of --- 150,154 ---- \item If the target list is a comma-separated list of targets: The object ! must be a sequence with the same number of items as there are targets in the target list, and the items are assigned, from left to right, to the corresponding targets. (This rule is relaxed as of From gvanrossum at users.sourceforge.net Mon Oct 20 13:01:10 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon Oct 20 13:01:14 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.18, 1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv16118 Modified Files: libitertools.tex Log Message: Use 'predicate = bool' as the default predicate for ifilter[false]. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** libitertools.tex 5 Oct 2003 16:47:36 -0000 1.18 --- libitertools.tex 20 Oct 2003 17:01:07 -0000 1.19 *************** *** 141,146 **** def ifilter(predicate, iterable): if predicate is None: ! def predicate(x): ! return x for x in iterable: if predicate(x): --- 141,145 ---- def ifilter(predicate, iterable): if predicate is None: ! predicate = bool for x in iterable: if predicate(x): *************** *** 158,163 **** def ifilterfalse(predicate, iterable): if predicate is None: ! def predicate(x): ! return x for x in iterable: if not predicate(x): --- 157,161 ---- def ifilterfalse(predicate, iterable): if predicate is None: ! predicate = bool for x in iterable: if not predicate(x): From rhettinger at users.sourceforge.net Mon Oct 20 16:45:35 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 20 16:45:39 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12.6.6, 1.12.6.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv25729 Modified Files: Tag: release23-maint libitertools.tex Log Message: Backport 1.19: Use 'predicate = bool' as the default predicate for ifilter[false]. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12.6.6 retrieving revision 1.12.6.7 diff -C2 -d -r1.12.6.6 -r1.12.6.7 *** libitertools.tex 5 Oct 2003 23:05:56 -0000 1.12.6.6 --- libitertools.tex 20 Oct 2003 20:45:33 -0000 1.12.6.7 *************** *** 141,146 **** def ifilter(predicate, iterable): if predicate is None: ! def predicate(x): ! return x for x in iterable: if predicate(x): --- 141,145 ---- def ifilter(predicate, iterable): if predicate is None: ! predicate = bool for x in iterable: if predicate(x): *************** *** 158,163 **** def ifilterfalse(predicate, iterable): if predicate is None: ! def predicate(x): ! return x for x in iterable: if not predicate(x): --- 157,161 ---- def ifilterfalse(predicate, iterable): if predicate is None: ! predicate = bool for x in iterable: if not predicate(x): From loewis at users.sourceforge.net Mon Oct 20 16:59:47 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 20 16:59:50 2003 Subject: [Python-checkins] python/dist/src/Modules _sre.c,2.99,2.99.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv28127 Modified Files: Tag: release23-maint _sre.c Log Message: Patch #813391: Reduce limits for amd64 and sparc64. Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.99 retrieving revision 2.99.8.1 diff -C2 -d -r2.99 -r2.99.8.1 *** _sre.c 26 Jun 2003 14:41:08 -0000 2.99 --- _sre.c 20 Oct 2003 20:59:45 -0000 2.99.8.1 *************** *** 72,78 **** /* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */ #define USE_RECURSION_LIMIT 7500 - #else ! #if defined(__GNUC__) && defined(WITH_THREAD) && defined(__FreeBSD__) /* the pthreads library on FreeBSD has a fixed 1MB stack size for the * initial (or "primary") thread, which is insufficient for the default --- 72,83 ---- /* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */ #define USE_RECURSION_LIMIT 7500 ! #elif defined(__FreeBSD__) ! /* FreeBSD/amd64 and /sparc64 require even smaller limits */ ! #if defined(__amd64__) ! #define USE_RECURSION_LIMIT 6000 ! #elif defined(__sparc64__) ! #define USE_RECURSION_LIMIT 3000 ! #elif defined(__GNUC__) && defined(WITH_THREAD) /* the pthreads library on FreeBSD has a fixed 1MB stack size for the * initial (or "primary") thread, which is insufficient for the default From gvanrossum at users.sourceforge.net Mon Oct 20 19:38:30 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Mon Oct 20 19:38:32 2003 Subject: [Python-checkins] python/dist/src/Lib timeit.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30336 Modified Files: timeit.py Log Message: Show microseconds, milliseconds or seconds, whichever is most natural, rather than showing weird numbers like 8.4e+03 usec. Index: timeit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/timeit.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** timeit.py 20 Sep 2003 11:09:28 -0000 1.14 --- timeit.py 20 Oct 2003 23:38:28 -0000 1.15 *************** *** 265,269 **** print "%d loops," % number, usec = best * 1e6 / number ! print "best of %d: %.*g usec per loop" % (repeat, precision, usec) return None --- 265,277 ---- print "%d loops," % number, usec = best * 1e6 / number ! if usec < 1000: ! print "best of %d: %.*g usec per loop" % (repeat, precision, usec) ! else: ! msec = usec / 1000 ! if msec < 1000: ! print "best of %d: %.*g msec per loop" % (repeat, precision, msec) ! else: ! sec = msec / 1000 ! print "best of %d: %.*g sec per loop" % (repeat, precision, sec) return None From akuchling at users.sourceforge.net Tue Oct 21 08:31:18 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Oct 21 08:31:21 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv10773 Modified Files: whatsnew24.tex Log Message: Document list.sort() changes Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** whatsnew24.tex 20 Sep 2003 15:52:20 -0000 1.3 --- whatsnew24.tex 21 Oct 2003 12:31:16 -0000 1.4 *************** *** 39,43 **** \begin{itemize} ! \item TBD \end{itemize} --- 39,79 ---- \begin{itemize} ! \item The \method{sort()} method of lists gained three keyword ! arguments, \var{cmp}, \var{key}, and \var{reverse}. These arguments ! make some common usages of \method{sort()} simpler. All are optional. ! ! \var{cmp} is the same as the previous single argument to ! \method{sort()}; if provided, the value should be a comparison ! function that takes two arguments and returns -1, 0, or +1 depending ! on how the arguments compare. ! ! \var{key} should be a single-argument function that takes a list ! element and returns a comparison key for the element. The list is ! then sorted using the comparison keys. The following example sorts a list ! case-insensitively: ! ! \begin{verbatim} ! >>> L = ['A', 'b', 'c', 'D'] ! >>> L.sort() # Case-sensitive sort ! >>> L ! ['A', 'D', 'b', 'c'] ! >>> L.sort(key=lambda x: x.lower()) ! >>> L ! ['A', 'b', 'c', 'D'] ! >>> L.sort(cmp=lambda x,y: cmp(x.lower(), y.lower())) ! >>> L ! ['A', 'b', 'c', 'D'] ! \end{verbatim} ! ! The last example, which uses the \var{cmp} parameter, is the old way ! to perform a case-insensitive sort. It works, but is slower than ! using a \var{key} parameter. Using \var{key} results in calling the ! \method{lower()} method once for each element in the list while using ! \var{cmp} will call the method twice for each comparison. ! ! The \var{reverse} parameter should have a Boolean value. If the value is ! \constant{True}, the list will be sorted into reverse order. Instead ! of \code{L.sort() ; L.reverse()}, you can now write ! \code{L.sort(reverse=True)}. \end{itemize} From akuchling at users.sourceforge.net Tue Oct 21 08:48:25 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Oct 21 08:48:28 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv13731 Modified Files: whatsnew24.tex Log Message: Add some more items Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** whatsnew24.tex 21 Oct 2003 12:31:16 -0000 1.4 --- whatsnew24.tex 21 Oct 2003 12:48:23 -0000 1.5 *************** *** 77,80 **** --- 77,84 ---- \code{L.sort(reverse=True)}. + \item The \function{zip()} built-in function and \function{itertools.izip()} now return an empty list + instead of raising a \exception{TypeError} exception if called + with no arguments. + \end{itemize} *************** *** 110,113 **** --- 114,128 ---- supports transparency, this makes it possible to use a transparent background. (Contributed by J\"org Lehmann.) + + \item The \module{random} module has a new method called \method{getrandbits(N)} + which returns an N-bit long integer. + + \item The regular expression language accepted by the \module{re} module + was extended with simple conditional expressions, written as + \code{(?(\var{group})\var{A}|\var{B})}. \var{group} is either a + numeric group ID or a group name defined with \code{(?P...)} + earlier in the expression. If the specified group matched, the + regular expression pattern \var{A} will be tested against the string; if + the group didn't match, the pattern \var{B} will be used instead. \end{itemize} *************** *** 125,129 **** \begin{itemize} ! \item Detailed changes are listed here. \end{itemize} --- 140,150 ---- \begin{itemize} ! \item Three new convenience macros were added for common return ! values from extension functions: \csimplemacro{Py_RETURN_NONE}, ! \csimplemacro{Py_RETURN_TRUE}, and \csimplemacro{Py_RETURN_FALSE}. ! ! \item A new function, \cfunction{PyTuple_Pack(N, obj1, obj2, ..., ! objN)}, constructs tuples from a variable length argument list of ! Python objects. \end{itemize} *************** *** 161,166 **** \begin{itemize} ! \item dircache.listdir now passes exceptions to the caller, ! instead of returning empty lists. \end{itemize} --- 182,191 ---- \begin{itemize} ! \item The \function{zip()} built-in function and \function{itertools.izip()} now return an empty list ! instead of raising a \exception{TypeError} exception if called ! with no arguments. ! ! \item \function{dircache.listdir()} now passes exceptions to the caller ! instead of returning empty lists. \end{itemize} From fdrake at users.sourceforge.net Tue Oct 21 11:38:58 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 11:39:33 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1 asciitab.h, 1.1.1.1, 1.2 expat.h, 1.5, 1.6 iasciitab.h, 1.1.1.1, 1.2 internal.h, 1.1, 1.2 latin1tab.h, 1.1.1.1, 1.2 utf8tab.h, 1.1.1.1, 1.2 winconfig.h, 1.1.1.1, 1.2 xmlparse.c, 1.5, 1.6 xmlrole.c, 1.5, 1.6 xmltok.c, 1.3, 1.4 xmltok_impl.c, 1.2, 1.3 expat.h.in, 1.1.1.1, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory sc8-pr-cvs1:/tmp/cvs-serv20685 Modified Files: asciitab.h expat.h iasciitab.h internal.h latin1tab.h utf8tab.h winconfig.h xmlparse.c xmlrole.c xmltok.c xmltok_impl.c Added Files: macconfig.h Removed Files: expat.h.in Log Message: Update to Expat 1.95.7; there are no changes to the Expat sources. --- NEW FILE: macconfig.h --- /*================================================================ ** Copyright 2000, Clark Cooper ** All rights reserved. ** ** This is free software. You are permitted to copy, distribute, or modify ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) ** */ #ifndef MACCONFIG_H #define MACCONFIG_H /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #define BYTEORDER 4321 /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #define HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS /* whether byteorder is bigendian */ #define WORDS_BIGENDIAN /* Define to specify how much context to retain around the current parse point. */ #undef XML_CONTEXT_BYTES /* Define to make parameter entity parsing functionality available. */ #define XML_DTD /* Define to make XML Namespaces functionality available. */ #define XML_NS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long' if does not define. */ #define off_t long /* Define to `unsigned' if does not define. */ #undef size_t #endif /* ifndef MACCONFIG_H */ Index: asciitab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/asciitab.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** asciitab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- asciitab.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: expat.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/expat.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** expat.h 7 Feb 2003 02:15:56 -0000 1.5 --- expat.h 21 Oct 2003 15:38:55 -0000 1.6 *************** *** 17,31 **** #include - #ifndef XMLPARSEAPI #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) ! #ifdef XML_STATIC ! #define XMLPARSEAPI(type) type __cdecl ! #else ! #define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl #endif #else ! #define XMLPARSEAPI(type) type #endif ! #endif /* not defined XMLPARSEAPI */ #ifdef __cplusplus --- 17,85 ---- #include #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) ! #define XML_USE_MSC_EXTENSIONS 1 #endif + + /* Expat tries very hard to make the API boundary very specifically + defined. There are two macros defined to control this boundary; + each of these can be defined before including this header to + achieve some different behavior, but doing so it not recommended or + tested frequently. + + XMLCALL - The calling convention to use for all calls across the + "library boundary." This will default to cdecl, and + try really hard to tell the compiler that's what we + want. + + XMLIMPORT - Whatever magic is needed to note that a function is + to be imported from a dynamically loaded library + (.dll, .so, or .sl, depending on your platform). + + The XMLCALL macro was added in Expat 1.95.7. The only one which is + expected to be directly useful in client code is XMLCALL. + + Note that on at least some Unix versions, the Expat library must be + compiled with the cdecl calling convention as the default since + system headers may assume the cdecl convention. + */ + #ifndef XMLCALL + #if defined(XML_USE_MSC_EXTENSIONS) + #define XMLCALL __cdecl + #elif defined(__GNUC__) + #define XMLCALL __attribute__((cdecl)) #else ! /* For any platform which uses this definition and supports more than ! one calling convention, we need to extend this definition to ! declare the convention used on that platform, if it's possible to ! do so. ! ! If this is the case for your platform, please file a bug report ! with information on how to identify your platform via the C ! pre-processor and how to specify the same calling convention as the ! platform's malloc() implementation. ! */ ! #define XMLCALL #endif ! #endif /* not defined XMLCALL */ ! ! ! #if !defined(XML_STATIC) && !defined(XMLIMPORT) ! #ifndef XML_BUILDING_EXPAT ! /* using Expat from an application */ ! ! #ifdef XML_USE_MSC_EXTENSIONS ! #define XMLIMPORT __declspec(dllimport) ! #endif ! ! #endif ! #endif /* not defined XML_STATIC */ ! ! /* If we didn't define it above, define it away: */ ! #ifndef XMLIMPORT ! #define XMLIMPORT ! #endif ! ! ! #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL #ifdef __cplusplus *************** *** 105,109 **** XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, ! XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING }; --- 159,164 ---- XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, ! XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, ! XML_ERROR_UNBOUND_PREFIX }; *************** *** 157,163 **** to free model when finished with it. */ ! typedef void (*XML_ElementDeclHandler) (void *userData, ! const XML_Char *name, ! XML_Content *model); XMLPARSEAPI(void) --- 212,218 ---- to free model when finished with it. */ ! typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, ! const XML_Char *name, ! XML_Content *model); XMLPARSEAPI(void) *************** *** 173,182 **** true and default is non-NULL, then this is a "#FIXED" default. */ ! typedef void (*XML_AttlistDeclHandler) (void *userData, ! const XML_Char *elname, ! const XML_Char *attname, ! const XML_Char *att_type, ! const XML_Char *dflt, ! int isrequired); XMLPARSEAPI(void) --- 228,238 ---- true and default is non-NULL, then this is a "#FIXED" default. */ ! typedef void (XMLCALL *XML_AttlistDeclHandler) ( ! void *userData, ! const XML_Char *elname, ! const XML_Char *attname, ! const XML_Char *att_type, ! const XML_Char *dflt, ! int isrequired); XMLPARSEAPI(void) *************** *** 192,199 **** as no, or that it was given as yes. */ ! typedef void (*XML_XmlDeclHandler) (void *userData, ! const XML_Char *version, ! const XML_Char *encoding, ! int standalone); XMLPARSEAPI(void) --- 248,255 ---- as no, or that it was given as yes. */ ! typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, ! const XML_Char *version, ! const XML_Char *encoding, ! int standalone); XMLPARSEAPI(void) *************** *** 203,209 **** typedef struct { ! void *(*malloc_fcn)(size_t size); ! void *(*realloc_fcn)(void *ptr, size_t size); ! void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; --- 259,265 ---- typedef struct { ! void *(XMLCALL *malloc_fcn)(size_t size); ! void *(XMLCALL *realloc_fcn)(void *ptr, size_t size); ! void (XMLCALL *free_fcn)(void *ptr); } XML_Memory_Handling_Suite; *************** *** 258,284 **** names and values are 0 terminated. */ ! typedef void (*XML_StartElementHandler)(void *userData, ! const XML_Char *name, ! const XML_Char **atts); ! typedef void (*XML_EndElementHandler)(void *userData, ! const XML_Char *name); /* s is not 0 terminated. */ ! typedef void (*XML_CharacterDataHandler)(void *userData, ! const XML_Char *s, ! int len); /* target and data are 0 terminated */ ! typedef void (*XML_ProcessingInstructionHandler)(void *userData, ! const XML_Char *target, ! const XML_Char *data); /* data is 0 terminated */ ! typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); ! typedef void (*XML_StartCdataSectionHandler)(void *userData); ! typedef void (*XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which --- 314,342 ---- names and values are 0 terminated. */ ! typedef void (XMLCALL *XML_StartElementHandler) (void *userData, ! const XML_Char *name, ! const XML_Char **atts); ! typedef void (XMLCALL *XML_EndElementHandler) (void *userData, ! const XML_Char *name); /* s is not 0 terminated. */ ! typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, ! const XML_Char *s, ! int len); /* target and data are 0 terminated */ ! typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( ! void *userData, ! const XML_Char *target, ! const XML_Char *data); /* data is 0 terminated */ ! typedef void (XMLCALL *XML_CommentHandler) (void *userData, ! const XML_Char *data); ! typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); ! typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); /* This is called for any characters in the XML document for which *************** *** 295,306 **** multiple calls. */ ! typedef void (*XML_DefaultHandler)(void *userData, ! const XML_Char *s, ! int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ ! typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, --- 353,365 ---- multiple calls. */ ! typedef void (XMLCALL *XML_DefaultHandler) (void *userData, ! const XML_Char *s, ! int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ ! typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( ! void *userData, const XML_Char *doctypeName, const XML_Char *sysid, *************** *** 312,316 **** subset. */ ! typedef void (*XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity --- 371,375 ---- subset. */ ! typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity *************** *** 332,344 **** that would break binary compatibility. */ ! typedef void (*XML_EntityDeclHandler) (void *userData, ! const XML_Char *entityName, ! int is_parameter_entity, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); XMLPARSEAPI(void) --- 391,404 ---- that would break binary compatibility. */ ! typedef void (XMLCALL *XML_EntityDeclHandler) ( ! void *userData, ! const XML_Char *entityName, ! int is_parameter_entity, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); XMLPARSEAPI(void) *************** *** 355,364 **** NULL. The other arguments may be. */ ! typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, ! const XML_Char *entityName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is --- 415,425 ---- NULL. The other arguments may be. */ ! typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( ! void *userData, ! const XML_Char *entityName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is *************** *** 366,374 **** NULL. The other arguments can be. */ ! typedef void (*XML_NotationDeclHandler)(void *userData, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* When namespace processing is enabled, these are called once for --- 427,436 ---- NULL. The other arguments can be. */ ! typedef void (XMLCALL *XML_NotationDeclHandler) ( ! void *userData, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* When namespace processing is enabled, these are called once for *************** *** 378,387 **** NULL. For an xmlns="" attribute, uri will be NULL. */ ! typedef void (*XML_StartNamespaceDeclHandler)(void *userData, ! const XML_Char *prefix, ! const XML_Char *uri); ! typedef void (*XML_EndNamespaceDeclHandler)(void *userData, ! const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an --- 440,451 ---- NULL. For an xmlns="" attribute, uri will be NULL. */ ! typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( ! void *userData, ! const XML_Char *prefix, ! const XML_Char *uri); ! typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( ! void *userData, ! const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an *************** *** 394,398 **** entity was actually read. */ ! typedef int (*XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general --- 458,462 ---- entity was actually read. */ ! typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); /* This is called for a reference to an external parsed general *************** *** 430,438 **** not userData. */ ! typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* This is called in two situations: --- 494,503 ---- not userData. */ ! typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( ! XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* This is called in two situations: *************** *** 446,452 **** declarations or attribute values */ ! typedef void (*XML_SkippedEntityHandler)(void *userData, ! const XML_Char *entityName, ! int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to --- 511,518 ---- declarations or attribute values */ ! typedef void (XMLCALL *XML_SkippedEntityHandler) ( ! void *userData, ! const XML_Char *entityName, ! int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to *************** *** 505,510 **** int map[256]; void *data; ! int (*convert)(void *data, const char *s); ! void (*release)(void *data); } XML_Encoding; --- 571,576 ---- int map[256]; void *data; ! int (XMLCALL *convert)(void *data, const char *s); ! void (XMLCALL *release)(void *data); } XML_Encoding; *************** *** 524,530 **** return an XML_UNKNOWN_ENCODING error. */ ! typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, ! const XML_Char *name, ! XML_Encoding *info); XMLPARSEAPI(void) --- 590,597 ---- return an XML_UNKNOWN_ENCODING error. */ ! typedef int (XMLCALL *XML_UnknownEncodingHandler) ( ! void *encodingHandlerData, ! const XML_Char *name, ! XML_Encoding *info); XMLPARSEAPI(void) *************** *** 814,819 **** /* These functions return information about the current parse location. They may be called from any callback called to report ! some parse event; in this case the location is the location of ! the first of the sequence of characters that generated the event. They may also be called after returning from a call to XML_Parse --- 881,891 ---- /* These functions return information about the current parse location. They may be called from any callback called to report ! some parse event; in this case the location is the location of the ! first of the sequence of characters that generated the event. When ! called from callbacks generated by declarations in the document ! prologue, the location identified isn't as neatly defined, but will ! be within the relevant markup. When called outside of the callback ! functions, the position indicated will be just past the last parse ! event (regardless of whether there was an associated callback). They may also be called after returning from a call to XML_Parse *************** *** 921,925 **** #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 6 #ifdef __cplusplus --- 993,997 ---- #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 7 #ifdef __cplusplus Index: iasciitab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/iasciitab.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** iasciitab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- iasciitab.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: internal.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/internal.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** internal.h 25 Jan 2003 22:41:29 -0000 1.1 --- internal.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 21,35 **** */ ! #if defined(__GNUC__) ! /* Instability reported with egcs on a RedHat Linux 7.3. ! Let's comment it out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) - #define PTRCALL #define PTRFASTCALL __attribute__((regparm(3))) - #elif defined(WIN32) /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for --- 21,38 ---- */ ! #if defined(__GNUC__) && defined(__i386__) ! /* We'll use this version by default only where we know it helps. ! ! regparm() generates warnings on Solaris boxes. See SF bug #692878. ! ! Instability reported with egcs on a RedHat Linux 7.3. ! Let's comment out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) #define PTRFASTCALL __attribute__((regparm(3))) + #endif /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for *************** *** 39,47 **** the compiler cannot perform stack optimizations for call clusters. */ - #define FASTCALL - #define PTRCALL - #define PTRFASTCALL ! #endif #ifndef FASTCALL --- 42,47 ---- the compiler cannot perform stack optimizations for call clusters. */ ! /* Make sure all of these are defined if they aren't already. */ #ifndef FASTCALL Index: latin1tab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/latin1tab.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** latin1tab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- latin1tab.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: utf8tab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/utf8tab.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** utf8tab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- utf8tab.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: winconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/winconfig.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** winconfig.h 11 Feb 2002 23:13:08 -0000 1.1.1.1 --- winconfig.h 21 Oct 2003 15:38:55 -0000 1.2 *************** *** 6,11 **** ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) - ** - ** */ --- 6,9 ---- *************** *** 22,27 **** #define XML_NS 1 #define XML_DTD 1 - #define XML_BYTE_ORDER 12 #define XML_CONTEXT_BYTES 1024 #endif /* ndef WINCONFIG_H */ --- 20,30 ---- #define XML_NS 1 #define XML_DTD 1 #define XML_CONTEXT_BYTES 1024 + + /* we will assume all Windows platforms are little endian */ + #define BYTEORDER 1234 + + /* Windows has memmove() available. */ + #define HAVE_MEMMOVE #endif /* ndef WINCONFIG_H */ Index: xmlparse.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlparse.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xmlparse.c 28 Jan 2003 06:42:40 -0000 1.5 --- xmlparse.c 21 Oct 2003 15:38:55 -0000 1.6 *************** *** 6,38 **** #include /* memset(), memcpy() */ ! #ifdef COMPILED_FROM_DSP #include "winconfig.h" - #define XMLPARSEAPI(type) type __cdecl - #include "expat.h" - #undef XMLPARSEAPI - #elif defined(MACOS_CLASSIC) [...1671 lines suppressed...] --- 5649,5654 ---- pool->blocks = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, ! (offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char))); if (pool->blocks == NULL) return XML_FALSE; *************** *** 5547,5551 **** blockSize *= 2; tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; --- 5666,5670 ---- blockSize *= 2; tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; Index: xmlrole.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xmlrole.c 25 Jan 2003 22:48:51 -0000 1.5 --- xmlrole.c 21 Oct 2003 15:38:55 -0000 1.6 *************** *** 8,14 **** #include "macconfig.h" #else ! /* Unused - MvL #include ! */ #endif /* ndef COMPILED_FROM_DSP */ --- 8,14 ---- #include "macconfig.h" #else ! #ifdef HAVE_EXPAT_CONFIG_H #include ! #endif #endif /* ndef COMPILED_FROM_DSP */ Index: xmltok.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xmltok.c 25 Jan 2003 22:41:29 -0000 1.3 --- xmltok.c 21 Oct 2003 15:38:55 -0000 1.4 *************** *** 8,14 **** #include "macconfig.h" #else ! /* Unused - MvL #include ! */ #endif /* ndef COMPILED_FROM_DSP */ --- 8,14 ---- #include "macconfig.h" #else ! #ifdef HAVE_EXPAT_CONFIG_H #include ! #endif #endif /* ndef COMPILED_FROM_DSP */ Index: xmltok_impl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok_impl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmltok_impl.c 25 Jan 2003 22:41:29 -0000 1.2 --- xmltok_impl.c 21 Oct 2003 15:38:55 -0000 1.3 *************** *** 883,887 **** { if (ptr == end) ! return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) --- 883,887 ---- { if (ptr == end) ! return -XML_TOK_PERCENT; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) --- expat.h.in DELETED --- From fdrake at users.sourceforge.net Tue Oct 21 11:41:18 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 11:41:21 2003 Subject: [Python-checkins] python/dist/src setup.py,1.173,1.174 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv21210 Modified Files: setup.py Log Message: Provide a bit more information to the compiler when building Expat. This avoids having to modify the Expat sources in any way starting with Expat 1.95.7. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** setup.py 22 Sep 2003 01:16:48 -0000 1.173 --- setup.py 21 Oct 2003 15:41:15 -0000 1.174 *************** *** 738,756 **** xmlbo = "4321" expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') ! exts.append(Extension('pyexpat', ! sources = [ ! 'pyexpat.c', ! 'expat/xmlparse.c', ! 'expat/xmlrole.c', ! 'expat/xmltok.c', ! ], ! define_macros = [ ('XML_NS', '1'), ('XML_DTD', '1'), ('BYTEORDER', xmlbo), ('XML_CONTEXT_BYTES','1024'), ! ], ! include_dirs = [expatinc] ! )) # Dynamic loading module --- 738,761 ---- xmlbo = "4321" expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') ! define_macros = [ ('XML_NS', '1'), ('XML_DTD', '1'), ('BYTEORDER', xmlbo), ('XML_CONTEXT_BYTES','1024'), ! ] ! config_h = sysconfig.get_config_h_filename() ! config_h_vars = sysconfig.parse_config_h(open(config_h)) ! for feature_macro in ['HAVE_MEMMOVE', 'HAVE_BCOPY']: ! if config_h_vars.has_key(feature_macro): ! define_macros.append((feature_macro, '1')) ! exts.append(Extension('pyexpat', ! define_macros = define_macros, ! include_dirs = [expatinc], ! sources = ['pyexpat.c', ! 'expat/xmlparse.c', ! 'expat/xmlrole.c', ! 'expat/xmltok.c', ! ], ! )) # Dynamic loading module From fdrake at users.sourceforge.net Tue Oct 21 11:42:01 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 11:42:04 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.873,1.874 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv21375 Modified Files: NEWS Log Message: Note the update to Expat 1.95.7. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.873 retrieving revision 1.874 diff -C2 -d -r1.873 -r1.874 *** NEWS 19 Oct 2003 21:31:43 -0000 1.873 --- NEWS 21 Oct 2003 15:41:59 -0000 1.874 *************** *** 48,51 **** --- 48,53 ---- ----------------- + - The xml.parsers.expat module now provides Expat 1.95.7. + - socket.IPPROTO_IPV6 was added. From fdrake at users.sourceforge.net Tue Oct 21 12:45:03 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 12:45:06 2003 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py,1.60,1.61 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv792 Modified Files: ConfigParser.py Log Message: Make both items() methods return lists; one had changed to return an iterator where it probably shouldn't have. Closes SF bug #818861. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** ConfigParser.py 20 Oct 2003 14:01:49 -0000 1.60 --- ConfigParser.py 21 Oct 2003 16:45:00 -0000 1.61 *************** *** 543,552 **** options.remove("__name__") if raw: ! for option in options: ! yield (option, d[option]) else: ! for option in options: ! yield (option, ! self._interpolate(section, option, d[option], d)) def _interpolate(self, section, option, rawval, vars): --- 543,551 ---- options.remove("__name__") if raw: ! return [(option, d[option]) ! for option in options] else: ! return [(option, self._interpolate(section, option, d[option], d)) ! for option in options] def _interpolate(self, section, option, rawval, vars): From fdrake at users.sourceforge.net Tue Oct 21 12:46:54 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 12:46:58 2003 Subject: [Python-checkins] python/dist/src/Lib ConfigParser.py, 1.58.8.2, 1.58.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv1242 Modified Files: Tag: release23-maint ConfigParser.py Log Message: Make both items() methods return lists; one had changed to return an iterator where it probably shouldn't have. Closes SF bug #818861. Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.58.8.2 retrieving revision 1.58.8.3 diff -C2 -d -r1.58.8.2 -r1.58.8.3 *** ConfigParser.py 20 Oct 2003 14:34:45 -0000 1.58.8.2 --- ConfigParser.py 21 Oct 2003 16:46:52 -0000 1.58.8.3 *************** *** 543,552 **** options.remove("__name__") if raw: ! for option in options: ! yield (option, d[option]) else: ! for option in options: ! yield (option, ! self._interpolate(section, option, d[option], d)) def _interpolate(self, section, option, rawval, vars): --- 543,551 ---- options.remove("__name__") if raw: ! return [(option, d[option]) ! for option in options] else: ! return [(option, self._interpolate(section, option, d[option], d)) ! for option in options] def _interpolate(self, section, option, rawval, vars): From fdrake at users.sourceforge.net Tue Oct 21 12:50:57 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 12:51:01 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.30, 1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1898 Modified Files: libcfgparser.tex Log Message: ConfigParser.items() and SafeConfigParser.items() no longer return a generator. See SF bug #818861. Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** libcfgparser.tex 14 Aug 2003 19:58:35 -0000 1.30 --- libcfgparser.tex 21 Oct 2003 16:50:55 -0000 1.31 *************** *** 280,286 **** \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} ! Create a generator which will return a tuple \code{(name, value)} for ! each option in the given \var{section}. Optional arguments have the ! same meaning as for the \code{get()} method. \versionadded{2.3} \end{methoddesc} --- 280,286 ---- \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} ! Return a list of \code{(\var{name}, \var{value})} pairs for each ! option in the given \var{section}. Optional arguments have the ! same meaning as for the \method{get()} method. \versionadded{2.3} \end{methoddesc} From fdrake at users.sourceforge.net Tue Oct 21 12:51:42 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 12:51:45 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.29.16.1, 1.29.16.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2041 Modified Files: Tag: release23-maint libcfgparser.tex Log Message: ConfigParser.items() and SafeConfigParser.items() no longer return a generator. See SF bug #818861. Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.29.16.1 retrieving revision 1.29.16.2 diff -C2 -d -r1.29.16.1 -r1.29.16.2 *** libcfgparser.tex 14 Aug 2003 20:01:40 -0000 1.29.16.1 --- libcfgparser.tex 21 Oct 2003 16:51:40 -0000 1.29.16.2 *************** *** 280,286 **** \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} ! Create a generator which will return a tuple \code{(name, value)} for ! each option in the given \var{section}. Optional arguments have the ! same meaning as for the \code{get()} method. \versionadded{2.3} \end{methoddesc} --- 280,286 ---- \begin{methoddesc}{items}{section\optional{, raw\optional{, vars}}} ! Return a list of \code{(\var{name}, \var{value})} pairs for each ! option in the given \var{section}. Optional arguments have the ! same meaning as for the \method{get()} method. \versionadded{2.3} \end{methoddesc} From fdrake at users.sourceforge.net Tue Oct 21 13:04:23 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 13:04:27 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.136, 1.137 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv4106 Modified Files: libstdtypes.tex Log Message: markup fixes; this would not format Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** libstdtypes.tex 18 Oct 2003 09:55:08 -0000 1.136 --- libstdtypes.tex 21 Oct 2003 17:04:21 -0000 1.137 *************** *** 1045,1054 **** much faster than specifying an equivalent \var{cmp} function. This is because \var{cmp} is called multiple times for each list element while ! \var{key} and \{reverse} touch each element only once. \versionchanged[Support for \code{None} as an equivalent to omitting \var{cmpfunc} was added]{2.3} ! \versionadded[Support for \var{key} and \var{reverse} was added]{2.4} \item[(9)] Starting with Python 2.3, the \method{sort()} method is --- 1045,1054 ---- much faster than specifying an equivalent \var{cmp} function. This is because \var{cmp} is called multiple times for each list element while ! \var{key} and \var{reverse} touch each element only once. \versionchanged[Support for \code{None} as an equivalent to omitting \var{cmpfunc} was added]{2.3} ! \versionchanged[Support for \var{key} and \var{reverse} was added]{2.4} \item[(9)] Starting with Python 2.3, the \method{sort()} method is From fdrake at users.sourceforge.net Tue Oct 21 13:25:08 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 13:25:13 2003 Subject: [Python-checkins] python/dist/src/Doc Makefile.deps,1.114,1.115 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv7574 Modified Files: Makefile.deps Log Message: add missing dependency Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** Makefile.deps 27 Sep 2003 22:07:04 -0000 1.114 --- Makefile.deps 21 Oct 2003 17:25:05 -0000 1.115 *************** *** 107,110 **** --- 107,111 ---- lib/libpython.tex \ lib/libsys.tex \ + lib/libplatform.tex \ lib/libfpectl.tex \ lib/libgc.tex \ From fdrake at users.sourceforge.net Tue Oct 21 13:58:57 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 13:59:02 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libplatform.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13996 Modified Files: libplatform.tex Log Message: - make this section format - start cleaning up the markup for consistency - comment out the reference to a MS KnowledgeBase article that doesn't seem to be present at msdn.microsoft.com; hopefully someone can point out an alternate source for the relevant information Index: libplatform.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libplatform.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** libplatform.tex 14 Oct 2003 21:45:59 -0000 1.1 --- libplatform.tex 21 Oct 2003 17:58:55 -0000 1.2 *************** *** 9,15 **** \versionadded{2.3} ! \begin{notice}[note] ! Specific platforms listed alphabetically, with Linux included in the \UNIX ! section. \end{notice} --- 9,15 ---- \versionadded{2.3} ! \begin{notice} ! Specific platforms listed alphabetically, with Linux included in the ! \UNIX{} section. \end{notice} *************** *** 39,88 **** \begin{funcdesc}{machine}{} Returns the machine type, e.g. \code{'i386'}. - An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{node}{} ! Returns the computer's network name (may not be fully qualified!) ! An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{platform}{aliased=0, terse=0} ! Returns a single string identifying the underlying platform ! with as much useful information as possible. ! ! The output is intended to be \emph{human readable} rather than ! machine parseable. It may look different on different ! platforms and this is intended. ! ! If \code{aliased} is true, the function will use aliases for ! various platforms that report system names which differ from ! their common names, e.g. SunOS will be reported as ! Solaris. The \function{system_alias()} function is used to implement ! this. ! ! Setting terse to true causes the function to return only the ! absolute minimum information needed to identify the platform. ! \end{funcdesc} \begin{funcdesc}{processor}{} ! Returns the (real) processor name, e.g. 'amdk6' ! An empty string is returned if the value cannot be ! determined. Note that many platforms do not provide this ! information or simply return the same value as for \function{machine()}, ! e.g. NetBSD does this. \end{funcdesc} \begin{funcdesc}{python_build}{} ! Returns a tuple \code{(buildno, builddate)} stating the Python ! build number and date as strings. \end{funcdesc} \begin{funcdesc}{python_compiler}{} ! Returns a string identifying the compiler used for compiling ! Python. \end{funcdesc} --- 39,82 ---- \begin{funcdesc}{machine}{} Returns the machine type, e.g. \code{'i386'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{node}{} ! Returns the computer's network name (may not be fully qualified!). An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{platform}{aliased=0, terse=0} ! Returns a single string identifying the underlying platform ! with as much useful information as possible. ! ! The output is intended to be \emph{human readable} rather than ! machine parseable. It may look different on different platforms and ! this is intended. ! ! If \var{aliased} is true, the function will use aliases for various ! platforms that report system names which differ from their common ! names, for example SunOS will be reported as Solaris. The ! \function{system_alias()} function is used to implement this. + Setting \var{terse} to true causes the function to return only the + absolute minimum information needed to identify the platform. + \end{funcdesc} \begin{funcdesc}{processor}{} ! Returns the (real) processor name, e.g. \code{'amdk6'}. ! An empty string is returned if the value cannot be determined. Note ! that many platforms do not provide this information or simply return ! the same value as for \function{machine()}. NetBSD does this. \end{funcdesc} \begin{funcdesc}{python_build}{} ! Returns a tuple \code{(\var{buildno}, \var{builddate})} stating the ! Python build number and date as strings. \end{funcdesc} \begin{funcdesc}{python_compiler}{} ! Returns a string identifying the compiler used for compiling Python. \end{funcdesc} *************** *** 95,135 **** \begin{funcdesc}{python_version_tuple}{} ! Returns the Python version as tuple \code{(major, minor, patchlevel)} ! of strings. Note that unlike the Python \code{sys.version}, the returned value ! will always include the patchlevel (it defaults to 0). \end{funcdesc} \begin{funcdesc}{release}{} Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'} - An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system}{} ! Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'}, or \code{'Java'}. ! An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system_alias}{system, release, version} ! Returns \code{(system, release, version)} aliased to common ! marketing names used for some systems. ! ! It also does some reordering of the information in some cases ! where it would otherwise cause confusion. \end{funcdesc} \begin{funcdesc}{version}{} ! Returns the system's release version, e.g. \code{'#3 on degas'}. ! An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{uname}{} ! Fairly portable uname interface. Returns a tuple ! of strings \code{(system, node, release, version, machine, processor)} ! identifying the underlying platform. Note that unlike the \function{os.uname()} function this also returns --- 89,127 ---- \begin{funcdesc}{python_version_tuple}{} ! Returns the Python version as tuple \code{(\var{major}, \var{minor}, ! \var{patchlevel})} of strings. Note that unlike the Python \code{sys.version}, the returned value ! will always include the patchlevel (it defaults to \code{'0'}). \end{funcdesc} \begin{funcdesc}{release}{} Returns the system's release, e.g. \code{'2.2.0'} or \code{'NT'} An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system}{} ! Returns the system/OS name, e.g. \code{'Linux'}, \code{'Windows'}, ! or \code{'Java'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{system_alias}{system, release, version} ! Returns \code{(\var{system}, \var{release}, \var{version})} aliased ! to common marketing names used for some systems. It also does some ! reordering of the information in some cases where it would otherwise ! cause confusion. \end{funcdesc} \begin{funcdesc}{version}{} ! Returns the system's release version, e.g. \code{'\#3 on degas'}. An empty string is returned if the value cannot be determined. \end{funcdesc} \begin{funcdesc}{uname}{} ! Fairly portable uname interface. Returns a tuple of strings ! \code{(\var{system}, \var{node}, \var{release}, \var{version}, ! \var{machine}, \var{processor})} identifying the underlying ! platform. Note that unlike the \function{os.uname()} function this also returns *************** *** 139,175 **** \end{funcdesc} \subsection{Java Platform} ! \begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''), osinfo=('','','')} ! Version interface for JPython. ! ! Returns a tuple \code{(release, vendor, vminfo, osinfo)} with vminfo being ! a tuple \code{(vm_name, vm_release, vm_vendor)} and osinfo being a ! tuple \code{(os_name, os_version, os_arch)}. ! ! Values which cannot be determined are set to the defaults ! given as parameters (which all default to \code{''}). \end{funcdesc} \subsection{Windows Platform} \begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''} ! Get additional version information from the Windows Registry ! and return a tuple \code{(version, csd, ptype)} referring to version ! number, CSD level and OS type (multi/single processor). ! ! As a hint: ptype returns \code{'Uniprocessor Free'} on single ! processor NT machines and \code{'Multiprocessor Free'} on multi ! processor machines. The \emph{'Free'} refers to the OS version being ! free of debugging code. It could also state \emph{'Checked'} which ! means the OS version uses debugging code, i.e. code that ! checks arguments, ranges, etc. ! \begin{notice}[note] ! This function only works if Mark Hammond's \module{win32all} ! package is installed and (obviously) only runs on Win32 ! compatible platforms. ! \end{notice} \end{funcdesc} --- 131,170 ---- \end{funcdesc} + \subsection{Java Platform} ! \begin{funcdesc}{java_ver}{release='', vendor='', vminfo=('','',''), ! osinfo=('','','')} ! Version interface for JPython. ! ! Returns a tuple \code{(\var{release}, \var{vendor}, \var{vminfo}, ! \var{osinfo})} with \var{vminfo} being a tuple \code{(\var{vm_name}, ! \var{vm_release}, \var{vm_vendor})} and \var{osinfo} being a tuple ! \code{(\var{os_name}, \var{os_version}, \var{os_arch})}. ! Values which cannot be determined are set to the defaults ! given as parameters (which all default to \code{''}). \end{funcdesc} + \subsection{Windows Platform} \begin{funcdesc}{win32_ver}{release='', version='', csd='', ptype=''} ! Get additional version information from the Windows Registry ! and return a tuple \code{(\var{version}, \var{csd}, \var{ptype})} ! referring to version number, CSD level and OS type (multi/single ! processor). ! As a hint: \var{ptype} is \code{'Uniprocessor Free'} on single ! processor NT machines and \code{'Multiprocessor Free'} on multi ! processor machines. The \emph{'Free'} refers to the OS version being ! free of debugging code. It could also state \emph{'Checked'} which ! means the OS version uses debugging code, i.e. code that ! checks arguments, ranges, etc. + \begin{notice}[note] + This function only works if Mark Hammond's \module{win32all} + package is installed and (obviously) only runs on Win32 + compatible platforms. + \end{notice} \end{funcdesc} *************** *** 177,223 **** \begin{funcdesc}{popen}{cmd, mode='r', bufsize=None} ! Portable \function{popen()} interface. ! Find a working popen implementation preferring \function{win32pipe.popen}. ! On NT \function{win32pipe} should work; on Win9x ! it hangs due to bugs in the MS C lib. ! \seetext{MS KnowledgeBase article Q150956.} \end{funcdesc} ! \subsection{Mac Platform} \begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''} ! Get MacOS version information and return it as tuple \code{(release, ! versioninfo, machine)} with versioninfo being a tuple \code{(version, ! dev_stage, non_release_version)}. ! ! Entries which cannot be determined are set to \code{''}. All tuple ! entries are strings. ! Documentation for the underlying gestalt() API is available online ! at \url{http://www.rgaros.nl/gestalt/} \end{funcdesc} \subsection{\UNIX{} Platforms} ! \begin{funcdesc}{dist}{distname='',version='',id='',supported_dists=('SuSE','debian','redhat','mandrake')} ! Tries to determine the name of the OS distribution name ! ! Returns a tuple \code{(distname, version, id)} which defaults to the ! args given as parameters. \end{funcdesc} ! \begin{funcdesc}{libc_ver}{executable=sys.executable, lib='', version='', chunksize=2048} ! Tries to determine the libc version against which the ! file executable (defaults to the Python interpreter) is linked. ! ! Returns a tuple of strings \code{(lib, version)} which default to the ! given parameters in case the lookup fails. ! Note that the function has intimate knowledge of how different libc versions add symbols to the executable is probably only ! useable for executables compiled using \emph{gcc}. ! The file is read and scanned in chunks of chunksize bytes. \end{funcdesc} --- 172,221 ---- \begin{funcdesc}{popen}{cmd, mode='r', bufsize=None} ! Portable \function{popen()} interface. Find a working popen ! implementation preferring \function{win32pipe.popen()}. On Windows ! NT, \function{win32pipe.popen()} should work; on Windows 9x it hangs ! due to bugs in the MS C library. ! % This KnowledgeBase article appears to be missing... ! %See also \ulink{MS KnowledgeBase article Q150956}{}. \end{funcdesc} ! \subsection{Mac OS Platform} \begin{funcdesc}{mac_ver}{release='', versioninfo=('','',''), machine=''} ! Get Mac OS version information and return it as tuple ! \code{(\var{release}, \var{versioninfo}, \var{machine})} with ! \var{versioninfo} being a tuple \code{(\var{version}, ! \var{dev_stage}, \var{non_release_version})}. ! Entries which cannot be determined are set to \code{''}. All tuple ! entries are strings. ! ! Documentation for the underlying \cfunction{gestalt()} API is ! available online at \url{http://www.rgaros.nl/gestalt/}. \end{funcdesc} + \subsection{\UNIX{} Platforms} ! \begin{funcdesc}{dist}{distname='', version='', id='', ! supported_dists=('SuSE','debian','redhat','mandrake')} ! Tries to determine the name of the OS distribution name ! Returns a tuple \code{(\var{distname}, \var{version}, \var{id})} ! which defaults to the args given as parameters. \end{funcdesc} ! \begin{funcdesc}{libc_ver}{executable=sys.executable, lib='', ! version='', chunksize=2048} ! Tries to determine the libc version against which the file ! executable (defaults to the Python interpreter) is linked. Returns ! a tuple of strings \code{(\var{lib}, \var{version})} which default ! to the given parameters in case the lookup fails. ! Note that this function has intimate knowledge of how different libc versions add symbols to the executable is probably only ! useable for executables compiled using \program{gcc}. ! The file is read and scanned in chunks of \var{chunksize} bytes. \end{funcdesc} From fdrake at acm.org Tue Oct 21 14:04:38 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Oct 21 14:04:49 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libplatform.tex, 1.1, 1.2 In-Reply-To: References: Message-ID: <16277.30006.67329.572905@grendel.zope.com> fdrake@users.sourceforge.net writes: > Modified Files: > libplatform.tex > Log Message: > - make this section format > - start cleaning up the markup for consistency > - comment out the reference to a MS KnowledgeBase article that doesn't > seem to be present at msdn.microsoft.com; hopefully someone can > point out an alternate source for the relevant information I forgot to mention in the checkin message that this is *not* ready to be backported to the 2.3.x maintenance branch yet. I hope to make another substantial pass through this later this week. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From jhylton at users.sourceforge.net Tue Oct 21 14:07:10 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Oct 21 14:07:15 2003 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.55,1.56 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv15593 Modified Files: urllib2.py Log Message: Apply patch 823328 -- support for rfc 2617 digestion authentication. The patch was tweaked slightly. It's get a different mechanism for generating the cnonce which uses /dev/urandom when possible to generate less-easily-guessed random input. Also rearrange the imports so that they are alphabetical and duplicates are eliminated. Add a few XXX comments about things left undone and things that could be improved. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** urllib2.py 20 Oct 2003 14:01:50 -0000 1.55 --- urllib2.py 21 Oct 2003 18:07:07 -0000 1.56 *************** *** 88,107 **** # check digest against correct (i.e. non-apache) implementation ! import socket import httplib import inspect - import re - import base64 - import urlparse import md5 import mimetypes import mimetools import rfc822 ! import ftplib import sys import time ! import os ! import gopherlib ! import posixpath try: --- 88,109 ---- # check digest against correct (i.e. non-apache) implementation ! import base64 ! import ftplib ! import gopherlib import httplib import inspect import md5 import mimetypes import mimetools + import os + import posixpath + import random + import re import rfc822 ! import sha ! import socket import sys import time ! import urlparse try: *************** *** 110,119 **** from StringIO import StringIO - try: - import sha - except ImportError: - # need 1.5.2 final - sha = None - # not sure how many of these need to be gotten rid of from urllib import unwrap, unquote, splittype, splithost, \ --- 112,115 ---- *************** *** 121,131 **** splitattr, ftpwrapper, noheaders ! # support for proxies via environment variables ! from urllib import getproxies ! ! # support for FileHandler ! from urllib import localhost, url2pathname ! __version__ = "2.0a1" _opener = None --- 117,124 ---- splitattr, ftpwrapper, noheaders ! # support for FileHandler, proxies via environment variables ! from urllib import localhost, url2pathname, getproxies ! __version__ = "2.1" _opener = None *************** *** 681,685 **** --- 674,701 ---- + def randombytes(n): + """Return n random bytes.""" + # Use /dev/urandom if it is available. Fall back to random module + # if not. It might be worthwhile to extend this function to use + # other platform-specific mechanisms for getting random bytes. + if os.path.exists("/dev/urandom"): + f = open("/dev/urandom") + s = f.read(n) + f.close() + return s + else: + L = [chr(random.randrange(0, 256)) for i in range(n)] + return "".join(L) + class AbstractDigestAuthHandler: + # Digest authentication is specified in RFC 2617. + + # XXX The client does not inspect the Authentication-Info header + # in a successful response. + + # XXX It should be possible to test this implementation against + # a mock server that just generates a static set of challenges. + + # XXX qop="auth-int" supports is shaky def __init__(self, passwd=None): *************** *** 688,698 **** self.passwd = passwd self.add_password = self.passwd.add_password ! def http_error_auth_reqed(self, authreq, host, req, headers): ! authreq = headers.get(self.auth_header, None) if authreq: ! kind = authreq.split()[0] ! if kind == 'Digest': return self.retry_http_digest_auth(req, authreq) def retry_http_digest_auth(self, req, auth): --- 704,732 ---- self.passwd = passwd self.add_password = self.passwd.add_password + self.retried = 0 + self.nonce_count = 0 ! def reset_retry_count(self): ! self.retried = 0 ! ! def http_error_auth_reqed(self, auth_header, host, req, headers): ! authreq = headers.get(auth_header, None) ! if self.retried > 5: ! # Don't fail endlessly - if we failed once, we'll probably ! # fail a second time. Hm. Unless the Password Manager is ! # prompting for the information. Crap. This isn't great ! # but it's better than the current 'repeat until recursion ! # depth exceeded' approach ! raise HTTPError(req.get_full_url(), 401, "digest auth failed", ! headers, None) ! else: ! self.retried += 1 if authreq: ! scheme = authreq.split()[0] ! if scheme.lower() == 'digest': return self.retry_http_digest_auth(req, authreq) + else: + raise ValueError("AbstractDigestAuthHandler doesn't know " + "about %s"%(scheme)) def retry_http_digest_auth(self, req, auth): *************** *** 708,715 **** --- 742,760 ---- return resp + def get_cnonce(self, nonce): + # The cnonce-value is an opaque + # quoted string value provided by the client and used by both client + # and server to avoid chosen plaintext attacks, to provide mutual + # authentication, and to provide some message integrity protection. + # This isn't a fabulous effort, but it's probably Good Enough. + dig = sha.new("%s:%s:%s:%s" % (self.nonce_count, nonce, time.ctime(), + randombytes(8))).hexdigest() + return dig[:16] + def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] + qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't *************** *** 723,728 **** return None ! user, pw = self.passwd.find_user_password(realm, ! req.get_full_url()) if user is None: return None --- 768,772 ---- return None ! user, pw = self.passwd.find_user_password(realm, req.get_full_url()) if user is None: return None *************** *** 738,742 **** # XXX selector: what about proxies and full urls req.get_selector()) ! respdig = KD(H(A1), "%s:%s" % (nonce, H(A2))) # XXX should the partial digests be encoded too? --- 782,797 ---- # XXX selector: what about proxies and full urls req.get_selector()) ! if qop == 'auth': ! self.nonce_count += 1 ! ncvalue = '%08x' % self.nonce_count ! cnonce = self.get_cnonce(nonce) ! noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, H(A2)) ! respdig = KD(H(A1), noncebit) ! elif qop is None: ! respdig = KD(H(A1), "%s:%s" % (nonce, H(A2))) ! else: ! # XXX handle auth-int. ! pass ! # XXX should the partial digests be encoded too? *************** *** 750,753 **** --- 805,810 ---- if algorithm != 'MD5': base = base + ', algorithm="%s"' % algorithm + if qop: + base = base + ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce) return base *************** *** 755,763 **** # lambdas assume digest modules are imported at the top level if algorithm == 'MD5': ! H = lambda x, e=encode_digest:e(md5.new(x).digest()) elif algorithm == 'SHA': ! H = lambda x, e=encode_digest:e(sha.new(x).digest()) # XXX MD5-sess ! KD = lambda s, d, H=H: H("%s:%s" % (s, d)) return H, KD --- 812,820 ---- # lambdas assume digest modules are imported at the top level if algorithm == 'MD5': ! H = lambda x: md5.new(x).hexdigest() elif algorithm == 'SHA': ! H = lambda x: sha.new(x).hexdigest() # XXX MD5-sess ! KD = lambda s, d: H("%s:%s" % (s, d)) return H, KD *************** *** 778,782 **** def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] ! self.http_error_auth_reqed('www-authenticate', host, req, headers) --- 835,842 ---- def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] ! retry = self.http_error_auth_reqed('www-authenticate', ! host, req, headers) ! self.reset_retry_count() ! return retry *************** *** 787,802 **** def http_error_407(self, req, fp, code, msg, headers): host = req.get_host() ! self.http_error_auth_reqed('proxy-authenticate', host, req, headers) ! ! ! def encode_digest(digest): ! hexrep = [] ! for c in digest: ! n = (ord(c) >> 4) & 0xf ! hexrep.append(hex(n)[-1]) ! n = ord(c) & 0xf ! hexrep.append(hex(n)[-1]) ! return ''.join(hexrep) ! class AbstractHTTPHandler(BaseHandler): --- 847,854 ---- def http_error_407(self, req, fp, code, msg, headers): host = req.get_host() ! retry = self.http_error_auth_reqed('proxy-authenticate', ! host, req, headers) ! self.reset_retry_count() ! return retry class AbstractHTTPHandler(BaseHandler): From jhylton at users.sourceforge.net Tue Oct 21 14:10:30 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Oct 21 14:10:34 2003 Subject: [Python-checkins] python/dist/src/Objects frameobject.c,2.74,2.75 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv16326 Modified Files: frameobject.c Log Message: Fix indentation. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.74 retrieving revision 2.75 diff -C2 -d -r2.74 -r2.75 *** frameobject.c 11 Aug 2003 16:14:06 -0000 2.74 --- frameobject.c 21 Oct 2003 18:10:28 -0000 2.75 *************** *** 745,749 **** j = f->f_nlocals; if (f->f_nlocals) ! map_to_dict(map, j, locals, fast, 0); if (f->f_ncells || f->f_nfreevars) { if (!(PyTuple_Check(f->f_code->co_cellvars) --- 745,749 ---- j = f->f_nlocals; if (f->f_nlocals) ! map_to_dict(map, j, locals, fast, 0); if (f->f_ncells || f->f_nfreevars) { if (!(PyTuple_Check(f->f_code->co_cellvars) From jhylton at users.sourceforge.net Tue Oct 21 14:14:23 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Oct 21 14:14:25 2003 Subject: [Python-checkins] python/dist/src/Objects frameobject.c,2.75,2.76 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv16884 Modified Files: frameobject.c Log Message: Removing bogus Py_DECREF() reported by Armin Rigo (SF bug 812353). Even if a new dict is generated for locals, it is stored in f->f_locals. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.75 retrieving revision 2.76 diff -C2 -d -r2.75 -r2.76 *** frameobject.c 21 Oct 2003 18:10:28 -0000 2.75 --- frameobject.c 21 Oct 2003 18:14:20 -0000 2.76 *************** *** 749,753 **** if (!(PyTuple_Check(f->f_code->co_cellvars) && PyTuple_Check(f->f_code->co_freevars))) { - Py_DECREF(locals); return; } --- 749,752 ---- From jhylton at users.sourceforge.net Tue Oct 21 14:15:46 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Oct 21 14:15:51 2003 Subject: [Python-checkins] python/dist/src/Objects frameobject.c, 2.73, 2.73.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv17150 Modified Files: Tag: release23-maint frameobject.c Log Message: Backport removal of bogus Py_DECREF() and indentation fix. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.73 retrieving revision 2.73.14.1 diff -C2 -d -r2.73 -r2.73.14.1 *** frameobject.c 5 Feb 2003 22:39:29 -0000 2.73 --- frameobject.c 21 Oct 2003 18:15:44 -0000 2.73.14.1 *************** *** 745,753 **** j = f->f_nlocals; if (f->f_nlocals) ! map_to_dict(map, j, locals, fast, 0); if (f->f_ncells || f->f_nfreevars) { if (!(PyTuple_Check(f->f_code->co_cellvars) && PyTuple_Check(f->f_code->co_freevars))) { - Py_DECREF(locals); return; } --- 745,752 ---- j = f->f_nlocals; if (f->f_nlocals) ! map_to_dict(map, j, locals, fast, 0); if (f->f_ncells || f->f_nfreevars) { if (!(PyTuple_Check(f->f_code->co_cellvars) && PyTuple_Check(f->f_code->co_freevars))) { return; } From rhettinger at users.sourceforge.net Tue Oct 21 14:42:23 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 21 14:42:31 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.207,1.208 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv22613 Modified Files: tut.tex Log Message: Don't make promises about about the visibility of the induction variable. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** tut.tex 19 Oct 2003 07:32:24 -0000 1.207 --- tut.tex 21 Oct 2003 18:42:21 -0000 1.208 *************** *** 1950,1965 **** \end{verbatim} - To make list comprehensions match the behavior of \keyword{for} - loops, assignments to the loop variable remain visible outside - of the comprehension: - - \begin{verbatim} - >>> x = 100 # this gets overwritten - >>> [x**3 for x in range(5)] - [0, 1, 8, 27, 64] - >>> x # the final value for range(5) - 4 - \end{verbatim} - \section{The \keyword{del} statement \label{del}} --- 1950,1953 ---- From rhettinger at users.sourceforge.net Tue Oct 21 14:43:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 21 14:43:23 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.6, 1.196.8.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv22739 Modified Files: Tag: release23-maint tut.tex Log Message: Don't make promises about about the visibility of the induction variable. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.6 retrieving revision 1.196.8.7 diff -C2 -d -r1.196.8.6 -r1.196.8.7 *** tut.tex 19 Oct 2003 07:31:15 -0000 1.196.8.6 --- tut.tex 21 Oct 2003 18:43:15 -0000 1.196.8.7 *************** *** 1939,1954 **** \end{verbatim} - To make list comprehensions match the behavior of \keyword{for} - loops, assignments to the loop variable remain visible outside - of the comprehension: - - \begin{verbatim} - >>> x = 100 # this gets overwritten - >>> [x**3 for x in range(5)] - [0, 1, 8, 27, 64] - >>> x # the final value for range(5) - 4 - \end{verbatim} - \section{The \keyword{del} statement \label{del}} --- 1939,1942 ---- From fdrake at users.sourceforge.net Tue Oct 21 16:01:26 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 16:01:46 2003 Subject: [Python-checkins] python/dist/src setup.py,1.171.6.1,1.171.6.2 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv6819 Modified Files: Tag: release23-maint setup.py Log Message: Provide a bit more information to the compiler when building Expat. This avoids having to modify the Expat sources in any way starting with Expat 1.95.7. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.171.6.1 retrieving revision 1.171.6.2 diff -C2 -d -r1.171.6.1 -r1.171.6.2 *** setup.py 22 Sep 2003 01:19:45 -0000 1.171.6.1 --- setup.py 21 Oct 2003 20:01:21 -0000 1.171.6.2 *************** *** 738,756 **** xmlbo = "4321" expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') ! exts.append(Extension('pyexpat', ! sources = [ ! 'pyexpat.c', ! 'expat/xmlparse.c', ! 'expat/xmlrole.c', ! 'expat/xmltok.c', ! ], ! define_macros = [ ('XML_NS', '1'), ('XML_DTD', '1'), ('BYTEORDER', xmlbo), ('XML_CONTEXT_BYTES','1024'), ! ], ! include_dirs = [expatinc] ! )) # Dynamic loading module --- 738,761 ---- xmlbo = "4321" expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') ! define_macros = [ ('XML_NS', '1'), ('XML_DTD', '1'), ('BYTEORDER', xmlbo), ('XML_CONTEXT_BYTES','1024'), ! ] ! config_h = sysconfig.get_config_h_filename() ! config_h_vars = sysconfig.parse_config_h(open(config_h)) ! for feature_macro in ['HAVE_MEMMOVE', 'HAVE_BCOPY']: ! if config_h_vars.has_key(feature_macro): ! define_macros.append((feature_macro, '1')) ! exts.append(Extension('pyexpat', ! define_macros = define_macros, ! include_dirs = [expatinc], ! sources = ['pyexpat.c', ! 'expat/xmlparse.c', ! 'expat/xmlrole.c', ! 'expat/xmltok.c', ! ], ! )) # Dynamic loading module From fdrake at users.sourceforge.net Tue Oct 21 16:02:38 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 16:02:41 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory sc8-pr-cvs1:/tmp/cvs-serv7002 Modified Files: Tag: release23-maint asciitab.h expat.h iasciitab.h internal.h latin1tab.h utf8tab.h winconfig.h xmlparse.c xmlrole.c xmltok.c xmltok_impl.c Added Files: Tag: release23-maint macconfig.h Removed Files: Tag: release23-maint expat.h.in Log Message: Update to Expat 1.95.7; there are no changes to the Expat sources. --- NEW FILE: macconfig.h --- /*================================================================ ** Copyright 2000, Clark Cooper ** All rights reserved. ** ** This is free software. You are permitted to copy, distribute, or modify ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) ** */ #ifndef MACCONFIG_H #define MACCONFIG_H /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ #define BYTEORDER 4321 /* Define to 1 if you have the `bcopy' function. */ #undef HAVE_BCOPY /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #define HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS /* whether byteorder is bigendian */ #define WORDS_BIGENDIAN /* Define to specify how much context to retain around the current parse point. */ #undef XML_CONTEXT_BYTES /* Define to make parameter entity parsing functionality available. */ #define XML_DTD /* Define to make XML Namespaces functionality available. */ #define XML_NS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `long' if does not define. */ #define off_t long /* Define to `unsigned' if does not define. */ #undef size_t #endif /* ifndef MACCONFIG_H */ Index: asciitab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/asciitab.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.16.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.16.1 *** asciitab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- asciitab.h 21 Oct 2003 20:02:33 -0000 1.1.1.1.16.1 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: expat.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/expat.h,v retrieving revision 1.5 retrieving revision 1.5.12.1 diff -C2 -d -r1.5 -r1.5.12.1 *** expat.h 7 Feb 2003 02:15:56 -0000 1.5 --- expat.h 21 Oct 2003 20:02:34 -0000 1.5.12.1 *************** *** 17,31 **** #include - #ifndef XMLPARSEAPI #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) ! #ifdef XML_STATIC ! #define XMLPARSEAPI(type) type __cdecl ! #else ! #define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl #endif #else ! #define XMLPARSEAPI(type) type #endif ! #endif /* not defined XMLPARSEAPI */ #ifdef __cplusplus --- 17,85 ---- #include #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) ! #define XML_USE_MSC_EXTENSIONS 1 #endif + + /* Expat tries very hard to make the API boundary very specifically + defined. There are two macros defined to control this boundary; + each of these can be defined before including this header to + achieve some different behavior, but doing so it not recommended or + tested frequently. + + XMLCALL - The calling convention to use for all calls across the + "library boundary." This will default to cdecl, and + try really hard to tell the compiler that's what we + want. + + XMLIMPORT - Whatever magic is needed to note that a function is + to be imported from a dynamically loaded library + (.dll, .so, or .sl, depending on your platform). + + The XMLCALL macro was added in Expat 1.95.7. The only one which is + expected to be directly useful in client code is XMLCALL. + + Note that on at least some Unix versions, the Expat library must be + compiled with the cdecl calling convention as the default since + system headers may assume the cdecl convention. + */ + #ifndef XMLCALL + #if defined(XML_USE_MSC_EXTENSIONS) + #define XMLCALL __cdecl + #elif defined(__GNUC__) + #define XMLCALL __attribute__((cdecl)) #else ! /* For any platform which uses this definition and supports more than ! one calling convention, we need to extend this definition to ! declare the convention used on that platform, if it's possible to ! do so. ! ! If this is the case for your platform, please file a bug report ! with information on how to identify your platform via the C ! pre-processor and how to specify the same calling convention as the ! platform's malloc() implementation. ! */ ! #define XMLCALL #endif ! #endif /* not defined XMLCALL */ ! ! ! #if !defined(XML_STATIC) && !defined(XMLIMPORT) ! #ifndef XML_BUILDING_EXPAT ! /* using Expat from an application */ ! ! #ifdef XML_USE_MSC_EXTENSIONS ! #define XMLIMPORT __declspec(dllimport) ! #endif ! ! #endif ! #endif /* not defined XML_STATIC */ ! ! /* If we didn't define it above, define it away: */ ! #ifndef XMLIMPORT ! #define XMLIMPORT ! #endif ! ! ! #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL #ifdef __cplusplus *************** *** 105,109 **** XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, ! XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING }; --- 159,164 ---- XML_ERROR_ENTITY_DECLARED_IN_PE, XML_ERROR_FEATURE_REQUIRES_XML_DTD, ! XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING, ! XML_ERROR_UNBOUND_PREFIX }; *************** *** 157,163 **** to free model when finished with it. */ ! typedef void (*XML_ElementDeclHandler) (void *userData, ! const XML_Char *name, ! XML_Content *model); XMLPARSEAPI(void) --- 212,218 ---- to free model when finished with it. */ ! typedef void (XMLCALL *XML_ElementDeclHandler) (void *userData, ! const XML_Char *name, ! XML_Content *model); XMLPARSEAPI(void) *************** *** 173,182 **** true and default is non-NULL, then this is a "#FIXED" default. */ ! typedef void (*XML_AttlistDeclHandler) (void *userData, ! const XML_Char *elname, ! const XML_Char *attname, ! const XML_Char *att_type, ! const XML_Char *dflt, ! int isrequired); XMLPARSEAPI(void) --- 228,238 ---- true and default is non-NULL, then this is a "#FIXED" default. */ ! typedef void (XMLCALL *XML_AttlistDeclHandler) ( ! void *userData, ! const XML_Char *elname, ! const XML_Char *attname, ! const XML_Char *att_type, ! const XML_Char *dflt, ! int isrequired); XMLPARSEAPI(void) *************** *** 192,199 **** as no, or that it was given as yes. */ ! typedef void (*XML_XmlDeclHandler) (void *userData, ! const XML_Char *version, ! const XML_Char *encoding, ! int standalone); XMLPARSEAPI(void) --- 248,255 ---- as no, or that it was given as yes. */ ! typedef void (XMLCALL *XML_XmlDeclHandler) (void *userData, ! const XML_Char *version, ! const XML_Char *encoding, ! int standalone); XMLPARSEAPI(void) *************** *** 203,209 **** typedef struct { ! void *(*malloc_fcn)(size_t size); ! void *(*realloc_fcn)(void *ptr, size_t size); ! void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; --- 259,265 ---- typedef struct { ! void *(XMLCALL *malloc_fcn)(size_t size); ! void *(XMLCALL *realloc_fcn)(void *ptr, size_t size); ! void (XMLCALL *free_fcn)(void *ptr); } XML_Memory_Handling_Suite; *************** *** 258,284 **** names and values are 0 terminated. */ ! typedef void (*XML_StartElementHandler)(void *userData, ! const XML_Char *name, ! const XML_Char **atts); ! typedef void (*XML_EndElementHandler)(void *userData, ! const XML_Char *name); /* s is not 0 terminated. */ ! typedef void (*XML_CharacterDataHandler)(void *userData, ! const XML_Char *s, ! int len); /* target and data are 0 terminated */ ! typedef void (*XML_ProcessingInstructionHandler)(void *userData, ! const XML_Char *target, ! const XML_Char *data); /* data is 0 terminated */ ! typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); ! typedef void (*XML_StartCdataSectionHandler)(void *userData); ! typedef void (*XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which --- 314,342 ---- names and values are 0 terminated. */ ! typedef void (XMLCALL *XML_StartElementHandler) (void *userData, ! const XML_Char *name, ! const XML_Char **atts); ! typedef void (XMLCALL *XML_EndElementHandler) (void *userData, ! const XML_Char *name); /* s is not 0 terminated. */ ! typedef void (XMLCALL *XML_CharacterDataHandler) (void *userData, ! const XML_Char *s, ! int len); /* target and data are 0 terminated */ ! typedef void (XMLCALL *XML_ProcessingInstructionHandler) ( ! void *userData, ! const XML_Char *target, ! const XML_Char *data); /* data is 0 terminated */ ! typedef void (XMLCALL *XML_CommentHandler) (void *userData, ! const XML_Char *data); ! typedef void (XMLCALL *XML_StartCdataSectionHandler) (void *userData); ! typedef void (XMLCALL *XML_EndCdataSectionHandler) (void *userData); /* This is called for any characters in the XML document for which *************** *** 295,306 **** multiple calls. */ ! typedef void (*XML_DefaultHandler)(void *userData, ! const XML_Char *s, ! int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ ! typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, --- 353,365 ---- multiple calls. */ ! typedef void (XMLCALL *XML_DefaultHandler) (void *userData, ! const XML_Char *s, ! int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ ! typedef void (XMLCALL *XML_StartDoctypeDeclHandler) ( ! void *userData, const XML_Char *doctypeName, const XML_Char *sysid, *************** *** 312,316 **** subset. */ ! typedef void (*XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity --- 371,375 ---- subset. */ ! typedef void (XMLCALL *XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity *************** *** 332,344 **** that would break binary compatibility. */ ! typedef void (*XML_EntityDeclHandler) (void *userData, ! const XML_Char *entityName, ! int is_parameter_entity, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); XMLPARSEAPI(void) --- 391,404 ---- that would break binary compatibility. */ ! typedef void (XMLCALL *XML_EntityDeclHandler) ( ! void *userData, ! const XML_Char *entityName, ! int is_parameter_entity, ! const XML_Char *value, ! int value_length, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); XMLPARSEAPI(void) *************** *** 355,364 **** NULL. The other arguments may be. */ ! typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, ! const XML_Char *entityName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is --- 415,425 ---- NULL. The other arguments may be. */ ! typedef void (XMLCALL *XML_UnparsedEntityDeclHandler) ( ! void *userData, ! const XML_Char *entityName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId, ! const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is *************** *** 366,374 **** NULL. The other arguments can be. */ ! typedef void (*XML_NotationDeclHandler)(void *userData, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* When namespace processing is enabled, these are called once for --- 427,436 ---- NULL. The other arguments can be. */ ! typedef void (XMLCALL *XML_NotationDeclHandler) ( ! void *userData, ! const XML_Char *notationName, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* When namespace processing is enabled, these are called once for *************** *** 378,387 **** NULL. For an xmlns="" attribute, uri will be NULL. */ ! typedef void (*XML_StartNamespaceDeclHandler)(void *userData, ! const XML_Char *prefix, ! const XML_Char *uri); ! typedef void (*XML_EndNamespaceDeclHandler)(void *userData, ! const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an --- 440,451 ---- NULL. For an xmlns="" attribute, uri will be NULL. */ ! typedef void (XMLCALL *XML_StartNamespaceDeclHandler) ( ! void *userData, ! const XML_Char *prefix, ! const XML_Char *uri); ! typedef void (XMLCALL *XML_EndNamespaceDeclHandler) ( ! void *userData, ! const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an *************** *** 394,398 **** entity was actually read. */ ! typedef int (*XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general --- 458,462 ---- entity was actually read. */ ! typedef int (XMLCALL *XML_NotStandaloneHandler) (void *userData); /* This is called for a reference to an external parsed general *************** *** 430,438 **** not userData. */ ! typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* This is called in two situations: --- 494,503 ---- not userData. */ ! typedef int (XMLCALL *XML_ExternalEntityRefHandler) ( ! XML_Parser parser, ! const XML_Char *context, ! const XML_Char *base, ! const XML_Char *systemId, ! const XML_Char *publicId); /* This is called in two situations: *************** *** 446,452 **** declarations or attribute values */ ! typedef void (*XML_SkippedEntityHandler)(void *userData, ! const XML_Char *entityName, ! int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to --- 511,518 ---- declarations or attribute values */ ! typedef void (XMLCALL *XML_SkippedEntityHandler) ( ! void *userData, ! const XML_Char *entityName, ! int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to *************** *** 505,510 **** int map[256]; void *data; ! int (*convert)(void *data, const char *s); ! void (*release)(void *data); } XML_Encoding; --- 571,576 ---- int map[256]; void *data; ! int (XMLCALL *convert)(void *data, const char *s); ! void (XMLCALL *release)(void *data); } XML_Encoding; *************** *** 524,530 **** return an XML_UNKNOWN_ENCODING error. */ ! typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, ! const XML_Char *name, ! XML_Encoding *info); XMLPARSEAPI(void) --- 590,597 ---- return an XML_UNKNOWN_ENCODING error. */ ! typedef int (XMLCALL *XML_UnknownEncodingHandler) ( ! void *encodingHandlerData, ! const XML_Char *name, ! XML_Encoding *info); XMLPARSEAPI(void) *************** *** 814,819 **** /* These functions return information about the current parse location. They may be called from any callback called to report ! some parse event; in this case the location is the location of ! the first of the sequence of characters that generated the event. They may also be called after returning from a call to XML_Parse --- 881,891 ---- /* These functions return information about the current parse location. They may be called from any callback called to report ! some parse event; in this case the location is the location of the ! first of the sequence of characters that generated the event. When ! called from callbacks generated by declarations in the document ! prologue, the location identified isn't as neatly defined, but will ! be within the relevant markup. When called outside of the callback ! functions, the position indicated will be just past the last parse ! event (regardless of whether there was an associated callback). They may also be called after returning from a call to XML_Parse *************** *** 921,925 **** #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 6 #ifdef __cplusplus --- 993,997 ---- #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 ! #define XML_MICRO_VERSION 7 #ifdef __cplusplus Index: iasciitab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/iasciitab.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.16.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.16.1 *** iasciitab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- iasciitab.h 21 Oct 2003 20:02:34 -0000 1.1.1.1.16.1 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: internal.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/internal.h,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 *** internal.h 25 Jan 2003 22:41:29 -0000 1.1 --- internal.h 21 Oct 2003 20:02:34 -0000 1.1.14.1 *************** *** 21,35 **** */ ! #if defined(__GNUC__) ! /* Instability reported with egcs on a RedHat Linux 7.3. ! Let's comment it out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) - #define PTRCALL #define PTRFASTCALL __attribute__((regparm(3))) - #elif defined(WIN32) /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for --- 21,38 ---- */ ! #if defined(__GNUC__) && defined(__i386__) ! /* We'll use this version by default only where we know it helps. ! ! regparm() generates warnings on Solaris boxes. See SF bug #692878. ! ! Instability reported with egcs on a RedHat Linux 7.3. ! Let's comment out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) #define PTRFASTCALL __attribute__((regparm(3))) + #endif /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for *************** *** 39,47 **** the compiler cannot perform stack optimizations for call clusters. */ - #define FASTCALL - #define PTRCALL - #define PTRFASTCALL ! #endif #ifndef FASTCALL --- 42,47 ---- the compiler cannot perform stack optimizations for call clusters. */ ! /* Make sure all of these are defined if they aren't already. */ #ifndef FASTCALL Index: latin1tab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/latin1tab.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.16.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.16.1 *** latin1tab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- latin1tab.h 21 Oct 2003 20:02:34 -0000 1.1.1.1.16.1 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: utf8tab.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/utf8tab.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.16.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.16.1 *** utf8tab.h 11 Feb 2002 23:13:05 -0000 1.1.1.1 --- utf8tab.h 21 Oct 2003 20:02:34 -0000 1.1.1.1.16.1 *************** *** 1,5 **** ! /* ! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ --- 1,4 ---- ! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd ! See the file COPYING for copying permission. */ Index: winconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/winconfig.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.16.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.16.1 *** winconfig.h 11 Feb 2002 23:13:08 -0000 1.1.1.1 --- winconfig.h 21 Oct 2003 20:02:34 -0000 1.1.1.1.16.1 *************** *** 6,11 **** ** it under the terms of the MIT/X license (contained in the COPYING file ** with this distribution.) - ** - ** */ --- 6,9 ---- *************** *** 22,27 **** #define XML_NS 1 #define XML_DTD 1 - #define XML_BYTE_ORDER 12 #define XML_CONTEXT_BYTES 1024 #endif /* ndef WINCONFIG_H */ --- 20,30 ---- #define XML_NS 1 #define XML_DTD 1 #define XML_CONTEXT_BYTES 1024 + + /* we will assume all Windows platforms are little endian */ + #define BYTEORDER 1234 + + /* Windows has memmove() available. */ + #define HAVE_MEMMOVE #endif /* ndef WINCONFIG_H */ Index: xmlparse.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlparse.c,v retrieving revision 1.5 retrieving revision 1.5.12.1 diff -C2 -d -r1.5 -r1.5.12.1 *** xmlparse.c 28 Jan 2003 06:42:40 -0000 1.5 --- xmlparse.c 21 Oct 2003 20:02:34 -0000 1.5.12.1 *************** *** 6,38 **** #include /* memset(), memcpy() */ ! #ifdef COMPILED_FROM_DSP #include "winconfig.h" - #define XMLPARSEAPI(type) type __cdecl - #include "expat.h" - #undef XMLPARSEAPI - #elif defined(MACOS_CLASSIC) [...1671 lines suppressed...] --- 5649,5654 ---- pool->blocks = (BLOCK *) pool->mem->realloc_fcn(pool->blocks, ! (offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char))); if (pool->blocks == NULL) return XML_FALSE; *************** *** 5547,5551 **** blockSize *= 2; tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; --- 5666,5670 ---- blockSize *= 2; tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!tem) return XML_FALSE; Index: xmlrole.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.c,v retrieving revision 1.5 retrieving revision 1.5.12.1 diff -C2 -d -r1.5 -r1.5.12.1 *** xmlrole.c 25 Jan 2003 22:48:51 -0000 1.5 --- xmlrole.c 21 Oct 2003 20:02:35 -0000 1.5.12.1 *************** *** 8,14 **** #include "macconfig.h" #else ! /* Unused - MvL #include ! */ #endif /* ndef COMPILED_FROM_DSP */ --- 8,14 ---- #include "macconfig.h" #else ! #ifdef HAVE_EXPAT_CONFIG_H #include ! #endif #endif /* ndef COMPILED_FROM_DSP */ Index: xmltok.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.c,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -C2 -d -r1.3 -r1.3.12.1 *** xmltok.c 25 Jan 2003 22:41:29 -0000 1.3 --- xmltok.c 21 Oct 2003 20:02:35 -0000 1.3.12.1 *************** *** 8,14 **** #include "macconfig.h" #else ! /* Unused - MvL #include ! */ #endif /* ndef COMPILED_FROM_DSP */ --- 8,14 ---- #include "macconfig.h" #else ! #ifdef HAVE_EXPAT_CONFIG_H #include ! #endif #endif /* ndef COMPILED_FROM_DSP */ Index: xmltok_impl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok_impl.c,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** xmltok_impl.c 25 Jan 2003 22:41:29 -0000 1.2 --- xmltok_impl.c 21 Oct 2003 20:02:35 -0000 1.2.12.1 *************** *** 883,887 **** { if (ptr == end) ! return XML_TOK_PARTIAL; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) --- 883,887 ---- { if (ptr == end) ! return -XML_TOK_PERCENT; switch (BYTE_TYPE(enc, ptr)) { CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) --- expat.h.in DELETED --- From fdrake at users.sourceforge.net Tue Oct 21 16:02:49 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 16:02:52 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.63,1.831.4.64 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv7045 Modified Files: Tag: release23-maint NEWS Log Message: Note the update to Expat 1.95.7. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.63 retrieving revision 1.831.4.64 diff -C2 -d -r1.831.4.63 -r1.831.4.64 *** NEWS 14 Oct 2003 22:44:51 -0000 1.831.4.63 --- NEWS 21 Oct 2003 20:02:46 -0000 1.831.4.64 *************** *** 19,22 **** --- 19,24 ---- ----------------- + - The xml.parsers.expat module now provides Expat 1.95.7. + - Patch #813445: Add missing socket.IPPROTO_IPV6. From fdrake at users.sourceforge.net Tue Oct 21 22:57:25 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 23:23:29 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129.8.6, 1.129.8.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14483/Doc/lib Modified Files: Tag: release23-maint libstdtypes.tex Log Message: Avoid confusing name for the 3rd argument to str.replace(). This closes SF bug #827260. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129.8.6 retrieving revision 1.129.8.7 diff -C2 -d -r1.129.8.6 -r1.129.8.7 *** libstdtypes.tex 18 Oct 2003 09:54:38 -0000 1.129.8.6 --- libstdtypes.tex 22 Oct 2003 02:57:23 -0000 1.129.8.7 *************** *** 564,568 **** \code{'strict'}, meaning that encoding errors raise \exception{ValueError}. Other possible values are \code{'ignore'} and ! \code{replace'}. \versionadded{2.2} \end{methoddesc} --- 564,568 ---- \code{'strict'}, meaning that encoding errors raise \exception{ValueError}. Other possible values are \code{'ignore'} and ! \code{'replace'}. \versionadded{2.2} \end{methoddesc} *************** *** 665,672 **** \end{methoddesc} ! \begin{methoddesc}[string]{replace}{old, new\optional{, maxsplit}} Return a copy of the string with all occurrences of substring \var{old} replaced by \var{new}. If the optional argument ! \var{maxsplit} is given, only the first \var{maxsplit} occurrences are replaced. \end{methoddesc} --- 665,672 ---- \end{methoddesc} ! \begin{methoddesc}[string]{replace}{old, new\optional{, count}} Return a copy of the string with all occurrences of substring \var{old} replaced by \var{new}. If the optional argument ! \var{count} is given, only the first \var{count} occurrences are replaced. \end{methoddesc} From fdrake at users.sourceforge.net Tue Oct 21 22:57:25 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 23:23:33 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.209.8.2, 2.209.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv14483/Objects Modified Files: Tag: release23-maint stringobject.c Log Message: Avoid confusing name for the 3rd argument to str.replace(). This closes SF bug #827260. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.209.8.2 retrieving revision 2.209.8.3 diff -C2 -d -r2.209.8.2 -r2.209.8.3 *** stringobject.c 18 Oct 2003 09:54:38 -0000 2.209.8.2 --- stringobject.c 22 Oct 2003 02:57:23 -0000 2.209.8.3 *************** *** 2309,2317 **** PyDoc_STRVAR(replace__doc__, ! "S.replace (old, new[, maxsplit]) -> string\n\ \n\ Return a copy of string S with all occurrences of substring\n\ ! old replaced by new. If the optional argument maxsplit is\n\ ! given, only the first maxsplit occurrences are replaced."); static PyObject * --- 2309,2317 ---- PyDoc_STRVAR(replace__doc__, ! "S.replace (old, new[, count]) -> string\n\ \n\ Return a copy of string S with all occurrences of substring\n\ ! old replaced by new. If the optional argument count is\n\ ! given, only the first count occurrences are replaced."); static PyObject * From fdrake at users.sourceforge.net Tue Oct 21 22:56:42 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 23:23:36 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.137, 1.138 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14279/Doc/lib Modified Files: libstdtypes.tex Log Message: Avoid confusing name for the 3rd argument to str.replace(). This closes SF bug #827260. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** libstdtypes.tex 21 Oct 2003 17:04:21 -0000 1.137 --- libstdtypes.tex 22 Oct 2003 02:56:40 -0000 1.138 *************** *** 564,568 **** \code{'strict'}, meaning that encoding errors raise \exception{ValueError}. Other possible values are \code{'ignore'} and ! \code{replace'}. \versionadded{2.2} \end{methoddesc} --- 564,568 ---- \code{'strict'}, meaning that encoding errors raise \exception{ValueError}. Other possible values are \code{'ignore'} and ! \code{'replace'}. \versionadded{2.2} \end{methoddesc} *************** *** 665,672 **** \end{methoddesc} ! \begin{methoddesc}[string]{replace}{old, new\optional{, maxsplit}} Return a copy of the string with all occurrences of substring \var{old} replaced by \var{new}. If the optional argument ! \var{maxsplit} is given, only the first \var{maxsplit} occurrences are replaced. \end{methoddesc} --- 665,672 ---- \end{methoddesc} ! \begin{methoddesc}[string]{replace}{old, new\optional{, count}} Return a copy of the string with all occurrences of substring \var{old} replaced by \var{new}. If the optional argument ! \var{count} is given, only the first \var{count} occurrences are replaced. \end{methoddesc} From fdrake at users.sourceforge.net Tue Oct 21 22:56:42 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Oct 21 23:23:38 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.211, 2.212 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv14279/Objects Modified Files: stringobject.c Log Message: Avoid confusing name for the 3rd argument to str.replace(). This closes SF bug #827260. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.211 retrieving revision 2.212 diff -C2 -d -r2.211 -r2.212 *** stringobject.c 18 Oct 2003 09:55:08 -0000 2.211 --- stringobject.c 22 Oct 2003 02:56:39 -0000 2.212 *************** *** 2309,2317 **** PyDoc_STRVAR(replace__doc__, ! "S.replace (old, new[, maxsplit]) -> string\n\ \n\ Return a copy of string S with all occurrences of substring\n\ ! old replaced by new. If the optional argument maxsplit is\n\ ! given, only the first maxsplit occurrences are replaced."); static PyObject * --- 2309,2317 ---- PyDoc_STRVAR(replace__doc__, ! "S.replace (old, new[, count]) -> string\n\ \n\ Return a copy of string S with all occurrences of substring\n\ ! old replaced by new. If the optional argument count is\n\ ! given, only the first count occurrences are replaced."); static PyObject * From akuchling at users.sourceforge.net Wed Oct 22 09:48:29 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 09:48:33 2003 Subject: [Python-checkins] python/dist/src/Lib asyncore.py,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv12416 Modified Files: asyncore.py Log Message: [Bug #758241] When you use asyncore with a non-default map, methods of the dispatcher object break. e.g. if you close() the object, it tries to remove itself from the default map, not from the map the dispatcher was created with. The patch, from Stephane Ninin, records the map as an attribute of the dispatcher instance. 2.3 bugfix candidate. Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** asyncore.py 20 Oct 2003 14:01:49 -0000 1.41 --- asyncore.py 22 Oct 2003 13:48:27 -0000 1.42 *************** *** 202,205 **** --- 202,210 ---- def __init__(self, sock=None, map=None): + if map is None: + self._map = socket_map + else: + self._map = map + if sock: self.set_socket(sock, map) *************** *** 233,237 **** #self.log_info('adding channel %s' % self) if map is None: ! map = socket_map map[self._fileno] = self --- 238,242 ---- #self.log_info('adding channel %s' % self) if map is None: ! map = self._map map[self._fileno] = self *************** *** 239,243 **** fd = self._fileno if map is None: ! map = socket_map if map.has_key(fd): #self.log_info('closing channel %d:%s' % (fd, self)) --- 244,248 ---- fd = self._fileno if map is None: ! map = self._map if map.has_key(fd): #self.log_info('closing channel %d:%s' % (fd, self)) From akuchling at users.sourceforge.net Wed Oct 22 10:12:05 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 10:12:07 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libxmlrpclib.tex, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv17612 Modified Files: libxmlrpclib.tex Log Message: [Bug #809174] loads() and dumps() not documented Index: libxmlrpclib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmlrpclib.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libxmlrpclib.tex 25 Apr 2003 00:29:31 -0000 1.13 --- libxmlrpclib.tex 22 Oct 2003 14:12:03 -0000 1.14 *************** *** 265,268 **** --- 265,292 ---- \end{funcdesc} + \begin{funcdesc}{dumps}{params\optional{, methodname\optional{, + methodresponse\optional{, encoding\optional{, + allow_none}}}}} + + Convert \var{params} into an XML-RPC request. + or into a response if \var{methodresponse} is true. + \var{params} can be either a tuple of arguments or an instance of the + \exception{Fault} exception class. If \var{methodresponse} is true, + only a single value can be returned, meaning that \var{params} must be of length 1. + \var{encoding}, if supplied, is the encoding to use in the generated + XML; the default is UTF-8. Python's \constant{None} value cannot be + used in standard XML-RPC; to allow using it via an extension, + provide a true value for \var{allow_none}. + \end{funcdesc} + + \begin{funcdesc}{loads}{data} + Convert an XML-RPC request or response into Python objects, a + \code{(\var{params}, \var{methodname})}. \var{params} is a tuple of argument; \var{methodname} + is a string, or \code{None} if no method name is present in the packet. + If the XML-RPC packet represents a fault condition, this + function will raise a \exception{Fault} exception. + \end{funcdesc} + + \subsection{Example of Client Usage \label{xmlrpc-client-example}} From akuchling at users.sourceforge.net Wed Oct 22 10:38:29 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 10:38:33 2003 Subject: [Python-checkins] python/dist/src/Lib asyncore.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv23063a Modified Files: asyncore.py Log Message: [Part of patch #648322] Delete the poll2() function, which uses a 'poll' extension module that was once part of Medusa. Contributed by Kjetil Jacobsen Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** asyncore.py 22 Oct 2003 13:48:27 -0000 1.42 --- asyncore.py 22 Oct 2003 14:38:27 -0000 1.43 *************** *** 126,153 **** def poll2(timeout=0.0, map=None): - import poll - if map is None: - map = socket_map - if timeout is not None: - # timeout is in milliseconds - timeout = int(timeout*1000) - if map: - l = [] - for fd, obj in map.items(): - flags = 0 - if obj.readable(): - flags = poll.POLLIN - if obj.writable(): - flags = flags | poll.POLLOUT - if flags: - l.append((fd, flags)) - r = poll.poll(l, timeout) - for fd, flags in r: - obj = map.get(fd) - if obj is None: - continue - readwrite(obj, flags) - - def poll3(timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: --- 126,129 ---- *************** *** 178,190 **** readwrite(obj, flags) def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map ! if use_poll: ! if hasattr(select, 'poll'): ! poll_fun = poll3 ! else: ! poll_fun = poll2 else: poll_fun = poll --- 154,165 ---- readwrite(obj, flags) + poll3 = poll2 # Alias for backward compatibility + def loop(timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map ! if use_poll and hasattr(select, 'poll'): ! poll_fun = poll2 else: poll_fun = poll From akuchling at users.sourceforge.net Wed Oct 22 10:38:56 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 10:38:59 2003 Subject: [Python-checkins] python/dist/src/Lib cmd.py,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv23135 Modified Files: cmd.py Log Message: Add docstring Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cmd.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** cmd.py 19 Feb 2003 02:35:02 -0000 1.36 --- cmd.py 22 Oct 2003 14:38:54 -0000 1.37 *************** *** 170,173 **** --- 170,177 ---- def parseline(self, line): + """Parse the line into a command name and a string containing + the arguments. Returns a tuple containing (command, args, line). + 'command' and 'args' may be None if the line couldn't be parsed. + """ line = line.strip() if not line: From rhettinger at users.sourceforge.net Wed Oct 22 12:49:04 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 22 12:49:10 2003 Subject: [Python-checkins] python/dist/src/Lib profile.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv14109 Modified Files: profile.py Log Message: Replace a reduce() with sum(). Index: profile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/profile.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** profile.py 27 Feb 2003 20:14:38 -0000 1.48 --- profile.py 22 Oct 2003 16:49:01 -0000 1.49 *************** *** 185,191 **** # cases. import operator ! def get_time_timer(timer=timer, ! reduce=reduce, reducer=operator.add): ! return reduce(reducer, timer(), 0) self.get_time = get_time_timer self.t = self.get_time() --- 185,190 ---- # cases. import operator ! def get_time_timer(timer=timer, sum=sum): ! return sum(timer()) self.get_time = get_time_timer self.t = self.get_time() From gvanrossum at users.sourceforge.net Wed Oct 22 13:22:21 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Wed Oct 22 13:22:27 2003 Subject: [Python-checkins] python/dist/src/Lib profile.py,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19386 Modified Files: profile.py Log Message: Remove unneeded import. Index: profile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/profile.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** profile.py 22 Oct 2003 16:49:01 -0000 1.49 --- profile.py 22 Oct 2003 17:22:18 -0000 1.50 *************** *** 184,188 **** # the timer() result contains two values in all # cases. - import operator def get_time_timer(timer=timer, sum=sum): return sum(timer()) --- 184,187 ---- From rhettinger at users.sourceforge.net Wed Oct 22 14:09:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 22 14:09:43 2003 Subject: [Python-checkins] python/nondist/peps pep-0000.txt, 1.253, 1.254 pep-0289.txt, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv28567 Modified Files: pep-0000.txt pep-0289.txt Log Message: Resurrect the PEP on generator expressions Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.253 retrieving revision 1.254 diff -C2 -d -r1.253 -r1.254 *** pep-0000.txt 24 Sep 2003 10:30:08 -0000 1.253 --- pep-0000.txt 22 Oct 2003 18:09:35 -0000 1.254 *************** *** 98,101 **** --- 98,102 ---- I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger + S 289 Generator Expressions Hettinger S 292 Simpler String Substitutions Warsaw S 294 Type Names in the types Module Tirosh *************** *** 183,187 **** SR 270 uniq method for list objects Petrone SR 271 Prefixing sys.path by command line option Giacometti - SR 289 Generator Comprehensions Hettinger SR 295 Interpretation of multiline string constants Koltsov SR 296 Adding a bytes Object Type Gilbert --- 184,187 ---- *************** *** 305,309 **** I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger ! SR 289 Generator Comprehensions Hettinger I 290 Code Migration and Modernization Hettinger I 291 Backward Compatibility for Standard Library Norwitz --- 305,309 ---- I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger ! S 289 Generator Expressions Hettinger I 290 Code Migration and Modernization Hettinger I 291 Backward Compatibility for Standard Library Norwitz Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0289.txt 30 Aug 2003 23:57:36 -0000 1.2 --- pep-0289.txt 22 Oct 2003 18:09:36 -0000 1.3 *************** *** 1,244 **** PEP: 289 ! Title: Generator Comprehensions Version: $Revision$ Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Rejected Type: Standards Track Created: 30-Jan-2002 Python-Version: 2.3 ! Post-History: Abstract ! This PEP introduces generator comprehensions as an idea for ! enhancing the generators introduced in Python version 2.2 [1]. ! The goal is to increase the convenience, utility, and power of ! generators by making it easy to convert a list comprehension into ! a generator. Rationale ! Python 2.2 introduced the concept of an iterable interface as ! proposed in PEP 234 [4]. The iter() factory function was provided ! as common calling convention and deep changes were made to use ! iterators as a unifying theme throughout Python. The unification ! came in the form of establishing a common iterable interface for ! mappings, sequences, and file objects. ! Generators, as proposed in PEP 255 [1], were introduced as a means ! for making it easier to create iterators, especially ones with ! complex internal execution or variable states. When I created new ! programs, generators were often the tool of choice for creating an ! iterator. ! However, when updating existing programs, I found that the tool ! had another use, one that improved program function as well as ! structure. Some programs exhibited a pattern of creating large ! lists and then looping over them. As data sizes increased, the ! programs encountered scalability limitations owing to excessive ! memory consumption (and malloc time) for the intermediate lists. ! Generators were found to be directly substitutable for the lists ! while eliminating the memory issues through lazy evaluation ! a.k.a. just in time manufacturing. ! Python itself encountered similar issues. As a result, xrange() ! and xreadlines() were introduced. And, in the case of file ! objects and mappings, just-in-time evaluation became the norm. ! Generators provide a tool to program memory conserving for-loops ! whenever complete evaluation is not desired because of memory ! restrictions or availability of data. ! The next step in the evolution of generators is to establish a ! generator alternative to list comprehensions [3]. This ! alternative provides a simple way to convert a list comprehension ! into a generator whenever memory issues arise. ! This suggestion is designed to take advantage of the existing ! implementation and require little additional effort to ! incorporate. It is backward compatible and requires no new ! keywords. BDFL Pronouncements ! Generator comprehensions are REJECTED. The rationale is that the ! benefits are marginal since generators can already be coded ! directly and the costs are high because implementation and ! maintenance require major efforts with the parser. ! Reference Implementation ! There is not currently a CPython implementation; however, a ! simulation module written in pure Python is available on ! SourceForge [5]. The simulation is meant to allow direct ! experimentation with the proposal. ! There is also a module [6] with working source code for all of the ! examples used in this PEP. It serves as a test suite for the ! simulator and it documents how each the new feature works in ! practice. ! The authors and implementers of PEP 255 [1] were contacted to ! provide their assessment of whether these enhancements were going ! to be straight-forward to implement and require only minor ! modification of the existing generator code. Neil felt the ! assertion was correct. Ka-Ping thought so also. GvR said he ! could believe that it was true. Later GvR re-assessed and thought ! that it would be difficult to tweak the code generator to produce ! a separate object. Tim did not have an opportunity to give an ! assessment. ! Specification for Generator Comprehensions : ! If a list comprehension starts with a 'yield' keyword, then ! express the comprehension with a generator. For example: ! g = [yield (len(line),line) for line in file if len(line)>5] ! This would be implemented as if it had been written: - def __temp(self): - for line in file: - if len(line) > 5: - yield (len(line), line) - g = __temp() ! Note A: There is some discussion about whether the enclosing ! brackets should be part of the syntax for generator ! comprehensions. On the plus side, it neatly parallels list ! comprehensions and would be immediately recognizable as a similar ! form with similar internal syntax (taking maximum advantage of ! what people already know). More importantly, it sets off the ! generator comprehension from the rest of the function so as to not ! suggest that the enclosing function is a generator (currently the ! only cue that a function is really a generator is the presence of ! the yield keyword). On the minus side, the brackets may falsely ! suggest that the whole expression returns a list. Most of the ! feedback received to date indicates that brackets are helpful and ! not misleading. Unfortunately, the one dissent is from GvR. ! A key advantage of the generator comprehension syntax is that it ! makes it trivially easy to transform existing list comprehension ! code to a generator by adding yield. Likewise, it can be ! converted back to a list by deleting yield. This makes it easy to ! scale-up programs from small datasets to ones large enough to ! warrant just in time evaluation. ! Note B: List comprehensions expose their looping variable and ! leave that variable in the enclosing scope. The code, [str(i) for ! i in range(8)] leaves 'i' set to 7 in the scope where the ! comprehension appears. This behavior is by design and reflects an ! intent to duplicate the result of coding a for-loop instead of a ! list comprehension. Further, the variable 'i' is in a defined and ! potentially useful state on the line immediately following the ! list comprehension. ! In contrast, generator comprehensions do not expose the looping ! variable to the enclosing scope. The code, [yield str(i) for i in ! range(8)] leaves 'i' untouched in the scope where the ! comprehension appears. This is also by design and reflects an ! intent to duplicate the result of coding a generator directly ! instead of a generator comprehension. Further, the variable 'i' ! is not in a defined state on the line immediately following the ! list comprehension. It does not come into existence until ! iteration starts (possibly never). - Comments from GvR: Cute hack, but I think the use of the [] syntax - strongly suggests that it would return a list, not an - iterator. I also think that this is trying to turn Python into - a functional language, where most algorithms use lazy infinite - sequences, and I just don't think that's where its future - lies. ! I don't think it's worth the trouble. I expect it will take a ! lot of work to hack it into the code generator: it has to ! create a separate code object in order to be a generator. ! List comprehensions are inlined, so I expect that the ! generator comprehension code generator can't share much with ! the list comprehension code generator. And this for something ! that's not that common and easily done by writing a 2-line ! helper function. IOW the ROI isn't high enough. ! Comments from Ka-Ping Yee: I am very happy with the things you have ! proposed in this PEP. I feel quite positive about generator ! comprehensions and have no reservations. So a +1 on that. ! Comments from Neil Schemenauer: I'm -0 on the generator list ! comprehensions. They don't seem to add much. You could ! easily use a nested generator to do the same thing. They ! smell like lambda. ! Comments from Magnus Lie Hetland: Generator comprehensions seem mildly ! useful, but I vote +0. Defining a separate, named generator ! would probably be my preference. On the other hand, I do see ! the advantage of "scaling up" from list comprehensions. ! Comments from the Community: The response to the generator comprehension ! proposal has been mostly favorable. There were some 0 votes ! from people who didn't see a real need or who were not ! energized by the idea. Some of the 0 votes were tempered by ! comments that the reviewer did not even like list ! comprehensions or did not have any use for generators in any ! form. The +1 votes outnumbered the 0 votes by about two to ! one. ! Author response: I've studied several syntactical variations and ! concluded that the brackets are essential for: ! - teachability (it's like a list comprehension) ! - set-off (yield applies to the comprehension not the enclosing ! function) ! - substitutability (list comprehensions can be made lazy just by ! adding yield) ! What I like best about generator comprehensions is that I can ! design using list comprehensions and then easily switch to a ! generator (by adding yield) in response to scalability ! requirements (when the list comprehension produces too large ! of an intermediate result). Had generators already been ! in-place when list comprehensions were accepted, the yield ! option might have been incorporated from the start. For ! certain, the mathematical style notation is explicit and ! readable as compared to a separate function definition with an ! embedded yield. ! References ! [1] PEP 255 Simple Generators ! http://python.sourceforge.net/peps/pep-0255.html ! [2] PEP 212 Loop Counter Iteration ! http://python.sourceforge.net/peps/pep-0212.html ! [3] PEP 202 List Comprehensions ! http://python.sourceforge.net/peps/pep-0202.html ! [4] PEP 234 Iterators ! http://python.sourceforge.net/peps/pep-0234.html ! [5] A pure Python simulation of every feature in this PEP is at: ! http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=17348&aid=513752 ! [6] The full, working source code for each of the examples in this PEP ! along with other examples and tests is at: ! http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=17412&aid=513756 - [7] Another partial implementation is at: - http://www.python.org/sf/795947 Copyright ! This document has been placed in the public domain. ! ! Local Variables: ! mode: indented-text ! indent-tabs-mode: nil ! fill-column: 70 ! End: --- 1,275 ---- PEP: 289 ! Title: Generator Expressions Version: $Revision$ Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Active Type: Standards Track + Content-Type: text/x-rst Created: 30-Jan-2002 Python-Version: 2.3 ! Post-History: 22-Oct-2003 Abstract + ======== ! This PEP introduces generator expressions as a high performance, ! memory efficient generalization of list comprehensions [1]_ and ! generators [2]_. Rationale + ========= ! Experience with list comprehensions has shown their wide-spread ! utility throughout Python. However, many of the use cases do ! not need to have a full list created in memory. Instead, they ! only need to iterate over the elements one at a time. ! For instance, the following summation code will build a full list of ! squares in memory, iterate over those values, and, when the reference ! is no longer needed, delete the list:: ! sum([x*x for x in range(10)]) ! Time, clarity, and memory are conserved by using an generator ! expession instead:: ! sum(x*x for x in range(10)) ! Similar benefits are conferred on constructors for container objects:: ! ! s = Set(word for line in page for word in line.split()) ! d = dict( (k, func(v)) for k in keylist) ! ! Generator expressions are especially useful in functions that reduce ! an iterable input to a single value:: ! ! sum(len(line) for line in file if line.strip()) ! ! Accordingly, generator expressions are expected to partially eliminate ! the need for reduce() which is notorious for its lack of clarity. And, ! there are additional speed and clarity benefits from writing expressions ! directly instead of using lambda. ! ! List comprehensions greatly reduced the need for filter() and map(). ! Likewise, generator expressions are expected to minimize the need ! for itertools.ifilter() and itertools.imap(). In contrast, the ! utility of other itertools will be enhanced by generator expressions:: ! ! dotproduct = sum(x*y for x,y in itertools.izip(x_vector, y_vector)) ! ! Having a syntax similar to list comprehensions also makes it easy to ! convert existing code into an generator expression when scaling up ! application. BDFL Pronouncements + =================== ! The previous version of this PEP was REJECTED. The bracketed yield ! syntax left something to be desired; the performance gains had not been ! demonstrated; and the range of use cases had not been shown. After, ! much discussion on the python-dev list, the PEP has been resurrected ! its present form. The impetus for the discussion was an innovative ! proposal from Peter Norvig [3]_. ! The Gory Details ! ================ ! 1. The semantics of a generator expression are equivalent to creating ! an anonymous generator function and calling it. There's still discussion ! about whether that generator function should copy the current value of all ! free variables into default arguments. ! 2. The syntax requires that a generator expression always needs to be inside ! a set of parentheses and cannot have a comma on either side. Unfortunately, ! this is different from list comprehensions. While [1, x for x in R] is ! illegal, [x for x in 1, 2, 3] is legal, meaning [x for x in (1,2,3)]. ! With reference to the file Grammar/Grammar in CVS, two rules change: ! a) The rule:: + atom: '(' [testlist] ')' ! changes to:: ! atom: '(' [listmaker1] ')' ! where listmaker1 is almost the same as listmaker, but only allows ! a single test after 'for' ... 'in'. ! b) The rule for arglist needs similar changes. ! 2. The loop variable is not exposed to the surrounding function. This ! facilates the implementation and makes typical use cases more reliable. ! In some future version of Python, list comprehensions will also hide the ! induction variable from the surrounding code (and, in Py2.4, warnings ! will be issued for code accessing the induction variable). ! ! 3. There is still discussion about whether variable referenced in generator ! expressions will exhibit late binding just like other Python code. In the ! following example, the iterator runs *after* the value of y is set to one:: ! def h(): ! y = 0 ! l = [1,2] ! def gen(S): ! for x in S: ! yield x+y ! it = gen(l) ! y = 1 ! for v in it: ! print v ! 4. List comprehensions will remain unchanged:: ! [x for x in S] # This is a list comprehension. ! [(x for x in S)] # This is a list containing one generator expression. ! Reduction Functions ! =================== ! The utility of generator expressions is greatly enhanced when combined ! with appropriate reduction functions like sum(), min(), and max(). I ! propose creating a set of high speed reduction functions designed to tap the ! power of generator expressions and replace the most common uses of reduce():: ! def xorsum(it): ! return reduce(operator.xor, it, 0) ! def product(it): ! return reduce(operator.mul, it, 1) ! def anytrue(it): ! for elem in it: ! if it: ! return True ! return False ! def alltrue(it): ! for elem in it: ! if it: ! return False ! return True ! def horner(it, x): ! 'horner([6,3,4], 5) evaluates 6*x**2 + 3*x + 4 at x=5' ! cum = 0.0 ! for c in it: ! cum = cum*x + c ! return cum + def mean(it): + data = list(it) + return sum(data) / len(data) ! def smallest(it, siz=1): ! result = [] ! for elem in it: ! if len(result) < siz: ! bisect.insort_left(result, elem) ! elif elem < result[-1]: ! result.pop() ! bisect.insort_left(result, elem) ! return result ! def largest(it, siz=1): ! result = [] ! for elem in it: ! if len(result) < siz: ! bisect.insort_left(result, elem) ! elif elem > result[0]: ! result.pop(0) ! bisect.insort_left(result, elem) ! result.reverse() ! return result ! Notes on reduce() ! ================= ! Reduce typically has three types of use cases: ! 1) Common reduction functions applied directly to elements in a sequence. ! This use case is addressed by the sum(), min(), max(), and the additional ! functions listed above. ! 2) Reduce is often used with lambda when the data needs be extracted from ! complex sequence elements. For example:: ! reduce(lambda sum, x: sum + x.myattr, data, 0) ! reduce(lambda prod, x: prod * x[3], data, 1) ! ! In concert with reduction functions, generator expressions completely ! fulfill these use cases:: ! ! sum(x.myattr for x in data) ! product(x[3] for x in data) ! ! 3) On rare occasions, the reduction function is non-standard and requires ! custom coding:: ! ! reduce(lambda cum, c: (cum >> 8) ^ crc32[ord(a) ^ (cum & 0x00ff)], data, -1) ! ! Because a complex lambda is required, this use case becomes clearer and ! faster when coded directly as a for-loop:: ! ! cum = -1 ! for c in data: ! cum = (cum >> 8) ^ crc32[ord(a) ^ (cum & 0x00ff)] ! ! In conclusion, after adding generator expressions and a set of common reduction ! functions, few, if any cases remain for reduce(). ! ! ! Acknowledgements ! ================ ! ! * Raymond Hettinger first proposed the idea of "generator comprehensions" ! in January 2002. ! ! * Peter Norvig resurrected the discussion in his proposal for ! Accumulation Displays [3]_. ! ! * Alex Martelli provided critical measurements that proved the performance ! benefits of generator expressions. He also provided strong arguments ! that they were a desirable thing to have. ! ! * Samuele Pedroni provided the example of late binding. ! Various contributors have made arguments for and against late binding. ! ! * Phillip Eby suggested "iterator expressions" as the name. ! ! * Subsequently, Tim Peters suggested the name "generator expressions". ! ! ! References ! ========== ! ! .. [1] PEP 202 List Comprehensions ! http://python.sourceforge.net/peps/pep-0202.html ! ! .. [2] PEP 255 Simple Generators ! http://python.sourceforge.net/peps/pep-0255.html ! ! .. [3] Peter Norvig's Accumulation Display Proposal ! http:///www.norvig.com/pyacc.html Copyright + ========= ! This document has been placed in the public domain. ! .. ! Local Variables: ! mode: indented-text ! indent-tabs-mode: nil ! sentence-end-double-space: t ! fill-column: 70 ! End: From theller at python.net Wed Oct 22 15:33:05 2003 From: theller at python.net (Thomas Heller) Date: Wed Oct 22 15:33:28 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE In-Reply-To: (fdrake@users.sourceforge.net's message of "Tue, 21 Oct 2003 13:02:38 -0700") References: Message-ID: fdrake@users.sourceforge.net writes: > Update of /cvsroot/python/python/dist/src/Modules/expat > In directory sc8-pr-cvs1:/tmp/cvs-serv7002 > > Modified Files: > Tag: release23-maint > asciitab.h expat.h iasciitab.h internal.h latin1tab.h > utf8tab.h winconfig.h xmlparse.c xmlrole.c xmltok.c > xmltok_impl.c > Added Files: > Tag: release23-maint > macconfig.h > Removed Files: > Tag: release23-maint > expat.h.in > Log Message: > Update to Expat 1.95.7; there are no changes to the Expat sources. I'm getting compile errors on Windows (in the release-23maint branch, haven't tried in the trunk yet): C:\sf\python\dist\src-maint23\Modules\expat\xmlparse.c(76) : fatal error C1189: #error : memmove does not exist on this platform, nor is a substitute available Thomas From theller at users.sourceforge.net Wed Oct 22 15:38:06 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 22 15:38:09 2003 Subject: [Python-checkins] python/dist/src/PC make_versioninfo.c, NONE, 1.1.2.1 .cvsignore, NONE, 1.1.2.1 python_nt.rc, 1.27.4.3, 1.27.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv13765 Modified Files: Tag: release23-maint python_nt.rc Added Files: Tag: release23-maint make_versioninfo.c .cvsignore Log Message: Backport from the trunk. To build on windows, the manual editing of the python_nt.rc file to change the version number is no longer required. Instead, a make_versioninfo.exe is compiled, which spits out an include file for python_nt.rc. --- NEW FILE: make_versioninfo.c --- #include #include "patchlevel.h" /* * This program prints out an include file containing fields required to build * the version info resource of pythonxx.dll because the resource compiler * cannot do the arithmetic. */ /* * FIELD3 is the third field of the version number. * This is what we'd like FIELD3 to be: * * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) * * but that neither gives an error nor comes anywhere close to working. * * For 2.4a0, * PY_MICRO_VERSION = 0 * PY_RELEASE_LEVEL = 'alpha' = 0xa * PY_RELEASE_SERIAL = 0 * * gives FIELD3 = 0*1000 + 10*10 + 0 = 100 */ int main(int argc, char **argv) { printf("/* This file created by make_versioninfo.exe */\n"); printf("#define FIELD3 %d\n", PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL); printf("#define MS_DLL_ID \"%d.%d\"\n", PY_MAJOR_VERSION, PY_MINOR_VERSION); printf("#define PYTHON_DLL_NAME \"python%d%d.dll\"\n", PY_MAJOR_VERSION, PY_MINOR_VERSION); return 0; } --- NEW FILE: .cvsignore --- pythonnt_rc.h pythonnt_rc_d.h Index: python_nt.rc =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/python_nt.rc,v retrieving revision 1.27.4.3 retrieving revision 1.27.4.4 diff -C2 -d -r1.27.4.3 -r1.27.4.4 *** python_nt.rc 1 Oct 2003 17:35:01 -0000 1.27.4.3 --- python_nt.rc 22 Oct 2003 19:38:04 -0000 1.27.4.4 *************** *** 7,45 **** #include "modsupport.h" #include "patchlevel.h" ! ! /* Across releases, change: ! * MS_DLL_ID if the minor version number changes. ! * PYTHON_DLL_NAME ditto. ! * MS_DLL_ID must match PY_VERSION in the Windows install script. ! */ ! #define MS_DLL_ID "2.3" ! ! #ifndef PYTHON_DLL_NAME ! #define PYTHON_DLL_NAME "python23.dll" #endif - - /* Nothing below this should need to be changed except for copyright - * notices, company name, and FIELD3. Unfortunately, all attempts - * to get the resource compiler to do arithmetic in macros have - * failed miserably -- it gives syntax errors, ignores operators, - * or does stuff that's simply bizarre. - */ - - - /* This is what we'd like FIELD3 to be: - * - * #define FIELD3 (PY_MICRO_VERSION*1000 + PY_RELEASE_LEVEL*10 + PY_RELEASE_SERIAL) - * - * but that neither gives an error nor comes anywhere close to working. The - * following comment and #define are output from PCbuild\field3.py: - * - * For 2.3.2, - * PY_MICRO_VERSION = 2 - * PY_RELEASE_LEVEL = 'final' = 0xf - * PY_RELEASE_SERIAL = 0 - * - * and 2*1000 + 15*10 + 0 = 2150 - */ - #define FIELD3 2150 /* e.g., 2.1a2 --- 7,15 ---- #include "modsupport.h" #include "patchlevel.h" ! #ifdef _DEBUG ! # include "pythonnt_rc_d.h" ! #else ! # include "pythonnt_rc.h" #endif /* e.g., 2.1a2 From theller at users.sourceforge.net Wed Oct 22 15:38:12 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Oct 22 15:38:17 2003 Subject: [Python-checkins] python/dist/src/PCbuild make_versioninfo.dsp, NONE, 1.1.2.1 pcbuild.dsw, 1.34, 1.34.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv13792 Modified Files: Tag: release23-maint pcbuild.dsw Added Files: Tag: release23-maint make_versioninfo.dsp Log Message: Backport from the trunk. To build on windows, the manual editing of the python_nt.rc file to change the version number is no longer required. Instead, a make_versioninfo.exe is compiled, which spits out an include file for python_nt.rc. --- NEW FILE: make_versioninfo.dsp --- # Microsoft Developer Studio Project File - Name="make_versioninfo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=make_versioninfo - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "make_versioninfo.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "make_versioninfo.mak" CFG="make_versioninfo - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "make_versioninfo - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "make_versioninfo - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "make_versioninfo" # PROP Scc_LocalPath ".." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "make_versioninfo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo.exe >..\PC\pythonnt_rc.h # End Custom Build !ELSEIF "$(CFG)" == "make_versioninfo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 /out:"./make_versioninfo_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo_d.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo_d.exe >..\PC\pythonnt_rc_d.h # End Custom Build !ENDIF # Begin Target # Name "make_versioninfo - Win32 Release" # Name "make_versioninfo - Win32 Debug" # Begin Source File SOURCE=..\PC\make_versioninfo.c # End Source File # End Target # End Project Index: pcbuild.dsw =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pcbuild.dsw,v retrieving revision 1.34 retrieving revision 1.34.10.1 diff -C2 -d -r1.34 -r1.34.10.1 *** pcbuild.dsw 21 Mar 2003 01:55:41 -0000 1.34 --- pcbuild.dsw 22 Oct 2003 19:38:10 -0000 1.34.10.1 *************** *** 160,163 **** --- 160,175 ---- ############################################################################### + Project: "make_versioninfo"=.\make_versioninfo.dsp - Package Owner=<4> + + Package=<5> + {{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### + Project: "mmap"=.\mmap.dsp - Package Owner=<4> *************** *** 228,231 **** --- 240,246 ---- Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name make_versioninfo + End Project Dependency }}} From fdrake at acm.org Wed Oct 22 15:44:41 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Oct 22 15:45:35 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE In-Reply-To: References: Message-ID: <16278.56873.730705.729001@grendel.zope.com> Thomas Heller writes: > I'm getting compile errors on Windows (in the release-23maint branch, > haven't tried in the trunk yet): I'll bet they match. ;-) > C:\sf\python\dist\src-maint23\Modules\expat\xmlparse.c(76) : fatal error > C1189: #error : memmove does not exist on this platform, nor is a > substitute available Hmm. I see PC\pyconfig.h doesn't define HAVE_MEMMOVE; this gets defined in the configure-generated pyconfig.h for the Linux systems I tested this on. Doesn't Windows always have memmove()? (I *think* it does based on a quick look at msdn.microsoft.com, but who knows for sure...) I'm not sure how extension building works on Windows; if setup.py is used, you should be able to define HAVE_MEMMOVE in PC\pyconfig.h, otherwise you can define it in the relevant .dsp file. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From theller at python.net Wed Oct 22 15:57:12 2003 From: theller at python.net (Thomas Heller) Date: Wed Oct 22 15:57:45 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE In-Reply-To: <16278.56873.730705.729001@grendel.zope.com> (Fred L. Drake, Jr.'s message of "Wed, 22 Oct 2003 15:44:41 -0400") References: <16278.56873.730705.729001@grendel.zope.com> Message-ID: "Fred L. Drake, Jr." writes: > Thomas Heller writes: > > I'm getting compile errors on Windows (in the release-23maint branch, > > haven't tried in the trunk yet): > > I'll bet they match. ;-) > > > C:\sf\python\dist\src-maint23\Modules\expat\xmlparse.c(76) : fatal error > > C1189: #error : memmove does not exist on this platform, nor is a > > substitute available > > Hmm. I see PC\pyconfig.h doesn't define HAVE_MEMMOVE; this gets > defined in the configure-generated pyconfig.h for the Linux systems I > tested this on. > > Doesn't Windows always have memmove()? (I *think* it does based on a > quick look at msdn.microsoft.com, but who knows for sure...) Windows? MSVC has it. > I'm not sure how extension building works on Windows; if setup.py is > used, you should be able to define HAVE_MEMMOVE in PC\pyconfig.h, > otherwise you can define it in the relevant .dsp file. setup.py isn't used, and PC\pyconfig.h is manually maintained. So HAVE_MEMMOVE has to be defined in this file, at least for MSVC6. I don't know anything about watcom, borland, or other compilers. Let's add it in the file and see what happens ;-) Thomas From fdrake at acm.org Wed Oct 22 16:07:03 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Wed Oct 22 16:07:19 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE In-Reply-To: References: <16278.56873.730705.729001@grendel.zope.com> Message-ID: <16278.58215.241781.151437@grendel.zope.com> Thomas Heller writes: > setup.py isn't used, and PC\pyconfig.h is manually maintained. > So HAVE_MEMMOVE has to be defined in this file, at least for MSVC6. > I don't know anything about watcom, borland, or other compilers. > Let's add it in the file and see what happens ;-) Not quite, I think. The setup.py script will load it from the pyconfig.h file and pass it along for Expat, but if that isn't used, it needs to be added to the .dsp used to build pyexpat.pyd. Not sure what to do about other C runtimes. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From tim.one at comcast.net Wed Oct 22 16:10:10 2003 From: tim.one at comcast.net (Tim Peters) Date: Wed Oct 22 16:10:49 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1. In-Reply-To: Message-ID: memmove is a standard ANSI C function so can be used freely (Python requires ANSI C). From theller at python.net Wed Oct 22 16:11:16 2003 From: theller at python.net (Thomas Heller) Date: Wed Oct 22 16:11:38 2003 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, NONE, 1.1.2.1 asciitab.h, 1.1.1.1, 1.1.1.1.16.1 expat.h, 1.5, 1.5.12.1 iasciitab.h, 1.1.1.1, 1.1.1.1.16.1 internal.h, 1.1, 1.1.14.1 latin1tab.h, 1.1.1.1, 1.1.1.1.16.1 utf8tab.h, 1.1.1.1, 1.1.1.1.16.1 winconfig.h, 1.1.1.1, 1.1.1.1.16.1 xmlparse.c, 1.5, 1.5.12.1 xmlrole.c, 1.5, 1.5.12.1 xmltok.c, 1.3, 1.3.12.1 xmltok_impl.c, 1.2, 1.2.12.1 expat.h.in, 1.1.1.1, NONE In-Reply-To: <16278.58215.241781.151437@grendel.zope.com> (Fred L. Drake, Jr.'s message of "Wed, 22 Oct 2003 16:07:03 -0400") References: <16278.56873.730705.729001@grendel.zope.com> <16278.58215.241781.151437@grendel.zope.com> Message-ID: "Fred L. Drake, Jr." writes: > Thomas Heller writes: > > setup.py isn't used, and PC\pyconfig.h is manually maintained. > > So HAVE_MEMMOVE has to be defined in this file, at least for MSVC6. > > I don't know anything about watcom, borland, or other compilers. > > Let's add it in the file and see what happens ;-) > > Not quite, I think. > > The setup.py script will load it from the pyconfig.h file and pass it > along for Expat, but if that isn't used, it needs to be added to the > .dsp used to build pyexpat.pyd. Ah, you mean pyconfig.h is not included by the expat files? Ok, in this case it will have to go into the .dsp. > Not sure what to do about other C runtimes. Neither do I. Thomas From rhettinger at users.sourceforge.net Wed Oct 22 18:08:10 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 22 18:08:15 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv13831 Modified Files: pep-0289.txt Log Message: * Remove claim to minimize use of reduce() * Add claim to minimize use of lambda. * Remove details of proposed new accumulator functions. * Reference Jeff Epler's proof-of-concept patch. * Minor wording improvements everywhere. Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0289.txt 22 Oct 2003 18:09:36 -0000 1.3 --- pep-0289.txt 22 Oct 2003 22:08:06 -0000 1.4 *************** *** 44,56 **** d = dict( (k, func(v)) for k in keylist) ! Generator expressions are especially useful in functions that reduce ! an iterable input to a single value:: ! sum(len(line) for line in file if line.strip()) ! Accordingly, generator expressions are expected to partially eliminate ! the need for reduce() which is notorious for its lack of clarity. And, ! there are additional speed and clarity benefits from writing expressions ! directly instead of using lambda. List comprehensions greatly reduced the need for filter() and map(). --- 44,62 ---- d = dict( (k, func(v)) for k in keylist) ! Generator expressions are especially useful with functions like sum(), ! min(), and max() that reduce an iterable input to a single value:: ! max(len(line) for line in file if line.strip()) ! Generator expressions also address some examples of functionals coded ! with lambda:: ! ! reduce(lambda s, a: s + a.myattr, data, 0) ! reduce(lambda s, a: s + a[3], data, 0) ! ! These simplify to:: ! ! sum(a.myattr for a in data) ! sum(a[3] for a in data) List comprehensions greatly reduced the need for filter() and map(). *************** *** 77,87 **** ! The Gory Details ! ================ 1. The semantics of a generator expression are equivalent to creating an anonymous generator function and calling it. There's still discussion ! about whether that generator function should copy the current value of all ! free variables into default arguments. 2. The syntax requires that a generator expression always needs to be inside --- 83,93 ---- ! The Details ! =========== 1. The semantics of a generator expression are equivalent to creating an anonymous generator function and calling it. There's still discussion ! about whether that generator function should copy the current value of ! all free variables into default arguments. 2. The syntax requires that a generator expression always needs to be inside *************** *** 136,228 **** The utility of generator expressions is greatly enhanced when combined ! with appropriate reduction functions like sum(), min(), and max(). I ! propose creating a set of high speed reduction functions designed to tap the ! power of generator expressions and replace the most common uses of reduce():: ! ! def xorsum(it): ! return reduce(operator.xor, it, 0) ! ! def product(it): ! return reduce(operator.mul, it, 1) ! ! def anytrue(it): ! for elem in it: ! if it: ! return True ! return False ! ! def alltrue(it): ! for elem in it: ! if it: ! return False ! return True ! ! def horner(it, x): ! 'horner([6,3,4], 5) evaluates 6*x**2 + 3*x + 4 at x=5' ! cum = 0.0 ! for c in it: ! cum = cum*x + c ! return cum ! ! def mean(it): ! data = list(it) ! return sum(data) / len(data) ! ! def smallest(it, siz=1): ! result = [] ! for elem in it: ! if len(result) < siz: ! bisect.insort_left(result, elem) ! elif elem < result[-1]: ! result.pop() ! bisect.insort_left(result, elem) ! return result ! ! def largest(it, siz=1): ! result = [] ! for elem in it: ! if len(result) < siz: ! bisect.insort_left(result, elem) ! elif elem > result[0]: ! result.pop(0) ! bisect.insort_left(result, elem) ! result.reverse() ! return result ! ! Notes on reduce() ! ================= ! ! Reduce typically has three types of use cases: ! ! 1) Common reduction functions applied directly to elements in a sequence. ! This use case is addressed by the sum(), min(), max(), and the additional ! functions listed above. ! ! 2) Reduce is often used with lambda when the data needs be extracted from ! complex sequence elements. For example:: ! ! reduce(lambda sum, x: sum + x.myattr, data, 0) ! reduce(lambda prod, x: prod * x[3], data, 1) ! ! In concert with reduction functions, generator expressions completely ! fulfill these use cases:: ! ! sum(x.myattr for x in data) ! product(x[3] for x in data) ! ! 3) On rare occasions, the reduction function is non-standard and requires ! custom coding:: ! ! reduce(lambda cum, c: (cum >> 8) ^ crc32[ord(a) ^ (cum & 0x00ff)], data, -1) ! ! Because a complex lambda is required, this use case becomes clearer and ! faster when coded directly as a for-loop:: ! ! cum = -1 ! for c in data: ! cum = (cum >> 8) ^ crc32[ord(a) ^ (cum & 0x00ff)] ! ! In conclusion, after adding generator expressions and a set of common reduction ! functions, few, if any cases remain for reduce(). --- 142,149 ---- The utility of generator expressions is greatly enhanced when combined ! with reduction functions like sum(), min(), and max(). Separate ! proposals are forthcoming that recommend several new accumulation ! functions possibly including: product(), average(), alltrue(), ! anytrue(), nlargest(), nsmallest(). *************** *** 259,263 **** .. [3] Peter Norvig's Accumulation Display Proposal http:///www.norvig.com/pyacc.html ! Copyright --- 180,187 ---- .. [3] Peter Norvig's Accumulation Display Proposal http:///www.norvig.com/pyacc.html ! ! .. [4] Jeff Epler had worked up a patch demonstrating ! the previously proposed bracket and yield syntax ! http://python.org/sf/795947 Copyright From akuchling at users.sourceforge.net Wed Oct 22 21:20:24 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 21:21:14 2003 Subject: [Python-checkins] distutils setup.py,1.32,1.33 Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv14069 Modified Files: setup.py Log Message: Bump version number; update my e-mail address Index: setup.py =================================================================== RCS file: /cvsroot/python/distutils/setup.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** setup.py 19 Nov 2002 14:29:35 -0000 1.32 --- setup.py 23 Oct 2003 01:20:21 -0000 1.33 *************** *** 10,19 **** setup (name = "Distutils", ! version = "1.0.3", description = "Python Distribution Utilities", author = "Greg Ward", author_email = "gward@python.net", maintainer = "A.M. Kuchling", ! maintainer_email = 'amk1@bigfoot.com', url = "http://www.python.org/sigs/distutils-sig/", licence = "Python", --- 10,19 ---- setup (name = "Distutils", ! version = "1.1", description = "Python Distribution Utilities", author = "Greg Ward", author_email = "gward@python.net", maintainer = "A.M. Kuchling", ! maintainer_email = 'amk@amk.ca', url = "http://www.python.org/sigs/distutils-sig/", licence = "Python", *************** *** 21,25 **** A collection of modules to aid in the distribution and installation of Python modules, extensions, and (ultimately) applications. A standard ! part of Python 1.6 and 2.0, but also distributed separately for use with Python 1.5.""", --- 21,25 ---- A collection of modules to aid in the distribution and installation of Python modules, extensions, and (ultimately) applications. A standard ! part of Python 2.x, but also distributed separately for use with Python 1.5.""", From akuchling at users.sourceforge.net Wed Oct 22 21:22:10 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 21:22:18 2003 Subject: [Python-checkins] distutils ANNOUNCE-0.9, 1.1, NONE USAGE.txt, 1.7, NONE Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv14356 Removed Files: ANNOUNCE-0.9 USAGE.txt Log Message: Remove obsolete files --- ANNOUNCE-0.9 DELETED --- --- USAGE.txt DELETED --- From akuchling at users.sourceforge.net Wed Oct 22 21:27:23 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Oct 22 21:27:26 2003 Subject: [Python-checkins] distutils setup.py,1.33,1.34 Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv15032 Modified Files: setup.py Log Message: Use modern option name Index: setup.py =================================================================== RCS file: /cvsroot/python/distutils/setup.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** setup.py 23 Oct 2003 01:20:21 -0000 1.33 --- setup.py 23 Oct 2003 01:27:20 -0000 1.34 *************** *** 17,21 **** maintainer_email = 'amk@amk.ca', url = "http://www.python.org/sigs/distutils-sig/", ! licence = "Python", long_description = """\ A collection of modules to aid in the distribution and installation of --- 17,21 ---- maintainer_email = 'amk@amk.ca', url = "http://www.python.org/sigs/distutils-sig/", ! license = "Python", long_description = """\ A collection of modules to aid in the distribution and installation of From gvanrossum at users.sourceforge.net Thu Oct 23 02:36:39 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Oct 23 02:36:43 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv24085 Modified Files: pep-0289.txt Log Message: Add lots of detail and examples to the Details section. Free variables are now captured at definition time. Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0289.txt 22 Oct 2003 22:08:06 -0000 1.4 --- pep-0289.txt 23 Oct 2003 06:36:37 -0000 1.5 *************** *** 66,70 **** dotproduct = sum(x*y for x,y in itertools.izip(x_vector, y_vector)) ! Having a syntax similar to list comprehensions also makes it easy to convert existing code into an generator expression when scaling up --- 66,70 ---- dotproduct = sum(x*y for x,y in itertools.izip(x_vector, y_vector)) ! Having a syntax similar to list comprehensions also makes it easy to convert existing code into an generator expression when scaling up *************** *** 86,99 **** =========== ! 1. The semantics of a generator expression are equivalent to creating ! an anonymous generator function and calling it. There's still discussion ! about whether that generator function should copy the current value of ! all free variables into default arguments. ! 2. The syntax requires that a generator expression always needs to be inside ! a set of parentheses and cannot have a comma on either side. Unfortunately, ! this is different from list comprehensions. While [1, x for x in R] is ! illegal, [x for x in 1, 2, 3] is legal, meaning [x for x in (1,2,3)]. ! With reference to the file Grammar/Grammar in CVS, two rules change: a) The rule:: --- 86,112 ---- =========== ! (None of this is exact enough in the eye of a reader from Mars, but I ! hope the examples convey the intention well enough for a discussion in ! c.l.py. The Python Reference Manual should contain a 100% exact ! semantic and syntactic specification.) ! 1. The semantics of a generator expression are equivalent to creating ! an anonymous generator function and calling it. For example:: ! ! g = (x**2 for x in range(10)) ! print g.next() ! ! is equivalent to:: ! ! def __gen(): ! for x in range(10): ! yield x**2 ! g = __gen() ! print g.next() ! ! 2. The syntax requires that a generator expression always needs to be ! directly inside a set of parentheses and cannot have a comma on either ! side. With reference to the file Grammar/Grammar in CVS, two rules ! change: a) The rule:: *************** *** 110,140 **** b) The rule for arglist needs similar changes. ! 2. The loop variable is not exposed to the surrounding function. This ! facilates the implementation and makes typical use cases more reliable. ! In some future version of Python, list comprehensions will also hide the induction variable from the surrounding code (and, in Py2.4, warnings will be issued for code accessing the induction variable). - - 3. There is still discussion about whether variable referenced in generator - expressions will exhibit late binding just like other Python code. In the - following example, the iterator runs *after* the value of y is set to one:: ! def h(): ! y = 0 ! l = [1,2] ! def gen(S): ! for x in S: ! yield x+y ! it = gen(l) ! y = 1 ! for v in it: ! print v ! 4. List comprehensions will remain unchanged:: [x for x in S] # This is a list comprehension. [(x for x in S)] # This is a list containing one generator expression. Reduction Functions --- 123,212 ---- b) The rule for arglist needs similar changes. + This means that you can write:: ! sum(x**2 for x in range(10)) ! ! but you would have to write:: ! ! reduce(operator.add, (x**2 for x in range(10))) ! ! and also:: ! ! g = (x**2 for i in range(10)) ! ! i.e. if a function call has a single positional argument, it can be a ! generator expression without extra parentheses, but in all other cases ! you have to parenthesize it. ! ! 3. The loop variable (if it is a simple variable or a tuple of simple ! variables) is not exposed to the surrounding function. This facilates ! the implementation and makes typical use cases more reliable. In some ! future version of Python, list comprehensions will also hide the induction variable from the surrounding code (and, in Py2.4, warnings will be issued for code accessing the induction variable). ! For example:: ! x = "hello" ! y = list(x for x in "abc") ! print x # prints "hello", not "c" ! ! (Loop variables may also use constructs like x[i] or x.a; this form ! may be deprecated.) ! ! 4. All free variable bindings are captured at the time this function ! is defined, and passed into it using default argument values. For ! example:: ! ! x = 0 ! g = (x for c in "abc") # x is not the loop variable! ! x = 1 ! print g.next() # prints 0 (captured x), not 1 (current x) ! ! This behavior of free variables is almost always what you want when ! the generator expression is evaluated at a later point than its ! definition. In fact, to date, no examples have been found of code ! where it would be better to use the execution-time instead of the ! definition-time value of a free variable. ! ! Note that free variables aren't copied, only their binding is ! captured. They may still change if they are mutable, for example:: ! ! x = [] ! g = (x for c in "abc") ! x.append(1) ! print g.next() # prints [1], not [] ! ! 5. List comprehensions will remain unchanged. For example:: [x for x in S] # This is a list comprehension. [(x for x in S)] # This is a list containing one generator expression. + Unfortunately, there is currently a slight syntactic difference. The + expression:: + + [x for x in 1, 2, 3] + + is legal, meaning:: + + [x for x in (1, 2, 3)] + + But generator expressions will not allow the former version:: + + (x for x in 1, 2, 3) + + is illegal. + + The former list comprehension syntax will become illegal in Python + 3.0, and should be deprecated in Python 2.4 and beyond. + + List comprehensions also "leak" their loop variable into the + surrounding scope. This will also change in Python 3.0, so that the + semantic definition of a list comprehension in Python 3.0 will be + equivalent to list(). Python 2.4 and beyond + should issue a deprecation warning if a list comprehension's loop + variable has the same name as a variable used in the immediately + surrounding scope. + Reduction Functions *************** *** 153,159 **** * Raymond Hettinger first proposed the idea of "generator comprehensions" in January 2002. ! * Peter Norvig resurrected the discussion in his proposal for ! Accumulation Displays [3]_. * Alex Martelli provided critical measurements that proved the performance --- 225,231 ---- * Raymond Hettinger first proposed the idea of "generator comprehensions" in January 2002. ! * Peter Norvig resurrected the discussion in his proposal for ! Accumulation Displays. * Alex Martelli provided critical measurements that proved the performance *************** *** 180,184 **** .. [3] Peter Norvig's Accumulation Display Proposal http:///www.norvig.com/pyacc.html ! .. [4] Jeff Epler had worked up a patch demonstrating the previously proposed bracket and yield syntax --- 252,256 ---- .. [3] Peter Norvig's Accumulation Display Proposal http:///www.norvig.com/pyacc.html ! .. [4] Jeff Epler had worked up a patch demonstrating the previously proposed bracket and yield syntax From jvr at users.sourceforge.net Thu Oct 23 04:10:08 2003 From: jvr at users.sourceforge.net (jvr@users.sourceforge.net) Date: Thu Oct 23 04:10:13 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv5554 Modified Files: pep-0289.txt Log Message: Fixed typo in Norvig's URL Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0289.txt 23 Oct 2003 06:36:37 -0000 1.5 --- pep-0289.txt 23 Oct 2003 08:10:05 -0000 1.6 *************** *** 251,255 **** .. [3] Peter Norvig's Accumulation Display Proposal ! http:///www.norvig.com/pyacc.html .. [4] Jeff Epler had worked up a patch demonstrating --- 251,255 ---- .. [3] Peter Norvig's Accumulation Display Proposal ! http://www.norvig.com/pyacc.html .. [4] Jeff Epler had worked up a patch demonstrating From goodger at users.sourceforge.net Thu Oct 23 08:51:32 2003 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Thu Oct 23 08:51:36 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv16621 Modified Files: pep-0289.txt Log Message: fixed list indentation; status: Draft is correct Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0289.txt 23 Oct 2003 08:10:05 -0000 1.6 --- pep-0289.txt 23 Oct 2003 12:51:30 -0000 1.7 *************** *** 4,8 **** Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Active Type: Standards Track Content-Type: text/x-rst --- 4,8 ---- Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Draft Type: Standards Track Content-Type: text/x-rst *************** *** 92,211 **** 1. The semantics of a generator expression are equivalent to creating ! an anonymous generator function and calling it. For example:: ! g = (x**2 for x in range(10)) ! print g.next() ! is equivalent to:: ! def __gen(): ! for x in range(10): ! yield x**2 ! g = __gen() ! print g.next() 2. The syntax requires that a generator expression always needs to be ! directly inside a set of parentheses and cannot have a comma on either ! side. With reference to the file Grammar/Grammar in CVS, two rules ! change: ! a) The rule:: ! atom: '(' [testlist] ')' ! changes to:: ! atom: '(' [listmaker1] ')' ! where listmaker1 is almost the same as listmaker, but only allows ! a single test after 'for' ... 'in'. ! b) The rule for arglist needs similar changes. ! This means that you can write:: ! sum(x**2 for x in range(10)) ! but you would have to write:: ! reduce(operator.add, (x**2 for x in range(10))) ! and also:: ! g = (x**2 for i in range(10)) ! i.e. if a function call has a single positional argument, it can be a ! generator expression without extra parentheses, but in all other cases ! you have to parenthesize it. 3. The loop variable (if it is a simple variable or a tuple of simple ! variables) is not exposed to the surrounding function. This facilates ! the implementation and makes typical use cases more reliable. In some ! future version of Python, list comprehensions will also hide the ! induction variable from the surrounding code (and, in Py2.4, warnings ! will be issued for code accessing the induction variable). ! For example:: ! x = "hello" ! y = list(x for x in "abc") ! print x # prints "hello", not "c" ! (Loop variables may also use constructs like x[i] or x.a; this form ! may be deprecated.) 4. All free variable bindings are captured at the time this function ! is defined, and passed into it using default argument values. For ! example:: ! x = 0 ! g = (x for c in "abc") # x is not the loop variable! ! x = 1 ! print g.next() # prints 0 (captured x), not 1 (current x) ! This behavior of free variables is almost always what you want when ! the generator expression is evaluated at a later point than its ! definition. In fact, to date, no examples have been found of code ! where it would be better to use the execution-time instead of the ! definition-time value of a free variable. ! Note that free variables aren't copied, only their binding is ! captured. They may still change if they are mutable, for example:: ! x = [] ! g = (x for c in "abc") ! x.append(1) ! print g.next() # prints [1], not [] 5. List comprehensions will remain unchanged. For example:: ! [x for x in S] # This is a list comprehension. ! [(x for x in S)] # This is a list containing one generator expression. ! Unfortunately, there is currently a slight syntactic difference. The ! expression:: ! [x for x in 1, 2, 3] ! is legal, meaning:: ! [x for x in (1, 2, 3)] ! But generator expressions will not allow the former version:: ! (x for x in 1, 2, 3) ! is illegal. ! The former list comprehension syntax will become illegal in Python ! 3.0, and should be deprecated in Python 2.4 and beyond. ! List comprehensions also "leak" their loop variable into the ! surrounding scope. This will also change in Python 3.0, so that the ! semantic definition of a list comprehension in Python 3.0 will be ! equivalent to list(). Python 2.4 and beyond ! should issue a deprecation warning if a list comprehension's loop ! variable has the same name as a variable used in the immediately ! surrounding scope. --- 92,213 ---- 1. The semantics of a generator expression are equivalent to creating ! an anonymous generator function and calling it. For example:: ! g = (x**2 for x in range(10)) ! print g.next() ! is equivalent to:: ! def __gen(): ! for x in range(10): ! yield x**2 ! g = __gen() ! print g.next() 2. The syntax requires that a generator expression always needs to be ! directly inside a set of parentheses and cannot have a comma on ! either side. With reference to the file Grammar/Grammar in CVS, ! two rules change: ! a) The rule:: ! atom: '(' [testlist] ')' ! changes to:: ! atom: '(' [listmaker1] ')' ! where listmaker1 is almost the same as listmaker, but only ! allows a single test after 'for' ... 'in'. ! b) The rule for arglist needs similar changes. ! This means that you can write:: ! sum(x**2 for x in range(10)) ! but you would have to write:: ! reduce(operator.add, (x**2 for x in range(10))) ! and also:: ! g = (x**2 for i in range(10)) ! i.e. if a function call has a single positional argument, it can be ! a generator expression without extra parentheses, but in all other ! cases you have to parenthesize it. 3. The loop variable (if it is a simple variable or a tuple of simple ! variables) is not exposed to the surrounding function. This ! facilates the implementation and makes typical use cases more ! reliable. In some future version of Python, list comprehensions ! will also hide the induction variable from the surrounding code ! (and, in Py2.4, warnings will be issued for code accessing the ! induction variable). ! For example:: ! x = "hello" ! y = list(x for x in "abc") ! print x # prints "hello", not "c" ! (Loop variables may also use constructs like x[i] or x.a; this form ! may be deprecated.) 4. All free variable bindings are captured at the time this function ! is defined, and passed into it using default argument values. For ! example:: ! x = 0 ! g = (x for c in "abc") # x is not the loop variable! ! x = 1 ! print g.next() # prints 0 (captured x), not 1 (current x) ! This behavior of free variables is almost always what you want when ! the generator expression is evaluated at a later point than its ! definition. In fact, to date, no examples have been found of code ! where it would be better to use the execution-time instead of the ! definition-time value of a free variable. ! Note that free variables aren't copied, only their binding is ! captured. They may still change if they are mutable, for example:: ! x = [] ! g = (x for c in "abc") ! x.append(1) ! print g.next() # prints [1], not [] 5. List comprehensions will remain unchanged. For example:: ! [x for x in S] # This is a list comprehension. ! [(x for x in S)] # This is a list containing one generator ! # expression. ! Unfortunately, there is currently a slight syntactic difference. ! The expression:: ! [x for x in 1, 2, 3] ! is legal, meaning:: ! [x for x in (1, 2, 3)] ! But generator expressions will not allow the former version:: ! (x for x in 1, 2, 3) ! is illegal. ! The former list comprehension syntax will become illegal in Python ! 3.0, and should be deprecated in Python 2.4 and beyond. ! List comprehensions also "leak" their loop variable into the ! surrounding scope. This will also change in Python 3.0, so that ! the semantic definition of a list comprehension in Python 3.0 will ! be equivalent to list(). Python 2.4 and ! beyond should issue a deprecation warning if a list comprehension's ! loop variable has the same name as a variable used in the ! immediately surrounding scope. *************** *** 216,220 **** with reduction functions like sum(), min(), and max(). Separate proposals are forthcoming that recommend several new accumulation ! functions possibly including: product(), average(), alltrue(), anytrue(), nlargest(), nsmallest(). --- 218,222 ---- with reduction functions like sum(), min(), and max(). Separate proposals are forthcoming that recommend several new accumulation ! functions possibly including: product(), average(), alltrue(), anytrue(), nlargest(), nsmallest(). *************** *** 223,238 **** ================ ! * Raymond Hettinger first proposed the idea of "generator comprehensions" ! in January 2002. * Peter Norvig resurrected the discussion in his proposal for Accumulation Displays. ! * Alex Martelli provided critical measurements that proved the performance ! benefits of generator expressions. He also provided strong arguments ! that they were a desirable thing to have. ! * Samuele Pedroni provided the example of late binding. ! Various contributors have made arguments for and against late binding. * Phillip Eby suggested "iterator expressions" as the name. --- 225,240 ---- ================ ! * Raymond Hettinger first proposed the idea of "generator ! comprehensions" in January 2002. * Peter Norvig resurrected the discussion in his proposal for Accumulation Displays. ! * Alex Martelli provided critical measurements that proved the ! performance benefits of generator expressions. He also provided ! strong arguments that they were a desirable thing to have. ! * Samuele Pedroni provided the example of late binding. Various ! contributors have made arguments for and against late binding. * Phillip Eby suggested "iterator expressions" as the name. From fdrake at users.sourceforge.net Thu Oct 23 10:33:49 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Oct 23 10:33:52 2003 Subject: [Python-checkins] python/dist/src/Doc python-docs.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv3506 Modified Files: python-docs.txt Log Message: - add "Why is Python installed on my computer?" as a documentation FAQ since this gets asked at the docs at python.org address a lot - fix some minor style violations and inconsistencies Index: python-docs.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/python-docs.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** python-docs.txt 30 Jul 2003 02:55:27 -0000 1.2 --- python-docs.txt 23 Oct 2003 14:33:46 -0000 1.3 *************** *** 24,28 **** 2. Where can I download Python? 3. I can't unpack a downloaded copy on Windows; what should I do? ! 4. I can't unpack a downloaded copy on MacOS; what should I do? 5. What can I use Python for? 6. How do I use module/function/whatever XXX? --- 24,28 ---- 2. Where can I download Python? 3. I can't unpack a downloaded copy on Windows; what should I do? ! 4. I can't unpack a downloaded copy on Mac OS; what should I do? 5. What can I use Python for? 6. How do I use module/function/whatever XXX? *************** *** 33,36 **** --- 33,37 ---- 11. Acrobat Reader won't print the PDF. What's wrong? 12. Where can I find documentation in my native language? + 13. Why is Python installed on my computer? *************** *** 78,82 **** http://www.winzip.com/ ! 4. I can't unpack a downloaded archive on MacOS; what should I do? Stuffit Expander 4.5 (and probably other versions) cannot handle --- 79,83 ---- http://www.winzip.com/ ! 4. I can't unpack a downloaded archive on Mac OS; what should I do? Stuffit Expander 4.5 (and probably other versions) cannot handle *************** *** 164,168 **** http://www.foolabs.com/xpdf/ ! 12. There is a lot of contributed documentation in languages other than English. Some of the documents are translations of English documents, and others were originally authored in other --- 165,171 ---- http://www.foolabs.com/xpdf/ ! 12. Where can I find documentation in my native language? ! ! There is a lot of contributed documentation in languages other than English. Some of the documents are translations of English documents, and others were originally authored in other *************** *** 170,171 **** --- 173,183 ---- http://www.python.org/doc/NonEnglish.html + + 13. Why is Python installed on my computer? + + We're increasingly seeing Python being installed on computers + as delivered by vendors. For more information on why, and + whether it's safe to remove, see the "Why is Python Installed on + my Computer?" FAQ, found at: + + http://www.python.org/doc/faq/installed.html From loewis at users.sourceforge.net Thu Oct 23 11:55:05 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Oct 23 11:56:51 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_tempfile.py, 1.14.8.2, 1.14.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv21085/Lib/test Modified Files: Tag: release23-maint test_tempfile.py Log Message: Patch #813200: Quote executable path on Windows. Fixes #811082. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.14.8.2 retrieving revision 1.14.8.3 diff -C2 -d -r1.14.8.2 -r1.14.8.3 *** test_tempfile.py 18 Oct 2003 18:09:18 -0000 1.14.8.2 --- test_tempfile.py 23 Oct 2003 15:55:03 -0000 1.14.8.3 *************** *** 293,298 **** "tf_inherit_check.py") ! retval = os.spawnl(os.P_WAIT, sys.executable, ! sys.executable, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) --- 293,306 ---- "tf_inherit_check.py") ! # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted, ! # but an arg with embedded spaces should be decorated with double ! # quotes on each end ! if sys.platform in ('win32'): ! decorated = '"%s"' % sys.executable ! tester = '"%s"' % tester ! else: ! decorated = sys.executable ! ! retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) From loewis at users.sourceforge.net Thu Oct 23 11:55:06 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Oct 23 11:56:55 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.64,1.831.4.65 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv21085/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #813200: Quote executable path on Windows. Fixes #811082. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.64 retrieving revision 1.831.4.65 diff -C2 -d -r1.831.4.64 -r1.831.4.65 *** NEWS 21 Oct 2003 20:02:46 -0000 1.831.4.64 --- NEWS 23 Oct 2003 15:55:03 -0000 1.831.4.65 *************** *** 33,36 **** --- 33,38 ---- ------- + - Bug #811082: test_tempfile fails if space in install directory. + - Bug #780461: platform.mac_ver() raised MacOSError exception under OS X. From loewis at users.sourceforge.net Thu Oct 23 11:55:30 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Oct 23 11:57:08 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_tempfile.py, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv21337 Modified Files: test_tempfile.py Log Message: Patch #813200: Quote executable path on Windows. Fixes #811082. Backported to 2.3. Index: test_tempfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tempfile.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_tempfile.py 12 Oct 2003 17:37:01 -0000 1.15 --- test_tempfile.py 23 Oct 2003 15:55:28 -0000 1.16 *************** *** 294,299 **** "tf_inherit_check.py") ! retval = os.spawnl(os.P_WAIT, sys.executable, ! sys.executable, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) --- 294,307 ---- "tf_inherit_check.py") ! # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted, ! # but an arg with embedded spaces should be decorated with double ! # quotes on each end ! if sys.platform in ('win32'): ! decorated = '"%s"' % sys.executable ! tester = '"%s"' % tester ! else: ! decorated = sys.executable ! ! retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd) self.failIf(retval < 0, "child process caught fatal signal %d" % -retval) From rhettinger at users.sourceforge.net Thu Oct 23 12:17:32 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 23 12:17:57 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv25019 Modified Files: pep-0289.txt Log Message: Remove discussion of loop variables in the form x[a] or x.a. Deprecation of that form is a subject encompassing all for-loop constructs and is not specific to this PEP. Also, most people are not aware that those forms are even possible, so it is prudent to not even bring it up as that would inevitably increase the number of people trying it in their code. Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0289.txt 23 Oct 2003 12:51:30 -0000 1.7 --- pep-0289.txt 23 Oct 2003 16:17:29 -0000 1.8 *************** *** 153,159 **** print x # prints "hello", not "c" - (Loop variables may also use constructs like x[i] or x.a; this form - may be deprecated.) - 4. All free variable bindings are captured at the time this function is defined, and passed into it using default argument values. For --- 153,156 ---- From rhettinger at users.sourceforge.net Thu Oct 23 13:02:13 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 23 13:02:18 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv1551 Modified Files: pep-0289.txt Log Message: Fix typo Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0289.txt 23 Oct 2003 16:17:29 -0000 1.8 --- pep-0289.txt 23 Oct 2003 17:02:11 -0000 1.9 *************** *** 42,46 **** s = Set(word for line in page for word in line.split()) ! d = dict( (k, func(v)) for k in keylist) Generator expressions are especially useful with functions like sum(), --- 42,46 ---- s = Set(word for line in page for word in line.split()) ! d = dict( (k, func(k)) for k in keylist) Generator expressions are especially useful with functions like sum(), From akuchling at users.sourceforge.net Thu Oct 23 13:58:22 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Oct 23 13:58:26 2003 Subject: [Python-checkins] python/nondist/peps pep-0042.txt,1.73,1.74 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv11542 Modified Files: pep-0042.txt Log Message: Record feature request Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** pep-0042.txt 20 Jun 2003 17:07:09 -0000 1.73 --- pep-0042.txt 23 Oct 2003 17:58:20 -0000 1.74 *************** *** 261,264 **** --- 261,269 ---- http://www.python.org/sf/723287 + - The curses library is missing two important calls: newterm() and + delscreen() + + http://www.python.org/sf/665572, http://bugs.debian.org/175590 + C API wishes From akuchling at users.sourceforge.net Thu Oct 23 14:03:45 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Oct 23 14:03:50 2003 Subject: [Python-checkins] python/nondist/peps pep-0042.txt,1.74,1.75 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv12637 Modified Files: pep-0042.txt Log Message: Remove an item that got done in 2.3 Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** pep-0042.txt 23 Oct 2003 17:58:20 -0000 1.74 --- pep-0042.txt 23 Oct 2003 18:03:41 -0000 1.75 *************** *** 279,299 **** build with MSVC. - - Add unsigneds to ParseTuple/BuildValue (due to David Beazley) - - Since "integers" can now have arbitrary precision and can - represent large unsigned values, can you add three new format - characters to PyArg_ParseTuple() and Py_BuildValue() for the C - datatypes "unsigned int", "unsigned long", and "unsigned long - long"? - - The "u" and "l" namespace is a little crowded (and I don't think - you would want to break that). However, here's one idea: - - 'I' - unsigned int (consistent with H and B) - 'p' - unsigned long ('p' is for positive) - 'P' - unsigned long long - - http://www.python.org/sf/454896 - Tools --- 279,282 ---- From akuchling at users.sourceforge.net Thu Oct 23 14:08:06 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Oct 23 14:08:08 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex, 1.162, 1.163 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv13464 Modified Files: whatsnew23.tex Log Message: Record an item I missed and bump the version number. [2.3 bugfix candidate.] Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** whatsnew23.tex 21 Sep 2003 23:41:02 -0000 1.162 --- whatsnew23.tex 23 Oct 2003 18:08:03 -0000 1.163 *************** *** 4,8 **** \title{What's New in Python 2.3} ! \release{1.00} \author{A.M.\ Kuchling} \authoraddress{\email{amk@amk.ca}} --- 4,8 ---- \title{What's New in Python 2.3} ! \release{1.01} \author{A.M.\ Kuchling} \authoraddress{\email{amk@amk.ca}} *************** *** 2169,2172 **** --- 2169,2177 ---- \code{PyArg_ParseTuple(\var{args}, "")} instead, but this will be slower than using \constant{METH_NOARGS}. + + \item \cfunction{PyArg_ParseTuple()} accepts new format characters for various sizes of unsigned integers: \samp{B} for \ctype{unsigned char}, + \samp{H} for \ctype{unsigned short int}, + \samp{I} for \ctype{unsigned int}, + and \samp{K} for \ctype{unsigned long long}. \item A new function, \cfunction{PyObject_DelItemString(\var{mapping}, From akuchling at users.sourceforge.net Thu Oct 23 14:20:35 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Oct 23 14:20:54 2003 Subject: [Python-checkins] python/nondist/peps pep-0006.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv15910 Modified Files: pep-0006.txt Log Message: Fix typo. While fixing the typo, I noticed the list of patch czars is incomplete, so it also got updated. If any of them are wrong, please correct them. E-mail addresses removed; they don't seem very useful in this PEP. Index: pep-0006.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0006.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0006.txt 11 Mar 2002 17:36:50 -0000 1.8 --- pep-0006.txt 23 Oct 2003 18:20:31 -0000 1.9 *************** *** 60,64 **** Starting with Python 2.0, all feature releases are required to ! have a version number the form X.Y; patch releases will always be of the form X.Y.Z. --- 60,64 ---- Starting with Python 2.0, all feature releases are required to ! have a version number of the form X.Y; patch releases will always be of the form X.Y.Z. *************** *** 100,108 **** Patch Czar History ! Anthony Baxter (anthony@interlink.com.au) is the Patch Czar for 2.1.2. ! Thomas Wouters (thomas@xs4all.net) is the Patch Czar for 2.1.1. ! Moshe Zadka (moshez@zadka.site.co.il) is the Patch Czar for 2.0.1. --- 100,116 ---- Patch Czar History ! Anthony Baxter is the Patch Czar for 2.3.1 and 2.3.2. ! Barry Warsaw is the Patch Czar for 2.2.3. ! Guido van Rossum is the Patch Czar for 2.2.2. ! ! Michael Hudson is the Patch Czar for 2.2.1. ! ! Anthony Baxter is the Patch Czar for 2.1.2 and 2.1.3. ! ! Thomas Wouters is the Patch Czar for 2.1.1. ! ! Moshe Zadka is the Patch Czar for 2.0.1. From gvanrossum at users.sourceforge.net Thu Oct 23 19:54:59 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Oct 23 19:55:03 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.874,1.875 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12795/Misc Modified Files: NEWS Log Message: - The pwd module incorrectly advertised its struct type as struct_pwent; this has been renamed to struct_passwd. (The old name is still supported for backwards compatibility.) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.874 retrieving revision 1.875 diff -C2 -d -r1.874 -r1.875 *** NEWS 21 Oct 2003 15:41:59 -0000 1.874 --- NEWS 23 Oct 2003 23:54:57 -0000 1.875 *************** *** 48,51 **** --- 48,55 ---- ----------------- + - The pwd module incorrectly advertised its struct type as + struct_pwent; this has been renamed to struct_passwd. (The old name + is still supported for backwards compatibility.) + - The xml.parsers.expat module now provides Expat 1.95.7. From gvanrossum at users.sourceforge.net Thu Oct 23 19:54:59 2003 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Oct 23 19:55:09 2003 Subject: [Python-checkins] python/dist/src/Modules pwdmodule.c,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12795/Modules Modified Files: pwdmodule.c Log Message: - The pwd module incorrectly advertised its struct type as struct_pwent; this has been renamed to struct_passwd. (The old name is still supported for backwards compatibility.) Index: pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** pwdmodule.c 6 Dec 2002 12:48:51 -0000 1.37 --- pwdmodule.c 23 Oct 2003 23:54:57 -0000 1.38 *************** *** 185,188 **** --- 185,190 ---- PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc); Py_INCREF((PyObject *) &StructPwdType); + PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType); + /* And for b/w compatibility (this was defined by mistake): */ PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType); } From rhettinger at users.sourceforge.net Thu Oct 23 21:29:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 23 21:29:20 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv27174 Modified Files: pep-0289.txt Log Message: Fix typo Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0289.txt 23 Oct 2003 17:02:11 -0000 1.9 --- pep-0289.txt 24 Oct 2003 01:29:14 -0000 1.10 *************** *** 133,137 **** and also:: ! g = (x**2 for i in range(10)) i.e. if a function call has a single positional argument, it can be --- 133,137 ---- and also:: ! g = (x**2 for x in range(10)) i.e. if a function call has a single positional argument, it can be From rhettinger at users.sourceforge.net Fri Oct 24 04:45:25 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Oct 24 04:46:17 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.875,1.876 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv26769/Misc Modified Files: NEWS Log Message: Added itertools.tee() It works like the pure python verion except: * it stops storing data after of the iterators gets deallocated * the data queue is implemented with two stacks instead of one dictionary. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.875 retrieving revision 1.876 diff -C2 -d -r1.875 -r1.876 *** NEWS 23 Oct 2003 23:54:57 -0000 1.875 --- NEWS 24 Oct 2003 08:45:22 -0000 1.876 *************** *** 74,77 **** --- 74,95 ---- - Implemented (?(id/name)yes|no) support in SRE (#572936). + - random.seed() with no arguments or None uses time.time() as a default + seed. Modified to match Py2.2 behavior and use fractional seconds so + that successive runs are more likely to produce different sequences. + + - random.Random has a new method, getrandbits(k), which returns an int + with k random bits. This method is now an optional part of the API + for user defined generators. Any generator that defines genrandbits() + can now use randrange() for ranges with a length >= 2**53. Formerly, + randrange would return only even numbers for ranges that large (see + SF bug #812202). Generators that do not define genrandbits() now + issue a warning when randrange() is called with a range that large. + + - itertools now has a new function, tee() which produces two independent + iterators from a single iterable. + + - itertools.izip() with no arguments now returns an empty iterator instead + of raising a TypeError exception. + Library ------- *************** *** 108,126 **** allow any iterable. Also the Set.update() has been deprecated because it duplicates Set.union_update(). - - - random.seed() with no arguments or None uses time.time() as a default - seed. Modified to match Py2.2 behavior and use fractional seconds so - that successive runs are more likely to produce different sequences. - - - random.Random has a new method, getrandbits(k), which returns an int - with k random bits. This method is now an optional part of the API - for user defined generators. Any generator that defines genrandbits() - can now use randrange() for ranges with a length >= 2**53. Formerly, - randrange would return only even numbers for ranges that large (see - SF bug #812202). Generators that do not define genrandbits() now - issue a warning when randrange() is called with a range that large. - - - itertools.izip() with no arguments now returns an empty iterator instead - of raising a TypeError exception. - _strptime.py now has a behind-the-scenes caching mechanism for the most --- 126,129 ---- From rhettinger at users.sourceforge.net Fri Oct 24 04:45:25 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Oct 24 04:46:22 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26769/Doc/lib Modified Files: libitertools.tex Log Message: Added itertools.tee() It works like the pure python verion except: * it stops storing data after of the iterators gets deallocated * the data queue is implemented with two stacks instead of one dictionary. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** libitertools.tex 20 Oct 2003 17:01:07 -0000 1.19 --- libitertools.tex 24 Oct 2003 08:45:23 -0000 1.20 *************** *** 109,115 **** \end{verbatim} ! Note, this is the only member of the toolkit that may require ! significant auxiliary storage (depending on the length of the ! iterable). \end{funcdesc} --- 109,114 ---- \end{verbatim} ! Note, this member of the toolkit may require significant ! auxiliary storage (depending on the length of the iterable). \end{funcdesc} *************** *** 283,286 **** --- 282,311 ---- \end{funcdesc} + \begin{funcdesc}{tee}{iterable} + Return two independent iterators from a single iterable. + Equivalent to: + + \begin{verbatim} + def tee(iterable): + def gen(next, data={}, cnt=[0]): + for i in count(): + if i == cnt[0]: + item = data[i] = next() + cnt[0] += 1 + else: + item = data.pop(i) + yield item + it = iter(iterable) + return (gen(it.next), gen(it.next)) + \end{verbatim} + + Note, this member of the toolkit may require significant auxiliary + storage (depending on how much temporary data needs to be stored). + In general, if one iterator is going use most or all of the data before + the other iterator, it is faster to use \function{list()} instead of + \function{tee()}. + \versionadded{2.4} + \end{funcdesc} + \subsection{Examples \label{itertools-example}} *************** *** 370,373 **** --- 395,409 ---- return sum(imap(operator.mul, vec1, vec2)) + def flatten(listOfLists): + return list(chain(*listOfLists)) + + def repeatfunc(func, times=None, *args): + "Repeat calls to func with specified arguments." + "Example: repeatfunc(random.random)" + if times is None: + return starmap(func, repeat(args)) + else: + return starmap(func, repeat(args, times)) + def window(seq, n=2): "Returns a sliding window (of width n) over data from the iterable" *************** *** 380,397 **** result = result[1:] + (elem,) yield result - - def tee(iterable): - "Return two independent iterators from a single iterable" - def gen(next, data={}, cnt=[0]): - dpop = data.pop - for i in count(): - if i == cnt[0]: - item = data[i] = next() - cnt[0] += 1 - else: - item = dpop(i) - yield item - next = iter(iterable).next - return (gen(next), gen(next)) \end{verbatim} --- 416,419 ---- From rhettinger at users.sourceforge.net Fri Oct 24 04:45:26 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Oct 24 04:46:26 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.21, 1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv26769/Lib/test Modified Files: test_itertools.py Log Message: Added itertools.tee() It works like the pure python verion except: * it stops storing data after of the iterators gets deallocated * the data queue is implemented with two stacks instead of one dictionary. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_itertools.py 5 Oct 2003 16:47:36 -0000 1.21 --- test_itertools.py 24 Oct 2003 08:45:23 -0000 1.22 *************** *** 4,7 **** --- 4,8 ---- import sys import operator + import random def onearg(x): *************** *** 199,202 **** --- 200,247 ---- self.assertRaises(ValueError, dropwhile(errfunc, [(4,5)]).next) + def test_tee(self): + n = 100 + def irange(n): + for i in xrange(n): + yield i + + a, b = tee([]) # test empty iterator + self.assertEqual(list(a), []) + self.assertEqual(list(b), []) + + a, b = tee(irange(n)) # test 100% interleaved + self.assertEqual(zip(a,b), zip(range(n),range(n))) + + a, b = tee(irange(n)) # test 0% interleaved + self.assertEqual(list(a), range(n)) + self.assertEqual(list(b), range(n)) + + a, b = tee(irange(n)) # test dealloc of leading iterator + self.assertEqual(a.next(), 0) + self.assertEqual(a.next(), 1) + del a + self.assertEqual(list(b), range(n)) + + a, b = tee(irange(n)) # test dealloc of trailing iterator + self.assertEqual(a.next(), 0) + self.assertEqual(a.next(), 1) + del b + self.assertEqual(list(a), range(2, n)) + + for j in xrange(5): # test randomly interleaved + order = [0]*n + [1]*n + random.shuffle(order) + lists = ([], []) + its = tee(irange(n)) + for i in order: + value = its[i].next() + lists[i].append(value) + self.assertEqual(lists[0], range(n)) + self.assertEqual(lists[1], range(n)) + + self.assertRaises(TypeError, tee) + self.assertRaises(TypeError, tee, 3) + self.assertRaises(TypeError, tee, [1,2], 'x') + def test_StopIteration(self): self.assertRaises(StopIteration, izip().next) *************** *** 209,212 **** --- 254,264 ---- self.assertRaises(StopIteration, islice(StopNow(), None).next) + p, q = tee([]) + self.assertRaises(StopIteration, p.next) + self.assertRaises(StopIteration, q.next) + p, q = tee(StopNow()) + self.assertRaises(StopIteration, p.next) + self.assertRaises(StopIteration, q.next) + self.assertRaises(StopIteration, repeat(None, 0).next) *************** *** 215,218 **** --- 267,316 ---- self.assertRaises(StopIteration, f(lambda x:x, StopNow()).next) + class TestGC(unittest.TestCase): + + def makecycle(self, iterator, container): + container.append(iterator) + iterator.next() + del container, iterator + + def test_chain(self): + a = [] + self.makecycle(chain(a), a) + + def test_cycle(self): + a = [] + self.makecycle(cycle([a]*2), a) + + def test_ifilter(self): + a = [] + self.makecycle(ifilter(lambda x:True, [a]*2), a) + + def test_ifilterfalse(self): + a = [] + self.makecycle(ifilterfalse(lambda x:False, a), a) + + def test_izip(self): + a = [] + self.makecycle(izip([a]*2, [a]*3), a) + + def test_imap(self): + a = [] + self.makecycle(imap(lambda x:x, [a]*2), a) + + def test_islice(self): + a = [] + self.makecycle(islice([a]*2, None), a) + + def test_starmap(self): + a = [] + self.makecycle(starmap(lambda *t: t, [(a,a)]*2), a) + + def test_tee(self): + a = [] + p, q = t = tee([a]*2) + a += [a, p, q, t] + p.next() + del a, p, q, t + def R(seqn): 'Regular generator' *************** *** 291,333 **** return chain(imap(lambda x:x, R(Ig(G(seqn))))) - class TestGC(unittest.TestCase): - - def makecycle(self, iterator, container): - container.append(iterator) - iterator.next() - del container, iterator - - def test_chain(self): - a = [] - self.makecycle(chain(a), a) - - def test_cycle(self): - a = [] - self.makecycle(cycle([a]*2), a) - - def test_ifilter(self): - a = [] - self.makecycle(ifilter(lambda x:True, [a]*2), a) - - def test_ifilterfalse(self): - a = [] - self.makecycle(ifilterfalse(lambda x:False, a), a) - - def test_izip(self): - a = [] - self.makecycle(izip([a]*2, [a]*3), a) - - def test_imap(self): - a = [] - self.makecycle(imap(lambda x:x, [a]*2), a) - - def test_islice(self): - a = [] - self.makecycle(islice([a]*2, None), a) - - def test_starmap(self): - a = [] - self.makecycle(starmap(lambda *t: t, [(a,a)]*2), a) - class TestVariousIteratorArgs(unittest.TestCase): --- 389,392 ---- *************** *** 428,431 **** --- 487,500 ---- self.assertRaises(ZeroDivisionError, list, dropwhile(isOdd, E(s))) + def test_tee(self): + for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): + for g in (G, I, Ig, S, L, R): + it1, it2 = tee(g(s)) + self.assertEqual(list(it1), list(g(s))) + self.assertEqual(list(it2), list(g(s))) + self.assertRaises(TypeError, tee, X(s)) + self.assertRaises(TypeError, list, tee(N(s))[0]) + self.assertRaises(ZeroDivisionError, list, tee(E(s))[0]) + class RegressionTests(unittest.TestCase): *************** *** 532,535 **** --- 601,615 ---- ... return sum(imap(operator.mul, vec1, vec2)) + >>> def flatten(listOfLists): + ... return list(chain(*listOfLists)) + + >>> def repeatfunc(func, times=None, *args): + ... "Repeat calls to func with specified arguments." + ... " Example: repeatfunc(random.random)" + ... if times is None: + ... return starmap(func, repeat(args)) + ... else: + ... return starmap(func, repeat(args, times)) + >>> def window(seq, n=2): ... "Returns a sliding window (of width n) over data from the iterable" *************** *** 543,560 **** ... yield result - >>> def tee(iterable): - ... "Return two independent iterators from a single iterable" - ... def gen(next, data={}, cnt=[0]): - ... dpop = data.pop - ... for i in count(): - ... if i == cnt[0]: - ... item = data[i] = next() - ... cnt[0] += 1 - ... else: - ... item = dpop(i) - ... yield item - ... next = iter(iterable).next - ... return (gen(next), gen(next)) - This is not part of the examples but it tests to make sure the definitions perform as purported. --- 623,626 ---- *************** *** 593,596 **** --- 659,673 ---- 50 + >>> a = [[1, 2, 3], [4, 5, 6]] + >>> flatten(a) + [1, 2, 3, 4, 5, 6] + + >>> list(repeatfunc(pow, 5, 2, 3)) + [8, 8, 8, 8, 8] + + >>> import random + >>> take(5, imap(int, repeatfunc(random.random))) + [0, 0, 0, 0, 0] + >>> list(window('abc')) [('a', 'b'), ('b', 'c')] *************** *** 607,618 **** >>> dotproduct([1,2,3], [4,5,6]) 32 - - >>> x, y = tee(chain(xrange(2,10))) - >>> list(x), list(y) - ([2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 4, 5, 6, 7, 8, 9]) - - >>> x, y = tee(chain(xrange(2,10))) - >>> zip(x, y) - [(2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)] """ --- 684,687 ---- From rhettinger at users.sourceforge.net Fri Oct 24 04:45:26 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Oct 24 04:46:28 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.21, 1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv26769/Modules Modified Files: itertoolsmodule.c Log Message: Added itertools.tee() It works like the pure python verion except: * it stops storing data after of the iterators gets deallocated * the data queue is implemented with two stacks instead of one dictionary. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** itertoolsmodule.c 30 Aug 2003 00:10:06 -0000 1.21 --- itertoolsmodule.c 24 Oct 2003 08:45:23 -0000 1.22 *************** *** 8,11 **** --- 8,269 ---- */ + /* independent iterator object supporting the tee object ***************/ + + /* The tee object maintains a queue of data seen by the leading iterator + but not seen by the trailing iterator. When the leading iterator + gets data from PyIter_Next() it appends a copy to the inbasket stack. + When the trailing iterator needs data, it is popped from the outbasket + stack. If the outbasket stack is empty, then it is filled from the + inbasket (i.e. the queue is implemented using two stacks so that only + O(n) operations like append() and pop() are used to access data and + calls to reverse() never move any data element more than once). + + If one of the independent iterators gets deallocated, it sets tee's + save_mode to zero so that future calls to PyIter_Next() stop getting + saved to the queue (because there is no longer a second iterator that + may need the data). + */ + + typedef struct { + PyObject_HEAD + PyObject *it; + PyObject *inbasket; + PyObject *outbasket; + int save_mode; + int num_seen; + } teeobject; + + typedef struct { + PyObject_HEAD + teeobject *tee; + int num_seen; + } iiobject; + + static PyTypeObject ii_type; + + static PyObject * + ii_next(iiobject *lz) + { + teeobject *to = lz->tee; + PyObject *result, *tmp; + + if (lz->num_seen == to->num_seen) { + /* This instance is leading, use iter to get more data */ + result = PyIter_Next(to->it); + if (result == NULL) + return NULL; + if (to->save_mode) + PyList_Append(to->inbasket, result); + to->num_seen++; + lz->num_seen++; + return result; + } + + /* This instance is trailing, get data from the queue */ + if (PyList_GET_SIZE(to->outbasket) == 0) { + /* outbasket is empty, so refill from the inbasket */ + tmp = to->outbasket; + to->outbasket = to->inbasket; + to->inbasket = tmp; + PyList_Reverse(to->outbasket); + assert(PyList_GET_SIZE(to->outbasket) > 0); + } + + lz->num_seen++; + return PyObject_CallMethod(to->outbasket, "pop", NULL); + } + + static void + ii_dealloc(iiobject *ii) + { + PyObject_GC_UnTrack(ii); + ii->tee->save_mode = 0; /* Stop saving data */ + Py_XDECREF(ii->tee); + PyObject_GC_Del(ii); + } + + static int + ii_traverse(iiobject *ii, visitproc visit, void *arg) + { + if (ii->tee) + return visit((PyObject *)(ii->tee), arg); + return 0; + } + + PyDoc_STRVAR(ii_doc, "Independent iterators linked to a tee() object."); + + static PyTypeObject ii_type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ + "itertools.independent_iterator", /* tp_name */ + sizeof(iiobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)ii_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + ii_doc, /* tp_doc */ + (traverseproc)ii_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)ii_next, /* tp_iternext */ + 0, /* tp_methods */ + }; + + /* tee object **********************************************************/ + + static PyTypeObject tee_type; + + static PyObject * + tee_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + { + PyObject *it = NULL; + PyObject *iterable; + PyObject *inbasket = NULL, *outbasket = NULL, *result = NULL; + teeobject *to = NULL; + int i; + + if (!PyArg_UnpackTuple(args, "tee", 1, 1, &iterable)) + return NULL; + + it = PyObject_GetIter(iterable); + if (it == NULL) goto fail; + + inbasket = PyList_New(0); + if (inbasket == NULL) goto fail; + + outbasket = PyList_New(0); + if (outbasket == NULL) goto fail; + + to = (teeobject *)type->tp_alloc(type, 0); + if (to == NULL) goto fail; + + to->it = it; + to->inbasket = inbasket; + to->outbasket = outbasket; + to->save_mode = 1; + to->num_seen = 0; + + /* create independent iterators */ + result = PyTuple_New(2); + if (result == NULL) goto fail; + for (i=0 ; i<2 ; i++) { + iiobject *indep_it = PyObject_GC_New(iiobject, &ii_type); + if (indep_it == NULL) goto fail; + Py_INCREF(to); + indep_it->tee = to; + indep_it->num_seen = 0; + PyObject_GC_Track(indep_it); + PyTuple_SET_ITEM(result, i, (PyObject *)indep_it); + } + goto succeed; + fail: + Py_XDECREF(it); + Py_XDECREF(inbasket); + Py_XDECREF(outbasket); + Py_XDECREF(result); + succeed: + Py_XDECREF(to); + return result; + } + + static void + tee_dealloc(teeobject *to) + { + PyObject_GC_UnTrack(to); + Py_XDECREF(to->inbasket); + Py_XDECREF(to->outbasket); + Py_XDECREF(to->it); + to->ob_type->tp_free(to); + } + + static int + tee_traverse(teeobject *to, visitproc visit, void *arg) + { + int err; + + if (to->it) { + err = visit(to->it, arg); + if (err) + return err; + } + if (to->inbasket) { + err = visit(to->inbasket, arg); + if (err) + return err; + } + if (to->outbasket) { + err = visit(to->outbasket, arg); + if (err) + return err; + } + return 0; + } + + PyDoc_STRVAR(tee_doc, + "tee(iterable) --> (it1, it2)\n\ + \n\ + Split the iterable into to independent iterables."); + + static PyTypeObject tee_type = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + "itertools.tee", /* tp_name */ + sizeof(teeobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)tee_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | + Py_TPFLAGS_BASETYPE, /* tp_flags */ + tee_doc, /* tp_doc */ + (traverseproc)tee_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + tee_new, /* tp_new */ + PyObject_GC_Del, /* tp_free */ + }; + /* cycle object **********************************************************/ *************** *** 1825,1828 **** --- 2083,2087 ---- char *name; PyTypeObject *typelist[] = { + &tee_type, &cycle_type, &dropwhile_type, From doerwalter at users.sourceforge.net Fri Oct 24 10:25:30 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Oct 24 10:25:47 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_codeccallbacks.py, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv21163/Lib/test Modified Files: test_codeccallbacks.py Log Message: Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap(). charmaptranslate_makespace() allocated more memory than required for the next replacement but didn't remember that fact, so memory size was growing exponentially every time a replacement string is longer that one character. This fixes SF bug #828737. Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_codeccallbacks.py 12 Aug 2003 17:34:49 -0000 1.14 --- test_codeccallbacks.py 24 Oct 2003 14:25:28 -0000 1.15 *************** *** 691,694 **** --- 691,706 ---- self.assertRaises(TypeError, u"\xff".translate, {0xff: ()}) + def test_bug828737(self): + charmap = { + ord("&"): u"&", + ord("<"): u"<", + ord(">"): u">", + ord('"'): u""", + } + + for n in (1, 10, 100, 1000): + text = u'abcghi'*n + text.translate(charmap) + def test_main(): test.test_support.run_unittest(CodecCallbackTest) From doerwalter at users.sourceforge.net Fri Oct 24 10:25:30 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Oct 24 10:25:51 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.200, 2.201 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv21163/Objects Modified Files: unicodeobject.c Log Message: Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap(). charmaptranslate_makespace() allocated more memory than required for the next replacement but didn't remember that fact, so memory size was growing exponentially every time a replacement string is longer that one character. This fixes SF bug #828737. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.200 retrieving revision 2.201 diff -C2 -d -r2.200 -r2.201 *** unicodeobject.c 18 Oct 2003 09:55:08 -0000 2.200 --- unicodeobject.c 24 Oct 2003 14:25:28 -0000 2.201 *************** *** 3223,3239 **** Return 0 on success, -1 on error */ static ! int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, int *outsize, int requiredsize) { ! if (requiredsize > *outsize) { /* remember old output position */ int outpos = *outp-PyUnicode_AS_UNICODE(*outobj); /* exponentially overallocate to minimize reallocations */ ! if (requiredsize < 2 * *outsize) ! requiredsize = 2 * *outsize; if (_PyUnicode_Resize(outobj, requiredsize) < 0) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; - *outsize = requiredsize; } return 0; --- 3223,3239 ---- Return 0 on success, -1 on error */ static ! int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, int requiredsize) { ! int oldsize = PyUnicode_GET_SIZE(*outobj); ! if (requiredsize > oldsize) { /* remember old output position */ int outpos = *outp-PyUnicode_AS_UNICODE(*outobj); /* exponentially overallocate to minimize reallocations */ ! if (requiredsize < 2 * oldsize) ! requiredsize = 2 * oldsize; if (_PyUnicode_Resize(outobj, requiredsize) < 0) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } return 0; *************** *** 3246,3257 **** Return 0 on success, -1 on error. */ static ! int charmaptranslate_output(Py_UNICODE c, PyObject *mapping, ! PyObject **outobj, int *outsize, Py_UNICODE **outp, PyObject **res) { ! if (charmaptranslate_lookup(c, mapping, res)) return -1; if (*res==NULL) { /* not found => default to 1:1 mapping */ ! *(*outp)++ = (Py_UNICODE)c; } else if (*res==Py_None) --- 3246,3258 ---- Return 0 on success, -1 on error. */ static ! int charmaptranslate_output(const Py_UNICODE *startinp, const Py_UNICODE *curinp, ! int insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, ! PyObject **res) { ! if (charmaptranslate_lookup(*curinp, mapping, res)) return -1; if (*res==NULL) { /* not found => default to 1:1 mapping */ ! *(*outp)++ = *curinp; } else if (*res==Py_None) *************** *** 3269,3274 **** else if (repsize!=0) { /* more than one character */ ! int requiredsize = *outsize + repsize - 1; ! if (charmaptranslate_makespace(outobj, outp, outsize, requiredsize)) return -1; memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); --- 3270,3277 ---- else if (repsize!=0) { /* more than one character */ ! int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (*curinp-*startinp)) + ! repsize - 1; ! if (charmaptranslate_makespace(outobj, outp, requiredsize)) return -1; memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); *************** *** 3295,3299 **** /* current output position */ int respos = 0; - int ressize; char *reason = "character maps to "; PyObject *errorHandler = NULL; --- 3298,3301 ---- *************** *** 3313,3326 **** res = PyUnicode_FromUnicode(NULL, size); if (res == NULL) ! goto onError; if (size == 0) return res; str = PyUnicode_AS_UNICODE(res); - ressize = size; while (p Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv28564/Lib/test Modified Files: Tag: release23-maint test_codeccallbacks.py Log Message: Backport checkin: Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap(). charmaptranslate_makespace() allocates more memory than required for the next replacement but didn't remember that fact, so memory size was growing exponentially every time a replacement string is longer that one character. This fixes SF bug #828737. Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.12.8.1 retrieving revision 1.12.8.2 diff -C2 -d -r1.12.8.1 -r1.12.8.2 *** test_codeccallbacks.py 12 Aug 2003 17:38:22 -0000 1.12.8.1 --- test_codeccallbacks.py 24 Oct 2003 15:05:29 -0000 1.12.8.2 *************** *** 691,694 **** --- 691,706 ---- self.assertRaises(TypeError, u"\xff".translate, {0xff: ()}) + def test_bug828737(self): + charmap = { + ord("&"): u"&", + ord("<"): u"<", + ord(">"): u">", + ord('"'): u""", + } + + for n in (1, 10, 100, 1000): + text = u'abcghi'*n + text.translate(charmap) + def test_main(): test.test_support.run_unittest(CodecCallbackTest) From doerwalter at users.sourceforge.net Fri Oct 24 11:05:32 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Oct 24 11:05:56 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190.6.8, 2.190.6.9 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv28564/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkin: Fix a bug in the memory reallocation code of PyUnicode_TranslateCharmap(). charmaptranslate_makespace() allocates more memory than required for the next replacement but didn't remember that fact, so memory size was growing exponentially every time a replacement string is longer that one character. This fixes SF bug #828737. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.8 retrieving revision 2.190.6.9 diff -C2 -d -r2.190.6.8 -r2.190.6.9 *** unicodeobject.c 18 Oct 2003 09:54:38 -0000 2.190.6.8 --- unicodeobject.c 24 Oct 2003 15:05:29 -0000 2.190.6.9 *************** *** 3224,3240 **** Return 0 on success, -1 on error */ static ! int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, int *outsize, int requiredsize) { ! if (requiredsize > *outsize) { /* remember old output position */ int outpos = *outp-PyUnicode_AS_UNICODE(*outobj); /* exponentially overallocate to minimize reallocations */ ! if (requiredsize < 2 * *outsize) ! requiredsize = 2 * *outsize; if (_PyUnicode_Resize(outobj, requiredsize)) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; - *outsize = requiredsize; } return 0; --- 3224,3240 ---- Return 0 on success, -1 on error */ static ! int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp, int requiredsize) { ! int oldsize = PyUnicode_GET_SIZE(*outobj); ! if (requiredsize > oldsize) { /* remember old output position */ int outpos = *outp-PyUnicode_AS_UNICODE(*outobj); /* exponentially overallocate to minimize reallocations */ ! if (requiredsize < 2 * oldsize) ! requiredsize = 2 * oldsize; if (_PyUnicode_Resize(outobj, requiredsize)) return -1; *outp = PyUnicode_AS_UNICODE(*outobj) + outpos; } return 0; *************** *** 3247,3258 **** Return 0 on success, -1 on error. */ static ! int charmaptranslate_output(Py_UNICODE c, PyObject *mapping, ! PyObject **outobj, int *outsize, Py_UNICODE **outp, PyObject **res) { ! if (charmaptranslate_lookup(c, mapping, res)) return -1; if (*res==NULL) { /* not found => default to 1:1 mapping */ ! *(*outp)++ = (Py_UNICODE)c; } else if (*res==Py_None) --- 3247,3259 ---- Return 0 on success, -1 on error. */ static ! int charmaptranslate_output(const Py_UNICODE *startinp, const Py_UNICODE *curinp, ! int insize, PyObject *mapping, PyObject **outobj, Py_UNICODE **outp, ! PyObject **res) { ! if (charmaptranslate_lookup(*curinp, mapping, res)) return -1; if (*res==NULL) { /* not found => default to 1:1 mapping */ ! *(*outp)++ = *curinp; } else if (*res==Py_None) *************** *** 3270,3275 **** else if (repsize!=0) { /* more than one character */ ! int requiredsize = *outsize + repsize - 1; ! if (charmaptranslate_makespace(outobj, outp, outsize, requiredsize)) return -1; memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); --- 3271,3278 ---- else if (repsize!=0) { /* more than one character */ ! int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (*curinp-*startinp)) + ! repsize - 1; ! if (charmaptranslate_makespace(outobj, outp, requiredsize)) return -1; memcpy(*outp, PyUnicode_AS_UNICODE(*res), sizeof(Py_UNICODE)*repsize); *************** *** 3296,3300 **** /* current output position */ int respos = 0; - int ressize; char *reason = "character maps to "; PyObject *errorHandler = NULL; --- 3299,3302 ---- *************** *** 3314,3327 **** res = PyUnicode_FromUnicode(NULL, size); if (res == NULL) ! goto onError; if (size == 0) return res; str = PyUnicode_AS_UNICODE(res); - ressize = size; while (p Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19056 Modified Files: unittest.py Log Message: Fixed bug introduced in revision 1.27 Index: unittest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** unittest.py 30 Sep 2003 09:25:32 -0000 1.29 --- unittest.py 24 Oct 2003 17:15:29 -0000 1.30 *************** *** 505,509 **** del parts_copy[-1] if not parts_copy: raise ! parts = parts[1:] obj = module for part in parts: --- 505,509 ---- del parts_copy[-1] if not parts_copy: raise ! parts = parts[1:] obj = module for part in parts: From akuchling at users.sourceforge.net Fri Oct 24 13:38:37 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 13:38:40 2003 Subject: [Python-checkins] python/dist/src/Lib tarfile.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv23734 Modified Files: tarfile.py Log Message: [Bug #822668] tarfile raises an exception if the tarfile is gzipped and is too large; the gzip filesize should be written out mod 2**32. (Reported by Johan Fredrik Ohman) Index: tarfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tarfile.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tarfile.py 22 Apr 2003 22:03:11 -0000 1.8 --- tarfile.py 24 Oct 2003 17:38:34 -0000 1.9 *************** *** 358,362 **** if self.type == "gz": self.fileobj.write(struct.pack(" Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv25149 Modified Files: Tag: release23-maint tarfile.py Log Message: [Backport fix for bug #822668] gzip filesize should be written out mod 2**32 Index: tarfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tarfile.py,v retrieving revision 1.8 retrieving revision 1.8.12.1 diff -C2 -d -r1.8 -r1.8.12.1 *** tarfile.py 22 Apr 2003 22:03:11 -0000 1.8 --- tarfile.py 24 Oct 2003 17:47:57 -0000 1.8.12.1 *************** *** 358,362 **** if self.type == "gz": self.fileobj.write(struct.pack(" Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv32119 Modified Files: MINIFEST.in Log Message: Include docs in snapshots Index: MINIFEST.in =================================================================== RCS file: /cvsroot/python/distutils/MINIFEST.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MINIFEST.in 28 Jun 2000 01:31:37 -0000 1.2 --- MINIFEST.in 24 Oct 2003 18:22:24 -0000 1.3 *************** *** 1,4 **** # ! # mini-manifest used to create code snapshots: no docs, no examples, # just the code (should include tests at some point, but they're # either non-existent or hopelessly crude right now) --- 1,4 ---- # ! # mini-manifest used to create code snapshots: no examples, # just the code (should include tests at some point, but they're # either non-existent or hopelessly crude right now) *************** *** 7,11 **** # include README.snapshot - exclude *.txt recursive-include examples *.txt *.py prune examples/sample*/build --- 7,10 ---- From akuchling at users.sourceforge.net Fri Oct 24 14:23:11 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:23:14 2003 Subject: [Python-checkins] distutils README.txt, 1.26, 1.27 CHANGES.txt, 1.22, 1.23 Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv32295 Modified Files: README.txt CHANGES.txt Log Message: Add entry for impending 1.1 release Index: README.txt =================================================================== RCS file: /cvsroot/python/distutils/README.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** README.txt 19 Nov 2002 14:26:18 -0000 1.26 --- README.txt 24 Oct 2003 18:23:09 -0000 1.27 *************** *** 1,5 **** Python Distribution Utilities ! release 1.0.3 ! November 24th, 2002 --- 1,5 ---- Python Distribution Utilities ! release 1.1 ! October XXXth, 2003 Index: CHANGES.txt =================================================================== RCS file: /cvsroot/python/distutils/CHANGES.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CHANGES.txt 19 Nov 2002 14:22:54 -0000 1.22 --- CHANGES.txt 24 Oct 2003 18:23:09 -0000 1.23 *************** *** 1,2 **** --- 1,9 ---- + Relase 1.1 (XXX October, 2003): + ------------------------------- + + Release 1.1 of Distutils is the version of the Distutils included with + Python 2.3.2, plus a few docstring typo fixes. + + Relase 1.0.3 (24 November, 2002): --------------------------------- From akuchling at users.sourceforge.net Fri Oct 24 14:23:33 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:23:36 2003 Subject: [Python-checkins] distutils snapshot_setup.py,1.1,1.2 Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv32342 Modified Files: snapshot_setup.py Log Message: Add current maintainer; fix old option name Index: snapshot_setup.py =================================================================== RCS file: /cvsroot/python/distutils/snapshot_setup.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** snapshot_setup.py 8 Jun 2000 01:18:36 -0000 1.1 --- snapshot_setup.py 24 Oct 2003 18:23:31 -0000 1.2 *************** *** 16,21 **** author = "Greg Ward", author_email = "gward@python.net", url = "http://www.python.org/sigs/distutils-sig/", ! licence = "Python", packages = ['distutils', 'distutils.command'], --- 16,23 ---- author = "Greg Ward", author_email = "gward@python.net", + maintainer = "A.M. Kuchling", + maintainer_email = 'amk@amk.ca', url = "http://www.python.org/sigs/distutils-sig/", ! license = "Python", packages = ['distutils', 'distutils.command'], From akuchling at users.sourceforge.net Fri Oct 24 14:26:28 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:27:04 2003 Subject: [Python-checkins] python/dist/src setup.py,1.174,1.175 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv443 Modified Files: setup.py Log Message: [Patch #772077 from Tim Rice] Fix for compiling the readline module on UnixWare; fix goofy comment indent. 2.3 bugfix candidate Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** setup.py 21 Oct 2003 15:41:15 -0000 1.174 --- setup.py 24 Oct 2003 18:26:26 -0000 1.175 *************** *** 279,284 **** inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) ! # OSF/1 has some stuff in /usr/ccs/lib (like -ldb) ! if platform == 'osf1': lib_dirs += ['/usr/ccs/lib'] --- 279,284 ---- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) ! # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) ! if platform in ['osf1', 'unixware7', 'openunix8']: lib_dirs += ['/usr/ccs/lib'] *************** *** 421,425 **** libraries=readline_libs) ) if platform not in ['mac']: ! # crypt module. if self.compiler.find_library_file(lib_dirs, 'crypt'): --- 421,425 ---- libraries=readline_libs) ) if platform not in ['mac']: ! # crypt module. if self.compiler.find_library_file(lib_dirs, 'crypt'): From akuchling at users.sourceforge.net Fri Oct 24 14:43:31 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:43:36 2003 Subject: [Python-checkins] distutils/examples/sample3 setup.py,1.1,1.2 Message-ID: Update of /cvsroot/python/distutils/examples/sample3 In directory sc8-pr-cvs1:/tmp/cvs-serv3777 Modified Files: setup.py Log Message: Fix example Index: setup.py =================================================================== RCS file: /cvsroot/python/distutils/examples/sample3/setup.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.py 22 Apr 2000 02:45:02 -0000 1.1 --- setup.py 24 Oct 2003 18:43:28 -0000 1.2 *************** *** 11,15 **** def run (self): ! self.run_peer ('greet') build.run (self) --- 11,15 ---- def run (self): ! self.run_command ('greet') build.run (self) From akuchling at users.sourceforge.net Fri Oct 24 14:49:00 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:49:07 2003 Subject: [Python-checkins] distutils/examples template_setup.py,1.2,1.3 Message-ID: Update of /cvsroot/python/distutils/examples In directory sc8-pr-cvs1:/tmp/cvs-serv5011 Modified Files: template_setup.py Log Message: Use current location for docs; modernize template a bit Index: template_setup.py =================================================================== RCS file: /cvsroot/python/distutils/examples/template_setup.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** template_setup.py 31 May 2000 02:29:52 -0000 1.2 --- template_setup.py 24 Oct 2003 18:48:58 -0000 1.3 *************** *** 1,7 **** #!/usr/bin/env python ! # Template for creating your own setup.py. See the USAGE file in ! # the Distutils source distribution for descriptions of all the ! # options shown below. Brief instructions on what to do: # - change XXX to the name of your module distribution; note that # this will be used to generate a filename, so keep it short and --- 1,9 ---- #!/usr/bin/env python ! # Template for creating your own setup.py. See the "Distributing ! # Python Modules" manual at http://www.python.org/doc/current/dist/ ! # for descriptions of all the options shown below. ! # ! # Brief instructions on what to do: # - change XXX to the name of your module distribution; note that # this will be used to generate a filename, so keep it short and *************** *** 28,36 **** name = "XXX", version = "", ! description = "", author = "", author_email = "", url = "", ! # Description of the modules and packages in the distribution packages = [''], --- 30,46 ---- name = "XXX", version = "", ! description = "XXX Single-line explanation of package", ! long_description = """XXX multi-paragraph explanation of package""", author = "", author_email = "", url = "", ! license = "XXX", ! classifiers = [ ! # Include appropriate classifiers from the output of ! # "setup.py register --list-classifiers" ! "XXX :: XXX", ! "XXX :: XXX", ! ], ! # Description of the modules and packages in the distribution packages = [''], From akuchling at users.sourceforge.net Fri Oct 24 14:50:40 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 24 14:50:45 2003 Subject: [Python-checkins] distutils setup.cfg,1.3,1.4 Message-ID: Update of /cvsroot/python/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv5420 Modified Files: setup.cfg Log Message: Updated file Index: setup.cfg =================================================================== RCS file: /cvsroot/python/distutils/setup.cfg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** setup.cfg 30 Jun 2000 03:45:44 -0000 1.3 --- setup.cfg 24 Oct 2003 18:50:38 -0000 1.4 *************** *** 11,16 **** # basis, rather than in the config file for each module distribution.) # - # created 2000/05/31, Greg Ward - # # $Id$ # --- 11,14 ---- *************** *** 21,32 **** [bdist_rpm] release = 1 ! packager = Greg Ward doc_files = CHANGES.txt README.txt - USAGE.txt doc/ examples/ changelog = * Thu Jun 29 2000 Greg Ward 0.9 - Made myself the packager, since I can now create the RPM on my own --- 19,32 ---- [bdist_rpm] release = 1 ! packager = A.M. Kuchling doc_files = CHANGES.txt README.txt doc/ examples/ changelog = + * Fri Oct 24 2003 A.M. Kuchling 1.1 + - Updated for the Distutils 1.1 code base. + * Thu Jun 29 2000 Greg Ward 0.9 - Made myself the packager, since I can now create the RPM on my own From loewis at users.sourceforge.net Fri Oct 24 16:05:34 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:07:36 2003 Subject: [Python-checkins] python/dist/src/Python modsupport.c,2.68,2.69 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv24423 Modified Files: modsupport.c Log Message: Patch #828384: Don't discard nested exception in AddObject. Index: modsupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v retrieving revision 2.68 retrieving revision 2.69 diff -C2 -d -r2.68 -r2.69 *** modsupport.c 21 Jun 2003 21:35:25 -0000 2.68 --- modsupport.c 24 Oct 2003 20:05:32 -0000 2.69 *************** *** 521,526 **** } if (!o) { ! PyErr_SetString(PyExc_TypeError, ! "PyModule_AddObject() needs non-NULL value"); return -1; } --- 521,527 ---- } if (!o) { ! if (!PyErr_Occurred()) ! PyErr_SetString(PyExc_TypeError, ! "PyModule_AddObject() needs non-NULL value"); return -1; } From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:29 2003 Subject: [Python-checkins] python/dist/src/Tools/framer/framer template.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/framer/framer In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Tools/framer/framer Modified Files: template.py Log Message: Patch #812378: Normalize white space. Index: template.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/framer/framer/template.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** template.py 5 Aug 2002 18:29:45 -0000 1.1 --- template.py 24 Oct 2003 20:09:23 -0000 1.2 *************** *** 20,31 **** methoddef_def = """\ ! {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s},""" methoddef_def_doc = """\ ! {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s, %(DocstringVar)s},""" methoddef_end = """\ ! {NULL, NULL} }; """ --- 20,31 ---- methoddef_def = """\ ! {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s},""" methoddef_def_doc = """\ ! {"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s, %(DocstringVar)s},""" methoddef_end = """\ ! {NULL, NULL} }; """ *************** *** 44,48 **** memberdef_end = """\ ! {NULL} }; --- 44,48 ---- memberdef_end = """\ ! {NULL} }; From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:32 2003 Subject: [Python-checkins] python/dist/src/Lib/distutils sysconfig.py, 1.57, 1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Lib/distutils Modified Files: sysconfig.py Log Message: Patch #812378: Normalize white space. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** sysconfig.py 10 Feb 2003 14:02:33 -0000 1.57 --- sysconfig.py 24 Oct 2003 20:09:23 -0000 1.58 *************** *** 71,77 **** elif os.name == "mac": if plat_specific: ! return os.path.join(prefix, "Mac", "Include") else: ! return os.path.join(prefix, "Include") elif os.name == "os2": return os.path.join(prefix, "Include") --- 71,77 ---- elif os.name == "mac": if plat_specific: ! return os.path.join(prefix, "Mac", "Include") else: ! return os.path.join(prefix, "Include") elif os.name == "os2": return os.path.join(prefix, "Include") *************** *** 161,165 **** ldshared = ldshared + ' ' + os.environ['LDFLAGS'] if basecflags: ! opt = basecflags + ' ' + opt if os.environ.has_key('CFLAGS'): opt = opt + ' ' + os.environ['CFLAGS'] --- 161,165 ---- ldshared = ldshared + ' ' + os.environ['LDFLAGS'] if basecflags: ! opt = basecflags + ' ' + opt if os.environ.has_key('CFLAGS'): opt = opt + ' ' + os.environ['CFLAGS'] From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:36 2003 Subject: [Python-checkins] python/dist/src/Tools/faqwiz faqconf.py, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/faqwiz In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Tools/faqwiz Modified Files: faqconf.py Log Message: Patch #812378: Normalize white space. Index: faqconf.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/faqwiz/faqconf.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** faqconf.py 31 Mar 2000 00:55:54 -0000 1.24 --- faqconf.py 24 Oct 2003 20:09:23 -0000 1.25 *************** *** 16,33 **** # Parameters you definitely want to change ! SHORTNAME = "Generic" # FAQ name with "FAQ" omitted ! PASSWORD = "" # Password for editing ! OWNERNAME = "FAQ owner" # Name for feedback ! OWNEREMAIL = "nobody@anywhere.org" # Email for feedback ! HOMEURL = "http://www.python.org" # Related home page ! HOMENAME = "Python home" # Name of related home page ! RCSBINDIR = "/usr/local/bin/" # Directory containing RCS commands ! # (must end in a slash) # Parameters you can normally leave alone ! MAXHITS = 10 # Max #hits to be shown directly ! COOKIE_LIFETIME = 28*24*3600 # Cookie expiration in seconds ! # (28*24*3600 = 28 days = 4 weeks) PROCESS_PREFORMAT = 1 # toggle whether preformatted text # will replace urls and emails with --- 16,33 ---- # Parameters you definitely want to change ! SHORTNAME = "Generic" # FAQ name with "FAQ" omitted ! PASSWORD = "" # Password for editing ! OWNERNAME = "FAQ owner" # Name for feedback ! OWNEREMAIL = "nobody@anywhere.org" # Email for feedback ! HOMEURL = "http://www.python.org" # Related home page ! HOMENAME = "Python home" # Name of related home page ! RCSBINDIR = "/usr/local/bin/" # Directory containing RCS commands ! # (must end in a slash) # Parameters you can normally leave alone ! MAXHITS = 10 # Max #hits to be shown directly ! COOKIE_LIFETIME = 28*24*3600 # Cookie expiration in seconds ! # (28*24*3600 = 28 days = 4 weeks) PROCESS_PREFORMAT = 1 # toggle whether preformatted text # will replace urls and emails with *************** *** 37,44 **** # (may contain HTML, e.g. ); and corresponding ! MARK_VERY_RECENT = " **" # Changed very recently ! MARK_RECENT = " *" # Changed recently ! DT_VERY_RECENT = 24*3600 # 24 hours ! DT_RECENT = 7*24*3600 # 7 days EXPLAIN_MARKS = """ --- 37,44 ---- # (may contain HTML, e.g. ); and corresponding ! MARK_VERY_RECENT = " **" # Changed very recently ! MARK_RECENT = " *" # Changed recently ! DT_VERY_RECENT = 24*3600 # 24 hours ! DT_RECENT = 7*24*3600 # 7 days EXPLAIN_MARKS = """ *************** *** 50,54 **** # Version -- don't change unless you edit faqwiz.py ! WIZVERSION = "1.0.4" # FAQ Wizard version import os, sys --- 50,54 ---- # Version -- don't change unless you edit faqwiz.py ! WIZVERSION = "1.0.4" # FAQ Wizard version import os, sys *************** *** 56,65 **** # On NT we'll probably be running python from a batch file, # so sys.argv[0] is not helpful ! FAQCGI = 'faq.bat' # Relative URL of the FAQ cgi script # LOGNAME is not typically set on NT os.environ[ 'LOGNAME' ] = "FAQWizard" else: # This parameter is normally overwritten with a dynamic value ! FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script FAQCGI = os.path.basename(sys.argv[0]) or FAQCGI del os, sys --- 56,65 ---- # On NT we'll probably be running python from a batch file, # so sys.argv[0] is not helpful ! FAQCGI = 'faq.bat' # Relative URL of the FAQ cgi script # LOGNAME is not typically set on NT os.environ[ 'LOGNAME' ] = "FAQWizard" else: # This parameter is normally overwritten with a dynamic value ! FAQCGI = 'faqw.py' # Relative URL of the FAQ cgi script FAQCGI = os.path.basename(sys.argv[0]) or FAQCGI del os, sys *************** *** 85,90 **** # Calculated parameter names ! COOKIE_NAME = SHORTNAME + "-FAQ-Wizard" # Name used for Netscape cookie ! FAQNAME = SHORTNAME + " FAQ" # Name of the FAQ # ---------------------------------------------------------------------- --- 85,90 ---- # Calculated parameter names ! COOKIE_NAME = SHORTNAME + "-FAQ-Wizard" # Name used for Netscape cookie ! FAQNAME = SHORTNAME + " FAQ" # Name of the FAQ # ---------------------------------------------------------------------- *************** *** 176,195 **** Simple string ! / Regular expression ! /
    Keywords (any) ! / Keywords (all) !
    Fold case ! / Case sensitive !
    --- 176,195 ---- Simple string ! / Regular expression ! /
    Keywords (any) ! / Keywords (all) !
    Fold case ! / Case sensitive !
    *************** *** 363,374 **** ! ! !
    Name: !
    Email: !
    Password: !
    --- 363,374 ---- ! ! !
    Name: !
    Email: !
    Password: !
    From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:40 2003 Subject: [Python-checkins] python/dist/src/Tools/versioncheck _checkversion.py, 1.1, 1.2 checkversions.py, 1.3, 1.4 pyversioncheck.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/versioncheck In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Tools/versioncheck Modified Files: _checkversion.py checkversions.py pyversioncheck.py Log Message: Patch #812378: Normalize white space. Index: _checkversion.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/versioncheck/_checkversion.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _checkversion.py 23 Dec 1997 18:43:51 -0000 1.1 --- _checkversion.py 24 Oct 2003 20:09:23 -0000 1.2 *************** *** 10,16 **** try: ! _myverbose=VERBOSE except NameError: ! _myverbose=1 ! pyversioncheck.versioncheck(_PACKAGE, _URL, _VERSION, verbose=_myverbose) --- 10,16 ---- try: ! _myverbose=VERBOSE except NameError: ! _myverbose=1 ! pyversioncheck.versioncheck(_PACKAGE, _URL, _VERSION, verbose=_myverbose) Index: checkversions.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/versioncheck/checkversions.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** checkversions.py 11 Sep 2002 20:36:01 -0000 1.3 --- checkversions.py 24 Oct 2003 20:09:23 -0000 1.4 *************** *** 24,54 **** def check1dir(dummy, dir, files): ! if CHECKNAME in files: ! fullname = os.path.join(dir, CHECKNAME) ! try: ! execfile(fullname) ! except: ! print '** Exception in', fullname ! def walk1tree(tree): ! os.path.walk(tree, check1dir, None) ! def main(): ! global VERBOSE ! try: ! options, arguments = getopt.getopt(sys.argv[1:], 'v:') ! except getopt.error: ! print USAGE ! sys.exit(1) ! for o, a in options: ! if o == '-v': ! VERBOSE = int(a) ! if not arguments: ! arguments = [sys.prefix] ! for dir in arguments: ! walk1tree(dir) ! if __name__ == '__main__': ! main() ! ! --- 24,54 ---- def check1dir(dummy, dir, files): ! if CHECKNAME in files: ! fullname = os.path.join(dir, CHECKNAME) ! try: ! execfile(fullname) ! except: ! print '** Exception in', fullname ! def walk1tree(tree): ! os.path.walk(tree, check1dir, None) ! def main(): ! global VERBOSE ! try: ! options, arguments = getopt.getopt(sys.argv[1:], 'v:') ! except getopt.error: ! print USAGE ! sys.exit(1) ! for o, a in options: ! if o == '-v': ! VERBOSE = int(a) ! if not arguments: ! arguments = [sys.prefix] ! for dir in arguments: ! walk1tree(dir) ! if __name__ == '__main__': ! main() ! ! Index: pyversioncheck.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/versioncheck/pyversioncheck.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pyversioncheck.py 11 Sep 2002 20:36:01 -0000 1.4 --- pyversioncheck.py 24 Oct 2003 20:09:23 -0000 1.5 *************** *** 6,13 **** # Verbose options ! VERBOSE_SILENT=0 # Single-line reports per package ! VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated ! VERBOSE_EACHFILE=2 # Report on each URL checked ! VERBOSE_CHECKALL=3 # Check each URL for each package # Test directory --- 6,13 ---- # Verbose options ! VERBOSE_SILENT=0 # Single-line reports per package ! VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated ! VERBOSE_EACHFILE=2 # Report on each URL checked ! VERBOSE_CHECKALL=3 # Check each URL for each package # Test directory *************** *** 97,100 **** if __name__ == '__main__': _test() ! ! --- 97,99 ---- if __name__ == '__main__': _test() ! From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:45 2003 Subject: [Python-checkins] python/dist/src/Tools/pynche PyncheWidget.py, 2.27, 2.28 StripViewer.py, 2.15, 2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/pynche In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Tools/pynche Modified Files: PyncheWidget.py StripViewer.py Log Message: Patch #812378: Normalize white space. Index: PyncheWidget.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/PyncheWidget.py,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** PyncheWidget.py 10 Jul 2001 21:43:43 -0000 2.27 --- PyncheWidget.py 24 Oct 2003 20:09:23 -0000 2.28 *************** *** 76,80 **** # helpmenu = Menu(menubar, name='help', tearoff=0) ! helpmenu.add_command(label='About Pynche...', command=self.__popup_about, underline=0) --- 76,80 ---- # helpmenu = Menu(menubar, name='help', tearoff=0) ! helpmenu.add_command(label='About Pynche...', command=self.__popup_about, underline=0) Index: StripViewer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/pynche/StripViewer.py,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** StripViewer.py 10 Jul 2001 21:44:24 -0000 2.15 --- StripViewer.py 24 Oct 2003 20:09:23 -0000 2.16 *************** *** 36,40 **** foreach c $colors { $canv itemconfigure $i -fill $c -outline $c ! incr i } } --- 36,40 ---- foreach c $colors { $canv itemconfigure $i -fill $c -outline $c ! incr i } } *************** *** 55,61 **** seq = [] while numchips > 0: ! seq.append(int(start)) ! start = start + step ! numchips = numchips - 1 return seq --- 55,61 ---- seq = [] while numchips > 0: ! seq.append(int(start)) ! start = start + step ! numchips = numchips - 1 return seq *************** *** 100,133 **** def __init__(self, canvas, x): ! self._canvas = canvas ! self.__arrow, self.__text = self._create(x) ! self.move_to(x) def _create(self, x): ! arrow = self._canvas.create_line( ! x, self._ARROWHEIGHT + self._YOFFSET, ! x, self._YOFFSET, ! x + self._ARROWWIDTH, self._YOFFSET, ! arrow='first', ! width=3.0, ! tags=self._TAG) ! text = self._canvas.create_text( ! x + self._ARROWWIDTH + 13, ! self._ARROWHEIGHT - self._TEXTYOFFSET, ! tags=self._TAG, ! text='128') ! return arrow, text def _x(self): ! coords = self._canvas.coords(self._TAG) ! assert coords ! return coords[0] def move_to(self, x): ! deltax = x - self._x() ! self._canvas.move(self._TAG, deltax, 0) def set_text(self, text): ! self._canvas.itemconfigure(self.__text, text=text) --- 100,133 ---- def __init__(self, canvas, x): ! self._canvas = canvas ! self.__arrow, self.__text = self._create(x) ! self.move_to(x) def _create(self, x): ! arrow = self._canvas.create_line( ! x, self._ARROWHEIGHT + self._YOFFSET, ! x, self._YOFFSET, ! x + self._ARROWWIDTH, self._YOFFSET, ! arrow='first', ! width=3.0, ! tags=self._TAG) ! text = self._canvas.create_text( ! x + self._ARROWWIDTH + 13, ! self._ARROWHEIGHT - self._TEXTYOFFSET, ! tags=self._TAG, ! text='128') ! return arrow, text def _x(self): ! coords = self._canvas.coords(self._TAG) ! assert coords ! return coords[0] def move_to(self, x): ! deltax = x - self._x() ! self._canvas.move(self._TAG, deltax, 0) def set_text(self, text): ! self._canvas.itemconfigure(self.__text, text=text) *************** *** 136,158 **** def _create(self, x): ! arrow = self._canvas.create_line( ! x, self._YOFFSET, ! x + self._ARROWWIDTH, self._YOFFSET, ! x + self._ARROWWIDTH, self._ARROWHEIGHT + self._YOFFSET, ! arrow='last', ! width=3.0, ! tags=self._TAG) ! text = self._canvas.create_text( ! x - self._ARROWWIDTH + 15, # BAW: kludge ! self._ARROWHEIGHT - self._TEXTYOFFSET, justify=RIGHT, ! text='128', ! tags=self._TAG) ! return arrow, text def _x(self): ! coords = self._canvas.bbox(self._TAG) ! assert coords ! return coords[2] - 6 # BAW: kludge --- 136,158 ---- def _create(self, x): ! arrow = self._canvas.create_line( ! x, self._YOFFSET, ! x + self._ARROWWIDTH, self._YOFFSET, ! x + self._ARROWWIDTH, self._ARROWHEIGHT + self._YOFFSET, ! arrow='last', ! width=3.0, ! tags=self._TAG) ! text = self._canvas.create_text( ! x - self._ARROWWIDTH + 15, # BAW: kludge ! self._ARROWHEIGHT - self._TEXTYOFFSET, justify=RIGHT, ! text='128', ! tags=self._TAG) ! return arrow, text def _x(self): ! coords = self._canvas.bbox(self._TAG) ! assert coords ! return coords[2] - 6 # BAW: kludge *************** *** 174,182 **** hexvar = None): # instance variables ! self.__generator = generator ! self.__axis = axis self.__numchips = numchips ! assert self.__axis in (0, 1, 2) ! self.__uwd = uwdvar self.__hexp = hexvar # the last chip selected --- 174,182 ---- hexvar = None): # instance variables ! self.__generator = generator ! self.__axis = axis self.__numchips = numchips ! assert self.__axis in (0, 1, 2) ! self.__uwd = uwdvar self.__hexp = hexvar # the last chip selected *************** *** 184,192 **** self.__sb = switchboard ! canvaswidth = numchips * (chipwidth + 1) ! canvasheight = chipheight + 43 # BAW: Kludge ! # create the canvas and pack it ! canvas = self.__canvas = Canvas(master, width=canvaswidth, height=canvasheight, --- 184,192 ---- self.__sb = switchboard ! canvaswidth = numchips * (chipwidth + 1) ! canvasheight = chipheight + 43 # BAW: Kludge ! # create the canvas and pack it ! canvas = self.__canvas = Canvas(master, width=canvaswidth, height=canvasheight, *************** *** 195,239 **** ) ! canvas.pack() ! canvas.bind('', self.__select_chip) ! canvas.bind('', self.__select_chip) ! canvas.bind('', self.__select_chip) ! # Load a proc into the Tcl interpreter. This is used in the ! # set_color() method to speed up setting the chip colors. ! canvas.tk.eval(TCLPROC) ! # create the color strip ! chips = self.__chips = [] ! x = 1 ! y = 30 ! tags = ('chip',) ! for c in range(self.__numchips): ! color = 'grey' ! canvas.create_rectangle( ! x, y, x+chipwidth, y+chipheight, ! fill=color, outline=color, ! tags=tags) ! x = x + chipwidth + 1 # for outline ! chips.append(color) ! # create the strip label ! self.__label = canvas.create_text( ! 3, y + chipheight + 8, ! text=label, ! anchor=W) ! # create the arrow and text item ! chipx = self.__arrow_x(0) ! self.__leftarrow = LeftArrow(canvas, chipx) ! chipx = self.__arrow_x(len(chips) - 1) ! self.__rightarrow = RightArrow(canvas, chipx) def __arrow_x(self, chipnum): ! coords = self.__canvas.coords(chipnum+1) ! assert coords ! x0, y0, x1, y1 = coords ! return (x1 + x0) / 2.0 # Invoked when one of the chips is clicked. This should just tell the --- 195,239 ---- ) ! canvas.pack() ! canvas.bind('', self.__select_chip) ! canvas.bind('', self.__select_chip) ! canvas.bind('', self.__select_chip) ! # Load a proc into the Tcl interpreter. This is used in the ! # set_color() method to speed up setting the chip colors. ! canvas.tk.eval(TCLPROC) ! # create the color strip ! chips = self.__chips = [] ! x = 1 ! y = 30 ! tags = ('chip',) ! for c in range(self.__numchips): ! color = 'grey' ! canvas.create_rectangle( ! x, y, x+chipwidth, y+chipheight, ! fill=color, outline=color, ! tags=tags) ! x = x + chipwidth + 1 # for outline ! chips.append(color) ! # create the strip label ! self.__label = canvas.create_text( ! 3, y + chipheight + 8, ! text=label, ! anchor=W) ! # create the arrow and text item ! chipx = self.__arrow_x(0) ! self.__leftarrow = LeftArrow(canvas, chipx) ! chipx = self.__arrow_x(len(chips) - 1) ! self.__rightarrow = RightArrow(canvas, chipx) def __arrow_x(self, chipnum): ! coords = self.__canvas.coords(chipnum+1) ! assert coords ! x0, y0, x1, y1 = coords ! return (x1 + x0) / 2.0 # Invoked when one of the chips is clicked. This should just tell the *************** *** 261,266 **** self.__canvas.itemconfigure(self.__lastchip, outline=color) self.__lastchip = chip ! # get the arrow's text ! coloraxis = rgbtuple[self.__axis] if self.__hexp.get(): # hex --- 261,266 ---- self.__canvas.itemconfigure(self.__lastchip, outline=color) self.__lastchip = chip ! # get the arrow's text ! coloraxis = rgbtuple[self.__axis] if self.__hexp.get(): # hex *************** *** 269,298 **** # decimal text = repr(coloraxis) ! # move the arrow, and set it's text ! if coloraxis <= 128: ! # use the left arrow ! self.__leftarrow.set_text(text) ! self.__leftarrow.move_to(self.__arrow_x(chip-1)) ! self.__rightarrow.move_to(-100) ! else: ! # use the right arrow ! self.__rightarrow.set_text(text) ! self.__rightarrow.move_to(self.__arrow_x(chip-1)) ! self.__leftarrow.move_to(-100) ! # and set the chip's outline brightness = ColorDB.triplet_to_brightness(rgbtuple) ! if brightness <= 128: ! outline = 'white' ! else: ! outline = 'black' ! self.__canvas.itemconfigure(chip, outline=outline) def update_yourself(self, red, green, blue): ! assert self.__generator ! i = 1 ! chip = 0 ! chips = self.__chips = [] ! tk = self.__canvas.tk # get the red, green, and blue components for all chips for t in self.__generator(self.__numchips, red, green, blue): --- 269,298 ---- # decimal text = repr(coloraxis) ! # move the arrow, and set it's text ! if coloraxis <= 128: ! # use the left arrow ! self.__leftarrow.set_text(text) ! self.__leftarrow.move_to(self.__arrow_x(chip-1)) ! self.__rightarrow.move_to(-100) ! else: ! # use the right arrow ! self.__rightarrow.set_text(text) ! self.__rightarrow.move_to(self.__arrow_x(chip-1)) ! self.__leftarrow.move_to(-100) ! # and set the chip's outline brightness = ColorDB.triplet_to_brightness(rgbtuple) ! if brightness <= 128: ! outline = 'white' ! else: ! outline = 'black' ! self.__canvas.itemconfigure(chip, outline=outline) def update_yourself(self, red, green, blue): ! assert self.__generator ! i = 1 ! chip = 0 ! chips = self.__chips = [] ! tk = self.__canvas.tk # get the red, green, and blue components for all chips for t in self.__generator(self.__numchips, red, green, blue): From loewis at users.sourceforge.net Fri Oct 24 16:09:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 24 16:09:49 2003 Subject: [Python-checkins] python/dist/src/Tools/modulator EXAMPLE.py, 1.2, 1.3 ScrolledListbox.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/modulator In directory sc8-pr-cvs1:/tmp/cvs-serv25282/Tools/modulator Modified Files: EXAMPLE.py ScrolledListbox.py Log Message: Patch #812378: Normalize white space. Index: EXAMPLE.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/modulator/EXAMPLE.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EXAMPLE.py 16 May 1995 13:43:09 -0000 1.2 --- EXAMPLE.py 24 Oct 2003 20:09:23 -0000 1.3 *************** *** 35,39 **** o3.methodlist = ['method1', 'method2'] o3.funclist = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr', ! 'tp_compare', 'tp_repr', 'tp_hash'] o3.typelist = ['tp_as_sequence', 'structure'] --- 35,39 ---- o3.methodlist = ['method1', 'method2'] o3.funclist = ['new', 'tp_dealloc', 'tp_print', 'tp_getattr', 'tp_setattr', ! 'tp_compare', 'tp_repr', 'tp_hash'] o3.typelist = ['tp_as_sequence', 'structure'] Index: ScrolledListbox.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/modulator/ScrolledListbox.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScrolledListbox.py 2 Mar 1995 14:04:25 -0000 1.1 --- ScrolledListbox.py 24 Oct 2003 20:09:23 -0000 1.2 *************** *** 15,37 **** class ScrolledListbox(Listbox): ! def __init__(self, master=None, cnf={}): ! cnf = _cnfmerge(cnf) ! fcnf = {} ! vcnf = {'name': 'vbar', ! Pack: {'side': 'right', 'fill': 'y'},} ! for k in cnf.keys(): ! if type(k) == ClassType or k == 'name': ! fcnf[k] = cnf[k] ! del cnf[k] ! self.frame = Frame(master, fcnf) ! self.vbar = Scrollbar(self.frame, vcnf) ! cnf[Pack] = {'side': 'left', 'fill': 'both', 'expand': 'yes'} ! cnf['name'] = 'list' ! Listbox.__init__(self, self.frame, cnf) ! self['yscrollcommand'] = (self.vbar, 'set') ! self.vbar['command'] = (self, 'yview') ! # Copy Pack methods of self.frame -- hack! ! for m in Pack.__dict__.keys(): ! if m[0] != '_' and m != 'config': ! setattr(self, m, getattr(self.frame, m)) --- 15,37 ---- class ScrolledListbox(Listbox): ! def __init__(self, master=None, cnf={}): ! cnf = _cnfmerge(cnf) ! fcnf = {} ! vcnf = {'name': 'vbar', ! Pack: {'side': 'right', 'fill': 'y'},} ! for k in cnf.keys(): ! if type(k) == ClassType or k == 'name': ! fcnf[k] = cnf[k] ! del cnf[k] ! self.frame = Frame(master, fcnf) ! self.vbar = Scrollbar(self.frame, vcnf) ! cnf[Pack] = {'side': 'left', 'fill': 'both', 'expand': 'yes'} ! cnf['name'] = 'list' ! Listbox.__init__(self, self.frame, cnf) ! self['yscrollcommand'] = (self.vbar, 'set') ! self.vbar['command'] = (self, 'yview') ! # Copy Pack methods of self.frame -- hack! ! for m in Pack.__dict__.keys(): ! if m[0] != '_' and m != 'config': ! setattr(self, m, getattr(self.frame, m)) From rhettinger at users.sourceforge.net Sat Oct 25 02:37:49 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 25 02:37:53 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv17377 Modified Files: itertoolsmodule.c Log Message: Improvements to coding for itertools.tee(): * Add error checking code to PyList_Append() call. * Replace PyObject_CallMethod(to->outbasket, "pop", NULL) with equivalent in-line code. Inlining is important here because the search for the pop method will occur for every element returned by the iterator. * Make tee's dealloc() a little smarter. If the trailing iterator is being deallocated, then the queue data is no longer needed and can be freed. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** itertoolsmodule.c 24 Oct 2003 08:45:23 -0000 1.22 --- itertoolsmodule.c 25 Oct 2003 06:37:47 -0000 1.23 *************** *** 47,50 **** --- 47,51 ---- teeobject *to = lz->tee; PyObject *result, *tmp; + int n; if (lz->num_seen == to->num_seen) { *************** *** 54,58 **** return NULL; if (to->save_mode) ! PyList_Append(to->inbasket, result); to->num_seen++; lz->num_seen++; --- 55,62 ---- return NULL; if (to->save_mode) ! if(PyList_Append(to->inbasket, result) == -1){ ! Py_DECREF(result); ! return NULL; ! } to->num_seen++; lz->num_seen++; *************** *** 67,75 **** to->inbasket = tmp; PyList_Reverse(to->outbasket); - assert(PyList_GET_SIZE(to->outbasket) > 0); } lz->num_seen++; ! return PyObject_CallMethod(to->outbasket, "pop", NULL); } --- 71,87 ---- to->inbasket = tmp; PyList_Reverse(to->outbasket); } + /* Pop result from to->outbasket */ + n = PyList_GET_SIZE(to->outbasket); + assert(n>0); + result = PyList_GET_ITEM(to->outbasket, n-1); + Py_INCREF(result); + if (PyList_SetSlice(to->outbasket, n-1, n, NULL) == -1) { + Py_DECREF(result); + return NULL; + } lz->num_seen++; ! return result; } *************** *** 77,82 **** --- 89,105 ---- ii_dealloc(iiobject *ii) { + teeobject *to = ii->tee; + int n; + PyObject_GC_UnTrack(ii); ii->tee->save_mode = 0; /* Stop saving data */ + if (ii->num_seen < to->num_seen) { + /* It is the trailing iterator being freed; this means + that the stored queue data is no longer needed */ + n = PyList_GET_SIZE(to->inbasket); + PyList_SetSlice(to->inbasket, 0, n, NULL); + n = PyList_GET_SIZE(to->outbasket); + PyList_SetSlice(to->outbasket, 0, n, NULL); + } Py_XDECREF(ii->tee); PyObject_GC_Del(ii); From rhettinger at users.sourceforge.net Sat Oct 25 02:41:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Oct 25 02:41:48 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.298,2.299 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv18167 Modified Files: bltinmodule.c Log Message: Use PyArg_UnpackTuple() where possible. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.298 retrieving revision 2.299 diff -C2 -d -r2.298 -r2.299 *** bltinmodule.c 12 Oct 2003 19:09:37 -0000 2.298 --- bltinmodule.c 25 Oct 2003 06:41:37 -0000 2.299 *************** *** 1807,1811 **** PyObject *temp, *item, *iter; ! if (!PyArg_ParseTuple(args, "O|O:sum", &seq, &result)) return NULL; --- 1807,1811 ---- PyObject *temp, *item, *iter; ! if (!PyArg_UnpackTuple(args, "sum", 1, 2, &seq, &result)) return NULL; From aleax at users.sourceforge.net Sat Oct 25 08:47:11 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 08:47:17 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.292.10.1, 2.292.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv2443 Modified Files: Tag: release23-maint bltinmodule.c Log Message: changed builtin_sum to use PyNumber_InPlaceAdd -- unchanged semantics but fixes performance bug with sum(lotsoflists, []). Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.292.10.1 retrieving revision 2.292.10.2 diff -C2 -d -r2.292.10.1 -r2.292.10.2 *** bltinmodule.c 18 Aug 2003 18:34:09 -0000 2.292.10.1 --- bltinmodule.c 25 Oct 2003 12:47:09 -0000 2.292.10.2 *************** *** 1841,1845 **** break; } ! temp = PyNumber_Add(result, item); Py_DECREF(result); Py_DECREF(item); --- 1841,1845 ---- break; } ! temp = PyNumber_InPlaceAdd(result, item); Py_DECREF(result); Py_DECREF(item); From aleax at users.sourceforge.net Sat Oct 25 08:49:58 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 08:50:00 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.299,2.300 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv2818 Modified Files: bltinmodule.c Log Message: Changed builtin_sum to use PyNumber_InPlaceAdd (same semantics, but fixes a performance bug in sum(manylists)), same as in 2.3 maintenance branch. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.299 retrieving revision 2.300 diff -C2 -d -r2.299 -r2.300 *** bltinmodule.c 25 Oct 2003 06:41:37 -0000 2.299 --- bltinmodule.c 25 Oct 2003 12:49:56 -0000 2.300 *************** *** 1841,1845 **** break; } ! temp = PyNumber_Add(result, item); Py_DECREF(result); Py_DECREF(item); --- 1841,1845 ---- break; } ! temp = PyNumber_InPlaceAdd(result, item); Py_DECREF(result); Py_DECREF(item); From aleax at users.sourceforge.net Sat Oct 25 09:02:28 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 09:02:32 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.65,1.831.4.66 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv5008 Modified Files: Tag: release23-maint NEWS Log Message: document the performance fix to builtin_sum(). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.65 retrieving revision 1.831.4.66 diff -C2 -d -r1.831.4.65 -r1.831.4.66 *** NEWS 23 Oct 2003 15:55:03 -0000 1.831.4.65 --- NEWS 25 Oct 2003 13:02:24 -0000 1.831.4.66 *************** *** 16,19 **** --- 16,22 ---- of 1 or 0. + - builtin_sum() now uses PyNumber_InPlaceAdd, fixing a previous + performance bug for sum(list_of_lists) and similar cases. + Extension modules ----------------- From aleax at users.sourceforge.net Sat Oct 25 09:03:00 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 09:03:02 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.876,1.877 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv5132 Modified Files: NEWS Log Message: document the performance fix to builtin_sum(). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.876 retrieving revision 1.877 diff -C2 -d -r1.876 -r1.877 *** NEWS 24 Oct 2003 08:45:22 -0000 1.876 --- NEWS 25 Oct 2003 13:02:57 -0000 1.877 *************** *** 24,27 **** --- 24,30 ---- records with equal keys is unchanged). + - Added a list.copysort() method that returns a copy of the sorted list + while leaving the original intact. + - Added test whether wchar_t is signed or not. A signed wchar_t is not usable as internal unicode type base for Py_UNICODE since the *************** *** 44,47 **** --- 47,53 ---- - obj.__contains__() now returns True/False instead of 1/0. SF patch 820195. + + - builtin_sum() now uses PyNumber_InPlaceAdd, fixing a previous + performance bug for sum(list_of_lists) and similar cases. Extension modules From nnorwitz at users.sourceforge.net Sat Oct 25 10:15:56 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Sat Oct 25 10:16:22 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.208,1.209 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv18225/Doc/tut Modified Files: tut.tex Log Message: SF #829941, update tutorial, built-in types can be base classes since 2.2 Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** tut.tex 21 Oct 2003 18:42:21 -0000 1.208 --- tut.tex 25 Oct 2003 14:15:54 -0000 1.209 *************** *** 3551,3556 **** in Smalltalk, classes themselves are objects, albeit in the wider sense of the word: in Python, all data types are objects. This ! provides semantics for importing and renaming. But, just like in ! \Cpp{} or Modula-3, built-in types cannot be used as base classes for extension by the user. Also, like in \Cpp{} but unlike in Modula-3, most built-in operators with special syntax (arithmetic operators, --- 3551,3556 ---- in Smalltalk, classes themselves are objects, albeit in the wider sense of the word: in Python, all data types are objects. This ! provides semantics for importing and renaming. Unlike ! \Cpp{} and Modula-3, built-in types can be used as base classes for extension by the user. Also, like in \Cpp{} but unlike in Modula-3, most built-in operators with special syntax (arithmetic operators, From nnorwitz at users.sourceforge.net Sat Oct 25 10:17:17 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Sat Oct 25 10:17:21 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.7, 1.196.8.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv18604/Doc/tut Modified Files: Tag: release23-maint tut.tex Log Message: SF #829941, update tutorial, built-in types can be base classes since 2.2 Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.7 retrieving revision 1.196.8.8 diff -C2 -d -r1.196.8.7 -r1.196.8.8 *** tut.tex 21 Oct 2003 18:43:15 -0000 1.196.8.7 --- tut.tex 25 Oct 2003 14:17:15 -0000 1.196.8.8 *************** *** 3542,3547 **** in Smalltalk, classes themselves are objects, albeit in the wider sense of the word: in Python, all data types are objects. This ! provides semantics for importing and renaming. But, just like in ! \Cpp{} or Modula-3, built-in types cannot be used as base classes for extension by the user. Also, like in \Cpp{} but unlike in Modula-3, most built-in operators with special syntax (arithmetic operators, --- 3542,3547 ---- in Smalltalk, classes themselves are objects, albeit in the wider sense of the word: in Python, all data types are objects. This ! provides semantics for importing and renaming. Unlike ! \Cpp{} and Modula-3, built-in types can be used as base classes for extension by the user. Also, like in \Cpp{} but unlike in Modula-3, most built-in operators with special syntax (arithmetic operators, From arigo at users.sourceforge.net Sat Oct 25 10:29:29 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Sat Oct 25 10:29:32 2003 Subject: [Python-checkins] python/dist/src/Python ceval.c, 2.368, 2.369 errors.c, 2.79, 2.80 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv20980 Modified Files: ceval.c errors.c Log Message: Made function declaration a proper C prototype Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.368 retrieving revision 2.369 diff -C2 -d -r2.368 -r2.369 *** ceval.c 12 Oct 2003 19:09:37 -0000 2.368 --- ceval.c 25 Oct 2003 14:29:27 -0000 2.369 *************** *** 511,514 **** --- 511,537 ---- } + int + _Py_CheckRecursiveCall(char *where) + { + PyThreadState *tstate = PyThreadState_GET(); + + #ifdef USE_STACKCHECK + if (PyOS_CheckStack()) { + --tstate->recursion_depth; + PyErr_SetString(PyExc_MemoryError, "Stack overflow"); + return -1; + } + #endif + if (tstate->recursion_depth > recursion_limit) { + --tstate->recursion_depth; + PyErr_Format(PyExc_RuntimeError, + "maximum recursion depth exceeded%s", + where); + return -1; + } + return 0; + } + + /* Status code for main loop (reason for stack unwind) */ *************** *** 675,693 **** return NULL; - #ifdef USE_STACKCHECK - if (tstate->recursion_depth%10 == 0 && PyOS_CheckStack()) { - PyErr_SetString(PyExc_MemoryError, "Stack overflow"); - return NULL; - } - #endif - /* push frame */ ! if (++tstate->recursion_depth > recursion_limit) { ! --tstate->recursion_depth; ! PyErr_SetString(PyExc_RuntimeError, ! "maximum recursion depth exceeded"); ! tstate->frame = f->f_back; return NULL; - } tstate->frame = f; --- 698,704 ---- return NULL; /* push frame */ ! if (Py_EnterRecursiveCall("")) return NULL; tstate->frame = f; *************** *** 711,717 **** f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } --- 722,726 ---- f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! goto exit_eval_frame; } } *************** *** 723,729 **** f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } --- 732,736 ---- f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! goto exit_eval_frame; } } *************** *** 2429,2433 **** /* pop frame */ ! --tstate->recursion_depth; tstate->frame = f->f_back; --- 2436,2441 ---- /* pop frame */ ! exit_eval_frame: ! Py_LeaveRecursiveCall(); tstate->frame = f->f_back; Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.79 retrieving revision 2.80 diff -C2 -d -r2.79 -r2.80 *** errors.c 12 Oct 2003 19:09:37 -0000 2.79 --- errors.c 25 Oct 2003 14:29:27 -0000 2.80 *************** *** 600,604 **** } ! extern PyObject *PyModule_GetWarningsModule(); /* Function to issue a warning message; may raise an exception. */ --- 600,604 ---- } ! extern PyObject *PyModule_GetWarningsModule(void); /* Function to issue a warning message; may raise an exception. */ From arigo at users.sourceforge.net Sat Oct 25 10:33:11 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Sat Oct 25 10:33:14 2003 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.369,2.370 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv21770 Modified Files: ceval.c Log Message: oh dear. Wrong manipulation. Committed a version of ceval.c from my no-cyclic-comparison patch at the same time as errors.c. Reverting ceval.c to the previous revision. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.369 retrieving revision 2.370 diff -C2 -d -r2.369 -r2.370 *** ceval.c 25 Oct 2003 14:29:27 -0000 2.369 --- ceval.c 25 Oct 2003 14:33:09 -0000 2.370 *************** *** 511,537 **** } - int - _Py_CheckRecursiveCall(char *where) - { - PyThreadState *tstate = PyThreadState_GET(); - - #ifdef USE_STACKCHECK - if (PyOS_CheckStack()) { - --tstate->recursion_depth; - PyErr_SetString(PyExc_MemoryError, "Stack overflow"); - return -1; - } - #endif - if (tstate->recursion_depth > recursion_limit) { - --tstate->recursion_depth; - PyErr_Format(PyExc_RuntimeError, - "maximum recursion depth exceeded%s", - where); - return -1; - } - return 0; - } - - /* Status code for main loop (reason for stack unwind) */ --- 511,514 ---- *************** *** 698,704 **** return NULL; /* push frame */ ! if (Py_EnterRecursiveCall("")) return NULL; tstate->frame = f; --- 675,693 ---- return NULL; + #ifdef USE_STACKCHECK + if (tstate->recursion_depth%10 == 0 && PyOS_CheckStack()) { + PyErr_SetString(PyExc_MemoryError, "Stack overflow"); + return NULL; + } + #endif + /* push frame */ ! if (++tstate->recursion_depth > recursion_limit) { ! --tstate->recursion_depth; ! PyErr_SetString(PyExc_RuntimeError, ! "maximum recursion depth exceeded"); ! tstate->frame = f->f_back; return NULL; + } tstate->frame = f; *************** *** 722,726 **** f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! goto exit_eval_frame; } } --- 711,717 ---- f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } *************** *** 732,736 **** f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! goto exit_eval_frame; } } --- 723,729 ---- f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } *************** *** 2436,2441 **** /* pop frame */ ! exit_eval_frame: ! Py_LeaveRecursiveCall(); tstate->frame = f->f_back; --- 2429,2433 ---- /* pop frame */ ! --tstate->recursion_depth; tstate->frame = f->f_back; From guido at python.org Sat Oct 25 17:18:42 2003 From: guido at python.org (Guido van Rossum) Date: Sat Oct 25 17:18:50 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.292.10.1, 2.292.10.2 In-Reply-To: Your message of "Sat, 25 Oct 2003 05:47:11 PDT." References: Message-ID: <200310252118.h9PLIgE07777@12-236-54-216.client.attbi.com> > Modified Files: > Tag: release23-maint > bltinmodule.c > Log Message: > changed builtin_sum to use PyNumber_InPlaceAdd -- unchanged semantics but > fixes performance bug with sum(lotsoflists, []). I think this ought to be reverted, both in 2.3 and 2.4. Consider this code: empty = [] for i in range(10): print sum([[x] for x in range(i)], empty) The output used to be: [] [0] [0, 1] [0, 1, 2] [0, 1, 2, 3] [0, 1, 2, 3, 4] [0, 1, 2, 3, 4, 5] [0, 1, 2, 3, 4, 5, 6] [0, 1, 2, 3, 4, 5, 6, 7] [0, 1, 2, 3, 4, 5, 6, 7, 8] But now it is: [] [0] [0, 0, 1] [0, 0, 1, 0, 1, 2] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7] [0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8] --Guido van Rossum (home page: http://www.python.org/~guido/) From aleax at users.sourceforge.net Sat Oct 25 19:22:57 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 19:23:01 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.292.10.2, 2.292.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv12391/Python Modified Files: Tag: release23-maint bltinmodule.c Log Message: regressing the performance bugfix -- Guido wants the performance bug left alone, because there can be no guarantee re the semantics of += vs + . Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.292.10.2 retrieving revision 2.292.10.3 diff -C2 -d -r2.292.10.2 -r2.292.10.3 *** bltinmodule.c 25 Oct 2003 12:47:09 -0000 2.292.10.2 --- bltinmodule.c 25 Oct 2003 23:22:55 -0000 2.292.10.3 *************** *** 1841,1845 **** break; } ! temp = PyNumber_InPlaceAdd(result, item); Py_DECREF(result); Py_DECREF(item); --- 1841,1845 ---- break; } ! temp = PyNumber_Add(result, item); Py_DECREF(result); Py_DECREF(item); From aleax at users.sourceforge.net Sat Oct 25 19:22:57 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 19:23:05 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.66,1.831.4.67 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12391/Misc Modified Files: Tag: release23-maint NEWS Log Message: regressing the performance bugfix -- Guido wants the performance bug left alone, because there can be no guarantee re the semantics of += vs + . Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.66 retrieving revision 1.831.4.67 diff -C2 -d -r1.831.4.66 -r1.831.4.67 *** NEWS 25 Oct 2003 13:02:24 -0000 1.831.4.66 --- NEWS 25 Oct 2003 23:22:55 -0000 1.831.4.67 *************** *** 16,22 **** of 1 or 0. - - builtin_sum() now uses PyNumber_InPlaceAdd, fixing a previous - performance bug for sum(list_of_lists) and similar cases. - Extension modules ----------------- --- 16,19 ---- From aleax at users.sourceforge.net Sat Oct 25 19:24:16 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 19:24:19 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.300,2.301 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv12803/Python Modified Files: bltinmodule.c Log Message: regressing the performance bugfix -- Guido wants the performance bug left alone, because there can be no guarantee re the semantics of += vs + . Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.300 retrieving revision 2.301 diff -C2 -d -r2.300 -r2.301 *** bltinmodule.c 25 Oct 2003 12:49:56 -0000 2.300 --- bltinmodule.c 25 Oct 2003 23:24:14 -0000 2.301 *************** *** 1841,1845 **** break; } ! temp = PyNumber_InPlaceAdd(result, item); Py_DECREF(result); Py_DECREF(item); --- 1841,1845 ---- break; } ! temp = PyNumber_Add(result, item); Py_DECREF(result); Py_DECREF(item); From aleax at users.sourceforge.net Sat Oct 25 19:24:16 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Sat Oct 25 19:24:22 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.877,1.878 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12803/Misc Modified Files: NEWS Log Message: regressing the performance bugfix -- Guido wants the performance bug left alone, because there can be no guarantee re the semantics of += vs + . Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.877 retrieving revision 1.878 diff -C2 -d -r1.877 -r1.878 *** NEWS 25 Oct 2003 13:02:57 -0000 1.877 --- NEWS 25 Oct 2003 23:24:14 -0000 1.878 *************** *** 48,54 **** 820195. - - builtin_sum() now uses PyNumber_InPlaceAdd, fixing a previous - performance bug for sum(list_of_lists) and similar cases. - Extension modules ----------------- --- 48,51 ---- From aleaxit at yahoo.com Sat Oct 25 19:45:23 2003 From: aleaxit at yahoo.com (Alex Martelli) Date: Sat Oct 25 19:45:47 2003 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.292.10.1, 2.292.10.2 In-Reply-To: <200310252118.h9PLIgE07777@12-236-54-216.client.attbi.com> References: <200310252118.h9PLIgE07777@12-236-54-216.client.attbi.com> Message-ID: <200310260145.23094.aleaxit@yahoo.com> On Saturday 25 October 2003 11:18 pm, Guido van Rossum wrote: > > Modified Files: > > Tag: release23-maint > > bltinmodule.c > > Log Message: > > changed builtin_sum to use PyNumber_InPlaceAdd -- unchanged semantics but > > fixes performance bug with sum(lotsoflists, []). > > I think this ought to be reverted, both in 2.3 and 2.4. Consider this > code: I have reverted it; it's obviously true that, by causing side effects on the 2nd argument, the fix as I had commited it could change semantics. I apologize for not thinking of this (and adding the missing unit-tests to catch this, see next paragraph). If it was up to me I would still pursue the possibility of using PyNumber_InPlaceAdd, for example by only doing so if the second argument could first be successfully copy.copy'ed into the result and falling back to PyNumber_Add otherwise. The alternative of leaving sum as a performance trap for the unwary -- an "attractive nuisance" in legal terms -- would appear to me to be such a bad situation, as to warrant such effort (including adding unit-tests to ensure sum does not alter its second argument, works correctly with a non-copyable 2nd argument, etc). However, it's YOUR decision, and you have already made it clear in another mail that your objections to remedying this performance bug are such that no possible solution will satisfy them. If a type gives different results for "a = a + b" vs "a += b", there is no way sum can find this out; and while, were it my decision, I would not care to support such weird cases at such a huge performance price, it's not my decision. Similarly for types which let you do "a = copy.copy(b)" but do NOT return a valid copy of b, or return b itself even though it's mutable, and so on weirdly. I'm just very sad that I didn't think of this performance-trap back when the specs of sum were first being defined. Oh well:-(. Can I at least add a warning about this performance trap to the docs at http://www.python.org/doc/current/lib/built-in-funcs.html ? Alex From purcell at users.sourceforge.net Sun Oct 26 05:41:06 2003 From: purcell at users.sourceforge.net (purcell@users.sourceforge.net) Date: Sun Oct 26 05:41:10 2003 Subject: [Python-checkins] python/dist/src/Lib unittest.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30693 Modified Files: unittest.py Log Message: Incorporated patch 819077, from George Yoshida: * Fixed typo in docstring for 'failUnlessAlmostEqual()' * Removed unnecessary use of 'float()' for time values. * Removed apparently unnecessary import of unittest. At some point in the distant past I believe it was necessary otherwise the 'TestCase' that a module saw was not the same as the 'TestCase' seen within 'unittest', and the user's TestCase subclasses were not recognised as subclasses of the TestCase seen within unittest. Seems not to be necessary now. Index: unittest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** unittest.py 24 Oct 2003 17:15:29 -0000 1.30 --- unittest.py 26 Oct 2003 10:41:03 -0000 1.31 *************** *** 47,51 **** __author__ = "Steve Purcell" __email__ = "stephen_purcell at yahoo dot com" ! __version__ = "#Revision: 1.58 $"[11:-2] import time --- 47,51 ---- __author__ = "Steve Purcell" __email__ = "stephen_purcell at yahoo dot com" ! __version__ = "#Revision: 1.61 $"[11:-2] import time *************** *** 330,334 **** (default 7) and comparing to zero. ! Note that decimal places (from zero) is usually not the same as significant digits (measured from the most signficant digit). """ --- 330,334 ---- (default 7) and comparing to zero. ! Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). """ *************** *** 510,526 **** parent, obj = obj, getattr(obj, part) - import unittest if type(obj) == types.ModuleType: return self.loadTestsFromModule(obj) elif (isinstance(obj, (type, types.ClassType)) and ! issubclass(obj, unittest.TestCase)): return self.loadTestsFromTestCase(obj) elif type(obj) == types.UnboundMethodType: return parent(obj.__name__) ! elif isinstance(obj, unittest.TestSuite): return obj elif callable(obj): test = obj() ! if not isinstance(test, (unittest.TestCase, unittest.TestSuite)): raise ValueError, \ "calling %s returned %s, not a test" % (obj,test) --- 510,525 ---- parent, obj = obj, getattr(obj, part) if type(obj) == types.ModuleType: return self.loadTestsFromModule(obj) elif (isinstance(obj, (type, types.ClassType)) and ! issubclass(obj, TestCase)): return self.loadTestsFromTestCase(obj) elif type(obj) == types.UnboundMethodType: return parent(obj.__name__) ! elif isinstance(obj, TestSuite): return obj elif callable(obj): test = obj() ! if not isinstance(test, (TestCase, TestSuite)): raise ValueError, \ "calling %s returned %s, not a test" % (obj,test) *************** *** 675,679 **** test(result) stopTime = time.time() ! timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) --- 674,678 ---- test(result) stopTime = time.time() ! timeTaken = stopTime - startTime result.printErrors() self.stream.writeln(result.separator2) From rhettinger at users.sourceforge.net Sun Oct 26 09:25:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 09:26:02 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1431/Lib/test Modified Files: test_itertools.py Log Message: Minor improvements to itertools.tee(): * tee object is no longer subclassable * independent iterators renamed to "itertools.tee_iterator" * fixed doc string typo and added entry in the module doc string Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_itertools.py 24 Oct 2003 08:45:23 -0000 1.22 --- test_itertools.py 26 Oct 2003 14:25:56 -0000 1.23 *************** *** 244,247 **** --- 244,259 ---- self.assertRaises(TypeError, tee, [1,2], 'x') + try: + class A(tee): pass + except TypeError: + pass + else: + self.fail("tee constructor should not be subclassable") + + # tee_iterator should not be instantiable + a, b = tee(xrange(10)) + self.assertRaises(TypeError, type(a)) + self.assert_(a is iter(a)) # tee_iterator should support __iter__ + def test_StopIteration(self): self.assertRaises(StopIteration, izip().next) From rhettinger at users.sourceforge.net Sun Oct 26 09:25:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 09:26:07 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.23, 1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1431/Modules Modified Files: itertoolsmodule.c Log Message: Minor improvements to itertools.tee(): * tee object is no longer subclassable * independent iterators renamed to "itertools.tee_iterator" * fixed doc string typo and added entry in the module doc string Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** itertoolsmodule.c 25 Oct 2003 06:37:47 -0000 1.23 --- itertoolsmodule.c 26 Oct 2003 14:25:56 -0000 1.24 *************** *** 114,123 **** } ! PyDoc_STRVAR(ii_doc, "Independent iterators linked to a tee() object."); static PyTypeObject ii_type = { PyObject_HEAD_INIT(&PyType_Type) 0, /* ob_size */ ! "itertools.independent_iterator", /* tp_name */ sizeof(iiobject), /* tp_basicsize */ 0, /* tp_itemsize */ --- 114,123 ---- } ! PyDoc_STRVAR(ii_doc, "Independent iterator created by tee(iterable)."); static PyTypeObject ii_type = { PyObject_HEAD_INIT(&PyType_Type) 0, /* ob_size */ ! "itertools.tee_iterator", /* tp_name */ sizeof(iiobject), /* tp_basicsize */ 0, /* tp_itemsize */ *************** *** 174,178 **** if (outbasket == NULL) goto fail; ! to = (teeobject *)type->tp_alloc(type, 0); if (to == NULL) goto fail; --- 174,178 ---- if (outbasket == NULL) goto fail; ! to = PyObject_GC_New(teeobject, &tee_type); if (to == NULL) goto fail; *************** *** 182,185 **** --- 182,186 ---- to->save_mode = 1; to->num_seen = 0; + PyObject_GC_Track(to); /* create independent iterators */ *************** *** 213,217 **** Py_XDECREF(to->outbasket); Py_XDECREF(to->it); ! to->ob_type->tp_free(to); } --- 214,218 ---- Py_XDECREF(to->outbasket); Py_XDECREF(to->it); ! PyObject_GC_Del(to); } *************** *** 242,246 **** "tee(iterable) --> (it1, it2)\n\ \n\ ! Split the iterable into to independent iterables."); static PyTypeObject tee_type = { --- 243,247 ---- "tee(iterable) --> (it1, it2)\n\ \n\ ! Split the iterable into two independent iterables."); static PyTypeObject tee_type = { *************** *** 263,271 **** 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | ! Py_TPFLAGS_BASETYPE, /* tp_flags */ tee_doc, /* tp_doc */ (traverseproc)tee_traverse, /* tp_traverse */ --- 264,271 ---- 0, /* tp_call */ 0, /* tp_str */ ! 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ ! Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ tee_doc, /* tp_doc */ (traverseproc)tee_traverse, /* tp_traverse */ *************** *** 286,290 **** 0, /* tp_alloc */ tee_new, /* tp_new */ - PyObject_GC_Del, /* tp_free */ }; --- 286,289 ---- *************** *** 2093,2096 **** --- 2092,2096 ---- imap(fun, p, q, ...) --> fun(p0, q0), fun(p1, q1), ...\n\ starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...\n\ + tee(it) --> (it1, it2) splits one iterator into two \n\ chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ... \n\ takewhile(pred, seq) --> seq[0], seq[1], until pred fails\n\ From rhettinger at users.sourceforge.net Sun Oct 26 10:34:52 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 10:34:57 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.20, 1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv16102/Doc/lib Modified Files: libitertools.tex Log Message: Replace the window() example with pairwise() which demonstrates tee(). Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libitertools.tex 24 Oct 2003 08:45:23 -0000 1.20 --- libitertools.tex 26 Oct 2003 15:34:50 -0000 1.21 *************** *** 406,419 **** return starmap(func, repeat(args, times)) ! def window(seq, n=2): ! "Returns a sliding window (of width n) over data from the iterable" ! " s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... " ! it = iter(seq) ! result = tuple(islice(it, n)) ! if len(result) == n: ! yield result ! for elem in it: ! result = result[1:] + (elem,) ! yield result \end{verbatim} --- 406,413 ---- return starmap(func, repeat(args, times)) ! def pairwise(iterable): ! "s -> (s0,s1), (s1,s2), (s2, s3), ..." ! a, b = tee(iterable) ! return izip(a, islice(b, 1, None)) \end{verbatim} From rhettinger at users.sourceforge.net Sun Oct 26 10:34:52 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 10:35:02 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.23, 1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv16102/Lib/test Modified Files: test_itertools.py Log Message: Replace the window() example with pairwise() which demonstrates tee(). Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_itertools.py 26 Oct 2003 14:25:56 -0000 1.23 --- test_itertools.py 26 Oct 2003 15:34:50 -0000 1.24 *************** *** 624,637 **** ... return starmap(func, repeat(args, times)) ! >>> def window(seq, n=2): ! ... "Returns a sliding window (of width n) over data from the iterable" ! ... " s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... " ! ... it = iter(seq) ! ... result = tuple(islice(it, n)) ! ... if len(result) == n: ! ... yield result ! ... for elem in it: ! ... result = result[1:] + (elem,) ! ... yield result This is not part of the examples but it tests to make sure the definitions --- 624,631 ---- ... return starmap(func, repeat(args, times)) ! >>> def pairwise(iterable): ! ... "s -> (s0,s1), (s1,s2), (s2, s3), ..." ! ... a, b = tee(iterable) ! ... return izip(a, islice(b, 1, None)) This is not part of the examples but it tests to make sure the definitions *************** *** 682,689 **** [0, 0, 0, 0, 0] ! >>> list(window('abc')) ! [('a', 'b'), ('b', 'c')] ! >>> list(window('abc',5)) [] --- 676,686 ---- [0, 0, 0, 0, 0] ! >>> list(pairwise('abcd')) ! [('a', 'b'), ('b', 'c'), ('c', 'd')] ! >>> list(pairwise([])) ! [] ! ! >>> list(pairwise('a')) [] From purcell at users.sourceforge.net Sun Oct 26 11:38:18 2003 From: purcell at users.sourceforge.net (purcell@users.sourceforge.net) Date: Sun Oct 26 11:38:22 2003 Subject: [Python-checkins] python/dist/src/Lib unittest.py,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv27220 Modified Files: unittest.py Log Message: Another instance of the same typo. Index: unittest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** unittest.py 26 Oct 2003 10:41:03 -0000 1.31 --- unittest.py 26 Oct 2003 16:38:16 -0000 1.32 *************** *** 47,51 **** __author__ = "Steve Purcell" __email__ = "stephen_purcell at yahoo dot com" ! __version__ = "#Revision: 1.61 $"[11:-2] import time --- 47,51 ---- __author__ = "Steve Purcell" __email__ = "stephen_purcell at yahoo dot com" ! __version__ = "#Revision: 1.62 $"[11:-2] import time *************** *** 342,346 **** (default 7) and comparing to zero. ! Note that decimal places (from zero) is usually not the same as significant digits (measured from the most signficant digit). """ --- 342,346 ---- (default 7) and comparing to zero. ! Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). """ From rhettinger at users.sourceforge.net Sun Oct 26 12:20:10 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 12:20:13 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv2239 Modified Files: concrete.tex Log Message: Document that varlist can be NULL. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** concrete.tex 19 Oct 2003 18:30:00 -0000 1.29 --- concrete.tex 26 Oct 2003 17:20:07 -0000 1.30 *************** *** 1742,1747 **** Sets the slice of \var{list} between \var{low} and \var{high} to the contents of \var{itemlist}. Analogous to ! \code{\var{list}[\var{low}:\var{high}] = \var{itemlist}}. Returns ! \code{0} on success, \code{-1} on failure. \end{cfuncdesc} --- 1742,1749 ---- Sets the slice of \var{list} between \var{low} and \var{high} to the contents of \var{itemlist}. Analogous to ! \code{\var{list}[\var{low}:\var{high}] = \var{itemlist}}. ! The \var{itemlist} may be \NULL{}, indicating the assignment ! of an empty list (slice deletion). ! Returns \code{0} on success, \code{-1} on failure. \end{cfuncdesc} From rhettinger at users.sourceforge.net Sun Oct 26 12:21:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Oct 26 12:22:00 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.25.10.2, 1.25.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv2537 Modified Files: Tag: release23-maint concrete.tex Log Message: Document that varlist can be NULL. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25.10.2 retrieving revision 1.25.10.3 diff -C2 -d -r1.25.10.2 -r1.25.10.3 *** concrete.tex 19 Oct 2003 07:31:14 -0000 1.25.10.2 --- concrete.tex 26 Oct 2003 17:21:56 -0000 1.25.10.3 *************** *** 1734,1739 **** Sets the slice of \var{list} between \var{low} and \var{high} to the contents of \var{itemlist}. Analogous to ! \code{\var{list}[\var{low}:\var{high}] = \var{itemlist}}. Returns ! \code{0} on success, \code{-1} on failure. \end{cfuncdesc} --- 1734,1741 ---- Sets the slice of \var{list} between \var{low} and \var{high} to the contents of \var{itemlist}. Analogous to ! \code{\var{list}[\var{low}:\var{high}] = \var{itemlist}}. ! The \var{itemlist} may be \NULL{}, indicating the assignment ! of an empty list (slice deletion). ! Returns \code{0} on success, \code{-1} on failure. \end{cfuncdesc} From rhettinger at users.sourceforge.net Mon Oct 27 04:22:20 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 27 04:22:26 2003 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.119,2.120 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv16730 Modified Files: abstract.c Log Message: Fix Greg Ward's error message nit: PyObject_SetItem and PySequenceSetItem had slightly different error messages. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.119 retrieving revision 2.120 diff -C2 -d -r2.119 -r2.120 *** abstract.c 1 Mar 2003 01:44:32 -0000 2.119 --- abstract.c 27 Oct 2003 09:22:16 -0000 2.120 *************** *** 1253,1257 **** } ! type_error("object doesn't support item assignment"); return -1; } --- 1253,1257 ---- } ! type_error("object does not support item assignment"); return -1; } From loewis at users.sourceforge.net Mon Oct 27 09:07:46 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:07:50 2003 Subject: [Python-checkins] python/dist/src/Lib httplib.py,1.79,1.79.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30648/Lib Modified Files: Tag: release23-maint httplib.py Log Message: Patch #817854: Add missing operations for SSLFile. Fixes #792101. Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.79 retrieving revision 1.79.8.1 diff -C2 -d -r1.79 -r1.79.8.1 *** httplib.py 29 Jun 2003 17:55:05 -0000 1.79 --- httplib.py 27 Oct 2003 14:07:42 -0000 1.79.8.1 *************** *** 911,914 **** --- 911,939 ---- return line + def readlines(self, sizehint=0): + total = 0 + list = [] + while True: + line = self.readline() + if not line: + break + list.append(line) + total += len(line) + if sizehint and total >= sizehint: + break + return list + + def fileno(self): + return self._sock.fileno() + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + class FakeSocket(SharedSocketClient): From loewis at users.sourceforge.net Mon Oct 27 09:07:46 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:07:56 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.67,1.831.4.68 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv30648/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #817854: Add missing operations for SSLFile. Fixes #792101. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.67 retrieving revision 1.831.4.68 diff -C2 -d -r1.831.4.67 -r1.831.4.68 *** NEWS 25 Oct 2003 23:22:55 -0000 1.831.4.67 --- NEWS 27 Oct 2003 14:07:43 -0000 1.831.4.68 *************** *** 33,36 **** --- 33,38 ---- ------- + - Bug #792101: Add missing file operations for httplib.SSLFile. + - Bug #811082: test_tempfile fails if space in install directory. From loewis at users.sourceforge.net Mon Oct 27 09:07:56 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:08:02 2003 Subject: [Python-checkins] python/dist/src/Lib httplib.py,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30650/Lib Modified Files: httplib.py Log Message: Patch #817854: Add missing operations for SSLFile. Fixes #792101. Backported to 2.3. Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** httplib.py 29 Jun 2003 17:55:05 -0000 1.79 --- httplib.py 27 Oct 2003 14:07:53 -0000 1.80 *************** *** 911,914 **** --- 911,939 ---- return line + def readlines(self, sizehint=0): + total = 0 + list = [] + while True: + line = self.readline() + if not line: + break + list.append(line) + total += len(line) + if sizehint and total >= sizehint: + break + return list + + def fileno(self): + return self._sock.fileno() + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + class FakeSocket(SharedSocketClient): From loewis at users.sourceforge.net Mon Oct 27 09:24:39 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:24:43 2003 Subject: [Python-checkins] python/dist/src/Modules _ssl.c,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1757/Modules Modified Files: _ssl.c Log Message: Patch #803998: Correctly check for error in SSL_write. Index: _ssl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** _ssl.c 20 Oct 2003 14:01:52 -0000 1.14 --- _ssl.c 27 Oct 2003 14:24:37 -0000 1.15 *************** *** 374,381 **** char *data; int len; int timedout; int err; ! if (!PyArg_ParseTuple(args, "s#:write", &data, &len)) return NULL; --- 374,382 ---- char *data; int len; + int count; int timedout; int err; ! if (!PyArg_ParseTuple(args, "s#:write", &data, &count)) return NULL; *************** *** 388,392 **** err = 0; Py_BEGIN_ALLOW_THREADS ! len = SSL_write(self->ssl, data, len); err = SSL_get_error(self->ssl, len); Py_END_ALLOW_THREADS --- 389,393 ---- err = 0; Py_BEGIN_ALLOW_THREADS ! len = SSL_write(self->ssl, data, count); err = SSL_get_error(self->ssl, len); Py_END_ALLOW_THREADS From loewis at users.sourceforge.net Mon Oct 27 09:24:44 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:24:48 2003 Subject: [Python-checkins] python/dist/src/Modules _ssl.c,1.13.6.1,1.13.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1678/Modules Modified Files: Tag: release23-maint _ssl.c Log Message: Patch #803998: Correctly check for error in SSL_write. Index: _ssl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v retrieving revision 1.13.6.1 retrieving revision 1.13.6.2 diff -C2 -d -r1.13.6.1 -r1.13.6.2 *** _ssl.c 20 Oct 2003 14:34:46 -0000 1.13.6.1 --- _ssl.c 27 Oct 2003 14:24:41 -0000 1.13.6.2 *************** *** 374,381 **** char *data; int len; int timedout; int err; ! if (!PyArg_ParseTuple(args, "s#:write", &data, &len)) return NULL; --- 374,382 ---- char *data; int len; + int count; int timedout; int err; ! if (!PyArg_ParseTuple(args, "s#:write", &data, &count)) return NULL; *************** *** 388,392 **** err = 0; Py_BEGIN_ALLOW_THREADS ! len = SSL_write(self->ssl, data, len); err = SSL_get_error(self->ssl, len); Py_END_ALLOW_THREADS --- 389,393 ---- err = 0; Py_BEGIN_ALLOW_THREADS ! len = SSL_write(self->ssl, data, count); err = SSL_get_error(self->ssl, len); Py_END_ALLOW_THREADS From loewis at users.sourceforge.net Mon Oct 27 09:24:44 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Mon Oct 27 09:24:51 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.68,1.831.4.69 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv1678/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #803998: Correctly check for error in SSL_write. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.68 retrieving revision 1.831.4.69 diff -C2 -d -r1.831.4.68 -r1.831.4.69 *** NEWS 27 Oct 2003 14:07:43 -0000 1.831.4.68 --- NEWS 27 Oct 2003 14:24:41 -0000 1.831.4.69 *************** *** 19,22 **** --- 19,24 ---- ----------------- + - Patch #803998: Deal with errors in SSL_write correctly. + - The xml.parsers.expat module now provides Expat 1.95.7. From aleax at users.sourceforge.net Mon Oct 27 10:01:11 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Mon Oct 27 10:01:32 2003 Subject: [Python-checkins] python/nondist/peps pep-0323.txt, NONE, 1.1 pep-0000.txt, 1.254, 1.255 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv9167 Modified Files: pep-0000.txt Added Files: pep-0323.txt Log Message: Added PEP 323, "Copyable Iterators". --- NEW FILE: pep-0323.txt --- PEP: 323 Title: Copyable Iterators Version: $Revision: 1.1 $ Last-Modified: $Date: 2003/10/27 15:01:08 $ Author: Alex Martelli Status: Draft Type: Standards Track Content-Type: text/plain Created: 25-Oct-2003 Python-Version: 2.4 Post-History: Abstract This PEP suggests that some iterator types should support being copied (shallowly or deeply), by exposing suitable methods such as __copy__ or __deepcopy__. Motivation Some iterators, such as those which built-in function iter builds over sequences, should be intrinsically easy to copy (just get another reference to the same sequence and a copy of the index) or deepcopy (ditto but with a deepcopy of the underlying sequence). However, in Python up to 2.3, those iterators don't expose their state: user code which is using such an iterator X is not able to just "save" a copy of X (for future iteration from the current point) with a simple "saved_X = copy.copy(X)". To "tee" a non-copyable iterator into two independently iterable ones, subtle code [such as that which will go into itertools.tee in 2.4] is needed (a Python version thereof is currently in the itertools docs). In any case, such code will inevitably have to consume memory to keep a copy of the subsequence which has been iterated on by one but not both tee'd iterators. This is a waste of memory in those cases in which the iterator being tee'd already _has_ an underlying sequence (or other iterable) and index. Having iterators expose a suitable __copy__ when feasible allows easy optimization of itertools.tee and similar user code, as in: def tee(it): it = iter(it) try: return it, copy.copy(it) except TypeError: # non-copyable iterator, do all the needed hard work Specification Any iterator type X may expose a method __copy__ that is callable without arguments on any instance x of X. The method should be exposed if and only if the iterator type can provide copyability with reasonably little computational and memory effort. Similarly, X may expose a method __deepcopy__ that is callable with one argument (a memo dictionary) on instances of X. The (very concise...) specs for these methods are at [2] -- for more details, see also file copy.py in the Python standard library. For example, suppose a class Iter essentially duplicated the functionality of the iter builtin for iterating on a sequence: class Iter(object): def __init__(self, sequence): self.sequence = sequence self.index = 0 def __iter__(self): return self def next(self): try: result = self.sequence[self.index] except IndexError: raise StopIteration self.index += 1 return result To make this Iter class compliant with this PEP, the following additions to the body of class Iter would suffice: def __copy__(self): result = self.__class__(sequence) result.index = self.index return result def __deepcopy__(self, memo): result = self.__copy__() result.sequence = deepcopy(self.sequence, memo) return result Details Besides adding to the Python docs a recommendation that user-coded iterators be made copyable when feasible, this PEP's implementation will specifically include the addition of copyability to the iterators over sequences that built-in iter returns, and also to the iterators over a dictionary returned by the methods __iter__, iterkeys, itervalues, and iteritems of built-in type dict. Iterators produced by generators will not be copyable (the BDFL deems shallow copy impossible, and deep copy too much trouble). However, iterators produced by the new "generator expressions" of Python 2.4 (PEP 289 [3]) should be copyable if their underlying iterator[s] are; the strict limitations on what is possible in a generator expression, compared to the much vaster generality of a generator, should make that feasible. Similarly, the iterators produced by the built-in function enumerate should be copyable if the underlying iterator is. The implementation of this PEP will also include the optimization of the new itertools.tee function mentioned in the Motivation section. Rationale Being able to copy iterators will allow copying of user-coded classes that have copyable iterators as attributes. This applies to both shallow and deep copying. Deep copyability of suitable iterators will allow "decoupling" from an underlying mutable sequence, and, according to the BDFL, may in the future allow certain iterators to become picklable (however, this PEP, in itself, does not include picklability of iterators). The main use case for (shallow) copying of an iterator is the same as for the function itertools.tee (new in 2.4). Indeed, we assume that user code will typically not directly attempt to copy.copy an iterator, because it would have to deal with uncopyable cases; just calling itertools.tee will enable copying when feasible, with an implicit fallback to a maximally efficient non-copying strategy for iterators that are not copyable. A tee'd iterator may serve as a "reference point", allowing processing of a sequence to continue or resume from a known point, while the other independent iterator can be freely advanced to "explore" a further part of the sequence as needed. To fully exploit this pattern, it should ideally also be possible, given two iterators originally produced by iterator.tee, to check if they are "equal" (have been stepped the same number of times); however, this PEP, in itself, does not include comparability of such iterators. Therefore, code using this pattern may also need to count the number of forward steps taken after tee by the iterators, so as to be able to tell which one is "behind", and by how much. Built-in function enumerate is one way to make such counting very easy in many situations. However, such needs do not always arise. Here is a simpler example: a generator which, given an iterator of numbers (assumed to be positive), returns a corresponding iterator each of whose items is the fraction of the total corresponding to each corresponding item of the input iterator. The caller may pass the total as a value, if known in advance; otherwise, the iterator returned by calling the generator will first compute the total. def fractions(numbers, total=None): if total is None: numbers, aux = itertools.tee(numbers) total = sum(aux) total = float(total) for item in numbers: yield item / total The ability to tee the numbers iterator allows this generator to precompute the total, if needed, without necessarily requiring O(N) auxiliary memory if the numbers iterator is copyable. References [1] Discussion on python-dev starting at post: http://mail.python.org/pipermail/python-dev/2003-October/038969.html [2] Online documentation for the copy module of the standard library: http://www.python.org/doc/current/lib/module-copy.html [3] PEP 289, Generator Expressions, Hettinger http://www.python.org/peps/pep-0289.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.254 retrieving revision 1.255 diff -C2 -d -r1.254 -r1.255 *** pep-0000.txt 22 Oct 2003 18:09:35 -0000 1.254 --- pep-0000.txt 27 Oct 2003 15:01:08 -0000 1.255 *************** *** 120,123 **** --- 120,124 ---- S 321 Date/Time Parsing and Formatting Kuchling S 322 Reverse Iteration Methods Hettinger + S 323 Copyable Iterators Martelli S 754 IEEE 754 Floating Point Special Values Warnes From akuchling at users.sourceforge.net Mon Oct 27 10:46:18 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Mon Oct 27 10:46:22 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libhtmllib.tex,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv17768 Modified Files: libhtmllib.tex Log Message: Fix inaccuracy: all entities from XHTML 1.0 are supported (according to text further down in this file) Index: libhtmllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhtmllib.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** libhtmllib.tex 14 Jul 2003 08:15:47 -0000 1.26 --- libhtmllib.tex 27 Oct 2003 15:46:16 -0000 1.27 *************** *** 65,70 **** \begin{classdesc}{HTMLParser}{formatter} This is the basic HTML parser class. It supports all entity names ! required by the HTML 2.0 specification (\rfc{1866}). It also defines ! handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements. \end{classdesc} --- 65,70 ---- \begin{classdesc}{HTMLParser}{formatter} This is the basic HTML parser class. It supports all entity names ! required by the XHTML 1.0 Recommendation (\url{http://www.w3.org/TR/xhtml1}). ! It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements. \end{classdesc} *************** *** 80,85 **** ``HTML as deployed'' and which isn't legal for XHTML.} ! \seemodule{htmlentitydefs}{Definition of replacement text for HTML ! 2.0 entities.} \seemodule{sgmllib}{Base class for \class{HTMLParser}.} \end{seealso} --- 80,85 ---- ``HTML as deployed'' and which isn't legal for XHTML.} ! \seemodule{htmlentitydefs}{Definition of replacement text for XHTML 1.0 ! entities.} \seemodule{sgmllib}{Base class for \class{HTMLParser}.} \end{seealso} From akuchling at users.sourceforge.net Mon Oct 27 10:47:50 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Mon Oct 27 10:47:54 2003 Subject: [Python-checkins] python/dist/src/Lib htmllib.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv18017 Modified Files: htmllib.py Log Message: Docstring fix: XHTML 1.0 entities are supported Index: htmllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/htmllib.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** htmllib.py 12 Sep 2003 16:38:00 -0000 1.20 --- htmllib.py 27 Oct 2003 15:47:48 -0000 1.21 *************** *** 14,20 **** """This is the basic HTML parser class. ! It supports all entity names required by the HTML 2.0 specification ! RFC 1866. It also defines handlers for all HTML 2.0 and many HTML 3.0 ! and 3.2 elements. """ --- 14,20 ---- """This is the basic HTML parser class. ! It supports all entity names required by the XHTML 1.0 Recommendation. ! It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2 ! elements. """ From rhettinger at users.sourceforge.net Mon Oct 27 15:00:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 27 15:00:43 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libposixpath.tex, 1.36, 1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5180 Modified Files: libposixpath.tex Log Message: SF bug #827902: ctime is not creation time Document the correct definition of os.path.getctime() Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** libposixpath.tex 25 Apr 2003 15:12:47 -0000 1.36 --- libposixpath.tex 27 Oct 2003 20:00:36 -0000 1.37 *************** *** 85,89 **** \begin{funcdesc}{getctime}{path} ! Return the time of creation of \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does --- 85,90 ---- \begin{funcdesc}{getctime}{path} ! Return the time of most recent content modification or metadata change ! for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does From rhettinger at users.sourceforge.net Mon Oct 27 15:03:25 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Oct 27 15:03:28 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libposixpath.tex, 1.36, 1.36.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5782 Modified Files: Tag: release23-maint libposixpath.tex Log Message: SF bug #827902: ctime is not creation time Document the correct definition of os.path.getctime() Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.36 retrieving revision 1.36.12.1 diff -C2 -d -r1.36 -r1.36.12.1 *** libposixpath.tex 25 Apr 2003 15:12:47 -0000 1.36 --- libposixpath.tex 27 Oct 2003 20:03:22 -0000 1.36.12.1 *************** *** 85,89 **** \begin{funcdesc}{getctime}{path} ! Return the time of creation of \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does --- 85,90 ---- \begin{funcdesc}{getctime}{path} ! Return the time of most recent content modification or metadata change ! for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does From rhettinger at users.sourceforge.net Tue Oct 28 02:32:31 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 02:32:35 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20751 Modified Files: itertoolsmodule.c Log Message: Fix nits in error messages. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** itertoolsmodule.c 26 Oct 2003 14:25:56 -0000 1.24 --- itertoolsmodule.c 28 Oct 2003 07:32:28 -0000 1.25 *************** *** 768,772 **** PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Stop argument must be an integer or None."); return NULL; } --- 768,772 ---- PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Stop argument must be a non-negative integer or None."); return NULL; } *************** *** 777,781 **** PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Start argument must be an integer."); return NULL; } --- 777,781 ---- PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Start argument must be a non-negative integer."); return NULL; } *************** *** 786,790 **** PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Stop argument must be an integer or None."); return NULL; } --- 786,790 ---- PyErr_Clear(); PyErr_SetString(PyExc_ValueError, ! "Stop argument must be a non-negative integer or None."); return NULL; } *************** *** 794,798 **** if (start<0 || stop<-1) { PyErr_SetString(PyExc_ValueError, ! "Indices for islice() must be positive."); return NULL; } --- 794,798 ---- if (start<0 || stop<-1) { PyErr_SetString(PyExc_ValueError, ! "Indices for islice() must be non-negative integers."); return NULL; } From rhettinger at users.sourceforge.net Tue Oct 28 05:16:35 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 05:16:52 2003 Subject: [Python-checkins] python/nondist/peps pep-0000.txt, 1.255, 1.256 pep-0322.txt, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv12216 Modified Files: pep-0000.txt pep-0322.txt Log Message: Update the reverse iteration pep to reflect comments from comp.lang.python, from Guido, and from some on python-dev. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.255 retrieving revision 1.256 diff -C2 -d -r1.255 -r1.256 *** pep-0000.txt 27 Oct 2003 15:01:08 -0000 1.255 --- pep-0000.txt 28 Oct 2003 10:16:31 -0000 1.256 *************** *** 119,123 **** S 319 Python Synchronize/Asynchronize Block Pelletier S 321 Date/Time Parsing and Formatting Kuchling ! S 322 Reverse Iteration Methods Hettinger S 323 Copyable Iterators Martelli S 754 IEEE 754 Floating Point Special Values Warnes --- 119,123 ---- S 319 Python Synchronize/Asynchronize Block Pelletier S 321 Date/Time Parsing and Formatting Kuchling ! S 322 Reverse Iteration Hettinger S 323 Copyable Iterators Martelli S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 338,342 **** I 320 Python 2.4 Release Schedule Warsaw S 321 Date/Time Parsing and Formatting Kuchling ! S 322 Reverse Iteration Methods Hettinger SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes --- 338,342 ---- I 320 Python 2.4 Release Schedule Warsaw S 321 Date/Time Parsing and Formatting Kuchling ! S 322 Reverse Iteration Hettinger SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes Index: pep-0322.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0322.txt 28 Sep 2003 02:43:37 -0000 1.5 --- pep-0322.txt 28 Oct 2003 10:16:32 -0000 1.6 *************** *** 1,4 **** PEP: 322 ! Title: Reverse Iteration Methods Version: $Revision$ Last-Modified: $Date$ --- 1,4 ---- PEP: 322 ! Title: Reverse Iteration Version: $Revision$ Last-Modified: $Date$ *************** *** 15,20 **** ======== ! This proposal is to extend the API of several sequence types ! to include a method for iterating over the sequence in reverse. --- 15,20 ---- ======== ! This proposal is to add a builtin function to support reverse ! iteration over sequences. *************** *** 47,66 **** ======== ! Add a method called *iterreverse()* to sequence objects that can ! benefit from it. The above examples then simplify to:: ! for i in xrange(n).iterreverse(): print seqn[i] :: ! for elem in seqn.iterreverse(): print elem ! The new protocol would be applied to lists, tuples, strings, and ! xrange objects. It would not apply to unordered collections like ! dicts and sets. ! No language syntax changes are needed. --- 47,81 ---- ======== ! Add a builtin function called *inreverse()* that makes a reverse ! iterator over sequence objects that support __getitem__() and ! __len__(). ! The above examples then simplify to:: ! ! for i in inreverse(xrange(n)): print seqn[i] :: ! for elem in inreverse(seqn): print elem ! The core idea is that the clearest, least error-prone way of specifying ! reverse iteration is to specify it in a forward direction and then say ! *inreverse*. ! The implementation could be as simple as:: ! ! def inreverse(x): ! i = len(x) ! while i > 0: ! i -= 1 ! yield x[i] ! ! If *x* is a mapping, the implementation should return a ValueError with ! a message noting that reverse iteration is undefined for mappings. ! ! No language syntax changes are needed. The proposal is fully backwards ! compatible. *************** *** 68,91 **** ======================== - * *iterbackwards* -- like iteritems() but somewhat long * *backwards* -- more pithy, less explicit * *ireverse* -- reminiscent of imap(), izip(), and ifilter() ! Other Issues ! ============ ! * Should *tuple* objects be included? In the past, they have been ! denied some list like behaviors such as count() and index(). I ! prefer that it be included. ! * Should *file* objects be included? Implementing reverse iteration ! may not be easy though it would be useful on occasion. I think ! this one should be skipped. ! * Should *enumerate* objects be included? They can provide reverse ! iteration only when the underlying sequences support *__len__* ! and reverse iteration. I think this can be saved for another ! day if the need arises. --- 83,102 ---- ======================== * *backwards* -- more pithy, less explicit * *ireverse* -- reminiscent of imap(), izip(), and ifilter() ! Custom Reverse ! ============== ! Objects may optionally provide an *__inreverse__* method that returns ! a custom reverse iterator. ! This allows reverse() to be applied to objects that do not have ! __getitem__() and __len__() but still have some useful way of ! providing reverse iteration. ! Using this protocol, enumerate() can be extended to support reversal ! whenever the underlying iterator supports it also. *************** *** 102,138 **** . . . ! The application dictates the need to run exit handlers in the ! reverse order they were built. The ``while alist: alist.pop()`` ! form is readable and clean; however, it would be slightly faster ! and clearer with:: ! ! for func, target, kargs in _exithandlers.iterreverse(): ! . . . ! del _exithandlers ! ! Note, if the order of deletion is important, then the first form ! is still needed. ! ! * difflib.get_close_matches() uses:: ! ! result.sort() # Retain only the best n. ! result = result[-n:] # Move best-scorer to head of list. ! result.reverse() # Strip scores. ! return [x for score, x in result] ! ! The need for reverse iteration arises from a requirement to return ! a portion of a sort in an order opposite of the sort criterion. The ! list comprehension is incidental (the third step of a Schwartzian ! transform). This particular use case can met with extended slicing, ! but the code is somewhat unattractive, hard to visually verify, ! and difficult for beginners to construct:: ! ! result.sort() ! return [x for score, x in result[:-n-1:-1]] ! ! The proposed form is much easier to construct and verify:: ! ! result.sort() ! return [x for score, x in result[-n:].iterreverse()] * heapq.heapify() uses ``for i in xrange(n//2 - 1, -1, -1)`` because --- 113,118 ---- . . . ! In this application popping is required, so the new function would ! not help. * heapq.heapify() uses ``for i in xrange(n//2 - 1, -1, -1)`` because *************** *** 161,166 **** be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in xrange(1, len(x)).iterreverse()`` is much easier ! to mentally verify. * rfc822.Message.__delitem__() uses:: --- 141,146 ---- be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in inreverse(xrange(1, len(x)))`` is much easier ! to verify visually. * rfc822.Message.__delitem__() uses:: *************** *** 174,203 **** ! Alternative Ideas ! ================= ! ! * Add a builtin function, *riter()* which calls a magic method, ! *__riter__*. I see this as more overhead for no additional benefit. ! ! * Several variants were submitted that provided fallback behavior ! when *__riter__* is not defined: ! ! - fallback to: ``for i in xrange(len(obj)-1,-1,-1): yield obj[i]`` ! - fallback to: ``for i in itertools.count(): yield obj[-i]`` ! - fallback to: ``tmp=list(obj); tmp.reverse(); return iter(tmp)`` ! ! All of these attempt to save implementing some object methods at the ! expense of adding a new builtin function and of creating a new magic ! method name. ! ! The approaches using *__getitem__()* are slower than using a custom ! method for each object. Also, the *__getitem__()* variants produce ! bizarre results when applied to mappings. ! ! All of the variants crash when applied to an infinite iterator. ! The last variant can invisibly slip into a low performance mode ! (in terms of time and memory) which could be made more visible with ! an explicit ``ro=list(obj); ro.reverse()``. --- 154,167 ---- ! Rejected Alternative ! ==================== ! Several variants were submitted that attempted to apply inreverse() ! to all iterables by running the iterable to completion, saving the ! results, and then returning a reverse iterator over the results. ! While satisfying some notions of full generality, running the input ! to the end is contrary to the purpose of using iterators ! in the first place. Also, a small disaster ensues if the underlying ! iterator is infinite. From arigo at users.sourceforge.net Tue Oct 28 07:05:49 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:06:06 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.878,1.879 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv30659/Misc Modified Files: NEWS Log Message: Deleting cyclic object comparison. SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.878 retrieving revision 1.879 diff -C2 -d -r1.878 -r1.879 *** NEWS 25 Oct 2003 23:24:14 -0000 1.878 --- NEWS 28 Oct 2003 12:05:47 -0000 1.879 *************** *** 48,51 **** --- 48,55 ---- 820195. + - Python no longer tries to be smart about recursive comparisons. + When comparing containers with cyclic references to themselves it + will now just hit the recursion limit. See SF patch 825639. + Extension modules ----------------- From arigo at users.sourceforge.net Tue Oct 28 07:05:49 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:06:10 2003 Subject: [Python-checkins] python/dist/src/Include ceval.h,2.49,2.50 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv30659/Include Modified Files: ceval.h Log Message: Deleting cyclic object comparison. SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html Index: ceval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v retrieving revision 2.49 retrieving revision 2.50 diff -C2 -d -r2.49 -r2.50 *** ceval.h 20 Feb 2003 17:59:17 -0000 2.49 --- ceval.h 28 Oct 2003 12:05:46 -0000 2.50 *************** *** 44,49 **** --- 44,63 ---- PyAPI_FUNC(int) Py_MakePendingCalls(void); + /* Protection against deeply nested recursive calls */ PyAPI_FUNC(void) Py_SetRecursionLimit(int); PyAPI_FUNC(int) Py_GetRecursionLimit(void); + + #define Py_EnterRecursiveCall(where) \ + (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \ + _Py_CheckRecursiveCall(where)) + #define Py_LeaveRecursiveCall() \ + (--PyThreadState_GET()->recursion_depth) + PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where); + PyAPI_DATA(int) _Py_CheckRecursionLimit; + #ifdef USE_STACKCHECK + # define _Py_MakeRecCheck(x) (++(x) > --_Py_CheckRecursionLimit) + #else + # define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit) + #endif PyAPI_FUNC(char *) PyEval_GetFuncName(PyObject *); From arigo at users.sourceforge.net Tue Oct 28 07:05:50 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:06:14 2003 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.370,2.371 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv30659/Python Modified Files: ceval.c Log Message: Deleting cyclic object comparison. SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.370 retrieving revision 2.371 diff -C2 -d -r2.370 -r2.371 *** ceval.c 25 Oct 2003 14:33:09 -0000 2.370 --- ceval.c 28 Oct 2003 12:05:48 -0000 2.371 *************** *** 498,501 **** --- 498,502 ---- static int recursion_limit = 1000; + int _Py_CheckRecursionLimit = 1000; int *************** *** 509,514 **** --- 510,545 ---- { recursion_limit = new_limit; + _Py_CheckRecursionLimit = recursion_limit; + } + + /* the macro Py_EnterRecursiveCall() only calls _Py_CheckRecursiveCall() + if the recursion_depth reaches _Py_CheckRecursionLimit. + If USE_STACKCHECK, the macro decrements _Py_CheckRecursionLimit + to guarantee that _Py_CheckRecursiveCall() is regularly called. + Without USE_STACKCHECK, there is no need for this. */ + int + _Py_CheckRecursiveCall(char *where) + { + PyThreadState *tstate = PyThreadState_GET(); + + #ifdef USE_STACKCHECK + if (PyOS_CheckStack()) { + --tstate->recursion_depth; + PyErr_SetString(PyExc_MemoryError, "Stack overflow"); + return -1; + } + #endif + if (tstate->recursion_depth > recursion_limit) { + --tstate->recursion_depth; + PyErr_Format(PyExc_RuntimeError, + "maximum recursion depth exceeded%s", + where); + return -1; + } + _Py_CheckRecursionLimit = recursion_limit; + return 0; } + /* Status code for main loop (reason for stack unwind) */ *************** *** 675,693 **** return NULL; - #ifdef USE_STACKCHECK - if (tstate->recursion_depth%10 == 0 && PyOS_CheckStack()) { - PyErr_SetString(PyExc_MemoryError, "Stack overflow"); - return NULL; - } - #endif - /* push frame */ ! if (++tstate->recursion_depth > recursion_limit) { ! --tstate->recursion_depth; ! PyErr_SetString(PyExc_RuntimeError, ! "maximum recursion depth exceeded"); ! tstate->frame = f->f_back; return NULL; - } tstate->frame = f; --- 706,712 ---- return NULL; /* push frame */ ! if (Py_EnterRecursiveCall("")) return NULL; tstate->frame = f; *************** *** 711,717 **** f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } --- 730,734 ---- f, PyTrace_CALL, Py_None)) { /* Trace function raised an error */ ! goto exit_eval_frame; } } *************** *** 723,729 **** f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! --tstate->recursion_depth; ! tstate->frame = f->f_back; ! return NULL; } } --- 740,744 ---- f, PyTrace_CALL, Py_None)) { /* Profile function raised an error */ ! goto exit_eval_frame; } } *************** *** 2429,2433 **** /* pop frame */ ! --tstate->recursion_depth; tstate->frame = f->f_back; --- 2444,2449 ---- /* pop frame */ ! exit_eval_frame: ! Py_LeaveRecursiveCall(); tstate->frame = f->f_back; From arigo at users.sourceforge.net Tue Oct 28 07:05:49 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:06:18 2003 Subject: [Python-checkins] python/dist/src/Lib/test pickletester.py, 1.55, 1.56 test_builtin.py, 1.23, 1.24 test_copy.py, 1.11, 1.12 test_richcmp.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv30659/Lib/test Modified Files: pickletester.py test_builtin.py test_copy.py test_richcmp.py Log Message: Deleting cyclic object comparison. SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html Index: pickletester.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pickletester.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** pickletester.py 2 Mar 2003 13:53:18 -0000 1.55 --- pickletester.py 28 Oct 2003 12:05:47 -0000 1.56 *************** *** 425,431 **** s = self.dumps(l, proto) x = self.loads(s) ! self.assertEqual(x, l) ! self.assertEqual(x, x[0]) ! self.assertEqual(id(x), id(x[0])) def test_recursive_dict(self): --- 425,430 ---- s = self.dumps(l, proto) x = self.loads(s) ! self.assertEqual(len(x), 1) ! self.assert_(x is x[0]) def test_recursive_dict(self): *************** *** 435,441 **** s = self.dumps(d, proto) x = self.loads(s) ! self.assertEqual(x, d) ! self.assertEqual(x[1], x) ! self.assertEqual(id(x[1]), id(x)) def test_recursive_inst(self): --- 434,439 ---- s = self.dumps(d, proto) x = self.loads(s) ! self.assertEqual(x.keys(), [1]) ! self.assert_(x[1] is x) def test_recursive_inst(self): *************** *** 445,451 **** s = self.dumps(i, 2) x = self.loads(s) ! self.assertEqual(x, i) ! self.assertEqual(x.attr, x) ! self.assertEqual(id(x.attr), id(x)) def test_recursive_multi(self): --- 443,448 ---- s = self.dumps(i, 2) x = self.loads(s) ! self.assertEqual(dir(x), dir(i)) ! self.assert_(x.attr is x) def test_recursive_multi(self): *************** *** 458,467 **** s = self.dumps(l, proto) x = self.loads(s) ! self.assertEqual(x, l) ! self.assertEqual(x[0], i) ! self.assertEqual(x[0].attr, d) ! self.assertEqual(x[0].attr[1], x) ! self.assertEqual(x[0].attr[1][0], i) ! self.assertEqual(x[0].attr[1][0].attr, d) def test_garyp(self): --- 455,462 ---- s = self.dumps(l, proto) x = self.loads(s) ! self.assertEqual(len(x), 1) ! self.assertEqual(dir(x[0]), dir(i)) ! self.assertEqual(x[0].attr.keys(), [1]) ! self.assert_(x[0].attr[1] is x) def test_garyp(self): Index: test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_builtin.py 15 Aug 2003 17:52:39 -0000 1.23 --- test_builtin.py 28 Oct 2003 12:05:47 -0000 1.24 *************** *** 168,181 **** self.assertEqual(cmp(1, -1), 1) self.assertEqual(cmp(1, 1), 0) ! # verify that circular objects are handled a = []; a.append(a) b = []; b.append(b) from UserList import UserList c = UserList(); c.append(c) ! self.assertEqual(cmp(a, b), 0) ! self.assertEqual(cmp(b, c), 0) ! self.assertEqual(cmp(c, a), 0) ! self.assertEqual(cmp(a, c), 0) ! # okay, now break the cycles a.pop(); b.pop(); c.pop() self.assertRaises(TypeError, cmp) --- 168,181 ---- self.assertEqual(cmp(1, -1), 1) self.assertEqual(cmp(1, 1), 0) ! # verify that circular objects are not handled a = []; a.append(a) b = []; b.append(b) from UserList import UserList c = UserList(); c.append(c) ! self.assertRaises(RuntimeError, cmp, a, b) ! self.assertRaises(RuntimeError, cmp, b, c) ! self.assertRaises(RuntimeError, cmp, c, a) ! self.assertRaises(RuntimeError, cmp, a, c) ! # okay, now break the cycles a.pop(); b.pop(); c.pop() self.assertRaises(TypeError, cmp) Index: test_copy.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_copy.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_copy.py 14 Jun 2003 07:10:06 -0000 1.11 --- test_copy.py 28 Oct 2003 12:05:47 -0000 1.12 *************** *** 273,280 **** x.append(x) y = copy.deepcopy(x) ! self.assertEqual(y, x) self.assert_(y is not x) ! self.assert_(y[0] is not x[0]) ! self.assert_(y is y[0]) def test_deepcopy_tuple(self): --- 273,280 ---- x.append(x) y = copy.deepcopy(x) ! self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) ! self.assert_(y[0] is y) ! self.assertEqual(len(y), 1) def test_deepcopy_tuple(self): *************** *** 289,293 **** x[0].append(x) y = copy.deepcopy(x) ! self.assertEqual(y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) --- 289,293 ---- x[0].append(x) y = copy.deepcopy(x) ! self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) *************** *** 305,312 **** x['foo'] = x y = copy.deepcopy(x) ! self.assertEqual(y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) ! self.assertEqual(y, {'foo': y}) def test_deepcopy_keepalive(self): --- 305,312 ---- x['foo'] = x y = copy.deepcopy(x) ! self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) ! self.assertEqual(len(y), 1) def test_deepcopy_keepalive(self): Index: test_richcmp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_richcmp.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_richcmp.py 1 May 2003 17:45:47 -0000 1.9 --- test_richcmp.py 28 Oct 2003 12:05:47 -0000 1.10 *************** *** 225,279 **** def test_recursion(self): ! # Check comparison for recursive objects from UserList import UserList - a = UserList(); a.append(a) - b = UserList(); b.append(b) - - self.assert_(a == b) - self.assert_(not a != b) - a.append(1) - self.assert_(a == a[0]) - self.assert_(not a != a[0]) - self.assert_(a != b) - self.assert_(not a == b) - b.append(0) - self.assert_(a != b) - self.assert_(not a == b) - a[1] = -1 - self.assert_(a != b) - self.assert_(not a == b) - a = UserList() b = UserList() a.append(b) b.append(a) ! self.assert_(a == b) ! self.assert_(not a != b) b.append(17) self.assert_(a != b) ! self.assert_(not a == b) a.append(17) ! self.assert_(a == b) ! self.assert_(not a != b) ! ! def test_recursion2(self): ! # This test exercises the circular structure handling code ! # in PyObject_RichCompare() ! class Weird(object): ! def __eq__(self, other): ! return self != other ! def __ne__(self, other): ! return self == other ! def __lt__(self, other): ! return self > other ! def __gt__(self, other): ! return self < other ! ! self.assert_(Weird() == Weird()) ! self.assert_(not (Weird() != Weird())) ! ! for op in opmap["lt"]: ! self.assertRaises(ValueError, op, Weird(), Weird()) class DictTest(unittest.TestCase): --- 225,258 ---- def test_recursion(self): ! # Check that comparison for recursive objects fails gracefully from UserList import UserList a = UserList() b = UserList() a.append(b) b.append(a) ! self.assertRaises(RuntimeError, operator.eq, a, b) ! self.assertRaises(RuntimeError, operator.ne, a, b) ! self.assertRaises(RuntimeError, operator.lt, a, b) ! self.assertRaises(RuntimeError, operator.le, a, b) ! self.assertRaises(RuntimeError, operator.gt, a, b) ! self.assertRaises(RuntimeError, operator.ge, a, b) b.append(17) + # Even recursive lists of different lengths are different, + # but they cannot be ordered + self.assert_(not (a == b)) self.assert_(a != b) ! self.assertRaises(RuntimeError, operator.lt, a, b) ! self.assertRaises(RuntimeError, operator.le, a, b) ! self.assertRaises(RuntimeError, operator.gt, a, b) ! self.assertRaises(RuntimeError, operator.ge, a, b) a.append(17) ! self.assertRaises(RuntimeError, operator.eq, a, b) ! self.assertRaises(RuntimeError, operator.ne, a, b) ! a.insert(0, 11) ! b.insert(0, 12) ! self.assert_(not (a == b)) ! self.assert_(a != b) ! self.assert_(a < b) class DictTest(unittest.TestCase): From arigo at users.sourceforge.net Tue Oct 28 07:05:50 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:06:23 2003 Subject: [Python-checkins] python/dist/src/Objects classobject.c, 2.172, 2.173 object.c, 2.210, 2.211 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv30659/Objects Modified Files: classobject.c object.c Log Message: Deleting cyclic object comparison. SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.172 retrieving revision 2.173 diff -C2 -d -r2.172 -r2.173 *** classobject.c 12 Oct 2003 19:09:37 -0000 2.172 --- classobject.c 28 Oct 2003 12:05:47 -0000 2.173 *************** *** 1971,1975 **** instance_call(PyObject *func, PyObject *arg, PyObject *kw) { - PyThreadState *tstate = PyThreadState_GET(); PyObject *res, *call = PyObject_GetAttrString(func, "__call__"); if (call == NULL) { --- 1971,1974 ---- *************** *** 1991,2002 **** This bounces between instance_call() and PyObject_Call() without ever hitting eval_frame() (which has the main recursion check). */ ! if (tstate->recursion_depth++ > Py_GetRecursionLimit()) { ! PyErr_SetString(PyExc_RuntimeError, ! "maximum __call__ recursion depth exceeded"); res = NULL; } ! else res = PyObject_Call(call, arg, kw); ! tstate->recursion_depth--; Py_DECREF(call); return res; --- 1990,2000 ---- This bounces between instance_call() and PyObject_Call() without ever hitting eval_frame() (which has the main recursion check). */ ! if (Py_EnterRecursiveCall(" in __call__")) { res = NULL; } ! else { res = PyObject_Call(call, arg, kw); ! Py_LeaveRecursiveCall(); ! } Py_DECREF(call); return res; Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.210 retrieving revision 2.211 diff -C2 -d -r2.210 -r2.211 *** object.c 15 Aug 2003 13:07:46 -0000 2.210 --- object.c 28 Oct 2003 12:05:47 -0000 2.211 *************** *** 741,858 **** } - /* compare_nesting is incremented before calling compare (for - some types) and decremented on exit. If the count exceeds the - nesting limit, enable code to detect circular data structures. - - This is a tunable parameter that should only affect the performance - of comparisons, nothing else. Setting it high makes comparing deeply - nested non-cyclical data structures faster, but makes comparing cyclical - data structures slower. - */ - #define NESTING_LIMIT 20 - - static int compare_nesting = 0; - - static PyObject* - get_inprogress_dict(void) - { - static PyObject *key; - PyObject *tstate_dict, *inprogress; - - if (key == NULL) { - key = PyString_InternFromString("cmp_state"); - if (key == NULL) - return NULL; - } - - tstate_dict = PyThreadState_GetDict(); - if (tstate_dict == NULL) { - PyErr_BadInternalCall(); - return NULL; - } - - inprogress = PyDict_GetItem(tstate_dict, key); - if (inprogress == NULL) { - inprogress = PyDict_New(); - if (inprogress == NULL) - return NULL; - if (PyDict_SetItem(tstate_dict, key, inprogress) == -1) { - Py_DECREF(inprogress); - return NULL; - } - Py_DECREF(inprogress); - } - - return inprogress; - } - - /* If the comparison "v op w" is already in progress in this thread, returns - * a borrowed reference to Py_None (the caller must not decref). - * If it's not already in progress, returns "a token" which must eventually - * be passed to delete_token(). The caller must not decref this either - * (delete_token decrefs it). The token must not survive beyond any point - * where v or w may die. - * If an error occurs (out-of-memory), returns NULL. - */ - static PyObject * - check_recursion(PyObject *v, PyObject *w, int op) - { - PyObject *inprogress; - PyObject *token; - Py_uintptr_t iv = (Py_uintptr_t)v; - Py_uintptr_t iw = (Py_uintptr_t)w; - PyObject *x, *y, *z; - - inprogress = get_inprogress_dict(); - if (inprogress == NULL) - return NULL; - - token = PyTuple_New(3); - if (token == NULL) - return NULL; - - if (iv <= iw) { - PyTuple_SET_ITEM(token, 0, x = PyLong_FromVoidPtr((void *)v)); - PyTuple_SET_ITEM(token, 1, y = PyLong_FromVoidPtr((void *)w)); - if (op >= 0) - op = swapped_op[op]; - } else { - PyTuple_SET_ITEM(token, 0, x = PyLong_FromVoidPtr((void *)w)); - PyTuple_SET_ITEM(token, 1, y = PyLong_FromVoidPtr((void *)v)); - } - PyTuple_SET_ITEM(token, 2, z = PyInt_FromLong((long)op)); - if (x == NULL || y == NULL || z == NULL) { - Py_DECREF(token); - return NULL; - } - - if (PyDict_GetItem(inprogress, token) != NULL) { - Py_DECREF(token); - return Py_None; /* Without INCREF! */ - } - - if (PyDict_SetItem(inprogress, token, token) < 0) { - Py_DECREF(token); - return NULL; - } - - return token; - } - - static void - delete_token(PyObject *token) - { - PyObject *inprogress; - - if (token == NULL || token == Py_None) - return; - inprogress = get_inprogress_dict(); - if (inprogress == NULL) - PyErr_Clear(); - else - PyDict_DelItem(inprogress, token); - Py_DECREF(token); - } - /* Compare v to w. Return -1 if v < w or exception (PyErr_Occurred() true in latter case). --- 741,744 ---- *************** *** 868,877 **** int result; - #if defined(USE_STACKCHECK) - if (PyOS_CheckStack()) { - PyErr_SetString(PyExc_MemoryError, "Stack overflow"); - return -1; - } - #endif if (v == NULL || w == NULL) { PyErr_BadInternalCall(); --- 754,757 ---- *************** *** 881,909 **** return 0; vtp = v->ob_type; ! compare_nesting++; ! if (compare_nesting > NESTING_LIMIT && ! (vtp->tp_as_mapping || vtp->tp_as_sequence) && ! !PyString_CheckExact(v) && ! !PyTuple_CheckExact(v)) { ! /* try to detect circular data structures */ ! PyObject *token = check_recursion(v, w, -1); ! ! if (token == NULL) { ! result = -1; ! } ! else if (token == Py_None) { ! /* already comparing these objects. assume ! they're equal until shown otherwise */ ! result = 0; ! } ! else { ! result = do_cmp(v, w); ! delete_token(token); ! } ! } ! else { ! result = do_cmp(v, w); ! } ! compare_nesting--; return result < 0 ? -1 : result; } --- 761,768 ---- return 0; vtp = v->ob_type; ! if (Py_EnterRecursiveCall(" in cmp")) ! return -1; ! result = do_cmp(v, w); ! Py_LeaveRecursiveCall(); return result < 0 ? -1 : result; } *************** *** 976,1014 **** assert(Py_LT <= op && op <= Py_GE); ! compare_nesting++; ! if (compare_nesting > NESTING_LIMIT && ! (v->ob_type->tp_as_mapping || v->ob_type->tp_as_sequence) && ! !PyString_CheckExact(v) && ! !PyTuple_CheckExact(v)) { ! /* try to detect circular data structures */ ! PyObject *token = check_recursion(v, w, op); ! if (token == NULL) { ! res = NULL; ! goto Done; ! } ! else if (token == Py_None) { ! /* already comparing these objects with this operator. ! assume they're equal until shown otherwise */ ! if (op == Py_EQ) ! res = Py_True; ! else if (op == Py_NE) ! res = Py_False; ! else { ! PyErr_SetString(PyExc_ValueError, ! "can't order recursive values"); ! res = NULL; ! } ! Py_XINCREF(res); ! } ! else { ! res = do_richcmp(v, w, op); ! delete_token(token); ! } ! goto Done; ! } ! ! /* No nesting extremism. ! If the types are equal, and not old-style instances, try to get out cheap (don't bother with coercions etc.). */ if (v->ob_type == w->ob_type && !PyInstance_Check(v)) { --- 835,842 ---- assert(Py_LT <= op && op <= Py_GE); + if (Py_EnterRecursiveCall(" in cmp")) + return NULL; ! /* If the types are equal, and not old-style instances, try to get out cheap (don't bother with coercions etc.). */ if (v->ob_type == w->ob_type && !PyInstance_Check(v)) { *************** *** 1042,1046 **** res = do_richcmp(v, w, op); Done: ! compare_nesting--; return res; } --- 870,874 ---- res = do_richcmp(v, w, op); Done: ! Py_LeaveRecursiveCall(); return res; } From arigo at users.sourceforge.net Tue Oct 28 07:10:40 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:12:39 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libgc.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv31501 Modified Files: libgc.tex Log Message: Documented gc.get_referrers() as dangerous. SF bug 793822 Index: libgc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgc.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libgc.tex 8 Apr 2003 17:37:47 -0000 1.14 --- libgc.tex 28 Oct 2003 12:10:38 -0000 1.15 *************** *** 97,100 **** --- 97,105 ---- \function{get_referrers()}. + Care must be taken when using objects returned by + \function{get_referrers()} because some of them could still be under + construction and hence in a temporarily invalid state. Avoid using + \function{get_referrers()} for any purpose other than debugging. + \versionadded{2.2} \end{funcdesc} From arigo at users.sourceforge.net Tue Oct 28 07:17:27 2003 From: arigo at users.sourceforge.net (arigo@users.sourceforge.net) Date: Tue Oct 28 07:17:31 2003 Subject: [Python-checkins] python/dist/src/Lib dis.py,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv32563/Lib Modified Files: dis.py Log Message: Fixed dis.disassemble_string(). Added dis.findlinestarts(). SF bug 811294 Index: dis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dis.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** dis.py 7 Mar 2003 17:30:45 -0000 1.46 --- dis.py 28 Oct 2003 12:17:25 -0000 1.47 *************** *** 61,79 **** """Disassemble a code object.""" code = co.co_code - - byte_increments = [ord(c) for c in co.co_lnotab[0::2]] - line_increments = [ord(c) for c in co.co_lnotab[1::2]] - table_length = len(byte_increments) # == len(line_increments) - - lineno = co.co_firstlineno - table_index = 0 - while (table_index < table_length - and byte_increments[table_index] == 0): - lineno += line_increments[table_index] - table_index += 1 - addr = 0 - line_incr = 0 - labels = findlabels(code) n = len(code) i = 0 --- 61,66 ---- """Disassemble a code object.""" code = co.co_code labels = findlabels(code) + linestarts = dict(findlinestarts(co)) n = len(code) i = 0 *************** *** 83,100 **** c = code[i] op = ord(c) ! ! if i >= addr: ! lineno += line_incr ! while table_index < table_length: ! addr += byte_increments[table_index] ! line_incr = line_increments[table_index] ! table_index += 1 ! if line_incr: ! break ! else: ! addr = sys.maxint if i > 0: print ! print "%3d"%lineno, else: print ' ', --- 70,77 ---- c = code[i] op = ord(c) ! if i in linestarts: if i > 0: print ! print "%3d" % linestarts[i], else: print ' ', *************** *** 138,143 **** c = code[i] op = ord(c) - if op == opmap['SET_LINENO'] and i > 0: - print # Extra blank line if i == lasti: print '-->', else: print ' ', --- 115,118 ---- *************** *** 200,203 **** --- 175,199 ---- return labels + def findlinestarts(code): + """Find the offsets in a byte code which are start of lines in the source. + + Generate pairs (offset, lineno) as described in Python/compile.c. + + """ + byte_increments = [ord(c) for c in code.co_lnotab[0::2]] + line_increments = [ord(c) for c in code.co_lnotab[1::2]] + + lastlineno = None + lineno = code.co_firstlineno + addr = 0 + for byte_incr, line_incr in zip(byte_increments, line_increments): + if byte_incr: + if lineno != lastlineno: + yield (addr, lineno) + lastlineno = lineno + addr += byte_incr + lineno += line_incr + if lineno != lastlineno: + yield (addr, lineno) def _test(): From montanaro at users.sourceforge.net Tue Oct 28 11:17:56 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Oct 28 11:18:00 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts db2pickle.py, 1.4, 1.5 pickle2db.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv11207 Modified Files: db2pickle.py pickle2db.py Log Message: allow dump/load of gdbm files Index: db2pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/db2pickle.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db2pickle.py 20 Jun 2003 01:00:20 -0000 1.4 --- db2pickle.py 28 Oct 2003 16:17:54 -0000 1.5 *************** *** 2,6 **** """ ! Synopsis: %(prog)s [-h|-b|-r] dbfile [ picklefile ] Convert the database file given on the command line to a pickle --- 2,6 ---- """ ! Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ] Convert the database file given on the command line to a pickle *************** *** 22,25 **** --- 22,29 ---- dbm = None try: + import gdbm + except ImportError: + gdbm = None + try: import anydbm except ImportError: *************** *** 38,43 **** def main(args): try: ! opts, args = getopt.getopt(args, "hbrda", ! ["hash", "btree", "recno", "dbm", "anydbm"]) except getopt.error: usage() --- 42,48 ---- def main(args): try: ! opts, args = getopt.getopt(args, "hbrdag", ! ["hash", "btree", "recno", "dbm", ! "gdbm", "anydbm"]) except getopt.error: usage() *************** *** 83,86 **** --- 88,97 ---- except AttributeError: sys.stderr.write("anydbm module unavailable.\n") + return 1 + elif opt in ("-g", "--gdbm"): + try: + dbopen = gdbm.open + except AttributeError: + sys.stderr.write("gdbm module unavailable.\n") return 1 elif opt in ("-d", "--dbm"): Index: pickle2db.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/pickle2db.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pickle2db.py 20 Jun 2003 01:01:19 -0000 1.5 --- pickle2db.py 28 Oct 2003 16:17:54 -0000 1.6 *************** *** 2,6 **** """ ! Synopsis: %(prog)s [-h|-b|-r|-a|-d] dbfile [ picklefile ] Read the given picklefile as a series of key/value pairs and write to a new --- 2,6 ---- """ ! Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] dbfile [ picklefile ] Read the given picklefile as a series of key/value pairs and write to a new *************** *** 26,29 **** --- 26,33 ---- dbm = None try: + import gdbm + except ImportError: + gdbm = None + try: import anydbm except ImportError: *************** *** 42,47 **** def main(args): try: ! opts, args = getopt.getopt(args, "hbrda", ! ["hash", "btree", "recno", "dbm", "anydbm"]) except getopt.error: usage() --- 46,52 ---- def main(args): try: ! opts, args = getopt.getopt(args, "hbrdag", ! ["hash", "btree", "recno", "dbm", "anydbm", ! "gdbm"]) except getopt.error: usage() *************** *** 87,90 **** --- 92,101 ---- except AttributeError: sys.stderr.write("anydbm module unavailable.\n") + return 1 + elif opt in ("-g", "--gdbm"): + try: + dbopen = gdbm.open + except AttributeError: + sys.stderr.write("gdbm module unavailable.\n") return 1 elif opt in ("-d", "--dbm"): From montanaro at users.sourceforge.net Tue Oct 28 11:24:03 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Oct 28 11:24:17 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.879,1.880 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12494 Modified Files: NEWS Log Message: note db2pickle/pickle2db tweaks Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.879 retrieving revision 1.880 diff -C2 -d -r1.879 -r1.880 *** NEWS 28 Oct 2003 12:05:47 -0000 1.879 --- NEWS 28 Oct 2003 16:24:00 -0000 1.880 *************** *** 144,147 **** --- 144,149 ---- ----------- + - The db2pickle and pickle2db scripts can now dump/load gdbm files. + - The pydoc script will display a link to the module documentation for modules determined to be part of the core distribution. The documentation From rhettinger at users.sourceforge.net Tue Oct 28 13:06:34 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 13:06:37 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt, 1.10, 1.11 pep-0000.txt, 1.256, 1.257 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv31304 Modified Files: pep-0289.txt pep-0000.txt Log Message: Mark PEP 289 as accepted. Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0289.txt 24 Oct 2003 01:29:14 -0000 1.10 --- pep-0289.txt 28 Oct 2003 18:06:32 -0000 1.11 *************** *** 4,8 **** Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Draft Type: Standards Track Content-Type: text/x-rst --- 4,8 ---- Last-Modified: $Date$ Author: python@rcn.com (Raymond D. Hettinger) ! Status: Accepted Type: Standards Track Content-Type: text/x-rst *************** *** 75,84 **** =================== ! The previous version of this PEP was REJECTED. The bracketed yield ! syntax left something to be desired; the performance gains had not been ! demonstrated; and the range of use cases had not been shown. After, ! much discussion on the python-dev list, the PEP has been resurrected ! its present form. The impetus for the discussion was an innovative ! proposal from Peter Norvig [3]_. --- 75,79 ---- =================== ! This PEP is ACCEPTED for Py2.4. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.256 retrieving revision 1.257 diff -C2 -d -r1.256 -r1.257 *** pep-0000.txt 28 Oct 2003 10:16:31 -0000 1.256 --- pep-0000.txt 28 Oct 2003 18:06:32 -0000 1.257 *************** *** 63,66 **** --- 63,67 ---- S 252 Making Types Look More Like Classes GvR S 253 Subtyping Built-in Types GvR + SA 289 Generator Expressions Hettinger Open PEPs (under consideration) *************** *** 98,102 **** I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger - S 289 Generator Expressions Hettinger S 292 Simpler String Substitutions Warsaw S 294 Type Names in the types Module Tirosh --- 99,102 ---- *************** *** 306,310 **** I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger ! S 289 Generator Expressions Hettinger I 290 Code Migration and Modernization Hettinger I 291 Backward Compatibility for Standard Library Norwitz --- 306,310 ---- I 287 reStructuredText Docstring Format Goodger S 288 Generators Attributes and Exceptions Hettinger ! SA 289 Generator Expressions Hettinger I 290 Code Migration and Modernization Hettinger I 291 Backward Compatibility for Standard Library Norwitz From akuchling at users.sourceforge.net Tue Oct 28 14:48:46 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Oct 28 14:48:49 2003 Subject: [Python-checkins] python/nondist/peps pep-0321.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv20002 Modified Files: pep-0321.txt Log Message: Turn paragraph into a list, and add some items Index: pep-0321.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0321.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0321.txt 7 Oct 2003 12:16:04 -0000 1.2 --- pep-0321.txt 28 Oct 2003 19:48:44 -0000 1.3 *************** *** 33,40 **** ======================= ! Useful formats to support include `ISO8601`_, `RFC2822`_, `ctime`_, ! and some that are commonly written by humans such as the American ! "MM/DD/YYYY", the European "YYYY/MM/DD", and variants such as ! "DD-Month-YYYY". XXX The Perl `ParseDate.pm`_ module supports many different input formats, --- 33,45 ---- ======================= ! Useful formats to support include: ! ! * `ISO8601`_ ! * ARPA/`RFC2822`_ ! * `ctime`_ ! * Formats commonly written by humans such as the American ! "MM/DD/YYYY", the European "YYYY/MM/DD", and variants such as ! "DD-Month-YYYY". ! * CVS-style or tar-style dates ("tomorrow", "12 hours ago", etc.) XXX The Perl `ParseDate.pm`_ module supports many different input formats, From rhettinger at users.sourceforge.net Tue Oct 28 15:40:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 15:42:38 2003 Subject: [Python-checkins] python/nondist/peps pep-0322.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv31368 Modified Files: pep-0322.txt Log Message: Offer the community a choice for a simpler, limited alternative. Index: pep-0322.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0322.txt 28 Oct 2003 10:16:32 -0000 1.6 --- pep-0322.txt 28 Oct 2003 20:40:56 -0000 1.7 *************** *** 154,157 **** --- 154,167 ---- + Active Alternative + ================== + + A simpler, but limited alternative is to create a builtin called + reverse_range() that takes the same arguments as range() but returns a + reverse iterator over the range. The idea is that much of the benefit + of inreverse() comes reducing the intellectual effort it takes to + express the arguments for [x]range() when going backwards. + + Rejected Alternative ==================== From rhettinger at users.sourceforge.net Tue Oct 28 16:21:33 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 16:22:40 2003 Subject: [Python-checkins] python/nondist/peps pep-0322.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv13072 Modified Files: pep-0322.txt Log Message: The alternative builtin needed a better name. Index: pep-0322.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0322.txt 28 Oct 2003 20:40:56 -0000 1.7 --- pep-0322.txt 28 Oct 2003 21:21:31 -0000 1.8 *************** *** 157,165 **** ================== ! A simpler, but limited alternative is to create a builtin called ! reverse_range() that takes the same arguments as range() but returns a ! reverse iterator over the range. The idea is that much of the benefit ! of inreverse() comes reducing the intellectual effort it takes to ! express the arguments for [x]range() when going backwards. --- 157,166 ---- ================== ! A simpler, but limited alternative is to create a builtin that takes ! the same arguments as range() but returns a reverse iterator over the ! range. The idea is that much of the benefit of inreverse() comes ! reducing the intellectual effort it takes to express the arguments for ! [x]range() when going backwards. A good name is needed for this ! alternative -- revrange() is cleanest so far. From nnorwitz at users.sourceforge.net Tue Oct 28 16:57:12 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Tue Oct 28 16:57:18 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib aboutDialog.py, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv20351/Lib/idlelib Modified Files: aboutDialog.py Log Message: SF #775057, fix IDLE problem in about dialog If the file doesn't exist, the code to display an error message was broken Will backport. Index: aboutDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/aboutDialog.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** aboutDialog.py 16 Jun 2003 18:46:42 -0000 1.13 --- aboutDialog.py 28 Oct 2003 21:57:10 -0000 1.14 *************** *** 140,146 **** textFile = codecs.open(fn, 'r') except IOError: tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ ! `fileName`+' .') return else: --- 140,148 ---- textFile = codecs.open(fn, 'r') except IOError: + import tkMessageBox tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ ! `fn`+' .', ! parent=self) return else: From nnorwitz at users.sourceforge.net Tue Oct 28 16:58:29 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Tue Oct 28 16:58:32 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib aboutDialog.py, 1.13, 1.13.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv20744/Lib/idlelib Modified Files: Tag: release23-maint aboutDialog.py Log Message: SF #775057, fix IDLE problem in about dialog If the file doesn't exist, the code to display an error message was broken Index: aboutDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/aboutDialog.py,v retrieving revision 1.13 retrieving revision 1.13.8.1 diff -C2 -d -r1.13 -r1.13.8.1 *** aboutDialog.py 16 Jun 2003 18:46:42 -0000 1.13 --- aboutDialog.py 28 Oct 2003 21:58:26 -0000 1.13.8.1 *************** *** 140,146 **** textFile = codecs.open(fn, 'r') except IOError: tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ ! `fileName`+' .') return else: --- 140,148 ---- textFile = codecs.open(fn, 'r') except IOError: + import tkMessageBox tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ ! `fn`+' .', ! parent=self) return else: From rhettinger at users.sourceforge.net Tue Oct 28 17:39:25 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 17:39:30 2003 Subject: [Python-checkins] python/nondist/peps pep-0322.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv29959 Modified Files: pep-0322.txt Log Message: No one likes the name inreverse(). Index: pep-0322.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0322.txt 28 Oct 2003 21:21:31 -0000 1.8 --- pep-0322.txt 28 Oct 2003 22:39:22 -0000 1.9 *************** *** 47,51 **** ======== ! Add a builtin function called *inreverse()* that makes a reverse iterator over sequence objects that support __getitem__() and __len__(). --- 47,51 ---- ======== ! Add a builtin function called *ireverse()* that makes a reverse iterator over sequence objects that support __getitem__() and __len__(). *************** *** 53,71 **** The above examples then simplify to:: ! for i in inreverse(xrange(n)): print seqn[i] :: ! for elem in inreverse(seqn): print elem The core idea is that the clearest, least error-prone way of specifying reverse iteration is to specify it in a forward direction and then say ! *inreverse*. The implementation could be as simple as:: ! def inreverse(x): i = len(x) while i > 0: --- 53,71 ---- The above examples then simplify to:: ! for i in ireverse(xrange(n)): print seqn[i] :: ! for elem in ireverse(seqn): print elem The core idea is that the clearest, least error-prone way of specifying reverse iteration is to specify it in a forward direction and then say ! *ireverse*. The implementation could be as simple as:: ! def ireverse(x): i = len(x) while i > 0: *************** *** 84,88 **** * *backwards* -- more pithy, less explicit ! * *ireverse* -- reminiscent of imap(), izip(), and ifilter() --- 84,91 ---- * *backwards* -- more pithy, less explicit ! * *inreverse* -- no one seems to like this one except me ! ! The name *reverse* is not a candidate because it duplicates the name ! of the list.reverse() which mutates the underlying list. *************** *** 90,94 **** ============== ! Objects may optionally provide an *__inreverse__* method that returns a custom reverse iterator. --- 93,97 ---- ============== ! Objects may optionally provide an *__ireverse__* method that returns a custom reverse iterator. *************** *** 141,145 **** be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in inreverse(xrange(1, len(x)))`` is much easier to verify visually. --- 144,148 ---- be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in ireverse(xrange(1, len(x)))`` is much easier to verify visually. *************** *** 159,163 **** A simpler, but limited alternative is to create a builtin that takes the same arguments as range() but returns a reverse iterator over the ! range. The idea is that much of the benefit of inreverse() comes reducing the intellectual effort it takes to express the arguments for [x]range() when going backwards. A good name is needed for this --- 162,166 ---- A simpler, but limited alternative is to create a builtin that takes the same arguments as range() but returns a reverse iterator over the ! range. The idea is that much of the benefit of ireverse() comes reducing the intellectual effort it takes to express the arguments for [x]range() when going backwards. A good name is needed for this *************** *** 168,172 **** ==================== ! Several variants were submitted that attempted to apply inreverse() to all iterables by running the iterable to completion, saving the results, and then returning a reverse iterator over the results. --- 171,175 ---- ==================== ! Several variants were submitted that attempted to apply ireverse() to all iterables by running the iterable to completion, saving the results, and then returning a reverse iterator over the results. From rhettinger at users.sourceforge.net Tue Oct 28 19:46:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 19:46:25 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libposixpath.tex, 1.37, 1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv19311 Modified Files: libposixpath.tex Log Message: SF bug #827902: ctime is not creation time New fix for this bug recognizes differing definitions on various systems. Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** libposixpath.tex 27 Oct 2003 20:00:36 -0000 1.37 --- libposixpath.tex 29 Oct 2003 00:46:19 -0000 1.38 *************** *** 85,90 **** \begin{funcdesc}{getctime}{path} ! Return the time of most recent content modification or metadata change ! for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does --- 85,91 ---- \begin{funcdesc}{getctime}{path} ! Return the system's ctime which, on some systems (like \UNIX) is the ! time of the last change, and, on others (like Windows), is the ! creation time for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does From rhettinger at users.sourceforge.net Tue Oct 28 19:47:14 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Oct 28 19:47:18 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libposixpath.tex, 1.36.12.1, 1.36.12.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv19808 Modified Files: Tag: release23-maint libposixpath.tex Log Message: SF bug #827902: ctime is not creation time New fix for this bug recognizes differing definitions on various systems. Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.36.12.1 retrieving revision 1.36.12.2 diff -C2 -d -r1.36.12.1 -r1.36.12.2 *** libposixpath.tex 27 Oct 2003 20:03:22 -0000 1.36.12.1 --- libposixpath.tex 29 Oct 2003 00:47:11 -0000 1.36.12.2 *************** *** 85,90 **** \begin{funcdesc}{getctime}{path} ! Return the time of most recent content modification or metadata change ! for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does --- 85,91 ---- \begin{funcdesc}{getctime}{path} ! Return the system's ctime which, on some systems (like \UNIX) is the ! time of the last change, and, on others (like Windows), is the ! creation time for \var{path}. The return value is a number giving the number of seconds since the epoch (see the \refmodule{time} module). Raise \exception{os.error} if the file does From rhettinger at users.sourceforge.net Wed Oct 29 01:54:44 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 01:54:49 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_sort.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6236/Lib/test Modified Files: test_sort.py Log Message: Add list.sorted() classmethod. Index: test_sort.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sort.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_sort.py 16 Oct 2003 03:41:09 -0000 1.5 --- test_sort.py 29 Oct 2003 06:54:42 -0000 1.6 *************** *** 1,4 **** --- 1,6 ---- from test.test_support import verbose import random + from UserList import UserList + from sets import Set nerrors = 0 *************** *** 191,194 **** --- 193,197 ---- data.sort(reverse=True) self.assertEqual(data, range(99,-1,-1)) + self.assertRaises(TypeError, data.sort, "wrong type") def test_reverse_stability(self): *************** *** 202,205 **** --- 205,262 ---- self.assertEqual(data, copy2) + class TestSorted(unittest.TestCase): + + def test_basic(self): + data = range(100) + copy = data[:] + random.shuffle(copy) + self.assertEqual(data, list.sorted(copy)) + self.assertNotEqual(data, copy) + + data.reverse() + random.shuffle(copy) + self.assertEqual(data, list.sorted(copy, cmp=lambda x, y: cmp(y,x))) + self.assertNotEqual(data, copy) + random.shuffle(copy) + self.assertEqual(data, list.sorted(copy, key=lambda x: -x)) + self.assertNotEqual(data, copy) + random.shuffle(copy) + self.assertEqual(data, list.sorted(copy, reverse=1)) + self.assertNotEqual(data, copy) + + def test_inputtypes(self): + s = 'abracadabra' + for T in [unicode, list, tuple]: + self.assertEqual(list.sorted(s), list.sorted(T(s))) + + s = ''.join(dict.fromkeys(s).keys()) # unique letters only + for T in [unicode, Set, list, tuple, dict.fromkeys]: + self.assertEqual(list.sorted(s), list.sorted(T(s))) + + def test_baddecorator(self): + data = 'The quick Brown fox Jumped over The lazy Dog'.split() + self.assertRaises(TypeError, list.sorted, data, None, lambda x,y: 0) + + def classmethods(self): + s = "hello world" + a = list.sorted(s) + b = UserList.sorted(s) + c = [].sorted(s) + d = UserList().sorted(s) + class Mylist(list): + def __new__(cls): + return UserList() + e = MyList.sorted(s) + f = MyList().sorted(s) + class Myuserlist(UserList): + def __new__(cls): + return [] + g = MyList.sorted(s) + h = MyList().sorted(s) + self.assert_(a == b == c == d == e == f == g == h) + self.assert_(b.__class__ == d.__class__ == UserList) + self.assert_(e.__class__ == f.__class__ == MyList) + self.assert_(g.__class__ == h.__class__ == Myuserlist) + #============================================================================== *************** *** 207,210 **** --- 264,268 ---- test_classes = ( TestDecorateSortUndecorate, + TestSorted, TestBugs, ) From rhettinger at users.sourceforge.net Wed Oct 29 01:54:44 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 01:54:53 2003 Subject: [Python-checkins] python/dist/src/Lib UserList.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv6236/Lib Modified Files: UserList.py Log Message: Add list.sorted() classmethod. Index: UserList.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserList.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UserList.py 16 Oct 2003 05:53:16 -0000 1.20 --- UserList.py 29 Oct 2003 06:54:42 -0000 1.21 *************** *** 79,82 **** --- 79,87 ---- def reverse(self): self.data.reverse() def sort(self, *args, **kwds): self.data.sort(*args, **kwds) + def sorted(cls, iterable, *args, **kwds): + s = cls(iterable) + s.sort(*args, **kwds) + return s + sorted = classmethod(sorted) def extend(self, other): if isinstance(other, UserList): From rhettinger at users.sourceforge.net Wed Oct 29 01:54:44 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 01:54:57 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.138, 1.139 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv6236/Doc/lib Modified Files: libstdtypes.tex Log Message: Add list.sorted() classmethod. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** libstdtypes.tex 22 Oct 2003 02:56:40 -0000 1.138 --- libstdtypes.tex 29 Oct 2003 06:54:42 -0000 1.139 *************** *** 630,634 **** \begin{methoddesc}[string]{istitle}{} Return true if the string is a titlecased string and there is at least one ! character, i.e. uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return false otherwise. --- 630,634 ---- \begin{methoddesc}[string]{istitle}{} Return true if the string is a titlecased string and there is at least one ! character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return false otherwise. *************** *** 976,979 **** --- 976,982 ---- \optional{, \var{reverse}=False}}})} {sort the items of \var{s} in place}{(7), (8), (9), (10)} + \lineiii{\var{s}.sorted(\var{iterable}\optional{, \var{cmp}=None\optional{, \var{key}=None + \optional{, \var{reverse}=False}}})} + {return a new sorted list from the items in \var{iterable}}{(8), (9), (11)} \end{tableiii} \indexiv{operations on}{mutable}{sequence}{types} *************** *** 1025,1030 **** the sorted or reversed list. ! \item[(8)] The \method{sort()} method takes optional arguments for ! controlling the comparisions. \var{cmp} specifies a custom comparison function of two arguments --- 1028,1033 ---- the sorted or reversed list. ! \item[(8)] The \method{sort()} and \method{sorted()} methods take optional ! arguments for controlling the comparisions. \var{cmp} specifies a custom comparison function of two arguments *************** *** 1053,1057 **** \item[(9)] Starting with Python 2.3, the \method{sort()} method is ! guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by --- 1056,1061 ---- \item[(9)] Starting with Python 2.3, the \method{sort()} method is ! guaranteed to be stable. Starting with Python 2.4, the \method{sorted()} ! method is also guaranteed to be stable. A sort is stable if it does not change the relative order of elements that compare equal --- this is helpful for sorting in multiple passes (for example, sort by *************** *** 1063,1066 **** --- 1067,1073 ---- \exception{ValueError} if it can detect that the list has been mutated during a sort. + + \item[(11)] \method{sorted()} is a class method that returns a new list. + \versionadded{2.4} \end{description} From rhettinger at users.sourceforge.net Wed Oct 29 01:54:45 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 01:55:01 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.880,1.881 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv6236/Misc Modified Files: NEWS Log Message: Add list.sorted() classmethod. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.880 retrieving revision 1.881 diff -C2 -d -r1.880 -r1.881 *** NEWS 28 Oct 2003 16:24:00 -0000 1.880 --- NEWS 29 Oct 2003 06:54:42 -0000 1.881 *************** *** 24,29 **** records with equal keys is unchanged). ! - Added a list.copysort() method that returns a copy of the sorted list ! while leaving the original intact. - Added test whether wchar_t is signed or not. A signed wchar_t is not --- 24,29 ---- records with equal keys is unchanged). ! - Added a list.sorted() classmethod that returns a new sorted list ! from any iterable. - Added test whether wchar_t is signed or not. A signed wchar_t is not From rhettinger at users.sourceforge.net Wed Oct 29 01:54:45 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 01:55:06 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.160,2.161 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv6236/Objects Modified Files: listobject.c Log Message: Add list.sorted() classmethod. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.160 retrieving revision 2.161 diff -C2 -d -r2.160 -r2.161 *** listobject.c 16 Oct 2003 17:16:30 -0000 2.160 --- listobject.c 29 Oct 2003 06:54:43 -0000 2.161 *************** *** 2002,2005 **** --- 2002,2037 ---- static PyObject * + listsorted(PyObject *cls, PyObject *args, PyObject *kwds) + { + PyObject *newlist, *v, *seq, *compare=NULL, *keyfunc=NULL, *newargs; + static char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0}; + long reverse; + + if (args != NULL) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OOi:sorted", + kwlist, &seq, &compare, &keyfunc, &reverse)) + return NULL; + } + + newlist = PyObject_CallFunctionObjArgs(cls, seq, NULL); + if (newlist == NULL) + return NULL; + + newargs = PyTuple_GetSlice(args, 1, 4); + if (newargs == NULL) { + Py_DECREF(newlist); + return NULL; + } + v = listsort((PyListObject *)newlist, newargs, kwds); + Py_DECREF(newargs); + if (v == NULL) { + Py_DECREF(newlist); + return NULL; + } + Py_DECREF(v); + return newlist; + } + + static PyObject * listreverse(PyListObject *self) { *************** *** 2336,2339 **** --- 2368,2374 ---- "L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;\n\ cmp(x, y) -> -1, 0, 1"); + PyDoc_STRVAR(sorted_doc, + "list.sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list;\n\ + cmp(x, y) -> -1, 0, 1"); static PyMethodDef list_methods[] = { *************** *** 2347,2350 **** --- 2382,2387 ---- {"reverse", (PyCFunction)listreverse, METH_NOARGS, reverse_doc}, {"sort", (PyCFunction)listsort, METH_VARARGS | METH_KEYWORDS, sort_doc}, + {"sorted", (PyCFunction)listsorted, + METH_VARARGS | METH_KEYWORDS | METH_CLASS, sorted_doc}, {NULL, NULL} /* sentinel */ }; From rhettinger at users.sourceforge.net Wed Oct 29 02:23:59 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Oct 29 02:24:05 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_descrtut.py, 1.16, 1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv10218 Modified Files: test_descrtut.py Log Message: Update test to include "sorted" in dir(list). Index: test_descrtut.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descrtut.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_descrtut.py 18 Feb 2003 22:05:12 -0000 1.16 --- test_descrtut.py 29 Oct 2003 07:23:57 -0000 1.17 *************** *** 226,230 **** 'remove', 'reverse', ! 'sort'] The new introspection API gives more information than the old one: in --- 226,231 ---- 'remove', 'reverse', ! 'sort', ! 'sorted'] The new introspection API gives more information than the old one: in From aleax at users.sourceforge.net Wed Oct 29 08:39:53 2003 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Wed Oct 29 08:39:57 2003 Subject: [Python-checkins] python/nondist/peps pep-0323.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv32477 Modified Files: pep-0323.txt Log Message: Rewritten, with removal of deep-copying ideas, but otherwise many additions of details and examples, as per feedback received on python-dev. Index: pep-0323.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0323.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0323.txt 27 Oct 2003 15:01:08 -0000 1.1 --- pep-0323.txt 29 Oct 2003 13:39:51 -0000 1.2 *************** *** 9,52 **** Created: 25-Oct-2003 Python-Version: 2.4 ! Post-History: Abstract ! This PEP suggests that some iterator types should support being copied ! (shallowly or deeply), by exposing suitable methods such as __copy__ or ! __deepcopy__. Motivation ! Some iterators, such as those which built-in function iter builds over ! sequences, should be intrinsically easy to copy (just get another ! reference to the same sequence and a copy of the index) or deepcopy ! (ditto but with a deepcopy of the underlying sequence). ! However, in Python up to 2.3, those iterators don't expose their state: ! user code which is using such an iterator X is not able to just "save" a ! copy of X (for future iteration from the current point) with a simple ! "saved_X = copy.copy(X)". ! To "tee" a non-copyable iterator into two independently iterable ones, ! subtle code [such as that which will go into itertools.tee in 2.4] is ! needed (a Python version thereof is currently in the itertools docs). ! In any case, such code will inevitably have to consume memory to keep ! a copy of the subsequence which has been iterated on by one but not ! both tee'd iterators. This is a waste of memory in those cases in ! which the iterator being tee'd already _has_ an underlying sequence ! (or other iterable) and index. ! Having iterators expose a suitable __copy__ when feasible allows easy ! optimization of itertools.tee and similar user code, as in: def tee(it): it = iter(it) ! try: return it, copy.copy(it) ! except TypeError: # non-copyable iterator, do all the needed hard work --- 9,113 ---- Created: 25-Oct-2003 Python-Version: 2.4 ! Post-History: 29-Oct-2003 Abstract ! This PEP suggests that some iterator types should support shallow ! copies of their instances by exposing a __copy__ method which meets ! some specific requirements, and indicates how code using an iterator ! might exploit such a __copy__ method when present. Motivation ! In Python up to 2.3, most built-in iterator types don't let the user ! copy their instances. User-coded iterators that do let their clients ! call copy.copy on their instances may, or may not, happen to return, ! as a result of the copy, a separate iterator object that may be ! iterated upon independently from the original. ! Currently, "support" for copy.copy in a user-coded iterator type is ! almost invariably "accidental" -- i.e., the standard machinery of the ! copy method in Python's standard library's copy module does build and ! return a copy. However, the copy will be independently iterable with ! respect to the original only if calling .next() on an instance of that ! class happens to change instance state solely by rebinding some ! attributes to new values, and not by mutating some attributes' ! existing values. ! For example, an iterator whose "index" state is held as an integer ! attribute will probably give usable copies, since (integers being ! immutable) .next() presumably just rebinds that attribute. On the ! other hand, another iterator whose "index" state is held as a list ! attribute will probably mutate the same list object when .next() ! executes, and therefore copies of such an iterator will not be ! iterable separately and independently from the original. ! Given this existing situation, copy.copy(it) on some iterator object ! isn't very useful, nor, therefore, is it at all widely used. However, ! there are many cases in which being able to get a "snapshot" of an ! iterator, as a "bookmark", so as to be able to keep iterating along ! the sequence but later iterate again on the same sequence from the ! bookmark onwards, is useful. To support such "bookmarking", module ! itertools, in 2.4, has grown a 'tee' function, to be used as: ! it, bookmark = itertools.tee(it) ! ! The previous value of 'it' must not be used again, which is why this ! typical usage idiom rebinds the name. After this call, 'it' and ! 'bookmark' are independently-iterable iterators on the same underlying ! sequence as the original value of 'it': this satisfies application ! needs for "iterator copying". ! ! However, when itertools.tee can make no hypotheses about the nature of ! the iterator it is passed as an argument, it must save in memory all ! items through which one of the two 'teed' iterators, but not yet both, ! have stepped. This can be quite costly in terms of memory, if the two ! iterators get very far from each other in their stepping; indeed, in ! some cases it may be preferable to make a list from the iterator so as ! to be able to step repeatedly through the subsequence, or, if that is ! too costy in terms of memory, save items to disk, again in order to be ! able to iterate through them repeatedly. ! ! This PEP proposes another idea that will, in some important cases, ! allow itertools.tee to do its job with minimal cost in terms of ! memory; user code may also occasionally be able to exploit the idea in ! order to decide whether to copy an iterator, make a list from it, or ! use an auxiliary disk file. ! ! The key consideration is that some important iterators, such as those ! which built-in function iter builds over sequences, would be ! intrinsically easy to copy: just get another reference to the same ! sequence, and a copy of the integer index. However, in Python 2.3, ! those iterators don't expose the state, and don't support copy.copy. ! ! The purpose of this PEP, therefore, is to have those iterator types ! expose a suitable __copy__ method. Similarly, user-coded iterator ! types that can provide copies of their instances, suitable for ! separate and independent iteration, with limited costs in time and ! space, should also expose a suitable __copy__ method. While ! copy.copy also supports other ways to let a type control the way ! its instances are copied, it is suggested, for simplicity, that ! iterator types that support copying always do so by exposing a ! __copy__ method, and not in the other ways copy.copy supports. ! ! Having iterators expose a suitable __copy__ when feasible will afford ! easy optimization of itertools.tee and similar user code, as in: def tee(it): it = iter(it) ! try: copier = it.__copy__ ! except AttributeError: # non-copyable iterator, do all the needed hard work + # [snipped!] + else: + return it, copier() + + Note that this function does NOT call "copy.copy(it)", which (even + after this PEP is implemented) might well still "just happen to + succeed". for some iterator type that is implemented as a user-coded + class. without really supplying an adequate "independently iterable" + copy object as its result. *************** *** 56,64 **** without arguments on any instance x of X. The method should be exposed if and only if the iterator type can provide copyability with ! reasonably little computational and memory effort. Similarly, X may ! expose a method __deepcopy__ that is callable with one argument (a memo ! dictionary) on instances of X. The (very concise...) specs for ! these methods are at [2] -- for more details, see also file copy.py ! in the Python standard library. For example, suppose a class Iter essentially duplicated the --- 117,124 ---- without arguments on any instance x of X. The method should be exposed if and only if the iterator type can provide copyability with ! reasonably little computational and memory effort. Furthermore, the ! new object y returned by method __copy__ should be a new instance ! of X that is iterable independently and separately from x, stepping ! along the same "underlying sequence" of items. For example, suppose a class Iter essentially duplicated the *************** *** 76,85 **** def next(self): try: result = self.sequence[self.index] ! except IndexError: raise StopIteration self.index += 1 return result To make this Iter class compliant with this PEP, the following ! additions to the body of class Iter would suffice: def __copy__(self): --- 136,145 ---- def next(self): try: result = self.sequence[self.index] ! except IndexError: raise StopIteration self.index += 1 return result To make this Iter class compliant with this PEP, the following ! addition to the body of class Iter would suffice: def __copy__(self): *************** *** 88,157 **** return result ! def __deepcopy__(self, memo): ! result = self.__copy__() ! result.sequence = deepcopy(self.sequence, memo) ! return result ! Details ! Besides adding to the Python docs a recommendation that user-coded ! iterators be made copyable when feasible, this PEP's implementation ! will specifically include the addition of copyability to the iterators ! over sequences that built-in iter returns, and also to the iterators ! over a dictionary returned by the methods __iter__, iterkeys, itervalues, ! and iteritems of built-in type dict. ! Iterators produced by generators will not be copyable (the BDFL deems ! shallow copy impossible, and deep copy too much trouble). However, ! iterators produced by the new "generator expressions" of Python 2.4 ! (PEP 289 [3]) should be copyable if their underlying iterator[s] are; ! the strict limitations on what is possible in a generator expression, ! compared to the much vaster generality of a generator, should make ! that feasible. Similarly, the iterators produced by the built-in ! function enumerate should be copyable if the underlying iterator is. ! The implementation of this PEP will also include the optimization ! of the new itertools.tee function mentioned in the Motivation section. ! Rationale ! Being able to copy iterators will allow copying of user-coded classes ! that have copyable iterators as attributes. This applies to both ! shallow and deep copying. ! Deep copyability of suitable iterators will allow "decoupling" from ! an underlying mutable sequence, and, according to the BDFL, may in ! the future allow certain iterators to become picklable (however, this ! PEP, in itself, does not include picklability of iterators). ! The main use case for (shallow) copying of an iterator is the same ! as for the function itertools.tee (new in 2.4). Indeed, we assume ! that user code will typically not directly attempt to copy.copy an ! iterator, because it would have to deal with uncopyable cases; just ! calling itertools.tee will enable copying when feasible, with an ! implicit fallback to a maximally efficient non-copying strategy for ! iterators that are not copyable. ! A tee'd iterator may serve as a "reference point", allowing processing ! of a sequence to continue or resume from a known point, while the other ! independent iterator can be freely advanced to "explore" a further part ! of the sequence as needed. To fully exploit this pattern, it should ! ideally also be possible, given two iterators originally produced by ! iterator.tee, to check if they are "equal" (have been stepped the same ! number of times); however, this PEP, in itself, does not include ! comparability of such iterators. Therefore, code using this pattern ! may also need to count the number of forward steps taken after tee by ! the iterators, so as to be able to tell which one is "behind", and by ! how much. Built-in function enumerate is one way to make such counting ! very easy in many situations. However, such needs do not always arise. ! Here is a simpler example: a generator which, given an iterator of ! numbers (assumed to be positive), returns a corresponding iterator ! each of whose items is the fraction of the total corresponding to each ! corresponding item of the input iterator. The caller may pass the ! total as a value, if known in advance; otherwise, the iterator ! returned by calling the generator will first compute the total. def fractions(numbers, total=None): --- 148,266 ---- return result ! Note that __copy__, in this case, does not even try to copy the ! sequence; if the sequence is altered while either or both of the ! original and copied iterators are still stepping on it, the iteration ! behavior is quite likely to go awry anyway -- it is not __copy__'s ! responsibility to change this normal Python behavior for iterators ! which iterate on mutable sequences (that might, perhaps, be the ! specification for a __deepcopy__ method of iterators, which, however, ! this PEP does not deal with). + Consider also a "random iterator", which provides a nonterminating + sequence of results from some method of a random instance, called + with given arguments: ! class RandomIterator(object): ! def __init__(self, bound_method, *args): ! self.call = bound_method ! self.args = args ! def __iter__(self): ! return self ! def next(self): ! return self.call(*self.args) ! ! def __copy__(self): ! import copy, new ! im_self = copy.copy(self.call.im_self) ! method = new.instancemethod(self.call.im_func, im_self) ! return self.__class__(method, *self.args) + This iterator type is slightly more general than its name implies, as + it supports calls to any bound method (or other callable, but if the + callable is not a bound method, then method __copy__ will fail). But + the use case is for the purpose of generating random streams, as in: ! import random ! def show5(it): ! for i, result in enumerate(it): ! print '%6.3f'%result, ! if i==4: break ! print ! normit = RandomIterator(random.Random().gauss, 0, 1) ! show5(normit) ! copit = normit.__copy__() ! show5(normit) ! show5(copit) ! which will display some output such as: ! -0.536 1.936 -1.182 -1.690 -1.184 ! 0.666 -0.701 1.214 0.348 1.373 ! 0.666 -0.701 1.214 0.348 1.373 ! the key point being that the second and third lines are equal, because ! the normit and copit iterators will step along the same "underlying ! sequence". (As an aside, note that to get a copy of self.call.im_self ! we must use copy.copy, NOT try getting at a __copy__ method directly, ! because for example instances of random.Random support copying via ! __getstate__ and __setstate__, NOT via __copy__; indeed, using ! copy.copy is the normal way to get a shallow copy of any object -- ! copyable iterators are different because of the already-mentioned ! uncertainty about the result of copy.copy supporting these "copyable ! iterator" specs). ! ! ! Details ! ! Besides adding to the Python docs a recommendation that user-coded ! iterator types support a __copy__ method (if and only if it can be ! implemented with small costs in memory and runtime, and produce an ! independently-iterable copy of an iterator object), this PEP's ! implementation will specifically include the addition of copyability ! to the iterators over sequences that built-in iter returns, and also ! to the iterators over a dictionary returned by the methods __iter__, ! iterkeys, itervalues, and iteritems of built-in type dict. ! ! Iterators produced by generator functions will not be copyable. ! However, iterators produced by the new "generator expressions" of ! Python 2.4 (PEP 289 [3]) should be copyable if their underlying ! iterator[s] are; the strict limitations on what is possible in a ! generator expression, compared to the much vaster generality of a ! generator, should make that feasible. Similarly, the iterators ! produced by the built-in function enumerate, and certain functions ! suppiled by module itertools, should be copyable if the underlying ! iterators are. ! ! The implementation of this PEP will also include the optimization of ! the new itertools.tee function mentioned in the Motivation section. ! ! ! Rationale ! ! The main use case for (shallow) copying of an iterator is the same as ! for the function itertools.tee (new in 2.4). User code will not ! directly attempt to copy an iterator, because it would have to deal ! separately with uncopyable cases; calling itertools.tee will ! internally perform the copy when appropriate, and implicitly fallback ! to a maximally efficient non-copying strategy for iterators that are ! not copyable. (Occasionally, user code may want more direct control, ! specifically in order to deal with non-copyable iterators by other ! strategies, such as making a list or saving the sequence to disk). ! ! A tee'd iterator may serve as a "reference point", allowing processing ! of a sequence to continue or resume from a known point, while the ! other independent iterator can be freely advanced to "explore" a ! further part of the sequence as needed. A simple example: a generator ! function which, given an iterator of numbers (assumed to be positive), ! returns a corresponding iterator, each of whose items is the fraction ! of the total corresponding to each corresponding item of the input ! iterator. The caller may pass the total as a value, if known in ! advance; otherwise, the iterator returned by calling this generator ! function will first compute the total. def fractions(numbers, total=None): *************** *** 166,170 **** --- 275,442 ---- precompute the total, if needed, without necessarily requiring O(N) auxiliary memory if the numbers iterator is copyable. + + As another example of "iterator bookmarking", consider a stream of + numbers with an occasional string as a "postfix operator" now and + then. By far most frequent such operator is a '+', whereupon we must + sum all previous numbers (since the last previous operator if any, or + else since the start) and yield the result. Sometimes we find a '*' + instead, which is the same except that the previous numbers must + instead be multiplied, not summed. + + def filter_weird_stream(stream): + it = iter(stream) + while True: + it, bookmark = itertools.tee(it) + total = 0 + for item in it: + if item=='+': + yield total + break + elif item=='*': + product = 1 + for item in bookmark: + if item=='*': + yield product + break + else: + product *= item + else: + total += item + + Similar use cases of itertools.tee can support such tasks as + "undo" on a stream of commands represented by an iterator, + "backtracking" on the parse of a stream of tokens, and so on. + (Of course, in each case, one should also consider simpler + possibilities such as saving relevant portions of the sequence + into lists while stepping on the sequence with just one iterator, + depending on the details of one's task). + + + Here is an example, in pure Python, of how the 'enumerate' + built-in could be extended to support __copy__ if its underlying + iterator also supported __copy__: + + class enumerate(object): + + def __init__(self, it): + self.it = iter(it) + self.i = -1 + + def __iter__(self): + return self + + def next(self): + self.i += 1 + return self.i, self.it.next() + + def __copy__(self): + result = self.__class__.new() + result.it = self.it.__copy__() + result.i = self.i + return result + + + Here is an example of the kind of "fragility" produced by "accidental + copyability" of an iterator -- the reason why one must NOT use + copy.copy expecting, if it succeeds, to receive as a result an + iterator which is iterable-on independently from the original. Here + is an iterator class that iterates (in preorder) on "trees" which, for + simplicity, are just nested lists -- any item that's a list is treated + as a subtree, any other item as a leaf. + + class ListreeIter(object): + + def __init__(self, tree): + self.tree = [tree] + self.indx = [-1] + + def __iter__(self): + return self + + def next(self): + if not self.indx: + raise StopIteration + self.indx[-1] += 1 + try: + result = self.tree[-1][self.indx[-1]] + except IndexError: + self.tree.pop() + self.indx.pop() + return self.next() + if type(result) is not list: + return result + self.tree.append(result) + self.indx.append(-1) + return self.next() + + Now, for example, the following code: + + import copy + x = [ [1,2,3], [4, 5, [6, 7, 8], 9], 10, 11, [12] ] + + print 'showing all items:', + it = ListreeIter(x) + for i in it: + print i, + if i==6: cop = copy.copy(it) + print + + print 'showing items >6 again:' + for i in cop: print i, + print + + does NOT work as intended -- the "cop" iterator gets consumed, and + exhausted, step by step as the original "it" iterator is, because + the accidental (rather than deliberate) copying performed by + copy.copy shares, rather than duplicating the "index" list, which + is the mutable attribute it.indx (a list of numerical indices). + Thus, this "client code" of the iterator, which attemps to iterate + twice over a portion of the sequence via a copy.copy on the + iterator, is NOT correct. + + Some correct solutions include using itertools.tee, i.e., changing + the first for loop into: + + for i in it: + print i, + if i==6: + it, cop = itertools.tee(it) + break + for i in it: print i, + + (note that we MUST break the loop in two, otherwise we'd still + be looping on the ORIGINAL value of it, which must NOT be used + further after the call to tee!!!); or making a list, i.e.: + + for i in it: + print i, + if i==6: + cop = lit = list(it) + break + for i in lit: print i, + (again, the loop must be broken in two, since iterator 'it' + gets exhausted by the call list(it)). + + Finally, all of these solutions would work if Listiter supplied + a suitable __copy__ method, as this PEP recommends: + + def __copy__(self): + result = self.__class__.new() + result.tree = copy.copy(self.tree) + result.indx = copy.copy(self.indx) + return result + + There is no need to get any "deeper" in the copy, but the two + mutable "index state" attributes must indeed be copied in order + to achieve a "proper" (independently iterable) iterator-copy. + + The recommended solution is to have class Listiter supply this + __copy__ method AND have client code use itertools.tee (with + the split-in-two-parts loop as shown above). This will make + client code maximally tolerant of different iterator types it + might be using AND achieve good performance for tee'ing of this + specific iterator type at the same time. + References From bcannon at users.sourceforge.net Thu Oct 30 00:42:17 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Oct 30 00:42:21 2003 Subject: [Python-checkins] python/dist/src/Doc/lib compiler.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14139/Doc/lib Modified Files: compiler.tex Log Message: Minor grammatical fix. Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/compiler.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compiler.tex 4 Dec 2001 02:48:52 -0000 1.3 --- compiler.tex 30 Oct 2003 05:42:15 -0000 1.4 *************** *** 90,94 **** the other set by the compiler. The compiler package relies on the interpreter's parser, so it get the first phases of error checking for ! free. It implements the second phase itself, and that implement is incomplete. For example, the compiler package does not raise an error if a name appears more than once in an argument list: --- 90,94 ---- the other set by the compiler. The compiler package relies on the interpreter's parser, so it get the first phases of error checking for ! free. It implements the second phase itself, and that implementation is incomplete. For example, the compiler package does not raise an error if a name appears more than once in an argument list: From rhettinger at users.sourceforge.net Thu Oct 30 01:08:34 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 30 01:08:37 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.139, 1.140 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv17086 Modified Files: libstdtypes.tex Log Message: Fix typo. Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** libstdtypes.tex 29 Oct 2003 06:54:42 -0000 1.139 --- libstdtypes.tex 30 Oct 2003 06:08:32 -0000 1.140 *************** *** 1029,1033 **** \item[(8)] The \method{sort()} and \method{sorted()} methods take optional ! arguments for controlling the comparisions. \var{cmp} specifies a custom comparison function of two arguments --- 1029,1033 ---- \item[(8)] The \method{sort()} and \method{sorted()} methods take optional ! arguments for controlling the comparisons. \var{cmp} specifies a custom comparison function of two arguments From rhettinger at users.sourceforge.net Thu Oct 30 02:41:22 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Oct 30 02:41:25 2003 Subject: [Python-checkins] python/nondist/peps pep-0322.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv29134 Modified Files: pep-0322.txt Log Message: Update PEP based on discussion on comp.lang.python: * reversed() is being preferred to ireverse() as the best name. * the sample implementation now shows a check for a custom reverse method and a guard against being applied to a mapping. * added sample output for enumerate.__reversed__ to show an example of how a custom reverse method would work * explained why the function is proposed as a builtin. * expanded a couple for the real world use cases to show what the replacement code would look like. * improved markup so that the function names get italicized. Index: pep-0322.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0322.txt 28 Oct 2003 22:39:22 -0000 1.9 --- pep-0322.txt 30 Oct 2003 07:41:20 -0000 1.10 *************** *** 47,51 **** ======== ! Add a builtin function called *ireverse()* that makes a reverse iterator over sequence objects that support __getitem__() and __len__(). --- 47,51 ---- ======== ! Add a builtin function called *reversed()* that makes a reverse iterator over sequence objects that support __getitem__() and __len__(). *************** *** 53,71 **** The above examples then simplify to:: ! for i in ireverse(xrange(n)): print seqn[i] :: ! for elem in ireverse(seqn): print elem The core idea is that the clearest, least error-prone way of specifying reverse iteration is to specify it in a forward direction and then say ! *ireverse*. The implementation could be as simple as:: ! def ireverse(x): i = len(x) while i > 0: --- 53,77 ---- The above examples then simplify to:: ! for i in reversed(xrange(n)): print seqn[i] :: ! for elem in reversed(seqn): print elem The core idea is that the clearest, least error-prone way of specifying reverse iteration is to specify it in a forward direction and then say ! *reversed*. The implementation could be as simple as:: ! def reversed(x): ! try: ! return x.__reversed__() ! except AttributeError: ! pass ! if hasattr(x, "has_key"): ! raise ValueError("mappings do not support reverse iteration") i = len(x) while i > 0: *************** *** 73,79 **** yield x[i] - If *x* is a mapping, the implementation should return a ValueError with - a message noting that reverse iteration is undefined for mappings. - No language syntax changes are needed. The proposal is fully backwards compatible. --- 79,82 ---- *************** *** 83,87 **** ======================== ! * *backwards* -- more pithy, less explicit * *inreverse* -- no one seems to like this one except me --- 86,90 ---- ======================== ! * *ireverse* -- uses the itertools naming convention * *inreverse* -- no one seems to like this one except me *************** *** 93,105 **** ============== ! Objects may optionally provide an *__ireverse__* method that returns a custom reverse iterator. ! This allows reverse() to be applied to objects that do not have __getitem__() and __len__() but still have some useful way of providing reverse iteration. ! Using this protocol, enumerate() can be extended to support reversal ! whenever the underlying iterator supports it also. --- 96,111 ---- ============== ! Objects may optionally provide a *__reversed__* method that returns a custom reverse iterator. ! This allows *reverse()* to be applied to objects that do not have __getitem__() and __len__() but still have some useful way of providing reverse iteration. ! For example, using this protocol, *enumerate()* can be extended to ! support reversal whenever the underlying iterator supports it also:: ! ! >>> list(reversed(enumerate("abc"))) ! [(2, 'c'), (1, 'b'), (0, 'a')] *************** *** 124,127 **** --- 130,135 ---- possible; however, that would complicate the rest of the heap code which iterates over the underlying list in the opposite direction. + The replacement code ``for i in reversed(xrange(n//2))`` makes + clear the range covered and how many iterations it takes. * mhlib.test() uses:: *************** *** 144,148 **** be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in ireverse(xrange(1, len(x)))`` is much easier to verify visually. --- 152,156 ---- be run in a forward direction but is less intuitive and rarely presented that way in literature. The replacement code ! ``for i in reversed(xrange(1, len(x)))`` is much easier to verify visually. *************** *** 161,175 **** A simpler, but limited alternative is to create a builtin that takes ! the same arguments as range() but returns a reverse iterator over the ! range. The idea is that much of the benefit of ireverse() comes reducing the intellectual effort it takes to express the arguments for [x]range() when going backwards. A good name is needed for this ! alternative -- revrange() is cleanest so far. ! Rejected Alternative ! ==================== ! Several variants were submitted that attempted to apply ireverse() to all iterables by running the iterable to completion, saving the results, and then returning a reverse iterator over the results. --- 169,183 ---- A simpler, but limited alternative is to create a builtin that takes ! the same arguments as *range()* but returns a reverse iterator over the ! range. The idea is that much of the benefit of *reversed()* comes reducing the intellectual effort it takes to express the arguments for [x]range() when going backwards. A good name is needed for this ! alternative -- *revrange()* is cleanest so far. ! Rejected Alternatives ! ===================== ! Several variants were submitted that attempted to apply *reversed()* to all iterables by running the iterable to completion, saving the results, and then returning a reverse iterator over the results. *************** *** 178,181 **** --- 186,197 ---- in the first place. Also, a small disaster ensues if the underlying iterator is infinite. + + Putting the function in another module or attaching it to a type object + is not being considered. Like its cousins, *zip()* and *enumerate()*, + the function needs to be directly accessible in daily programming. Each + solves a basic looping problem: lock-step iteration, loop counting, and + reverse iteration. Requiring some form of dotted access would interfere + with their simplicity, daily utility, and accessibility. They are core + looping constructs, independent of any one application domain. From fdrake at users.sourceforge.net Thu Oct 30 10:13:44 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Oct 30 10:13:50 2003 Subject: [Python-checkins] python/dist/src/Lib mimetypes.py,1.21,1.21.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv7056 Modified Files: Tag: release22-maint mimetypes.py Log Message: use True/False for boolean values Index: mimetypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetypes.py,v retrieving revision 1.21 retrieving revision 1.21.6.1 diff -C2 -d -r1.21 -r1.21.6.1 *** mimetypes.py 5 Dec 2001 15:58:29 -0000 1.21 --- mimetypes.py 30 Oct 2003 15:13:41 -0000 1.21.6.1 *************** *** 36,40 **** ] ! inited = 0 --- 36,40 ---- ] ! inited = False *************** *** 209,213 **** global suffix_map, types_map, encodings_map, common_types global inited ! inited = 1 db = MimeTypes() if files is None: --- 209,213 ---- global suffix_map, types_map, encodings_map, common_types global inited ! inited = True db = MimeTypes() if files is None: From loewis at users.sourceforge.net Fri Oct 31 05:01:39 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 05:01:44 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.69,1.831.4.70 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12180/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #788404: ignore "b" and "t" mode modifiers in posix_popen. Fixes #703198. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.69 retrieving revision 1.831.4.70 diff -C2 -d -r1.831.4.69 -r1.831.4.70 *** NEWS 27 Oct 2003 14:24:41 -0000 1.831.4.69 --- NEWS 31 Oct 2003 10:01:35 -0000 1.831.4.70 *************** *** 19,22 **** --- 19,24 ---- ----------------- + - Bug #703198: Ignore "b" and "t" in os.popen on Unix. + - Patch #803998: Deal with errors in SSL_write correctly. From loewis at users.sourceforge.net Fri Oct 31 05:01:40 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 05:01:49 2003 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300.8.3, 2.300.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12180/Modules Modified Files: Tag: release23-maint posixmodule.c Log Message: Patch #788404: ignore "b" and "t" mode modifiers in posix_popen. Fixes #703198. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.300.8.3 retrieving revision 2.300.8.4 diff -C2 -d -r2.300.8.3 -r2.300.8.4 *** posixmodule.c 20 Oct 2003 14:34:47 -0000 2.300.8.3 --- posixmodule.c 31 Oct 2003 10:01:37 -0000 2.300.8.4 *************** *** 4331,4334 **** --- 4331,4339 ---- if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; + /* Strip mode of binary or text modifiers */ + if (strcmp(mode, "rb") == 0 || strcmp(mode, "rt") == 0) + mode = "r"; + else if (strcmp(mode, "wb") == 0 || strcmp(mode, "wt") == 0) + mode = "w"; Py_BEGIN_ALLOW_THREADS fp = popen(name, mode); From loewis at users.sourceforge.net Fri Oct 31 05:01:59 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 05:02:02 2003 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.306, 2.307 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12379/Modules Modified Files: posixmodule.c Log Message: Patch #788404: ignore "b" and "t" mode modifiers in posix_popen. Fixes #703198. Backported to 2.3. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.306 retrieving revision 2.307 diff -C2 -d -r2.306 -r2.307 *** posixmodule.c 20 Oct 2003 14:01:53 -0000 2.306 --- posixmodule.c 31 Oct 2003 10:01:53 -0000 2.307 *************** *** 4349,4352 **** --- 4349,4357 ---- if (!PyArg_ParseTuple(args, "s|si:popen", &name, &mode, &bufsize)) return NULL; + /* Strip mode of binary or text modifiers */ + if (strcmp(mode, "rb") == 0 || strcmp(mode, "rt") == 0) + mode = "r"; + else if (strcmp(mode, "wb") == 0 || strcmp(mode, "wt") == 0) + mode = "w"; Py_BEGIN_ALLOW_THREADS fp = popen(name, mode); From loewis at users.sourceforge.net Fri Oct 31 07:52:37 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 07:52:41 2003 Subject: [Python-checkins] python/dist/src/Misc ACKS, 1.251, 1.252 NEWS, 1.881, 1.882 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv5427/Misc Modified Files: ACKS NEWS Log Message: Patch #: Add POP3 over SSL support. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.251 retrieving revision 1.252 diff -C2 -d -r1.251 -r1.252 *** ACKS 14 Oct 2003 21:47:28 -0000 1.251 --- ACKS 31 Oct 2003 12:52:35 -0000 1.252 *************** *** 563,566 **** --- 563,567 ---- Doobee R. Tzeck Lionel Ulmer + Hector Urtubia Frank Vercruesse Jaap Vermeulen Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.881 retrieving revision 1.882 diff -C2 -d -r1.881 -r1.882 *** NEWS 29 Oct 2003 06:54:42 -0000 1.881 --- NEWS 31 Oct 2003 12:52:35 -0000 1.882 *************** *** 102,105 **** --- 102,107 ---- ------- + - poplib.POP3_SSL has been added. + - tmpfile.mkstemp now returns an absolute path even if dir is relative. From loewis at users.sourceforge.net Fri Oct 31 07:52:37 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 07:52:46 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libpoplib.tex,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5427/Doc/lib Modified Files: libpoplib.tex Log Message: Patch #: Add POP3 over SSL support. Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libpoplib.tex 18 Oct 2002 16:50:17 -0000 1.15 --- libpoplib.tex 31 Oct 2003 12:52:34 -0000 1.16 *************** *** 14,20 **** This module defines a class, \class{POP3}, which encapsulates a ! connection to an POP3 server and implements the protocol as defined in \rfc{1725}. The \class{POP3} class supports both the minimal and ! optional command sets. Note that POP3, though widely supported, is obsolescent. The --- 14,23 ---- This module defines a class, \class{POP3}, which encapsulates a ! connection to a POP3 server and implements the protocol as defined in \rfc{1725}. The \class{POP3} class supports both the minimal and ! optional command sets. Additionally, this module provides a class ! \class{POP3_SSL}, which provides support for connecting to POP3 ! servers that use SSL as an underlying protocol layer. ! Note that POP3, though widely supported, is obsolescent. The *************** *** 32,35 **** --- 35,48 ---- \end{classdesc} + \begin{classdesc}{POP3_SSL}{host\optional{, port\optional{, keyfile\optional{, certfile}}}} + This is a subclass of \class{POP3} that connects to the server over an + SSL encrypted socket. If \var{port} is not specified, 995, the + standard POP3-over-SSL port is used. \var{keyfile} and \var{certfile} + are also optional - they can contain a PEM formatted private key and + certificate chain file for the SSL connection. + + \versionadded{2.4} + \end{classdesc} + One exception is defined as an attribute of the \module{poplib} module: *************** *** 143,146 **** --- 156,162 ---- \var{octets})}. \end{methoddesc} + + Instances of \class{POP3_SSL} have no additional methods. The + interface of this subclass is identical to its parent. From loewis at users.sourceforge.net Fri Oct 31 07:52:37 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 07:52:50 2003 Subject: [Python-checkins] python/dist/src/Lib poplib.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv5427/Lib Modified Files: poplib.py Log Message: Patch #: Add POP3 over SSL support. Index: poplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** poplib.py 1 Jun 2002 16:07:16 -0000 1.21 --- poplib.py 31 Oct 2003 12:52:35 -0000 1.22 *************** *** 8,11 **** --- 8,12 ---- # Updated: Piers Lauder [Jul '97] # String method conversion and test jig improvements by ESR, February 2001. + # Added the POP3_SSL class. Methods loosely based on IMAP_SSL. Hector Urtubia Aug 2003 # Example (see the test function at the end of this file) *************** *** 15,19 **** import re, socket ! __all__ = ["POP3","error_proto"] # Exception raised when an error or invalid response is received: --- 16,20 ---- import re, socket ! __all__ = ["POP3","error_proto","POP3_SSL"] # Exception raised when an error or invalid response is received: *************** *** 24,27 **** --- 25,31 ---- POP3_PORT = 110 + # POP SSL PORT + POP3_SSL_PORT = 995 + # Line terminators (we always output CRLF, but accept any of CRLF, LFCR, LF) CR = '\r' *************** *** 317,320 **** --- 321,408 ---- return self._shortcmd('UIDL %s' % which) return self._longcmd('UIDL') + + class POP3_SSL(POP3): + """POP3 client class over SSL connection + + Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None) + + hostname - the hostname of the pop3 over ssl server + port - port number + keyfile - PEM formatted file that countains your private key + certfile - PEM formatted certificate chain file + + See the methods of the parent class POP3 for more documentation. + """ + + def __init__(self, host, port = POP3_SSL_PORT, keyfile = None, certfile = None): + self.host = host + self.port = port + self.keyfile = keyfile + self.certfile = certfile + self.buffer = "" + msg = "getaddrinfo returns an empty list" + self.sock = None + for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + try: + self.sock = socket.socket(af, socktype, proto) + self.sock.connect(sa) + except socket.error, msg: + if self.sock: + self.sock.close() + self.sock = None + continue + break + if not self.sock: + raise socket.error, msg + self.file = self.sock.makefile('rb') + self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile) + self._debugging = 0 + self.welcome = self._getresp() + + def _fillBuffer(self): + localbuf = self.sslobj.read() + if len(localbuf) == 0: + raise error_proto('-ERR EOF') + self.buffer += localbuf + + def _getline(self): + line = "" + renewline = re.compile(r'.*?\n') + match = renewline.match(self.buffer) + while not match: + self._fillBuffer() + match = renewline.match(self.buffer) + line = match.group(0) + self.buffer = renewline.sub('' ,self.buffer, 1) + if self._debugging > 1: print '*get*', `line` + + octets = len(line) + if line[-2:] == CRLF: + return line[:-2], octets + if line[0] == CR: + return line[1:-1], octets + return line[:-1], octets + + def _putline(self, line): + if self._debugging > 1: print '*put*', `line` + line += CRLF + bytes = len(line) + while bytes > 0: + sent = self.sslobj.write(line) + if sent == bytes: + break # avoid copy + line = line[sent:] + bytes = bytes - sent + + def quit(self): + """Signoff: commit changes on server, unlock mailbox, close connection.""" + try: + resp = self._shortcmd('QUIT') + except error_proto, val: + resp = val + self.sock.close() + del self.sslobj, self.sock + return resp From loewis at users.sourceforge.net Fri Oct 31 08:01:11 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:01:14 2003 Subject: [Python-checkins] python/dist/src/Modules termios.c,2.37,2.37.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv6862/Modules Modified Files: Tag: release23-maint termios.c Log Message: Patch #787189: Explicitly define CTRL on SGI. Index: termios.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/termios.c,v retrieving revision 2.37 retrieving revision 2.37.8.1 diff -C2 -d -r2.37 -r2.37.8.1 *** termios.c 23 May 2003 14:35:24 -0000 2.37 --- termios.c 31 Oct 2003 13:01:08 -0000 2.37.8.1 *************** *** 5,8 **** --- 5,14 ---- #define PyInit_termios inittermios + /* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE + is defined, so we define it here. */ + #if defined(__sgi) + #define CTRL(c) ((c)&037) + #endif + #include #ifdef __osf__ From loewis at users.sourceforge.net Fri Oct 31 08:01:26 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:01:29 2003 Subject: [Python-checkins] python/dist/src/Modules termios.c,2.37,2.38 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv7005/Modules Modified Files: termios.c Log Message: Patch #787189: Explicitly define CTRL on SGI. Index: termios.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/termios.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -d -r2.37 -r2.38 *** termios.c 23 May 2003 14:35:24 -0000 2.37 --- termios.c 31 Oct 2003 13:01:24 -0000 2.38 *************** *** 5,8 **** --- 5,14 ---- #define PyInit_termios inittermios + /* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE + is defined, so we define it here. */ + #if defined(__sgi) + #define CTRL(c) ((c)&037) + #endif + #include #ifdef __osf__ From loewis at users.sourceforge.net Fri Oct 31 08:05:06 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:05:08 2003 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.86,1.86.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv7480/Lib Modified Files: Tag: release23-maint pydoc.py Log Message: Patch #785689: Use basename in usage. Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.86 retrieving revision 1.86.8.1 diff -C2 -d -r1.86 -r1.86.8.1 *** pydoc.py 27 Jun 2003 15:45:41 -0000 1.86 --- pydoc.py 31 Oct 2003 13:05:04 -0000 1.86.8.1 *************** *** 2122,2126 **** except (getopt.error, BadUsage): ! cmd = sys.argv[0] print """pydoc - the Python documentation tool --- 2122,2126 ---- except (getopt.error, BadUsage): ! cmd = os.path.basename(sys.argv[0]) print """pydoc - the Python documentation tool From loewis at users.sourceforge.net Fri Oct 31 08:05:23 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:05:27 2003 Subject: [Python-checkins] python/dist/src/Lib pydoc.py,1.88,1.89 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv7570/Lib Modified Files: pydoc.py Log Message: Patch #785689: Use basename in usage. Backported to 2.3. Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** pydoc.py 16 Oct 2003 05:53:16 -0000 1.88 --- pydoc.py 31 Oct 2003 13:05:21 -0000 1.89 *************** *** 2168,2172 **** except (getopt.error, BadUsage): ! cmd = sys.argv[0] print """pydoc - the Python documentation tool --- 2168,2172 ---- except (getopt.error, BadUsage): ! cmd = os.path.basename(sys.argv[0]) print """pydoc - the Python documentation tool From loewis at users.sourceforge.net Fri Oct 31 08:49:39 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:49:43 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.882,1.883 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv14689/Misc Modified Files: NEWS Log Message: Patch #531629: Add multicall support. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.882 retrieving revision 1.883 diff -C2 -d -r1.882 -r1.883 *** NEWS 31 Oct 2003 12:52:35 -0000 1.882 --- NEWS 31 Oct 2003 13:49:36 -0000 1.883 *************** *** 102,105 **** --- 102,107 ---- ------- + - xmlrpclib.MultiCall has been added. + - poplib.POP3_SSL has been added. From loewis at users.sourceforge.net Fri Oct 31 08:49:38 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:49:48 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libxmlrpclib.tex, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14689/Doc/lib Modified Files: libxmlrpclib.tex Log Message: Patch #531629: Add multicall support. Index: libxmlrpclib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmlrpclib.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libxmlrpclib.tex 22 Oct 2003 14:12:03 -0000 1.14 --- libxmlrpclib.tex 31 Oct 2003 13:49:36 -0000 1.15 *************** *** 253,256 **** --- 253,285 ---- \end{memberdesc} + \subsection{MultiCall Objects} + + \versionadded{2.4} + + In \url{http://www.xmlrpc.com/discuss/msgReader\$1208}, an approach + is presented to encapsulate multiple calls to a remote server into + a single request. + + \begin{classdesc}{MultiCall}{server} + + Create an object used to boxcar method calls. \var{server} is the + eventual target of the call. Calls can be made to the result object, + but they will immediately return \var{None}, and only store the + call name and parameters in the \class{MultiCall} object. Calling + the object itself causes all stored calls to be transmitted as + a single \code{system.multicall} request. The result of this call + is a generator; iterating over this generator yields the individual + results. + + \end{classdesc} + + A usage example of this class is + + \begin{verbatim} + multicall = MultiCall(server_proxy) + multicall.add(2,3) + multicall.get_address("Guido") + add_result, address = multicall() + \end{verbatim} \subsection{Convenience Functions} From loewis at users.sourceforge.net Fri Oct 31 08:49:39 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 08:49:52 2003 Subject: [Python-checkins] python/dist/src/Lib xmlrpclib.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv14689/Lib Modified Files: xmlrpclib.py Log Message: Patch #531629: Add multicall support. Index: xmlrpclib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** xmlrpclib.py 20 Oct 2003 14:01:51 -0000 1.30 --- xmlrpclib.py 31 Oct 2003 13:49:36 -0000 1.31 *************** *** 51,54 **** --- 51,55 ---- # 2003-06-15 gn Add support for time.struct_time # 2003-07-12 gp Correct marshalling of Faults + # 2003-10-31 mvl Add multicall support # # Copyright (c) 1999-2002 by Secret Labs AB. *************** *** 109,112 **** --- 110,114 ---- ServerProxy Represents a logical connection to an XML-RPC server + MultiCall Executor of boxcared xmlrpc requests Boolean boolean wrapper to generate a "boolean" XML-RPC value DateTime dateTime wrapper for an ISO 8601 string or time tuple or *************** *** 876,880 **** --- 878,944 ---- dispatch["methodName"] = end_methodName + ## Multicall support + # + + class _MultiCallMethod: + # some lesser magic to store calls made to a MultiCall object + # for batch execution + def __init__(self, call_list, name): + self.__call_list = call_list + self.__name = name + def __getattr__(self, name): + return _MultiCallMethod(self.__call_list, "%s.%s" % (self.__name, name)) + def __call__(self, *args): + self.__call_list.append((self.__name, args)) + + def MultiCallIterator(results): + """Iterates over the results of a multicall. Exceptions are + thrown in response to xmlrpc faults.""" + + for i in results: + if type(i) == type({}): + raise Fault(i['faultCode'], i['faultString']) + elif type(i) == type([]): + yield i[0] + else: + raise ValueError,\ + "unexpected type in multicall result" + + class MultiCall: + """server -> a object used to boxcar method calls + + server should be a ServerProxy object. + + Methods can be added to the MultiCall using normal + method call syntax e.g.: + + multicall = MultiCall(server_proxy) + multicall.add(2,3) + multicall.get_address("Guido") + + To execute the multicall, call the MultiCall object e.g.: + add_result, address = multicall() + """ + + def __init__(self, server): + self.__server = server + self.__call_list = [] + + def __repr__(self): + return "" % id(self) + + __str__ = __repr__ + + def __getattr__(self, name): + return _MultiCallMethod(self.__call_list, name) + + def __call__(self): + marshalled_list = [] + for name, args in self.__call_list: + marshalled_list.append({'methodName' : name, 'params' : args}) + + return MultiCallIterator(self.__server.system.multicall(marshalled_list)) + # -------------------------------------------------------------------- # convenience functions *************** *** 1329,1333 **** __str__ = __repr__ ! def __getattr__(self, name): # magic method dispatcher --- 1393,1397 ---- __str__ = __repr__ ! def __getattr__(self, name): # magic method dispatcher From loewis at users.sourceforge.net Fri Oct 31 09:02:43 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 09:02:48 2003 Subject: [Python-checkins] python/dist/src/PCbuild python.iss,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv17280 Modified Files: python.iss Log Message: Patch #628301: Update installer to http://cesnet.dl.sourceforge.net/sourceforge/avpython/Python-2.3.2-Win32-159-Setup.iss Index: python.iss =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python.iss,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** python.iss 4 Apr 2002 17:52:50 -0000 1.6 --- python.iss 31 Oct 2003 14:02:41 -0000 1.7 *************** *** 43,57 **** [Setup] ! ; Note: we *want* the version number to show up everywhere. ! ; Which of these controls App Path??? ! AppName=Python 2.2 alpha 1 ! AppVerName=Python 2.2 alpha 1 ! AppId=Python 2.2 ! AppVersion=2.2a1 ! AppCopyright=Copyright © 2001 Python Software Foundation ; Default install dir; value of {app} later (unless user overrides). ; {sd} = system root drive, probably "C:". DefaultDirName={sd}\Python22 ; Start menu folder name; value of {group} later (unless user overrides). --- 43,56 ---- [Setup] ! AppName=Python and combined Win32 Extensions ! AppVerName=Python 2.2.2 and combined Win32 Extensions 150 ! AppId=Python 2.2.2.150 ! AppVersion=2.2.2.150 ! AppCopyright=Python is Copyright © 2001 Python Software Foundation. Win32 Extensions are Copyright © 1996-2001 Greg Stein and Mark Hammond. ; Default install dir; value of {app} later (unless user overrides). ; {sd} = system root drive, probably "C:". DefaultDirName={sd}\Python22 + ;DefaultDirName={pf}\Python ; Start menu folder name; value of {group} later (unless user overrides). *************** *** 59,80 **** ; Point SourceDir to one above PCBuild = src. ! ; YAY! That actually worked: means this script can run unchanged from anyone's ! ; CVS tree, no matter what they called the top-level directories. Wise ! ; required hardcoded absolute paths all over the place. ! SourceDir=.. ! OutputDir=PCBuild ! OutputBaseFilename=Python-2.2a1 ! AppPublisher=PythonLabs at Zope Corporation AppPublisherURL=http://www.python.org AppSupportURL=http://www.python.org AppUpdatesURL=http://www.python.org ! AlwaysCreateUninstallIcon=yes ! ChangesAssociations=yes UninstallLogMode=new ; The fewer screens the better; leave these commented. ! ;LicenseFile=LICENSE ;InfoBeforeFile=Misc\NEWS --- 58,84 ---- ; Point SourceDir to one above PCBuild = src. ! ; means this script can run unchanged from anyone's CVS tree, no matter ! ; what they called the top-level directories. ! SourceDir=. ! OutputDir=.. ! OutputBaseFilename=Python-2.2.2-Win32-150-Setup ! AppPublisher=PythonLabs at Digital Creations AppPublisherURL=http://www.python.org AppSupportURL=http://www.python.org AppUpdatesURL=http://www.python.org ! AlwaysCreateUninstallIcon=true ! ChangesAssociations=true UninstallLogMode=new + AllowNoIcons=true + AdminPrivilegesRequired=true + UninstallDisplayIcon={app}\pyc.ico + WizardDebug=false ; The fewer screens the better; leave these commented. ! ! Compression=bzip ! InfoBeforeFile=LICENSE.txt ;InfoBeforeFile=Misc\NEWS *************** *** 83,97 **** [Types] ! Name: normal; Description: "Select desired components"; Flags: iscustom [Components] ! Name: main; Description: "Python interpreter, library and Tk"; Types: normal ! Name: docs; Description: "Python documentation (HTML)"; Types: normal ! Name: tools; Description: "Python utility scripts (Tools\)"; Types: normal ! Name: test; Description: "Python test suite (Lib\test\)"; Types: normal [Tasks] ! Name: startmenu; Description: "Create Start menu shortcuts"; Components: main docs tools ! Name: extensions; Description: "Register file extensions (.py, .pyw, .pyc, .pyo)"; Components: main [Files] --- 87,101 ---- [Types] ! Name: normal; Description: Select desired components; Flags: iscustom [Components] ! Name: main; Description: Python and Win32 Extensions; Types: normal ! Name: docs; Description: Python documentation (HTML); Types: normal ! Name: tk; Description: TCL/TK, tkinter, and Idle; Types: normal ! Name: tools; Description: Python utility scripts (Tools\); Types: normal ! Name: test; Description: Python test suite (Lib\test\); Types: normal [Tasks] ! Name: extensions; Description: Register file associations (.py, .pyw, .pyc, .pyo); Components: main; Check: IsAdminLoggedOn [Files] *************** *** 101,241 **** ; physical lines. ! Source: LICENSE; DestDir: "{app}"; DestName: LICENSE.txt; CopyMode: alwaysoverwrite ! Source: README; DestDir: "{app}"; DestName: README.txt; CopyMode: alwaysoverwrite ! Source: Misc\News; DestDir: "{app}"; DestName: NEWS.txt; CopyMode: alwaysoverwrite ! Source: PC\*.ico; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main - Source: PCbuild\python.exe; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main - Source: PCbuild\pythonw.exe; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main - Source: PCbuild\w9xpopen.exe; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\python22.dll; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main ! Source: ..\tcl\bin\tcl83.dll; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: ..\tcl\bin\tk83.dll; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: ..\tcl\lib\*.*; DestDir: "{app}\tcl"; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: PCbuild\_socket.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_socket.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_sre.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_sre.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_symtable.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_symtable.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_testcapi.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_testcapi.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_tkinter.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_tkinter.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\bsddb.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\bsddb.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\mmap.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\mmap.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\parser.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\parser.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\pyexpat.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\pyexpat.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\select.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\select.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\unicodedata.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\unicodedata.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_winreg.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\_winreg.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\winsound.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\winsound.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\zlib.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\zlib.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: PCbuild\python22.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main ! Source: ..\expat\Libs\expat.dll; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\*.py; DestDir: "{app}\Lib"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\lib-tk\*.py; DestDir: "{app}\Lib\lib-tk"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\encodings\*.py; DestDir: "{app}\Lib\encodings"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\distutils\*.py; DestDir: "{app}\Lib\distutils"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\xml\*.py; DestDir: "{app}\Lib\xml"; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: main - Source: Lib\lib-old\*.py; DestDir: "{app}\Lib\lib-old"; CopyMode: alwaysoverwrite; Components: main - Source: Lib\site-packages\README; DestDir: "{app}\Lib\site-packages"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: main - Source: Include\*.h; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: main - Source: PC\pyconfig.h; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: main ! Source: Tools\scripts\*.py; DestDir: "{app}\Tools\Scripts"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\scripts\*.pyw; DestDir: "{app}\Tools\Scripts"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\scripts\*.doc; DestDir: "{app}\Tools\Scripts"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\scripts\README; DestDir: "{app}\Tools\Scripts"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\webchecker\*.py; DestDir: "{app}\Tools\webchecker"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\webchecker\README; DestDir: "{app}\Tools\webchecker"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\versioncheck\*.py; DestDir: "{app}\Tools\versioncheck"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\versioncheck\README; DestDir: "{app}\Tools\versioncheck"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\idle\*.py; DestDir: "{app}\Tools\idle"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\idle\idle.pyw; DestDir: "{app}\Tools\idle"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\idle\*.txt; DestDir: "{app}\Tools\idle"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\idle\Icons\*.*; DestDir: "{app}\Tools\idle\Icons"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\*.py; DestDir: "{app}\Tools\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\README; DestDir: "{app}\Tools\compiler"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.py; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\compiler\compiler\*.txt; DestDir: "{app}\Tools\compiler\compiler"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\pynche\*.py; DestDir: "{app}\Tools\pynche"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\pynche\pynche.pyw; DestDir: "{app}\Tools\pynche"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\pynche\X\*.txt; DestDir: "{app}\Tools\pynche\X"; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\pynche\README; DestDir: "{app}\Tools\pynche"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools ! Source: Tools\pynche\pynche; DestDir: "{app}\Tools\pynche"; DestName: pynche.py; CopyMode: alwaysoverwrite; Components: tools ! Source: html\*.*; DestDir: "{app}\Doc"; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: docs - Source: Lib\test\*.py; DestDir: "{app}\Lib\test"; CopyMode: alwaysoverwrite; Components: test - Source: Lib\test\*.uue; DestDir: "{app}\Lib\test"; CopyMode: alwaysoverwrite; Components: test - Source: Lib\test\*.xml; DestDir: "{app}\Lib\test"; CopyMode: alwaysoverwrite; Components: test - Source: Lib\test\*.out; DestDir: "{app}\Lib\test"; CopyMode: alwaysoverwrite; Components: test - Source: Lib\test\audiotest.au; DestDir: "{app}\Lib\test"; CopyMode: alwaysoverwrite; Components: test - Source: Lib\test\output\*.*; DestDir: "{app}\Lib\test\output"; CopyMode: alwaysoverwrite; Components: test [Icons] ! Tasks: startmenu; Name: "{group}\IDLE (Python GUI)"; Filename: "{app}\pythonw.exe"; WorkingDir: "{app}"; Parameters: """{app}\Tools\idle\idle.pyw"""; Components: tools ! Tasks: startmenu; Name: "{group}\Module Docs"; Filename: "{app}\pythonw.exe"; WorkingDir: "{app}"; Parameters: """{app}\Tools\Scripts\pydoc.pyw"""; Components: tools ! Tasks: startmenu; Name: "{group}\Python (command line)"; Filename: "{app}\python.exe"; WorkingDir: "{app}"; Components: main ! Tasks: startmenu; Name: "{group}\Python Manuals"; Filename: "{app}\Doc\index.html"; WorkingDir: "{app}"; Components: docs [Registry] ; Register .py ! Tasks: extensions; Root: HKCR; Subkey: ".py"; ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: ".py"; ValueType: string; ValueName: "Content Type"; ValueData: "text/plain"; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: "Python File"; ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: "Python File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Py.ico" ! Tasks: extensions; Root: HKCR; Subkey: "Python File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python.exe"" ""%1"" %*" ; Register .pyc ! Tasks: extensions; Root: HKCR; Subkey: ".pyc"; ValueType: string; ValueName: ""; ValueData: "Python CompiledFile"; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile"; ValueType: string; ValueName: ""; ValueData: "Compiled Python File"; Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pyc.ico" ! Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python.exe"" ""%1"" %*" ; Register .pyo ! Tasks: extensions; Root: HKCR; Subkey: ".pyo"; ValueType: string; ValueName: ""; ValueData: "Python CompiledFile"; Flags: uninsdeletevalue ; Register .pyw ! Tasks: extensions; Root: HKCR; Subkey: ".pyw"; ValueType: string; ValueName: ""; ValueData: "Python NoConFile"; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: ".pyw"; ValueType: string; ValueName: "Content Type"; ValueData: "text/plain"; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile"; ValueType: string; ValueName: ""; ValueData: "Python File (no console)"; Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Py.ico" ! Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\pythonw.exe"" ""%1"" %*" --- 105,346 ---- ; physical lines. ! Source: LICENSE.txt; DestDir: {app}; CopyMode: alwaysoverwrite ! Source: README.txt; DestDir: {app}; CopyMode: alwaysoverwrite ! Source: News.txt; DestDir: {app}; CopyMode: alwaysoverwrite ! Source: *.ico; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main + Source: python.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main + Source: pythonw.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main + Source: w9xpopen.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\tcl83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk ! Source: DLLs\tk83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk ! Source: tcl\*.*; DestDir: {app}\tcl; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs ! Source: sysdir\python22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: sharedfile restartreplace ! Source: sysdir\PyWinTypes22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile ! Source: sysdir\pythoncom22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile ! Source: DLLs\_socket.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\_socket.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\_sre.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\_sre.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\_symtable.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\_symtable.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\_testcapi.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\_testcapi.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\_tkinter.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk ! Source: libs\_tkinter.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: tk ! Source: DLLs\bsddb.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\bsddb.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\mmap.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\mmap.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\parser.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\parser.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\pyexpat.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\pyexpat.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\select.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\select.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\unicodedata.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\unicodedata.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\_winreg.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\_winreg.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\winsound.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\winsound.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\zlib.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\zlib.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: libs\python22.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main ! Source: DLLs\expat.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main ! Source: Lib\*.py; DestDir: {app}\Lib; CopyMode: alwaysoverwrite; Components: main ! Source: Lib\compiler\*.*; DestDir: {app}\Lib\compiler; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\distutils\*.*; DestDir: {app}\Lib\distutils; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\email\*.*; DestDir: {app}\Lib\email; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\encodings\*.*; DestDir: {app}\Lib\encodings; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\lib-old\*.*; DestDir: {app}\Lib\lib-old; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\xml\*.*; DestDir: {app}\Lib\xml; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\test\*.*; DestDir: {app}\Lib\test; CopyMode: alwaysoverwrite; Components: test; Flags: recursesubdirs ! Source: Lib\site-packages\README.txt; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: main ! Source: Lib\site-packages\PyWin32.chm; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: docs ! Source: Lib\site-packages\win32\*.*; DestDir: {app}\Lib\site-packages\win32; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\site-packages\win32com\*.*; DestDir: {app}\Lib\site-packages\win32com; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\site-packages\win32comext\*.*; DestDir: {app}\Lib\site-packages\win32comext; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs ! Source: Lib\lib-tk\*.py; DestDir: {app}\Lib\lib-tk; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs ! Source: include\*.h; DestDir: {app}\include; CopyMode: alwaysoverwrite; Components: main ! Source: Tools\idle\*.*; DestDir: {app}\Tools\idle; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs ! Source: Tools\pynche\*.*; DestDir: {app}\Tools\pynche; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs ! Source: Tools\scripts\*.*; DestDir: {app}\Tools\Scripts; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs ! Source: Tools\webchecker\*.*; DestDir: {app}\Tools\webchecker; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs ! Source: Tools\versioncheck\*.*; DestDir: {app}\Tools\versioncheck; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs ! ! Source: Doc\*.*; DestDir: {app}\Doc; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: docs [Icons] ! Name: {group}\Python (command line); Filename: {app}\python.exe; WorkingDir: {app}; Components: main ! Name: {group}\Python Manuals; Filename: {app}\Doc\index.html; WorkingDir: {app}; Components: docs ! Name: {group}\Win32 Extensions Help; Filename: {app}\Lib\site-packages\PyWin32.chm; WorkingDir: {app}\Lib\site-packages; Components: docs ! Name: {group}\Module Docs; Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\Scripts\pydoc.pyw"""; Components: tools ! Name: {group}\IDLE (Python GUI); Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\idle\idle.pyw"""; Components: tools [Registry] ; Register .py ! Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: Python File; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: Python File\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico ! Tasks: extensions; Root: HKCR; Subkey: Python File\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*" ; Register .pyc ! Tasks: extensions; Root: HKCR; Subkey: .pyc; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile; ValueType: string; ValueName: ; ValueData: Compiled Python File; Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\pyc.ico ! Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*" ; Register .pyo ! Tasks: extensions; Root: HKCR; Subkey: .pyo; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue ; Register .pyw ! Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: ; ValueData: Python NoConFile; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue ! Tasks: extensions; Root: HKCR; Subkey: Python NoConFile; ValueType: string; ValueName: ; ValueData: Python File (no console); Flags: uninsdeletekey ! Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico ! Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\pythonw.exe"" ""%1"" %*" ! ! ! ; Python Registry Keys ! Root: HKLM; Subkey: SOFTWARE\Python; Flags: uninsdeletekeyifempty; Check: IsAdminLoggedOn ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore; Flags: uninsdeletekeyifempty ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2; Flags: uninsdeletekeyifempty ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath; ValueData: "{app}\Lib;{app}\DLLs"; Flags: uninsdeletekeyifempty ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\tk; ValueData: {app}\Lib\lib-tk; Flags: uninsdeletekey; Components: tk ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32; ValueData: "{app}\lib\site-packages\win32;{app}\lib\site-packages\win32\lib"; Flags: uninsdeletekey ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32com; ValueData: C:\Python\lib\site-packages; Flags: uninsdeletekey ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules; Flags: uninsdeletekeyifempty ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pythoncom; ValueData: {sys}\pythoncom22.dll; Flags: uninsdeletekey ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pywintypes; ValueData: {sys}\PyWinTypes22.dll; Flags: uninsdeletekey ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath; ValueData: {app}; Flags: uninsdeletekeyifempty; ValueType: string ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath\InstallGroup; ValueData: {group}; Flags: uninsdeletekey ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help; Flags: uninsdeletekeyifempty ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Main Python Documentation; ValueType: string; ValueData: {app}\Doc\index.html; Flags: uninsdeletekey; Components: docs ! Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Python Win32 Documentation; ValueType: string; ValueData: {app}\lib\site-packages\PyWin32.chm; Flags: uninsdeletekey; Components: docs ! ! [_ISTool] ! EnableISX=true ! ! ! [Code] ! Program Setup; ! ! Function IsAdminNotLoggedOn(): Boolean; ! begin ! Result := Not IsAdminLoggedOn(); ! end; ! ! begin ! end. ! ! ! ! ! [UninstallDelete] ! Name: {app}\Lib\compiler\*.pyc; Type: files ! Name: {app}\Lib\compiler\*.pyo; Type: files ! Name: {app}\Lib\compiler; Type: dirifempty ! Name: {app}\Lib\distutils\command\*.pyc; Type: files ! Name: {app}\Lib\distutils\command\*.pyo; Type: files ! Name: {app}\Lib\distutils\command; Type: dirifempty ! Name: {app}\Lib\distutils\*.pyc; Type: files ! Name: {app}\Lib\distutils\*.pyo; Type: files ! Name: {app}\Lib\distutils; Type: dirifempty ! Name: {app}\Lib\email\test\*.pyc; Type: files ! Name: {app}\Lib\email\test\*.pyo; Type: files ! Name: {app}\Lib\email\test; Type: dirifempty ! Name: {app}\Lib\email\*.pyc; Type: files ! Name: {app}\Lib\email\*.pyo; Type: files ! Name: {app}\Lib\email; Type: dirifempty ! Name: {app}\Lib\encodings\*.pyc; Type: files ! Name: {app}\Lib\encodings\*.pyo; Type: files ! Name: {app}\Lib\encodings; Type: dirifempty ! Name: {app}\Lib\hotshot\*.pyc; Type: files ! Name: {app}\Lib\hotshot\*.pyo; Type: files ! Name: {app}\Lib\hotshot; Type: dirifempty ! Name: {app}\Lib\lib-old\*.pyc; Type: files ! Name: {app}\Lib\lib-old\*.pyo; Type: files ! Name: {app}\Lib\lib-old; Type: dirifempty ! Name: {app}\Lib\lib-tk\*.pyc; Type: files ! Name: {app}\Lib\lib-tk\*.pyo; Type: files ! Name: {app}\Lib\lib-tk; Type: dirifempty ! Name: {app}\Lib\test\*.pyc; Type: files ! Name: {app}\Lib\test\*.pyo; Type: files ! Name: {app}\Lib\test; Type: dirifempty ! Name: {app}\Lib\xml\dom\*.pyc; Type: files ! Name: {app}\Lib\xml\dom\*.pyo; Type: files ! Name: {app}\Lib\xml\dom; Type: dirifempty ! Name: {app}\Lib\xml\parsers\*.pyc; Type: files ! Name: {app}\Lib\xml\parsers\*.pyo; Type: files ! Name: {app}\Lib\xml\parsers; Type: dirifempty ! Name: {app}\Lib\xml\sax\*.pyc; Type: files ! Name: {app}\Lib\xml\sax\*.pyo; Type: files ! Name: {app}\Lib\xml\sax; Type: dirifempty ! Name: {app}\Lib\xml\*.pyc; Type: files ! Name: {app}\Lib\xml\*.pyo; Type: files ! Name: {app}\Lib\xml; Type: dirifempty ! ! Name: {app}\Lib\site-packages\win32; Type: filesandordirs ! Name: {app}\Lib\site-packages\win32com; Type: filesandordirs ! Name: {app}\Lib\site-packages\win32comext; Type: filesandordirs ! Name: {app}\Lib\site-packages\pythoncom.py*; Type: files ! Name: {app}\Lib\site-packages; Type: dirifempty ! ! Name: {app}\Lib\*.pyc; Type: files ! Name: {app}\Lib; Type: dirifempty ! ! Name: {app}\Tools\pynche\*.pyc; Type: files ! Name: {app}\Tools\pynche\*.pyo; Type: files ! Name: {app}\Tools\pynche; Type: dirifempty ! ! Name: {app}\Tools\idle\*.pyc; Type: files ! Name: {app}\Tools\idle\*.pyo; Type: files ! Name: {app}\Tools\idle; Type: dirifempty ! ! Name: {app}\Tools\scripts\*.pyc; Type: files ! Name: {app}\Tools\scripts\*.pyo; Type: files ! Name: {app}\Tools\scripts; Type: dirifempty ! ! Name: {app}\Tools\versioncheck\*.pyc; Type: files ! Name: {app}\Tools\versioncheck\*.pyo; Type: files ! Name: {app}\Tools\versioncheck; Type: dirifempty ! ! Name: {app}\Tools\webchecker\*.pyc; Type: files ! Name: {app}\Tools\webchecker\*.pyo; Type: files ! Name: {app}\Tools\webchecker; Type: dirifempty ! ! Name: {app}\Tools; Type: dirifempty From loewis at users.sourceforge.net Fri Oct 31 10:27:57 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:28:02 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libinspect.tex, 1.10.6.1, 1.10.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2044 Modified Files: Tag: release22-maint libinspect.tex Log Message: Patch #830858: Update number of functions starting with "is". Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.10.6.1 retrieving revision 1.10.6.2 diff -C2 -d -r1.10.6.1 -r1.10.6.2 *** libinspect.tex 23 Apr 2002 21:20:44 -0000 1.10.6.1 --- libinspect.tex 31 Oct 2003 15:27:55 -0000 1.10.6.2 *************** *** 26,30 **** The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The nine functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when --- 26,30 ---- The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The ten functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when From loewis at users.sourceforge.net Fri Oct 31 10:34:18 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:34:22 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libinspect.tex, 1.13, 1.13.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3416/Doc/lib Modified Files: Tag: release23-maint libinspect.tex Log Message: Patch #830858: Correct the number of is-functions. Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.13 retrieving revision 1.13.10.1 diff -C2 -d -r1.13 -r1.13.10.1 *** libinspect.tex 29 May 2003 02:10:31 -0000 1.13 --- libinspect.tex 31 Oct 2003 15:34:16 -0000 1.13.10.1 *************** *** 26,30 **** The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The nine functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when --- 26,30 ---- The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The eleven functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when From loewis at users.sourceforge.net Fri Oct 31 10:34:18 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:34:26 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_inspect.py, 1.12, 1.12.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv3416/Lib/test Modified Files: Tag: release23-maint test_inspect.py Log Message: Patch #830858: Correct the number of is-functions. Index: test_inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_inspect.py,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -C2 -d -r1.12 -r1.12.8.1 *** test_inspect.py 27 Jun 2003 18:43:12 -0000 1.12 --- test_inspect.py 31 Oct 2003 15:34:16 -0000 1.12.8.1 *************** *** 371,372 **** --- 371,376 ---- test(varkw is None, 'A.m varkw') test(defaults is None, 'A.m defaults') + + # Doc/lib/libinspect.tex claims there are 11 such functions + count = len(filter(lambda x:x.startswith('is'), dir(inspect))) + test(count == 11, "There are %d (not 11) is* functions", count) From loewis at users.sourceforge.net Fri Oct 31 10:34:42 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:34:46 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libinspect.tex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3543/Doc/lib Modified Files: libinspect.tex Log Message: Patch #830858: Correct the number of is-functions. Backported to 2.3 and 2.2. Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libinspect.tex 29 May 2003 02:10:31 -0000 1.13 --- libinspect.tex 31 Oct 2003 15:34:40 -0000 1.14 *************** *** 26,30 **** The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The nine functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when --- 26,30 ---- The \function{getmembers()} function retrieves the members of an object such as a class or module. ! The eleven functions whose names begin with ``is'' are mainly provided as convenient choices for the second argument to \function{getmembers()}. They also help you determine when From loewis at users.sourceforge.net Fri Oct 31 10:35:55 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:35:58 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_inspect.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv3765/Lib/test Modified Files: test_inspect.py Log Message: Patch #830858: Correct the number of is-functions. Backported to 2.3 and 2.2. Index: test_inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_inspect.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_inspect.py 27 Jun 2003 18:43:12 -0000 1.12 --- test_inspect.py 31 Oct 2003 15:35:53 -0000 1.13 *************** *** 371,372 **** --- 371,376 ---- test(varkw is None, 'A.m varkw') test(defaults is None, 'A.m defaults') + + # Doc/lib/libinspect.tex claims there are 11 such functions + count = len(filter(lambda x:x.startswith('is'), dir(inspect))) + test(count == 11, "There are %d (not 11) is* functions", count) From loewis at users.sourceforge.net Fri Oct 31 10:41:53 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:41:55 2003 Subject: [Python-checkins] python/dist/src configure, 1.416.4.9, 1.416.4.10 configure.in, 1.427.4.8, 1.427.4.9 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv4701 Modified Files: Tag: release23-maint configure configure.in Log Message: Patch #833710: Set INSTSONAME on Solaris. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.416.4.9 retrieving revision 1.416.4.10 diff -C2 -d -r1.416.4.9 -r1.416.4.10 *** configure 4 Oct 2003 07:56:12 -0000 1.416.4.9 --- configure 31 Oct 2003 15:41:46 -0000 1.416.4.10 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.427.4.7 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.427.4.8 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. *************** *** 3596,3599 **** --- 3596,3600 ---- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*) Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.427.4.8 retrieving revision 1.427.4.9 diff -C2 -d -r1.427.4.8 -r1.427.4.9 *** configure.in 4 Oct 2003 07:56:14 -0000 1.427.4.8 --- configure.in 31 Oct 2003 15:41:49 -0000 1.427.4.9 *************** *** 516,519 **** --- 516,520 ---- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*) From loewis at users.sourceforge.net Fri Oct 31 10:42:09 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Oct 31 10:42:13 2003 Subject: [Python-checkins] python/dist/src configure, 1.428, 1.429 configure.in, 1.438, 1.439 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv4780 Modified Files: configure configure.in Log Message: Patch #833710: Set INSTSONAME on Solaris. Backported to 2.3. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.428 retrieving revision 1.429 diff -C2 -d -r1.428 -r1.429 *** configure 4 Oct 2003 07:46:20 -0000 1.428 --- configure 31 Oct 2003 15:42:07 -0000 1.429 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.437 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.438 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 3596,3599 **** --- 3596,3600 ---- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*) Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.438 retrieving revision 1.439 diff -C2 -d -r1.438 -r1.439 *** configure.in 4 Oct 2003 07:46:23 -0000 1.438 --- configure.in 31 Oct 2003 15:42:07 -0000 1.439 *************** *** 516,519 **** --- 516,520 ---- BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} + INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*) From akuchling at users.sourceforge.net Fri Oct 31 14:52:32 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 31 14:52:37 2003 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20833 Modified Files: emailmessage.tex Log Message: [Bug #817178] Fix incorrect arguments in example, noted by Terry Reedy Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** emailmessage.tex 19 Aug 2003 04:26:59 -0000 1.12 --- emailmessage.tex 31 Oct 2003 19:52:30 -0000 1.13 *************** *** 47,51 **** from email.Generator import Generator fp = StringIO() ! g = Generator(mangle_from_=False, maxheaderlen=60) g.flatten(msg) text = fp.getvalue() --- 47,51 ---- from email.Generator import Generator fp = StringIO() ! g = Generator(fp, mangle_from_=False, maxheaderlen=60) g.flatten(msg) text = fp.getvalue() From akuchling at users.sourceforge.net Fri Oct 31 14:52:45 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Oct 31 14:52:50 2003 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex, 1.11.12.1, 1.11.12.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20903 Modified Files: Tag: release23-maint emailmessage.tex Log Message: [Bug #817178] Fix incorrect arguments in example, noted by Terry Reedy Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.11.12.1 retrieving revision 1.11.12.2 diff -C2 -d -r1.11.12.1 -r1.11.12.2 *** emailmessage.tex 19 Aug 2003 04:51:25 -0000 1.11.12.1 --- emailmessage.tex 31 Oct 2003 19:52:42 -0000 1.11.12.2 *************** *** 47,51 **** from email.Generator import Generator fp = StringIO() ! g = Generator(mangle_from_=False, maxheaderlen=60) g.flatten(msg) text = fp.getvalue() --- 47,51 ---- from email.Generator import Generator fp = StringIO() ! g = Generator(fp, mangle_from_=False, maxheaderlen=60) g.flatten(msg) text = fp.getvalue()