From montanaro@users.sourceforge.net Fri Aug 1 05:00:34 2003 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu, 31 Jul 2003 21:00:34 -0700 Subject: [Python-checkins] python/dist/src/Misc python-mode.el,4.36,4.37 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20998 Modified Files: python-mode.el Log Message: make pending-delete/delete-selection mode work with py-electric-colon Index: python-mode.el =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v retrieving revision 4.36 retrieving revision 4.37 diff -C2 -d -r4.36 -r4.37 *** python-mode.el 31 Jul 2003 04:59:48 -0000 4.36 --- python-mode.el 1 Aug 2003 04:00:32 -0000 4.37 *************** *** 1188,1192 **** (not (looking-at py-no-outdent-re))) ))) ! (defun py-electric-colon (arg) "Insert a colon. --- 1188,1192 ---- (not (looking-at py-no-outdent-re))) ))) ! (defun py-electric-colon (arg) "Insert a colon. *************** *** 1195,1199 **** non-electrically. Electric behavior is inhibited inside a string or comment." ! (interactive "P") (self-insert-command (prefix-numeric-value arg)) ;; are we in a string or comment? --- 1195,1199 ---- non-electrically. Electric behavior is inhibited inside a string or comment." ! (interactive "*P") (self-insert-command (prefix-numeric-value arg)) ;; are we in a string or comment? *************** *** 1948,1951 **** --- 1948,1953 ---- ;; required for pending-del and delsel modes + (put 'py-electric-colon 'delete-selection t) ;delsel + (put 'py-electric-colon 'pending-delete t) ;pending-del (put 'py-electric-backspace 'delete-selection 'supersede) ;delsel (put 'py-electric-backspace 'pending-delete 'supersede) ;pending-del From montanaro@users.sourceforge.net Fri Aug 1 05:27:36 2003 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu, 31 Jul 2003 21:27:36 -0700 Subject: [Python-checkins] python/dist/src/Misc python-mode.el,4.37,4.38 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv24156 Modified Files: python-mode.el Log Message: delete the f1 key binding. py-help-at-point is still available @ C-c C-h. Index: python-mode.el =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/python-mode.el,v retrieving revision 4.37 retrieving revision 4.38 diff -C2 -d -r4.37 -r4.38 *** python-mode.el 1 Aug 2003 04:00:32 -0000 4.37 --- python-mode.el 1 Aug 2003 04:27:34 -0000 4.38 *************** *** 566,570 **** (define-key py-mode-map "\C-c#" 'py-comment-region) (define-key py-mode-map "\C-c?" 'py-describe-mode) - (define-key py-mode-map [f1] 'py-help-at-point) (define-key py-mode-map "\C-c\C-h" 'py-help-at-point) (define-key py-mode-map "\e\C-a" 'py-beginning-of-def-or-class) --- 566,569 ---- From montanaro@users.sourceforge.net Fri Aug 1 06:01:57 2003 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu, 31 Jul 2003 22:01:57 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.832,1.833 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv28638 Modified Files: NEWS Log Message: add skeletal "what's new" for 2.4a1 and mention a couple python-mode tweaks. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.832 retrieving revision 1.833 diff -C2 -d -r1.832 -r1.833 *** NEWS 30 Jul 2003 12:14:02 -0000 1.832 --- NEWS 1 Aug 2003 05:01:54 -0000 1.833 *************** *** 5,8 **** --- 5,50 ---- (editors: check NEWS.help for information about editing NEWS using ReST.) + What's New in Python 2.4 alpha 1? + ================================= + + *Release date: DD-MMM-YYYY* + + Core and builtins + ----------------- + + Extension modules + ----------------- + + Library + ------- + + Tools/Demos + ----------- + + - py-electric-colon now works when pending-delete/delete-selection mode is + in effect + + - py-help-at-point is no longer bound to the F1 key - it's still bound to + C-c C-h + + Build + ----- + + C API + ----- + + New platforms + ------------- + + Tests + ----- + + Windows + ------- + + Mac + ---- + + What's New in Python 2.3 final? =============================== From montanaro@users.sourceforge.net Fri Aug 1 15:20:04 2003 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri, 01 Aug 2003 07:20:04 -0700 Subject: [Python-checkins] python/dist/src/Demo/sockets unixserver.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/sockets In directory sc8-pr-cvs1:/tmp/cvs-serv26491 Modified Files: unixserver.py Log Message: To be a good citizen, it should really delete its socket when done. Index: unixserver.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/unixserver.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** unixserver.py 29 Jan 1998 04:04:04 -0000 1.2 --- unixserver.py 1 Aug 2003 14:20:02 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- # Echo server demo using Unix sockets (handles one connection only) # Piet van Oostrum + import os from socket import * FILE = 'blabla' *************** *** 14,15 **** --- 15,17 ---- conn.send(data) conn.close() + os.unlink(FILE) From rhettinger@users.sourceforge.net Sat Aug 2 07:32:14 2003 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri, 01 Aug 2003 23:32:14 -0700 Subject: [Python-checkins] python/nondist/peps pep-0201.txt,1.19,1.20 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv29378 Modified Files: pep-0201.txt Log Message: * Document the reasoning for having zip(*[]) return [] rather than raising an exception. * Add notes about the itertools module addressing other concerns listed in the pep. Index: pep-0201.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0201.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pep-0201.txt 14 Aug 2001 15:45:26 -0000 1.19 --- pep-0201.txt 2 Aug 2003 06:32:12 -0000 1.20 *************** *** 216,219 **** --- 216,262 ---- more detailed analysis, see version 1.7 of this PEP. + Subsequent Change to zip() + + In Python 2.4, zip() with no arguments was modified to return an + empty list rather than raising a TypeError exception. The rationale + for the original behavior was that the absence of arguments was + thought to indicate a programming error. However, that thinking + did not anticipate the use of zip() with the * operator for unpacking + variable length argument lists. For example, the inverse of zip + could be defined as: unzip = lambda s: zip(*s). That transformation + also defines a matrix transpose or an equivalent row/column swap for + tables defined as lists of tuples. The latter transformation is + commonly used when reading data files with records as rows and fields + as columns. For example, the code: + + date, rain, high, low = zip(*csv.reader(file("weather.csv"))) + + rearranges columnar data so that each field is collected into + individual tuples for straight-forward looping and summarization: + + print "Total rainfall", sum(rain) + + Using zip(*args) is more easily coded if zip(*[]) is handled as an + allowable case rather than an exception. This is especially helpful + when data is either built up from or recursed down to a null case + with no records. + + Seeing this possibility, the BDFL agreed (with some misgivings) to + have the behavior changed for Py2.4. + + Other Changes + + - The xzip() function discussed above was implemented in Py2.3 in + the itertools module as itertools.izip(). This function provides + lazy behavior, consuming single elements and producing a single + tuple on each pass. The "just-in-time" style saves memory and + runs faster than its list based counterpart, zip(). + + - The itertools module also added itertools.repeat() and + itertools.chain(). These tools can be used together to pad + sequences with None (to match the behavior of map(None, seqn)): + + zip(firstseq, chain(secondseq, repeat(None))) + References From rhettinger@users.sourceforge.net Sat Aug 2 08:42:58 2003 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 02 Aug 2003 00:42:58 -0700 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.833,1.834 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv4929/Misc Modified Files: NEWS Log Message: As discussed on python-dev, changed builtin.zip() to handle zero arguments by returning an empty list instead of raising a TypeError. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.833 retrieving revision 1.834 diff -C2 -d -r1.833 -r1.834 *** NEWS 1 Aug 2003 05:01:54 -0000 1.833 --- NEWS 2 Aug 2003 07:42:55 -0000 1.834 *************** *** 13,16 **** --- 13,19 ---- ----------------- + - zip() with no arguments now returns an empty list instead of raising + a TypeError exception. + Extension modules ----------------- From rhettinger@users.sourceforge.net Sat Aug 2 08:42:58 2003 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 02 Aug 2003 00:42:58 -0700 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.292,2.293 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv4929/Python Modified Files: bltinmodule.c Log Message: As discussed on python-dev, changed builtin.zip() to handle zero arguments by returning an empty list instead of raising a TypeError. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.292 retrieving revision 2.293 diff -C2 -d -r2.292 -r2.293 *** bltinmodule.c 23 Apr 2003 13:34:35 -0000 2.292 --- bltinmodule.c 2 Aug 2003 07:42:56 -0000 2.293 *************** *** 1917,1925 **** int len; /* guess at result length */ ! if (itemsize < 1) { ! PyErr_SetString(PyExc_TypeError, ! "zip() requires at least one sequence"); ! return NULL; ! } /* args must be a tuple */ assert(PyTuple_Check(args)); --- 1917,1923 ---- int len; /* guess at result length */ ! if (itemsize == 0) ! return PyList_New(0); ! /* args must be a tuple */ assert(PyTuple_Check(args)); From rhettinger@users.sourceforge.net Sat Aug 2 08:42:59 2003 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 02 Aug 2003 00:42:59 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_iter.py,1.28,1.29 test_builtin.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv4929/Lib/test Modified Files: test_iter.py test_builtin.py Log Message: As discussed on python-dev, changed builtin.zip() to handle zero arguments by returning an empty list instead of raising a TypeError. Index: test_iter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_iter.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** test_iter.py 23 Dec 2002 16:50:58 -0000 1.28 --- test_iter.py 2 Aug 2003 07:42:56 -0000 1.29 *************** *** 424,428 **** # Test zip()'s use of iterators. def test_builtin_zip(self): ! self.assertRaises(TypeError, zip) self.assertRaises(TypeError, zip, None) self.assertRaises(TypeError, zip, range(10), 42) --- 424,431 ---- # Test zip()'s use of iterators. def test_builtin_zip(self): ! self.assertEqual(zip(), []) ! self.assertEqual(zip(*[]), []) ! self.assertEqual(zip(*[(1, 2), 'ab']), [(1, 'a'), (2, 'b')]) ! self.assertRaises(TypeError, zip, None) self.assertRaises(TypeError, zip, range(10), 42) Index: test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_builtin.py 18 Jun 2003 14:26:18 -0000 1.21 --- test_builtin.py 2 Aug 2003 07:42:56 -0000 1.22 *************** *** 1127,1131 **** return i + 4 self.assertEqual(zip(a, I()), t) ! self.assertRaises(TypeError, zip) self.assertRaises(TypeError, zip, None) class G: --- 1127,1132 ---- return i + 4 self.assertEqual(zip(a, I()), t) ! self.assertEqual(zip(), []) ! self.assertEqual(zip(*[]), []) self.assertRaises(TypeError, zip, None) class G: From rhettinger@users.sourceforge.net Sat Aug 2 08:42:59 2003 From: rhettinger@users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat, 02 Aug 2003 00:42:59 -0700 Subject: [Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.143,1.144 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv4929/Doc/lib Modified Files: libfuncs.tex Log Message: As discussed on python-dev, changed builtin.zip() to handle zero arguments by returning an empty list instead of raising a TypeError. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** libfuncs.tex 5 Jul 2003 17:37:58 -0000 1.143 --- libfuncs.tex 2 Aug 2003 07:42:57 -0000 1.144 *************** *** 1064,1076 **** \end{funcdesc} ! \begin{funcdesc}{zip}{seq1, \moreargs} This function returns a list of tuples, where the \var{i}-th tuple contains ! the \var{i}-th element from each of the argument sequences. At ! least one sequence is required, otherwise a \exception{TypeError} is ! raised. The returned list is truncated in length to the length of the shortest argument sequence. When there are multiple argument sequences which are all of the same length, \function{zip()} is similar to \function{map()} with an initial argument of \code{None}. With a single sequence argument, it returns a list of 1-tuples. \versionadded{2.0} \end{funcdesc} --- 1064,1080 ---- \end{funcdesc} ! \begin{funcdesc}{zip}{\optional{seq1, \moreargs}} This function returns a list of tuples, where the \var{i}-th tuple contains ! the \var{i}-th element from each of the argument sequences. ! The returned list is truncated in length to the length of the shortest argument sequence. When there are multiple argument sequences which are all of the same length, \function{zip()} is similar to \function{map()} with an initial argument of \code{None}. With a single sequence argument, it returns a list of 1-tuples. + With no arguments, it returns an empty list. \versionadded{2.0} + + \versionchanged[Formerly, \function{zip()} required at least one argument + and \code{zip()} raised a \exception{TypeError} instead of returning + \code{[]}]{2.4} \end{funcdesc} From montanaro@users.sourceforge.net Sat Aug 2 16:02:35 2003 From: montanaro@users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat, 02 Aug 2003 08:02:35 -0700 Subject: [Python-checkins] python/dist/src/Lib/test test_marshal.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv30489 Modified Files: test_marshal.py Log Message: more extension marshal tests and conversion to unittest - was surprised to see how much of the file was not covered by the build process Index: test_marshal.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_marshal.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_marshal.py 30 Jul 2002 11:40:57 -0000 1.3 --- test_marshal.py 2 Aug 2003 15:02:33 -0000 1.4 *************** *** 1,44 **** ! from test.test_support import TestFailed import marshal import sys ! # XXX Much more needed here. ! # Test the full range of Python ints. ! n = sys.maxint ! while n: ! for expected in (-n, n): ! s = marshal.dumps(expected) ! got = marshal.loads(s) ! if expected != got: ! raise TestFailed("for int %d, marshal string is %r, loaded " ! "back as %d" % (expected, s, got)) ! n = n >> 1 ! # Simulate int marshaling on a 64-bit box. This is most interesting if ! # we're running the test on a 32-bit box, of course. ! def to_little_endian_string(value, nbytes): ! bytes = [] ! for i in range(nbytes): ! bytes.append(chr(value & 0xff)) ! value >>= 8 ! return ''.join(bytes) ! maxint64 = (1L << 63) - 1 ! minint64 = -maxint64-1 ! for base in maxint64, minint64, -maxint64, -(minint64 >> 1): ! while base: ! s = 'I' + to_little_endian_string(base, 8) got = marshal.loads(s) ! if base != got: ! raise TestFailed("for int %d, simulated marshal string is %r, " ! "loaded back as %d" % (base, s, got)) ! if base == -1: # a fixed-point for shifting right 1 ! base = 0 ! else: ! base >>= 1 ! # Simple-minded check for SF 588452: Debug build crashes ! marshal.dumps([128] * 1000) --- 1,188 ---- ! #!/usr/bin/env python ! # -*- coding: iso-8859-1 -*- ! ! from test import test_support import marshal import sys + import unittest + import os ! class IntTestCase(unittest.TestCase): ! def test_ints(self): ! # Test the full range of Python ints. ! n = sys.maxint ! while n: ! for expected in (-n, n): ! s = marshal.dumps(expected) ! got = marshal.loads(s) ! self.assertEqual(expected, got) ! marshal.dump(expected, file(test_support.TESTFN, "wb")) ! got = marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(expected, got) ! n = n >> 1 ! os.unlink(test_support.TESTFN) ! def test_int64(self): ! # Simulate int marshaling on a 64-bit box. This is most interesting if ! # we're running the test on a 32-bit box, of course. ! def to_little_endian_string(value, nbytes): ! bytes = [] ! for i in range(nbytes): ! bytes.append(chr(value & 0xff)) ! value >>= 8 ! return ''.join(bytes) ! maxint64 = (1L << 63) - 1 ! minint64 = -maxint64-1 ! for base in maxint64, minint64, -maxint64, -(minint64 >> 1): ! while base: ! s = 'I' + to_little_endian_string(base, 8) ! got = marshal.loads(s) ! self.assertEqual(base, got) ! if base == -1: # a fixed-point for shifting right 1 ! base = 0 ! else: ! base >>= 1 ! def test_bool(self): ! for b in (True, False): ! new = marshal.loads(marshal.dumps(b)) ! self.assertEqual(b, new) ! self.assertEqual(type(b), type(new)) ! marshal.dump(b, file(test_support.TESTFN, "wb")) ! new = marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(b, new) ! self.assertEqual(type(b), type(new)) ! ! class FloatTestCase(unittest.TestCase): ! def test_floats(self): ! # Test a few floats ! small = 1e-25 ! n = sys.maxint * 3.7e250 ! while n > small: ! for expected in (-n, n): ! f = float(expected) ! s = marshal.dumps(f) ! got = marshal.loads(s) ! self.assertEqual(f, got) ! marshal.dump(f, file(test_support.TESTFN, "wb")) ! got = marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(f, got) ! n /= 123.4567 ! ! f = 0.0 ! s = marshal.dumps(f) got = marshal.loads(s) ! self.assertEqual(f, got) ! n = sys.maxint * 3.7e-250 ! while n < small: ! for expected in (-n, n): ! f = float(expected) ! s = marshal.dumps(f) ! got = marshal.loads(s) ! self.assertEqual(f, got) ! marshal.dump(f, file(test_support.TESTFN, "wb")) ! got = marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(f, got) ! n *= 123.4567 ! os.unlink(test_support.TESTFN) ! ! class StringTestCase(unittest.TestCase): ! def test_unicode(self): ! for s in [u"", u"Andrè Previn", u"abc", u" "*10000]: ! new = marshal.loads(marshal.dumps(s)) ! self.assertEqual(s, new) ! self.assertEqual(type(s), type(new)) ! marshal.dump(s, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(s, new) ! self.assertEqual(type(s), type(new)) ! os.unlink(test_support.TESTFN) ! ! def test_string(self): ! for s in ["", "Andrè Previn", "abc", " "*10000]: ! new = marshal.loads(marshal.dumps(s)) ! self.assertEqual(s, new) ! self.assertEqual(type(s), type(new)) ! marshal.dump(s, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(s, new) ! self.assertEqual(type(s), type(new)) ! os.unlink(test_support.TESTFN) ! ! def test_buffer(self): ! for s in ["", "Andrè Previn", "abc", " "*10000]: ! b = buffer(s) ! new = marshal.loads(marshal.dumps(b)) ! self.assertEqual(s, new) ! marshal.dump(b, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(s, new) ! os.unlink(test_support.TESTFN) ! ! class ExceptionTestCase(unittest.TestCase): ! def test_exceptions(self): ! new = marshal.loads(marshal.dumps(StopIteration)) ! self.assertEqual(StopIteration, new) ! ! class CodeTestCase(unittest.TestCase): ! def test_code(self): ! co = ExceptionTestCase.test_exceptions.func_code ! new = marshal.loads(marshal.dumps(co)) ! self.assertEqual(co, new) ! ! class ContainerTestCase(unittest.TestCase): ! d = {'astring': 'foo@bar.baz.spam', ! 'afloat': 7283.43, ! 'anint': 2**20, ! 'ashortlong': 2L, ! 'alist': ['.zyx.41'], ! 'atuple': ('.zyx.41',)*10, ! 'aboolean': False, ! 'aunicode': u"Andrè Previn" ! } ! def test_dict(self): ! new = marshal.loads(marshal.dumps(self.d)) ! self.assertEqual(self.d, new) ! marshal.dump(self.d, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(self.d, new) ! os.unlink(test_support.TESTFN) ! ! def test_list(self): ! lst = self.d.items() ! new = marshal.loads(marshal.dumps(lst)) ! self.assertEqual(lst, new) ! marshal.dump(lst, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(lst, new) ! os.unlink(test_support.TESTFN) ! ! def test_tuple(self): ! t = tuple(self.d.keys()) ! new = marshal.loads(marshal.dumps(t)) ! self.assertEqual(t, new) ! marshal.dump(t, file(test_support.TESTFN, "wb")) ! marshal.load(file(test_support.TESTFN, "rb")) ! self.assertEqual(t, new) ! os.unlink(test_support.TESTFN) ! ! class BugsTestCase(unittest.TestCase): ! def test_bug_5888452(self): ! # Simple-minded check for SF 588452: Debug build crashes ! marshal.dumps([128] * 1000) ! ! def test_main(): ! test_support.run_unittest(IntTestCase, ! FloatTestCase, ! StringTestCase, ! CodeTestCase, ! ContainerTestCase, ! ExceptionTestCase, ! BugsTestCase) ! ! if __name__ == "__main__": ! test_main() From montanaro at users.sourceforge.net Sun Aug 3 17:02:12 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sun Aug 3 19:02:17 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_array.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv2454 Modified Files: test_array.py Log Message: added test for bug 782369 Index: test_array.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_array.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_array.py 22 May 2003 13:29:15 -0000 1.24 --- test_array.py 3 Aug 2003 23:02:10 -0000 1.25 *************** *** 601,604 **** --- 601,613 ---- self.assertEqual(b[0], a.tostring()[0]) + def test_bug_782369(self): + import sys + for i in range(10): + b = array.array('B', range(64)) + rc = sys.getrefcount(10) + for i in range(10): + b = array.array('B', range(64)) + self.assertEqual(rc, sys.getrefcount(10)) + class StringTest(BaseTest): From montanaro at users.sourceforge.net Sun Aug 3 17:30:43 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sun Aug 3 19:30:46 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_array.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6847 Modified Files: test_array.py Log Message: protect against test problems with Jython Index: test_array.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_array.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_array.py 3 Aug 2003 23:02:10 -0000 1.25 --- test_array.py 3 Aug 2003 23:30:40 -0000 1.26 *************** *** 603,612 **** def test_bug_782369(self): import sys ! for i in range(10): ! b = array.array('B', range(64)) ! rc = sys.getrefcount(10) ! for i in range(10): ! b = array.array('B', range(64)) ! self.assertEqual(rc, sys.getrefcount(10)) class StringTest(BaseTest): --- 603,613 ---- def test_bug_782369(self): import sys ! if hasattr(sys, "getrefcount"): ! for i in range(10): ! b = array.array('B', range(64)) ! rc = sys.getrefcount(10) ! for i in range(10): ! b = array.array('B', range(64)) ! self.assertEqual(rc, sys.getrefcount(10)) class StringTest(BaseTest): From rhettinger at users.sourceforge.net Mon Aug 4 02:33:52 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 4 04:33:55 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libexcs.tex,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18913 Modified Files: libexcs.tex Log Message: Clarified that TypeErrors can be raised by any function (not just builtins). The issue arose in a thread on comp.lang.python. Index: libexcs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libexcs.tex,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** libexcs.tex 29 May 2003 02:17:22 -0000 1.52 --- libexcs.tex 4 Aug 2003 08:33:50 -0000 1.53 *************** *** 323,327 **** \begin{excdesc}{TypeError} ! Raised when a built-in operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. --- 323,327 ---- \begin{excdesc}{TypeError} ! Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. From tim_one at users.sourceforge.net Mon Aug 4 13:08:59 2003 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon Aug 4 15:09:03 2003 Subject: [Python-checkins] python/nondist/peps pep-0307.txt,1.30,1.31 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv25422 Modified Files: pep-0307.txt Log Message: In the section on the __reduce__ API, the description of the state argument used an implicit __setitem__ in the last-resort case, but the implementation actually uses setattr. Repaired the pseudocode to match reality. Doc bug spotted by Jim Fulton. Index: pep-0307.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0307.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** pep-0307.txt 19 Feb 2003 01:59:59 -0000 1.30 --- pep-0307.txt 4 Aug 2003 19:08:57 -0000 1.31 *************** *** 207,211 **** for k, v in state.items(): ! obj[k] = v listitems Optional, and new in this PEP. --- 207,211 ---- for k, v in state.items(): ! setattr(obj, k, v) listitems Optional, and new in this PEP. From jackjansen at users.sourceforge.net Mon Aug 4 15:06:18 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:06:23 2003 Subject: [Python-checkins] python/dist/src/Mac/Distributions binary.include, 1.23, 1.23.10.1 dev.include, 1.29, 1.29.8.1 src.include, 1.8, 1.8.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory sc8-pr-cvs1:/tmp/cvs-serv17341/Distributions Modified Files: Tag: release23-branch binary.include dev.include src.include Log Message: Files used for MacPython 2.3 distribution. Index: binary.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/binary.include,v retrieving revision 1.23 retrieving revision 1.23.10.1 diff -C2 -d -r1.23 -r1.23.10.1 *** binary.include 8 Jan 2003 16:27:38 -0000 1.23 --- binary.include 4 Aug 2003 21:06:16 -0000 1.23.10.1 *************** *** 186,190 **** (':Tools:freeze', '') (':Tools:i18n', '') - (':Tools:idle', '') (':Tools:modulator', None) (':Tools:pynche', '') --- 186,189 ---- *************** *** 206,207 **** --- 205,208 ---- (':setup.py', None) (':site-packages', None) + (':Tools:unicode:mkstringprep.py', '') + (':Objects:dictnotes.txt', None) Index: dev.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.include,v retrieving revision 1.29 retrieving revision 1.29.8.1 diff -C2 -d -r1.29 -r1.29.8.1 *** dev.include 21 Feb 2003 22:33:47 -0000 1.29 --- dev.include 4 Aug 2003 21:06:16 -0000 1.29.8.1 *************** *** 428,431 **** --- 428,432 ---- (':Mac:mwerks:mwerks_carbonNOGUSI_config.h', None) (':Mac:mwerks:mwerks_nscarbon_config.h', '') + (':Mac:mwerks:mwerks_pyexpat_config.h', None) (':Mac:mwerks:mwerks_shcarbon_config.h', '') (':Mac:mwerks:mwerks_smcarbon_config.h', '') *************** *** 454,457 **** --- 455,459 ---- (':Modules:_cursesmodule.c', None) (':Modules:_hotshot.c', None) + (':Modules:_iconv_codec.c', None) (':Modules:_localemodule.c', None) (':Modules:_randommodule.c', None) *************** *** 502,505 **** --- 504,508 ---- (':Modules:imageop.c', None) (':Modules:imgfile.c', None) + (':Modules:itertoolsmodule.c', None) (':Modules:ld_so_aix', None) (':Modules:ld_so_beos', None) *************** *** 630,634 **** (':setup.py', None) (':site-packages', None) ! (':Modules:itertoolsmodule.c', None) ! (':Modules:_iconv_codec.c', None) ! (':Mac:mwerks:mwerks_pyexpat_config.h', None) --- 633,639 ---- (':setup.py', None) (':site-packages', None) ! (':Tools:unicode:mkstringprep.py', '') ! (':Modules:_csv.c', None) ! (':Mac:Build:_csv.carbon.mcp.xml', None) ! (':Mac:Build:_csv.carbon.mcp.exp', None) ! (':Mac:Build:_csv.carbon.mcp', None) Index: src.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/src.include,v retrieving revision 1.8 retrieving revision 1.8.10.1 diff -C2 -d -r1.8 -r1.8.10.1 *** src.include 8 Jan 2003 16:27:38 -0000 1.8 --- src.include 4 Aug 2003 21:06:16 -0000 1.8.10.1 *************** *** 114,120 **** (':Tools:compiler', '') (':Tools:faqwiz', '') (':Tools:freeze', '') (':Tools:i18n', '') - (':Tools:idle', '') (':Tools:modulator', '') (':Tools:pynche', '') --- 114,120 ---- (':Tools:compiler', '') (':Tools:faqwiz', '') + (':Tools:framer', '') (':Tools:freeze', '') (':Tools:i18n', '') (':Tools:modulator', '') (':Tools:pynche', '') *************** *** 136,138 **** (':setup.py', None) (':site-packages', None) ! (':Tools:framer', '') --- 136,140 ---- (':setup.py', None) (':site-packages', None) ! (':Mac:Distributions:.DS_Store', None) ! (':Mac:Unsupported:unshar.py', '') ! (':Tools:unicode:mkstringprep.py', '') From jackjansen at users.sourceforge.net Mon Aug 4 15:06:18 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:06:25 2003 Subject: [Python-checkins] python/dist/src/Mac/Contrib/osam OSAm.prj, 1.4, 1.4.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/osam In directory sc8-pr-cvs1:/tmp/cvs-serv17341/Contrib/osam Modified Files: Tag: release23-branch OSAm.prj Log Message: Files used for MacPython 2.3 distribution. Index: OSAm.prj =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/osam/OSAm.prj,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 Binary files /tmp/cvsB8NWfe and /tmp/cvsYcqAai differ From jackjansen at users.sourceforge.net Mon Aug 4 15:06:19 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:06:27 2003 Subject: [Python-checkins] python/dist/src/Mac/Include macbuildno.h, 1.27, 1.27.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory sc8-pr-cvs1:/tmp/cvs-serv17341/Include Modified Files: Tag: release23-branch macbuildno.h Log Message: Files used for MacPython 2.3 distribution. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.27 retrieving revision 1.27.8.1 diff -C2 -d -r1.27 -r1.27.8.1 *** macbuildno.h 21 Feb 2003 22:33:52 -0000 1.27 --- macbuildno.h 4 Aug 2003 21:06:17 -0000 1.27.8.1 *************** *** 1 **** ! #define BUILD 154 --- 1 ---- ! #define BUILD 155 From jackjansen at users.sourceforge.net Mon Aug 4 15:06:20 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:06:32 2003 Subject: [Python-checkins] python/dist/src/Mac/scripts fixfiletypes.py, 1.8, 1.8.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv17341/scripts Modified Files: Tag: release23-branch fixfiletypes.py Log Message: Files used for MacPython 2.3 distribution. Index: fixfiletypes.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fixfiletypes.py,v retrieving revision 1.8 retrieving revision 1.8.10.1 diff -C2 -d -r1.8 -r1.8.10.1 *** fixfiletypes.py 6 Feb 2003 23:13:11 -0000 1.8 --- fixfiletypes.py 4 Aug 2003 21:06:17 -0000 1.8.10.1 *************** *** 35,39 **** if change: MacOS.SetCreatorAndType(name, cr, tp) ! macostools.touched(fs) print 'Fixed ', name else: --- 35,39 ---- if change: MacOS.SetCreatorAndType(name, cr, tp) ! #macostools.touched(fs) print 'Fixed ', name else: *************** *** 52,56 **** if __name__ == '__main__': ! run(0) --- 52,56 ---- if __name__ == '__main__': ! run(1) From jackjansen at users.sourceforge.net Mon Aug 4 15:06:19 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:06:35 2003 Subject: [Python-checkins] python/dist/src/Mac/Distributions/(vise) Python 2.3.vct, 1.6, 1.6.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory sc8-pr-cvs1:/tmp/cvs-serv17341/Distributions/(vise) Modified Files: Tag: release23-branch Python 2.3.vct Log Message: Files used for MacPython 2.3 distribution. Index: Python 2.3.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.3.vct,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -C2 -d -r1.6 -r1.6.10.1 Binary files /tmp/cvsDlNUc0 and /tmp/cvswOiAXQ differ From jackjansen at users.sourceforge.net Mon Aug 4 15:06:47 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:09:39 2003 Subject: [Python-checkins] python/dist/src/Mac/Build PythonCore.mcp, 1.44, 1.44.8.1 PythonInterpreter.mcp, 1.23, 1.23.8.1 PythonStandSmall.mcp, 1.50, 1.50.8.1 _CG.carbon.mcp, 1.7, 1.7.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory sc8-pr-cvs1:/tmp/cvs-serv17341/Build Modified Files: Tag: release23-branch PythonCore.mcp PythonInterpreter.mcp PythonStandSmall.mcp _CG.carbon.mcp Log Message: Files used for MacPython 2.3 distribution. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.44 retrieving revision 1.44.8.1 diff -C2 -d -r1.44 -r1.44.8.1 Binary files /tmp/cvsO6fA03 and /tmp/cvscPQLsX differ Index: PythonInterpreter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonInterpreter.mcp,v retrieving revision 1.23 retrieving revision 1.23.8.1 diff -C2 -d -r1.23 -r1.23.8.1 Binary files /tmp/cvsrRecq6 and /tmp/cvsMC2at2 differ Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.50 retrieving revision 1.50.8.1 diff -C2 -d -r1.50 -r1.50.8.1 Binary files /tmp/cvsgW7PN8 and /tmp/cvsWk4LI6 differ Index: _CG.carbon.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_CG.carbon.mcp,v retrieving revision 1.7 retrieving revision 1.7.8.1 diff -C2 -d -r1.7 -r1.7.8.1 Binary files /tmp/cvsVvpnoa and /tmp/cvsS5WNxa differ From jackjansen at users.sourceforge.net Mon Aug 4 15:06:42 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 4 17:14:16 2003 Subject: [Python-checkins] python/dist/src/Mac ReadMe,1.48,1.48.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory sc8-pr-cvs1:/tmp/cvs-serv17341 Modified Files: Tag: release23-branch ReadMe Log Message: Files used for MacPython 2.3 distribution. Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.48 retrieving revision 1.48.6.1 diff -C2 -d -r1.48 -r1.48.6.1 *** ReadMe 16 Jun 2003 13:57:09 -0000 1.48 --- ReadMe 4 Aug 2003 21:06:10 -0000 1.48.6.1 *************** *** 1,4 **** ! How to install MacPython-OS9 2.3a2 on your Macintosh ! ---------------------------------------------------- This is a MacPython that can run on Mac OS 8.6 with CarbonLib --- 1,4 ---- ! How to install MacPython-OS9 2.3 on your Macintosh ! -------------------------------------------------- This is a MacPython that can run on Mac OS 8.6 with CarbonLib From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:24 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libundoc.tex, 1.86, 1.86.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/lib Modified Files: Tag: release23-maint libundoc.tex Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: libundoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v retrieving revision 1.86 retrieving revision 1.86.10.1 diff -C2 -d -r1.86 -r1.86.10.1 *** libundoc.tex 9 May 2003 15:04:56 -0000 1.86 --- libundoc.tex 4 Aug 2003 22:49:41 -0000 1.86.10.1 *************** *** 3,7 **** Here's a quick listing of modules that are currently undocumented, but that should be documented. Feel free to contribute documentation for ! them! (Send via email to \email{python-docs@python.org}.) The idea and original contents for this chapter were taken --- 3,7 ---- Here's a quick listing of modules that are currently undocumented, but that should be documented. Feel free to contribute documentation for ! them! (Send via email to \email{docs@python.org}.) The idea and original contents for this chapter were taken From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:25 2003 Subject: [Python-checkins] python/dist/src/Mac/Contrib/osam OSAm.prj, 1.4, 1.4.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Contrib/osam In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/Contrib/osam Modified Files: Tag: release23-maint OSAm.prj Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: OSAm.prj =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Contrib/osam/OSAm.prj,v retrieving revision 1.4 retrieving revision 1.4.12.1 diff -C2 -d -r1.4 -r1.4.12.1 Binary files /tmp/cvsnV99LC and /tmp/cvsuR26d5 differ From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:27 2003 Subject: [Python-checkins] python/dist/src README,1.177,1.177.4.1 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv6043 Modified Files: Tag: release23-maint README Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.177 retrieving revision 1.177.4.1 diff -C2 -d -r1.177 -r1.177.4.1 *** README 25 Jul 2003 01:12:48 -0000 1.177 --- README 4 Aug 2003 22:49:41 -0000 1.177.4.1 *************** *** 1,4 **** ! This is Python version 2.3 release candidate 2 ! ============================================== Copyright (c) 2001, 2002, 2003 Python Software Foundation. --- 1,4 ---- ! This is Python version 2.3 (final) ! ================================== Copyright (c) 2001, 2002, 2003 Python Software Foundation. *************** *** 36,39 **** --- 36,40 ---- See the file "Misc/NEWS". + If you don't read instructions ------------------------------ *************** *** 225,228 **** --- 226,230 ---- compilers from the vendor, or one of the free compilers (gcc). + Unsupported systems ------------------- *************** *** 247,250 **** --- 249,253 ---- - Systems using --with-dl-dld - Systems using --without-universal-newlines + Platform specific notes From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:28 2003 Subject: [Python-checkins] python/dist/src/Doc/info README,1.4,1.4.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/info In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/info Modified Files: Tag: release23-maint README Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/info/README,v retrieving revision 1.4 retrieving revision 1.4.18.1 diff -C2 -d -r1.4 -r1.4.18.1 *** README 17 Jan 2002 21:05:14 -0000 1.4 --- README 4 Aug 2003 22:49:41 -0000 1.4.18.1 *************** *** 19,21 **** Questions and comments on these documents should be directed to ! python-docs@python.org. --- 19,21 ---- Questions and comments on these documents should be directed to ! docs@python.org. From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:30 2003 Subject: [Python-checkins] python/dist/src/Doc/texinputs boilerplate.tex, 1.84, 1.84.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/texinputs Modified Files: Tag: release23-maint boilerplate.tex Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.84 retrieving revision 1.84.4.1 diff -C2 -d -r1.84 -r1.84.4.1 *** boilerplate.tex 29 Jul 2003 03:20:32 -0000 1.84 --- boilerplate.tex 4 Aug 2003 22:49:42 -0000 1.84.4.1 *************** *** 3,10 **** \authoraddress{ \strong{PythonLabs}\\ ! Email: \email{python-docs@python.org} } ! \date{July 29, 2003} % XXX update before final release! \release{2.3} % software release, not documentation \setreleaseinfo{} % empty for final release --- 3,10 ---- \authoraddress{ \strong{PythonLabs}\\ ! Email: \email{docs@python.org} } ! \date{\today} % XXX update before final release! \release{2.3} % software release, not documentation \setreleaseinfo{} % empty for final release From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:31 2003 Subject: [Python-checkins] python/dist/src/Doc/html about.html, 1.8, 1.8.16.1 stdabout.dat, 1.6, 1.6.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/html Modified Files: Tag: release23-maint about.html stdabout.dat Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: about.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/about.html,v retrieving revision 1.8 retrieving revision 1.8.16.1 diff -C2 -d -r1.8 -r1.8.16.1 *** about.html 30 Oct 2002 21:29:50 -0000 1.8 --- about.html 4 Aug 2003 22:49:41 -0000 1.8.16.1 *************** *** 56,61 ****

General comments and questions regarding this document should ! be sent by email to python-docs@python.org. If you find specific errors in this document, please report the bug at the Python Bug --- 56,61 ----

General comments and questions regarding this document should ! be sent by email to docs@python.org. If you find specific errors in this document, please report the bug at the Python Bug Index: stdabout.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/stdabout.dat,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -C2 -d -r1.6 -r1.6.10.1 *** stdabout.dat 22 May 2003 15:09:27 -0000 1.6 --- stdabout.dat 4 Aug 2003 22:49:41 -0000 1.6.10.1 *************** *** 29,34 ****

General comments and questions regarding this document should ! be sent by email to python-docs@python.org. If you find specific errors in this document, either in the content or the presentation, please report the bug at the General comments and questions regarding this document should ! be sent by email to docs@python.org. If you find specific errors in this document, either in the content or the presentation, please report the bug at the Update of /cvsroot/python/python/dist/src/Mac/Build In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/Build Modified Files: Tag: release23-maint PythonCore.mcp PythonInterpreter.mcp PythonStandSmall.mcp _CG.carbon.mcp Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.44 retrieving revision 1.44.10.1 diff -C2 -d -r1.44 -r1.44.10.1 Binary files /tmp/cvsFNzhbu and /tmp/cvs8h3abQ differ Index: PythonInterpreter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonInterpreter.mcp,v retrieving revision 1.23 retrieving revision 1.23.10.1 diff -C2 -d -r1.23 -r1.23.10.1 Binary files /tmp/cvsiTMsFw and /tmp/cvsSuilgV differ Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.50 retrieving revision 1.50.10.1 diff -C2 -d -r1.50 -r1.50.10.1 Binary files /tmp/cvsfqeqDz and /tmp/cvs8TAaqY differ Index: _CG.carbon.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_CG.carbon.mcp,v retrieving revision 1.7 retrieving revision 1.7.10.1 diff -C2 -d -r1.7 -r1.7.10.1 Binary files /tmp/cvsug3khB and /tmp/cvs8sQZg2 differ From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:34 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew23.tex, 1.159, 1.159.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/whatsnew Modified Files: Tag: release23-maint whatsnew23.tex Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.159 retrieving revision 1.159.4.1 diff -C2 -d -r1.159 -r1.159.4.1 *** whatsnew23.tex 29 Jul 2003 12:06:32 -0000 1.159 --- whatsnew23.tex 4 Aug 2003 22:49:42 -0000 1.159.4.1 *************** *** 1056,1060 **** if isinstance(item, slice): indices = item.indices(len(self)) ! return FakeSeq([self.calc_item(i) in range(*indices)]) else: return self.calc_item(i) --- 1056,1060 ---- if isinstance(item, slice): indices = item.indices(len(self)) ! return FakeSeq([self.calc_item(i) for i in range(*indices)]) else: return self.calc_item(i) *************** *** 2387,2391 **** suggestions, corrections and assistance with various drafts of this article: Jeff Bauer, Simon Brunning, Brett Cannon, Michael Chermside, ! Andrew Dalke, Scott David Daniels, Fred~L. Drake, Jr., Kelly Gerber, Raymond Hettinger, Michael Hudson, Chris Lambert, Detlef Lannert, Martin von~L\"owis, Andrew MacIntyre, Lalo Martins, Chad Netzer, --- 2387,2392 ---- suggestions, corrections and assistance with various drafts of this article: Jeff Bauer, Simon Brunning, Brett Cannon, Michael Chermside, ! Andrew Dalke, Scott David Daniels, Fred~L. Drake, Jr., David Fraser, ! Kelly Gerber, Raymond Hettinger, Michael Hudson, Chris Lambert, Detlef Lannert, Martin von~L\"owis, Andrew MacIntyre, Lalo Martins, Chad Netzer, From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:36 2003 Subject: [Python-checkins] python/dist/src/Doc/mac toolbox.tex, 1.8, 1.8.6.1 undoc.tex, 1.9, 1.9.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/mac Modified Files: Tag: release23-maint toolbox.tex undoc.tex Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: toolbox.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/toolbox.tex,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** toolbox.tex 22 Jul 2003 01:09:22 -0000 1.8 --- toolbox.tex 4 Aug 2003 22:49:42 -0000 1.8.6.1 *************** *** 25,29 **** \strong{Warning!} These modules are not yet documented. If you wish to contribute documentation of any of these modules, please get ! in touch with \email{python-docs@python.org}. \localmoduletable --- 25,29 ---- \strong{Warning!} These modules are not yet documented. If you wish to contribute documentation of any of these modules, please get ! in touch with \email{docs@python.org}. \localmoduletable Index: undoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/undoc.tex,v retrieving revision 1.9 retrieving revision 1.9.14.1 diff -C2 -d -r1.9 -r1.9.14.1 *** undoc.tex 12 Feb 2003 09:58:33 -0000 1.9 --- undoc.tex 4 Aug 2003 22:49:42 -0000 1.9.14.1 *************** *** 5,9 **** wish to contribute documentation of any of these modules, please get in touch with ! \ulink{\email{python-docs@python.org}}{mailto:python-docs@python.org}. \localmoduletable --- 5,9 ---- wish to contribute documentation of any of these modules, please get in touch with ! \ulink{\email{docs@python.org}}{mailto:docs@python.org}. \localmoduletable From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:37 2003 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.75,1.75.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/doc Modified Files: Tag: release23-maint doc.tex Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.75 retrieving revision 1.75.8.1 diff -C2 -d -r1.75 -r1.75.8.1 *** doc.tex 16 Jul 2003 13:50:28 -0000 1.75 --- doc.tex 4 Aug 2003 22:49:41 -0000 1.75.8.1 *************** *** 1912,1916 **** Comments and bug reports on the standard documents should be sent ! to \email{python-docs@python.org}. This may include comments about formatting, content, grammatical and spelling errors, or this document. You can also send comments on this document --- 1912,1916 ---- Comments and bug reports on the standard documents should be sent ! to \email{docs@python.org}. This may include comments about formatting, content, grammatical and spelling errors, or this document. You can also send comments on this document From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:39 2003 Subject: [Python-checkins] python/dist/src/Mac ReadMe,1.48,1.48.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac Modified Files: Tag: release23-maint ReadMe Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.48 retrieving revision 1.48.8.1 diff -C2 -d -r1.48 -r1.48.8.1 *** ReadMe 16 Jun 2003 13:57:09 -0000 1.48 --- ReadMe 4 Aug 2003 22:49:42 -0000 1.48.8.1 *************** *** 1,4 **** ! How to install MacPython-OS9 2.3a2 on your Macintosh ! ---------------------------------------------------- This is a MacPython that can run on Mac OS 8.6 with CarbonLib --- 1,4 ---- ! How to install MacPython-OS9 2.3 on your Macintosh ! -------------------------------------------------- This is a MacPython that can run on Mac OS 8.6 with CarbonLib From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:41 2003 Subject: [Python-checkins] python/dist/src/Doc/tools getpagecounts, 1.9, 1.9.10.1 html2texi.pl, 1.3, 1.3.48.1 mkackshtml, 1.3, 1.3.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/tools Modified Files: Tag: release23-maint getpagecounts html2texi.pl mkackshtml Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: getpagecounts =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/getpagecounts,v retrieving revision 1.9 retrieving revision 1.9.10.1 diff -C2 -d -r1.9 -r1.9.10.1 *** getpagecounts 20 Jun 2003 14:00:49 -0000 1.9 --- getpagecounts 4 Aug 2003 22:49:42 -0000 1.9.10.1 *************** *** 74,78 **** If you have any questions, comments, or suggestions regarding these ! documents, please send them via email to python-docs@python.org. """ --- 74,78 ---- If you have any questions, comments, or suggestions regarding these ! documents, please send them via email to docs@python.org. """ Index: html2texi.pl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/html2texi.pl,v retrieving revision 1.3 retrieving revision 1.3.48.1 diff -C2 -d -r1.3 -r1.3.48.1 *** html2texi.pl 14 Jan 1999 18:17:07 -0000 1.3 --- html2texi.pl 4 Aug 2003 22:49:42 -0000 1.3.48.1 *************** *** 138,142 **** # Perhaps double-check that every tag mentioned in the index is found # in the text. ! # Python: email to python-docs@python.org, to get their feedback. # Compare to existing lib/ Info manual # Write the hooks into info-look; replace pyliblookup1-1.tar.gz. --- 138,142 ---- # Perhaps double-check that every tag mentioned in the index is found # in the text. ! # Python: email to docs@python.org, to get their feedback. # Compare to existing lib/ Info manual # Write the hooks into info-look; replace pyliblookup1-1.tar.gz. Index: mkackshtml =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkackshtml,v retrieving revision 1.3 retrieving revision 1.3.18.1 diff -C2 -d -r1.3 -r1.3.18.1 *** mkackshtml 5 Apr 2002 17:34:50 -0000 1.3 --- mkackshtml 4 Aug 2003 22:49:42 -0000 1.3.18.1 *************** *** 54,58 **** you or anyone else should be on this list, please let us know (send email to python-docs@python.org), and we will be glad to correct the problem.

--- 54,58 ---- you or anyone else should be on this list, please let us know (send email to docs@python.org), and we will be glad to correct the problem.

From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:42 2003 Subject: [Python-checkins] python/dist/src/Doc/tools/sgmlconv README, 1.6, 1.6.40.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc/tools/sgmlconv Modified Files: Tag: release23-maint README Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/README,v retrieving revision 1.6 retrieving revision 1.6.40.1 diff -C2 -d -r1.6 -r1.6.40.1 *** README 22 Nov 2000 16:58:25 -0000 1.6 --- README 4 Aug 2003 22:49:42 -0000 1.6.40.1 *************** *** 14,18 **** make -f ../tools/sgmlconv/make.rules TOOLSDIR=../tools ! Please send comments and bug reports to python-docs@python.org. --- 14,18 ---- make -f ../tools/sgmlconv/make.rules TOOLSDIR=../tools ! Please send comments and bug reports to docs@python.org. From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:44 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_optparse.py, 1.2, 1.2.8.1 test_posixpath.py, 1.9, 1.9.6.1 test_strptime.py, 1.19, 1.19.4.1 test_urllib.py, 1.14, 1.14.8.1 test_uu.py, 1.6, 1.6.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Lib/test Modified Files: Tag: release23-maint test_optparse.py test_posixpath.py test_strptime.py test_urllib.py test_uu.py Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: test_optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_optparse.py,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** test_optparse.py 1 May 2003 17:45:38 -0000 1.2 --- test_optparse.py 4 Aug 2003 22:49:42 -0000 1.2.8.1 *************** *** 608,612 **** def test_version(self): oldargv = sys.argv[0] ! sys.argv[0] = "./foo/bar" self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1") self.assertStdoutEquals(["--version"], "bar 0.1\n") --- 608,612 ---- def test_version(self): oldargv = sys.argv[0] ! sys.argv[0] = os.path.join(os.curdir, "foo", "bar") self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1") self.assertStdoutEquals(["--version"], "bar 0.1\n") *************** *** 1087,1091 **** # This trick is used to make optparse believe bar.py is being executed. oldargv = sys.argv[0] ! sys.argv[0] = "./foo/bar.py" self.assertStdoutEquals(["-h"], expected_output) --- 1087,1091 ---- # This trick is used to make optparse believe bar.py is being executed. oldargv = sys.argv[0] ! sys.argv[0] = os.path.join(os.curdir, "foo", "bar.py") self.assertStdoutEquals(["-h"], expected_output) Index: test_posixpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_posixpath.py,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** test_posixpath.py 1 Jul 2003 03:33:31 -0000 1.9 --- test_posixpath.py 4 Aug 2003 22:49:42 -0000 1.9.6.1 *************** *** 327,330 **** --- 327,332 ---- def test_ismount(self): + if os.name in ('mac',): + return self.assertIs(posixpath.ismount("/"), True) Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.19 retrieving revision 1.19.4.1 diff -C2 -d -r1.19 -r1.19.4.1 *** test_strptime.py 24 Jul 2003 06:27:17 -0000 1.19 --- test_strptime.py 4 Aug 2003 22:49:42 -0000 1.19.4.1 *************** *** 5,8 **** --- 5,9 ---- import locale import re + import sys from test import test_support *************** *** 307,310 **** --- 308,314 ---- strp_output = _strptime.strptime(strf_output, "%Z") locale_time = _strptime.LocaleTime() + if sys.platform == 'mac': + # Timezones don't really work on MacOS9 + return if time.tzname[0] != time.tzname[1] or not time.daylight: self.failUnless(strp_output[8] == time_tuple[8], Index: test_urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib.py,v retrieving revision 1.14 retrieving revision 1.14.8.1 diff -C2 -d -r1.14 -r1.14.8.1 *** test_urllib.py 12 May 2003 20:19:37 -0000 1.14 --- test_urllib.py 4 Aug 2003 22:49:42 -0000 1.14.8.1 *************** *** 107,111 **** # a headers value is returned. result = urllib.urlretrieve("file:%s" % test_support.TESTFN) ! self.assertEqual(result[0], test_support.TESTFN) self.assert_(isinstance(result[1], mimetools.Message), "did not get a mimetools.Message instance as second " --- 107,112 ---- # a headers value is returned. result = urllib.urlretrieve("file:%s" % test_support.TESTFN) ! self.assertEqual(os.path.normpath(result[0]), ! os.path.normpath(test_support.TESTFN)) self.assert_(isinstance(result[1], mimetools.Message), "did not get a mimetools.Message instance as second " Index: test_uu.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_uu.py,v retrieving revision 1.6 retrieving revision 1.6.8.1 diff -C2 -d -r1.6 -r1.6.8.1 *** test_uu.py 6 May 2003 08:57:41 -0000 1.6 --- test_uu.py 4 Aug 2003 22:49:42 -0000 1.6.8.1 *************** *** 143,147 **** f.close() ! f = open(self.tmpout, 'r') s = f.read() f.close() --- 143,147 ---- f.close() ! f = open(self.tmpout, 'rU') s = f.read() f.close() From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:14 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:50:46 2003 Subject: [Python-checkins] python/dist/src/Doc ACKS, 1.39, 1.39.8.1 Makefile, 1.261, 1.261.4.1 README, 1.49, 1.49.8.1 python-docs.txt, 1.1, 1.1.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Doc Modified Files: Tag: release23-maint ACKS Makefile README python-docs.txt Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.39 retrieving revision 1.39.8.1 diff -C2 -d -r1.39 -r1.39.8.1 *** ACKS 30 Jun 2003 12:18:52 -0000 1.39 --- ACKS 4 Aug 2003 22:49:41 -0000 1.39.8.1 *************** *** 5,9 **** documentation. It is probably not complete -- if you feel that you or anyone else should be on this list, please let us know (send email to ! python-docs@python.org), and we'll be glad to correct the problem. It is only with the input and contributions of the Python community --- 5,9 ---- documentation. It is probably not complete -- if you feel that you or anyone else should be on this list, please let us know (send email to ! docs@python.org), and we'll be glad to correct the problem. It is only with the input and contributions of the Python community Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.261 retrieving revision 1.261.4.1 diff -C2 -d -r1.261 -r1.261.4.1 *** Makefile 29 Jul 2003 03:11:34 -0000 1.261 --- Makefile 4 Aug 2003 22:49:41 -0000 1.261.4.1 *************** *** 50,54 **** # PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in # the html/ directory. If you want to fix the GNU info process, look ! # in the info/ directory; please send patches to python-docs@python.org. # This Makefile only includes information on how to perform builds; for --- 50,54 ---- # PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in # the html/ directory. If you want to fix the GNU info process, look ! # in the info/ directory; please send patches to docs@python.org. # This Makefile only includes information on how to perform builds; for *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.3 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.3+ PYTHON= python Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/README,v retrieving revision 1.49 retrieving revision 1.49.8.1 diff -C2 -d -r1.49 -r1.49.8.1 *** README 8 Jul 2003 18:05:26 -0000 1.49 --- README 4 Aug 2003 22:49:41 -0000 1.49.8.1 *************** *** 67,82 **** Documentation Team: ! python-docs@python.org Thanks! - - - What happened to the Macintosh chapter of the Python Library Reference? - ----------------------------------------------------------------------- - - The directory mac/ contains the LaTeX sources for the "Macintosh - Library Modules" manual; this is built using the standard build - targets, so check the proper output directory for your chosen format - and paper size. --- 67,73 ---- Documentation Team: ! docs@python.org Thanks! Index: python-docs.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/python-docs.txt,v retrieving revision 1.1 retrieving revision 1.1.18.1 diff -C2 -d -r1.1 -r1.1.18.1 *** python-docs.txt 12 Aug 2002 22:01:42 -0000 1.1 --- python-docs.txt 4 Aug 2003 22:49:41 -0000 1.1.18.1 *************** *** 1,4 **** This message is being sent in response to your message to the Python ! documentation maintainers (python-docs@python.org). Your message will be handled by a human, but this message serves to answer the most common questions sent to this address. --- 1,4 ---- This message is being sent in response to your message to the Python ! documentation maintainers (docs@python.org). Your message will be handled by a human, but this message serves to answer the most common questions sent to this address. *************** *** 97,101 **** Start by reading the documentation for XXX. If the documentation doesn't make sense or seems incomplete, please ! file a specific bug report to python-docs@python.org (the address you sent your question to). Otherwise, you probably sent your question to the wrong place (which does not preclude --- 97,101 ---- Start by reading the documentation for XXX. If the documentation doesn't make sense or seems incomplete, please ! file a specific bug report to docs@python.org (the address you sent your question to). Otherwise, you probably sent your question to the wrong place (which does not preclude *************** *** 125,129 **** Chances are very good that the person who answers questions ! posted to python-docs@python.org doesn't use Jython very often, and won't be able to give you a meaningful answer beyond "Look at the Jython website." Sorry, I don't have *all* the answers! --- 125,129 ---- Chances are very good that the person who answers questions ! posted to docs@python.org doesn't use Jython very often, and won't be able to give you a meaningful answer beyond "Look at the Jython website." Sorry, I don't have *all* the answers! *************** *** 132,136 **** If you're reading this, you've found the right address! Send ! all documentation bug reports to python-docs@python.org. If you prefer to use a Web-based reporting mechanism, you can use the bug database at http://www.python.org/python-bugs/. --- 132,136 ---- If you're reading this, you've found the right address! Send ! all documentation bug reports to docs@python.org. If you prefer to use a Web-based reporting mechanism, you can use the bug database at http://www.python.org/python-bugs/. From bwarsaw at users.sourceforge.net Mon Aug 4 16:52:29 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:52:32 2003 Subject: [Python-checkins] python/dist/src/Include patchlevel.h, 2.74, 2.74.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv6930 Modified Files: Tag: release23-maint patchlevel.h Log Message: Bump version string. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.74 retrieving revision 2.74.4.1 diff -C2 -d -r2.74 -r2.74.4.1 *** patchlevel.h 29 Jul 2003 00:21:36 -0000 2.74 --- patchlevel.h 4 Aug 2003 22:52:27 -0000 2.74.4.1 *************** *** 27,31 **** /* Version as a string */ ! #define PY_VERSION "2.3" /* 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+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From bwarsaw at users.sourceforge.net Mon Aug 4 16:53:51 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 18:53:54 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.1,1.831.4.2 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv7161 Modified Files: Tag: release23-maint NEWS Log Message: Boilerplate for Python 2.3.1 Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.1 retrieving revision 1.831.4.2 diff -C2 -d -r1.831.4.1 -r1.831.4.2 *** NEWS 4 Aug 2003 22:49:46 -0000 1.831.4.1 --- NEWS 4 Aug 2003 22:53:49 -0000 1.831.4.2 *************** *** 5,8 **** --- 5,38 ---- (editors: check NEWS.help for information about editing NEWS using ReST.) + What's New in Python 2.3.1? + =========================== + + *Release date: XX-XXX-XXXX* + + Core and builtins + ----------------- + + Extension modules + ----------------- + + Library + ------- + + IDLE + ---- + + Build + ----- + + C API + ----- + + Windows + ------- + + Mac + --- + + What's New in Python 2.3 final? =============================== From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 19:08:04 2003 Subject: [Python-checkins] python/dist/src/Mac/Include macbuildno.h, 1.27, 1.27.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/Include Modified Files: Tag: release23-maint macbuildno.h Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.27 retrieving revision 1.27.10.1 diff -C2 -d -r1.27 -r1.27.10.1 *** macbuildno.h 21 Feb 2003 22:33:52 -0000 1.27 --- macbuildno.h 4 Aug 2003 22:49:43 -0000 1.27.10.1 *************** *** 1 **** ! #define BUILD 154 --- 1 ---- ! #define BUILD 155 From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 19:08:06 2003 Subject: [Python-checkins] python/dist/src/Mac/Distributions/(vise) Python 2.3.vct, 1.6, 1.6.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/Distributions/(vise) Modified Files: Tag: release23-maint Python 2.3.vct Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: Python 2.3.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.3.vct,v retrieving revision 1.6 retrieving revision 1.6.12.1 diff -C2 -d -r1.6 -r1.6.12.1 Binary files /tmp/cvsDz9jE7 and /tmp/cvsSnF8Q5 differ From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 19:08:09 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Dist build,1.12,1.12.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Dist In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/OSX/Dist Modified Files: Tag: release23-maint build Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: build =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/OSX/Dist/build,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** build 23 Jul 2003 10:51:55 -0000 1.12 --- build 4 Aug 2003 22:49:43 -0000 1.12.4.1 *************** *** 6,12 **** # Script configs ! PYVERSION=2.3rc1plus PYVER=2.3 ! BUILDNUM=8 DOCLEANUP=no --- 6,12 ---- # Script configs ! PYVERSION=2.3 PYVER=2.3 ! BUILDNUM=1 DOCLEANUP=no *************** *** 134,138 **** # ...and then make a disk image containing the package. mv MacPython-OSX.pkg $DMGDIR/root ! cp $RESOURCEDIR/Welcome.txt $DMGDIR/root/README.txt $PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM --- 134,138 ---- # ...and then make a disk image containing the package. mv MacPython-OSX.pkg $DMGDIR/root ! cp $RESOURCEDIR/ReadMe.txt $DMGDIR/root/ReadMe.txt $PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM From bwarsaw at users.sourceforge.net Mon Aug 4 16:49:48 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 19:08:11 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Dist/resources ReadMe.txt, NONE, 1.1.4.1 Welcome.rtf, NONE, 1.1.4.1 Welcome.txt, 1.6, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Dist/resources In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/OSX/Dist/resources Added Files: Tag: release23-maint ReadMe.txt Welcome.rtf Removed Files: Tag: release23-maint Welcome.txt Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch --- NEW FILE: ReadMe.txt --- This package will install MacPython 2.3 for Mac OS X 10.2. Installation on the Panther preview may work, on 10.1 or earlier will not work. Installation requires approximately 20 MB of disk space, ignore the message that it will take zero bytes. You must install onto your current boot disk, even though the installer does not enforce this, otherwise things will not work. MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, a Python extension package manager), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more). The installer puts the applications in MacPython-2.3 in your Applications folder, command-line tools in /usr/local/bin and the underlying machinery in /Library/Frameworks/Python.framework. The PythonIDE application has a Help command that gets you started quickly with MacPython and contains references to other documentation. More information on MacPython can be found at http://www.cwi.nl/~jack/macpython.html, more information on Python in general at http://www.python.org. --- NEW FILE: Welcome.rtf --- {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f0\fs24 \cf0 This package will install \f1\b MacPython 2.3 \f0\b0 for \f1\b Mac OS X 10.2 \f0\b0 . Installation on the Panther preview may work, on 10.1 or earlier will not work.\ \ MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, a Python extension package manager), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\ \ See the ReadMe file for more information.} --- Welcome.txt DELETED --- From bwarsaw at users.sourceforge.net Mon Aug 4 16:50:15 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 4 19:08:13 2003 Subject: [Python-checkins] python/dist/src/Mac/Distributions binary.include, 1.23, 1.23.12.1 dev.include, 1.29, 1.29.10.1 src.include, 1.8, 1.8.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory sc8-pr-cvs1:/tmp/cvs-serv6043/Mac/Distributions Modified Files: Tag: release23-maint binary.include dev.include src.include Log Message: Merging release23-branch into the long-term Python 2.3 maintenance branch Index: binary.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/binary.include,v retrieving revision 1.23 retrieving revision 1.23.12.1 diff -C2 -d -r1.23 -r1.23.12.1 *** binary.include 8 Jan 2003 16:27:38 -0000 1.23 --- binary.include 4 Aug 2003 22:49:43 -0000 1.23.12.1 *************** *** 186,190 **** (':Tools:freeze', '') (':Tools:i18n', '') - (':Tools:idle', '') (':Tools:modulator', None) (':Tools:pynche', '') --- 186,189 ---- *************** *** 206,207 **** --- 205,208 ---- (':setup.py', None) (':site-packages', None) + (':Tools:unicode:mkstringprep.py', '') + (':Objects:dictnotes.txt', None) Index: dev.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.include,v retrieving revision 1.29 retrieving revision 1.29.10.1 diff -C2 -d -r1.29 -r1.29.10.1 *** dev.include 21 Feb 2003 22:33:47 -0000 1.29 --- dev.include 4 Aug 2003 22:49:43 -0000 1.29.10.1 *************** *** 428,431 **** --- 428,432 ---- (':Mac:mwerks:mwerks_carbonNOGUSI_config.h', None) (':Mac:mwerks:mwerks_nscarbon_config.h', '') + (':Mac:mwerks:mwerks_pyexpat_config.h', None) (':Mac:mwerks:mwerks_shcarbon_config.h', '') (':Mac:mwerks:mwerks_smcarbon_config.h', '') *************** *** 454,457 **** --- 455,459 ---- (':Modules:_cursesmodule.c', None) (':Modules:_hotshot.c', None) + (':Modules:_iconv_codec.c', None) (':Modules:_localemodule.c', None) (':Modules:_randommodule.c', None) *************** *** 502,505 **** --- 504,508 ---- (':Modules:imageop.c', None) (':Modules:imgfile.c', None) + (':Modules:itertoolsmodule.c', None) (':Modules:ld_so_aix', None) (':Modules:ld_so_beos', None) *************** *** 630,634 **** (':setup.py', None) (':site-packages', None) ! (':Modules:itertoolsmodule.c', None) ! (':Modules:_iconv_codec.c', None) ! (':Mac:mwerks:mwerks_pyexpat_config.h', None) --- 633,639 ---- (':setup.py', None) (':site-packages', None) ! (':Tools:unicode:mkstringprep.py', '') ! (':Modules:_csv.c', None) ! (':Mac:Build:_csv.carbon.mcp.xml', None) ! (':Mac:Build:_csv.carbon.mcp.exp', None) ! (':Mac:Build:_csv.carbon.mcp', None) Index: src.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/src.include,v retrieving revision 1.8 retrieving revision 1.8.12.1 diff -C2 -d -r1.8 -r1.8.12.1 *** src.include 8 Jan 2003 16:27:38 -0000 1.8 --- src.include 4 Aug 2003 22:49:43 -0000 1.8.12.1 *************** *** 114,120 **** (':Tools:compiler', '') (':Tools:faqwiz', '') (':Tools:freeze', '') (':Tools:i18n', '') - (':Tools:idle', '') (':Tools:modulator', '') (':Tools:pynche', '') --- 114,120 ---- (':Tools:compiler', '') (':Tools:faqwiz', '') + (':Tools:framer', '') (':Tools:freeze', '') (':Tools:i18n', '') (':Tools:modulator', '') (':Tools:pynche', '') *************** *** 136,138 **** (':setup.py', None) (':site-packages', None) ! (':Tools:framer', '') --- 136,140 ---- (':setup.py', None) (':site-packages', None) ! (':Mac:Distributions:.DS_Store', None) ! (':Mac:Unsupported:unshar.py', '') ! (':Tools:unicode:mkstringprep.py', '') From fdrake at users.sourceforge.net Mon Aug 4 21:45:39 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Aug 4 23:45:43 2003 Subject: [Python-checkins] python/dist/src/Doc/perl l2hinit.perl, 1.74, 1.75 python.perl, 1.137, 1.138 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv17524 Modified Files: l2hinit.perl python.perl Log Message: make the portions of the generated HTML produced by these styles better conform to XHTML rules. Index: l2hinit.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** l2hinit.perl 27 Jun 2003 18:26:01 -0000 1.74 --- l2hinit.perl 5 Aug 2003 03:45:37 -0000 1.75 *************** *** 27,31 **** $BODYTEXT = ''; ! $CHILDLINE = "\n


\n"; $VERBOSITY = 0; --- 27,31 ---- $BODYTEXT = ''; ! $CHILDLINE = "\n


\n"; $VERBOSITY = 0; *************** *** 105,108 **** --- 105,109 ---- if ($title =~ /\<[aA] /) { $title =~ s/\<[aA] /"; } --- 140,144 ---- my $iconserver = ($ICONSERVER eq '.') ? '' : "$ICONSERVER/"; return "$text"; } *************** *** 158,161 **** --- 159,163 ---- } $s =~ s/<[aA] /||g; $toc =~ s/ NAME=\"tex2html\d+\"\s*href=/ href=/gi; ! $toc =~ s|(\s*
)?||gi; return $toc; } --- 205,209 ---- $toc =~ s|\s*||g; $toc =~ s/ NAME=\"tex2html\d+\"\s*href=/ href=/gi; ! $toc =~ s|(\s*)?||gi; return $toc; } *************** *** 228,238 **** return "\n" . make_nav_panel() ! . "

\n"; } sub bot_navigation_panel() { ! return "\n


\n" . make_nav_panel() ! . "
\n" . get_version_text() . "\n"; --- 230,240 ---- return "\n" . make_nav_panel() ! . "

\n"; } sub bot_navigation_panel() { ! return "\n


\n" . make_nav_panel() ! . "
\n" . get_version_text() . "\n"; *************** *** 410,415 **** anchor_label('contents', $CURRENT_FILE, $_); # this is added $MY_CONTENTS_PAGE = "$CURRENT_FILE"; ! join('', "
\n\\tableofchildlinks[off]", $closures ! , make_section_heading($toc_title, 'H2'), $toc_mark , $reopens, $_); } --- 412,417 ---- anchor_label('contents', $CURRENT_FILE, $_); # this is added $MY_CONTENTS_PAGE = "$CURRENT_FILE"; ! join('', "
\n\\tableofchildlinks[off]", $closures ! , make_section_heading($toc_title, 'h2'), $toc_mark , $reopens, $_); } *************** *** 421,426 **** my($closures, $reopens) = preserve_open_tags(); anchor_label('lof', $CURRENT_FILE, $_); # this is added ! join('', "
\n", $closures ! , make_section_heading($lof_title, 'H2'), $lof_mark , $reopens, $_); } --- 423,428 ---- my($closures, $reopens) = preserve_open_tags(); anchor_label('lof', $CURRENT_FILE, $_); # this is added ! join('', "
\n", $closures ! , make_section_heading($lof_title, 'h2'), $lof_mark , $reopens, $_); } *************** *** 432,437 **** my($closures, $reopens) = preserve_open_tags(); anchor_label('lot', $CURRENT_FILE, $_); # this is added ! join('', "
\n", $closures ! , make_section_heading($lot_title, 'H2'), $lot_mark , $reopens, $_); } --- 434,439 ---- my($closures, $reopens) = preserve_open_tags(); anchor_label('lot', $CURRENT_FILE, $_); # this is added ! join('', "
\n", $closures ! , make_section_heading($lot_title, 'h2'), $lot_mark , $reopens, $_); } *************** *** 474,478 **** my($pre, $post) = minimize_open_tags($heading); anchor_label('genindex',$CURRENT_FILE,$_); # this is added ! return "
\n" . $pre . $_; } --- 476,480 ---- my($pre, $post) = minimize_open_tags($heading); anchor_label('genindex',$CURRENT_FILE,$_); # this is added ! return "
\n" . $pre . $_; } *************** *** 485,489 **** anchor_label('modindex', $CURRENT_FILE, $_); $MODULE_INDEX_FILE = "$CURRENT_FILE"; ! $_ = ('

' . make_section_heading($idx_module_title, 'h2') . $idx_module_mark . $_); return $_; --- 487,491 ---- anchor_label('modindex', $CURRENT_FILE, $_); $MODULE_INDEX_FILE = "$CURRENT_FILE"; ! $_ = ('

' . make_section_heading($idx_module_title, 'h2') . $idx_module_mark . $_); return $_; *************** *** 625,629 **** eval("\$title = ". $default_title ) unless ($title); ! # allow user-modification of the tag; thanks Dan Young if (defined &custom_TITLE_hook) { $title = &custom_TITLE_hook($title, $toc_sec_title); --- 627,631 ---- eval("\$title = ". $default_title ) unless ($title); ! # allow user-modification of the <title> tag; thanks Dan Young if (defined &custom_TITLE_hook) { $title = &custom_TITLE_hook($title, $toc_sec_title); *************** *** 641,668 **** ($DOCTYPE ? $DTDcomment : ''), "<html>\n<head>", ! ($BASE ? "\n<base href=\"$BASE\">" : ''), ! "\n<link rel=\"STYLESHEET\" href=\"$STYLESHEET\" type='text/css'>", ($FAVORITES_ICON ! ? ("\n<link rel=\"SHORTCUT ICON\" href=\"" . "$FAVORITES_ICON\">") : ''), ($EXTERNAL_UP_LINK ? ("\n<link rel='start' href='" . $EXTERNAL_UP_LINK . ($EXTERNAL_UP_TITLE ? ! "' title='$EXTERNAL_UP_TITLE'>" : "'>")) : ''), "\n<link rel=\"first\" href=\"$FILE.html\"", ($t_title ? " title='$t_title'" : ''), ! '>', ($HAVE_TABLE_OF_CONTENTS ? ("\n<link rel='contents' href='$MY_CONTENTS_PAGE'" ! . ' title="Contents">') : ''), ($HAVE_GENERAL_INDEX ! ? "\n<link rel='index' href='genindex.html' title='Index'>" : ''), # disable for now -- Mozilla doesn't do well with multiple indexes # ($HAVE_MODULE_INDEX ! # ? '<link rel="index" href="modindex.html" title="Module Index">' ! # . "\n" # : ''), ($INFO --- 643,671 ---- ($DOCTYPE ? $DTDcomment : ''), "<html>\n<head>", ! ($BASE ? "\n<base href=\"$BASE\" />" : ''), ! "\n<link rel=\"STYLESHEET\" href=\"$STYLESHEET\" type='text/css'", ! " />", ($FAVORITES_ICON ! ? ("\n<link rel=\"SHORTCUT ICON\" href=\"$FAVORITES_ICON\" />") : ''), ($EXTERNAL_UP_LINK ? ("\n<link rel='start' href='" . $EXTERNAL_UP_LINK . ($EXTERNAL_UP_TITLE ? ! "' title='$EXTERNAL_UP_TITLE' />" : "' />")) : ''), "\n<link rel=\"first\" href=\"$FILE.html\"", ($t_title ? " title='$t_title'" : ''), ! ' />', ($HAVE_TABLE_OF_CONTENTS ? ("\n<link rel='contents' href='$MY_CONTENTS_PAGE'" ! . ' title="Contents" />') : ''), ($HAVE_GENERAL_INDEX ! ? "\n<link rel='index' href='genindex.html' title='Index' />" : ''), # disable for now -- Mozilla doesn't do well with multiple indexes # ($HAVE_MODULE_INDEX ! # ? '<link rel="index" href="modindex.html" title="Module Index"' ! # . " />\n" # : ''), ($INFO *************** *** 672,678 **** # rest of the Python doc tools. ? ("\n<link rel='last' href='about.html'" ! . " title='About this document...'>" . "\n<link rel='help' href='about.html'" ! . " title='About this document...'>") : ''), $more_links_mark, --- 675,681 ---- # rest of the Python doc tools. ? ("\n<link rel='last' href='about.html'" ! . " title='About this document...' />" . "\n<link rel='help' href='about.html'" ! . " title='About this document...' />") : ''), $more_links_mark, *************** *** 680,687 **** ($CHARSET && $HTML_VERSION ge "2.1" ? ('<meta http-equiv="Content-Type" content="text/html; ' ! . "charset=$CHARSET\">\n") : ''), ($AESOP_META_TYPE ! ? "<meta name='aesop' content='$AESOP_META_TYPE'>\n" : '')); } if (!$charset && $CHARSET) { --- 683,690 ---- ($CHARSET && $HTML_VERSION ge "2.1" ? ('<meta http-equiv="Content-Type" content="text/html; ' ! . "charset=$CHARSET\" />\n") : ''), ($AESOP_META_TYPE ! ? "<meta name='aesop' content='$AESOP_META_TYPE' />\n" : '')); } if (!$charset && $CHARSET) { *************** *** 693,701 **** my $metatitle = "$title"; $metatitle =~ s/^\d+(\.\d+)*\s*//; join('', $MY_PARTIAL_HEADER, ! &meta_information($metatitle), "<title>", $title, "\n\n"); } --- 696,713 ---- my $metatitle = "$title"; $metatitle =~ s/^\d+(\.\d+)*\s*//; + $metatitle = meta_information($metatitle); + $metatitle =~ s/ NAME=/ name=/g; + $metatitle =~ s/ CONTENT=/ content=/g; join('', $MY_PARTIAL_HEADER, ! $metatitle, "", $title, "\n\n"); + } + + sub replace_morelinks { + $more_links =~ s/ REL=/ rel=/g; + $more_links =~ s/ HREF=/ href=/g; + $_ =~ s/$more_links_mark/$more_links/e; } Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** python.perl 16 Jul 2003 14:01:56 -0000 1.137 --- python.perl 5 Aug 2003 03:45:37 -0000 1.138 *************** *** 52,56 **** : '') . " alt=\"[off-site link]\"\n" ! . " >"); } return ''; --- 52,56 ---- : '') . " alt=\"[off-site link]\"\n" ! . " />"); } return ''; *************** *** 346,351 **** my $nstr = gen_index_id("Python Enhancement Proposals!PEP $rfcnumber", ''); $index{$nstr} .= make_half_href("$CURRENT_FILE#$id"); ! return ("PEP $rfcnumber" ! . "$icon" . $_); } --- 346,351 ---- my $nstr = gen_index_id("Python Enhancement Proposals!PEP $rfcnumber", ''); $index{$nstr} .= make_half_href("$CURRENT_FILE#$id"); ! return ("PEP $rfcnumber$icon" . $_); } *************** *** 359,364 **** my $nstr = gen_index_id("RFC!RFC $rfcnumber", ''); $index{$nstr} .= make_half_href("$CURRENT_FILE#$id"); ! return ("RFC $rfcnumber" ! . "$icon" . $_); } --- 359,364 ---- my $nstr = gen_index_id("RFC!RFC $rfcnumber", ''); $index{$nstr} .= make_half_href("$CURRENT_FILE#$id"); ! return ("" ! . "RFC $rfcnumber$icon" . $_); } *************** *** 395,399 **** return ('
' . "Deprecated since release $release." ! . "\n$reason

" . $_); } --- 395,399 ---- return ('

' . "Deprecated since release $release." ! . "\n$reason

" . $_); } *************** *** 513,517 **** sub new_link_info(){ my $name = "l2h-" . ++$globals{'max_id'}; ! my $aname = ""; my $ahref = gen_link($CURRENT_FILE, $name); return ($name, $aname, $ahref); --- 513,517 ---- sub new_link_info(){ my $name = "l2h-" . ++$globals{'max_id'}; ! my $aname = ""; my $ahref = gen_link($CURRENT_FILE, $name); return ($name, $aname, $ahref); *************** *** 811,815 **** $TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target; return ("\n" ! . " $token\n" . "  ::= \n" . " " --- 811,816 ---- $TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target; return ("\n" ! . " " ! . "$token\n" . "  ::= \n" . " " *************** *** 963,970 **** . "\n"); } ! return "
$siginfo\n
" . $rcinfo . $_ ! . '
'; } --- 964,971 ---- . "\n"); } ! return "
$siginfo
\n
" . $rcinfo . $_ ! . '
'; } *************** *** 977,981 **** . " ($container member)"); $idx =~ s/ \(.*\)//; ! return "
$type $idx\n
" . $_; } --- 978,982 ---- . " ($container member)"); $idx =~ s/ \(.*\)//; ! return "
$type $idx
\n
" . $_; } *************** *** 988,992 **** . " ($container member)"); $idx =~ s/ \(.*\)//; ! return "
$type $idx\n
" . $_ . '
'; --- 989,993 ---- . " ($container member)"); $idx =~ s/ \(.*\)//; ! return "
$type $idx
\n
" . $_ . '
'; *************** *** 997,1001 **** my $name = next_argument(); my $idx = make_str_index_entry("$name"); ! return "
$idx\n
" . $_ . '
' --- 998,1002 ---- my $name = next_argument(); my $idx = make_str_index_entry("$name"); ! return "
$idx
\n
" . $_ . '
' *************** *** 1010,1014 **** my($name, $aname, $ahref) = new_link_info(); add_index_entry("$index_name (C type)", $ahref); ! return "
$aname$type_name\n
" . $_ . '
' --- 1011,1016 ---- my($name, $aname, $ahref) = new_link_info(); add_index_entry("$index_name (C type)", $ahref); ! return "
$aname$type_name
" ! . "\n
" . $_ . '
' *************** *** 1022,1029 **** . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$var_type $idx\n" . '
' . $_ ! . '
'; } --- 1024,1031 ---- . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$var_type $idx
\n" . '
' . $_ ! . '
'; } *************** *** 1039,1043 **** . '
' . "\n " ! . "\n
$idxitem($arglist)
\n
"); } --- 1041,1045 ---- . '
' . "\n " ! . "\n
$idxitem($arglist)
\n
"); } *************** *** 1105,1109 **** $stuff .= "    $arg_list"; } ! return $stuff . "\n
" . $_ . ''; } --- 1107,1111 ---- $stuff .= "    $arg_list"; } ! return $stuff . "\n
" . $_ . ''; } *************** *** 1113,1119 **** my $idx = make_str_index_entry("$dataname" . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$idx\n
" . $_ ! . '
'; } --- 1115,1121 ---- my $idx = make_str_index_entry("$dataname" . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$idx
\n
" . $_ ! . '
'; } *************** *** 1124,1128 **** $idx = "$idx"; } ! return "
$idx\n
" . $_ . '
'; } --- 1126,1130 ---- $idx = "$idx"; } ! return "
$idx
\n
" . $_ . '
'; } *************** *** 1132,1136 **** my $idx = make_str_index_entry("$data_name" . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$idx
" . $_; } --- 1134,1138 ---- my $idx = make_str_index_entry("$data_name" . get_indexsubitem()); $idx =~ s/ \(.*\)//; ! return "
$idx
" . $_; } *************** *** 1138,1142 **** local($_) = @_; my $data_name = next_argument(); ! return "
$data_name
" . $_; } --- 1140,1144 ---- local($_) = @_; my $data_name = next_argument(); ! return "
$data_name
" . $_; } *************** *** 1145,1152 **** my $excname = next_argument(); my $idx = make_str_index_entry("$excname"); ! return ("
${TLSTART}exception$TLEND$idx" . "\n
" . $_ ! . '
'); } --- 1147,1154 ---- my $excname = next_argument(); my $idx = make_str_index_entry("$excname"); ! return ("
${TLSTART}exception$TLEND$idx
" . "\n
" . $_ ! . '
'); } *************** *** 1252,1256 **** $idx =~ s/ \(.*\)//; $idx =~ s/\(\)//; ! return "
$idx\n
" . $_ . '
'; } --- 1254,1258 ---- $idx =~ s/ \(.*\)//; $idx =~ s/\(\)//; ! return "
$idx
\n
" . $_ . '
'; } *************** *** 1268,1272 **** $idx =~ s/ \(.*\)//; $idx =~ s/\(\)//; ! return "
$idx
" . $_; } --- 1270,1274 ---- $idx =~ s/ \(.*\)//; $idx =~ s/\(\)//; ! return "
$idx
" . $_; } *************** *** 1276,1282 **** next_optional_argument(); my $member = next_argument(); ! return "
$member\n
" . $_ ! . '
'; } --- 1278,1284 ---- next_optional_argument(); my $member = next_argument(); ! return "
$member
\n
" . $_ ! . '
'; } *************** *** 1286,1290 **** next_optional_argument(); my $member = next_argument(); ! return "
$member
" . $_; } --- 1288,1292 ---- next_optional_argument(); my $member = next_argument(); ! return "
$member
\n
" . $_; } *************** *** 1636,1640 **** if ($PACKAGE_VERSION) { $the_title .= ('Release ' ! . "$PACKAGE_VERSION$RELEASE_INFO
\n"); } $the_title .= "$t_date

" --- 1638,1642 ---- if ($PACKAGE_VERSION) { $the_title .= ('Release ' ! . "$PACKAGE_VERSION$RELEASE_INFO
\n"); } $the_title .= "$t_date

" *************** *** 1644,1648 **** } else { ! $the_title .= "\n

"; } if ($t_email) { --- 1646,1650 ---- } else { ! $the_title .= "\n

"; } if ($t_email) { *************** *** 1662,1666 **** $graphic .= " height=\"$TITLE_PAGE_GRAPHIC_HEIGHT\"" if ($TITLE_PAGE_GRAPHIC_HEIGHT); ! $graphic .= "\n src=\"$filename\">\n"; return $graphic; } --- 1664,1668 ---- $graphic .= " height=\"$TITLE_PAGE_GRAPHIC_HEIGHT\"" if ($TITLE_PAGE_GRAPHIC_HEIGHT); ! $graphic .= "\n src=\"$filename\" />\n"; return $graphic; } *************** *** 1670,1674 **** my $the_title = "\n"; if ($EXTERNAL_UP_LINK) { ! # This generates a element in the wrong place (the # body), but I don't see any other way to get this generated # at all. Browsers like Mozilla, that support navigation --- 1672,1676 ---- my $the_title = "\n"; if ($EXTERNAL_UP_LINK) { ! # This generates a element in the wrong place (the # body), but I don't see any other way to get this generated # at all. Browsers like Mozilla, that support navigation *************** *** 1677,1681 **** . ($EXTERNAL_UP_TITLE ? " title='$EXTERNAL_UP_TITLE'" : '') ! . ">\n"); } $the_title .= '
'; --- 1679,1683 ---- . ($EXTERNAL_UP_TITLE ? " title='$EXTERNAL_UP_TITLE'" : '') ! . " />\n"); } $the_title .= '
'; *************** *** 1898,1909 **** return '
' . "\n
$title$icon" ! . "\n
$text\n
" . $_; } return '
' . "\n
$title" ! . "\n
$text\n
" . $_; } --- 1900,1911 ---- return '
' . "\n
$title$icon
" ! . "\n
$text
\n
" . $_; } return '
' . "\n
$title
" ! . "\n
$text
\n
" . $_; } *************** *** 1916,1921 **** return '
' . "\n
$url$icon" ! . "\n
$text\n
" . $_; } --- 1918,1923 ---- return '
' . "\n
$url$icon
" ! . "\n
$text
\n
" . $_; } *************** *** 1924,1928 **** local($_) = @_; my $content = next_argument(); ! return '

' . $content . '

' . $_; } --- 1926,1930 ---- local($_) = @_; my $content = next_argument(); ! return '

' . $content . '

' . $_; } *************** *** 1933,1937 **** sub do_env_definitions{ ! return "
" . $_[0] . "
\n"; } --- 1935,1939 ---- sub do_env_definitions{ ! return '
' . $_[0] . "
\n"; } *************** *** 1941,1945 **** my($name, $aname, $ahref) = new_link_info(); # could easily add an index entry here... ! return "
$aname" . $term . "\n
" . $_; } --- 1943,1947 ---- my($name, $aname, $ahref) = new_link_info(); # could easily add an index entry here... ! return "
$aname" . $term . "
\n
" . $_; } From fdrake at users.sourceforge.net Mon Aug 4 21:48:31 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Aug 4 23:48:35 2003 Subject: [Python-checkins] python/dist/src/Doc/perl ltxmarkup.perl,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv17855 Modified Files: ltxmarkup.perl Log Message: better support for well-formed XHTML Index: ltxmarkup.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/ltxmarkup.perl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ltxmarkup.perl 3 Apr 2000 04:41:18 -0000 1.4 --- ltxmarkup.perl 5 Aug 2003 03:48:29 -0000 1.5 *************** *** 46,53 **** return "\n
" . "\n
\$macro" ! . "\n $params" . "\n
" . $_ ! . "
"; } --- 46,53 ---- return "\n
" . "\n
\$macro" ! . "\n $params
" . "\n
" . $_ ! . '
'; } *************** *** 59,66 **** . "\n
\begin{$env}" . "\n $params" ! . "\n
\end{$env}" . "\n
" . $_ ! . ""; } --- 59,66 ---- . "\n
\begin{$env}" . "\n $params" ! . "\n
\end{$env}
" . "\n
" . $_ ! . '
'; } From bcannon at users.sourceforge.net Mon Aug 4 21:52:06 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 4 23:52:09 2003 Subject: [Python-checkins] python/dist/src/Lib platform.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv18459/Lib Modified Files: platform.py Log Message: Touch-up to docstrings. Index: platform.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/platform.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** platform.py 29 Jun 2003 04:17:45 -0000 1.5 --- platform.py 5 Aug 2003 03:52:04 -0000 1.6 *************** *** 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). """ *************** *** 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 --- 545,550 ---- 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 *************** *** 596,600 **** def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')): ! """ Version interface for JPython. Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being --- 596,600 ---- 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. --- 816,822 ---- """ 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. """ --- 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 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 ''. --- 906,910 ---- 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. --- 1014,1019 ---- 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 Mon Aug 4 21:51:26 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 4 23:52:19 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libsocket.tex,1.76,1.77 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18409/Doc/lib Modified Files: libsocket.tex Log Message: Add note about fileno not being usable as a normal file descriptor in Windows. Index: libsocket.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** libsocket.tex 20 Jul 2003 01:10:15 -0000 1.76 --- libsocket.tex 5 Aug 2003 03:51:24 -0000 1.77 *************** *** 481,484 **** --- 481,488 ---- Return the socket's file descriptor (a small integer). This is useful with \function{select.select()}. + + Under Windows the small integer returned by this method cannot be used where + a file descriptor can be used (such as \function{os.fdopen()}). \UNIX{} does + not have this limitation. \end{methoddesc} From bcannon at users.sourceforge.net Mon Aug 4 22:02:51 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Aug 5 00:02:56 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv18944/Lib/test Modified Files: test_strptime.py Log Message: Re-introduce caching of TimeRE and compiled regexes with added thread-safety. Also remove now unnecessary property attributes for thread safety (no longer have lazy attributes) and code simplicity reasons. Timezone storage has been reworked to be simpler and more flexible. All values in LocaleTime instances are lower-cased. This is all done to simplify the module. The module now assumes nothing beyond the strptime function will be exposed for general use beyond providing functionality for strptime. Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_strptime.py 24 Jul 2003 06:27:17 -0000 1.19 --- test_strptime.py 5 Aug 2003 04:02:49 -0000 1.20 *************** *** 5,8 **** --- 5,9 ---- import locale import re + import sets from test import test_support *************** *** 15,19 **** class LocaleTime_Tests(unittest.TestCase): ! """Tests for _strptime.LocaleTime.""" def setUp(self): --- 16,25 ---- class LocaleTime_Tests(unittest.TestCase): ! """Tests for _strptime.LocaleTime. ! ! All values are lower-cased when stored in LocaleTime, so make sure to ! compare values after running ``lower`` on them. ! ! """ def setUp(self): *************** *** 28,32 **** """ ! strftime_output = time.strftime(directive, self.time_tuple) comparison = testing[self.time_tuple[tuple_position]] self.failUnless(strftime_output in testing, "%s: not found in tuple" % --- 34,38 ---- """ ! strftime_output = time.strftime(directive, self.time_tuple).lower() comparison = testing[self.time_tuple[tuple_position]] self.failUnless(strftime_output in testing, "%s: not found in tuple" % *************** *** 54,58 **** def test_am_pm(self): # Make sure AM/PM representation done properly ! strftime_output = time.strftime("%p", self.time_tuple) self.failUnless(strftime_output in self.LT_ins.am_pm, "AM/PM representation not in tuple") --- 60,64 ---- def test_am_pm(self): # Make sure AM/PM representation done properly ! strftime_output = time.strftime("%p", self.time_tuple).lower() self.failUnless(strftime_output in self.LT_ins.am_pm, "AM/PM representation not in tuple") *************** *** 64,70 **** def test_timezone(self): # Make sure timezone is correct ! timezone = time.strftime("%Z", self.time_tuple) if timezone: ! self.failUnless(timezone in self.LT_ins.timezone, "timezone %s not found in %s" % (timezone, self.LT_ins.timezone)) --- 70,77 ---- def test_timezone(self): # Make sure timezone is correct ! timezone = time.strftime("%Z", self.time_tuple).lower() if timezone: ! self.failUnless(timezone in self.LT_ins.timezone[0] or \ ! timezone in self.LT_ins.timezone[1], "timezone %s not found in %s" % (timezone, self.LT_ins.timezone)) *************** *** 90,94 **** magic_date), "LC_time incorrect") ! LT = _strptime.LocaleTime(am_pm=('','')) self.failUnless(LT.LC_time, "LocaleTime's LC directives cannot handle " "empty strings") --- 97,102 ---- magic_date), "LC_time incorrect") ! LT = _strptime.LocaleTime() ! LT.am_pm = ('', '') self.failUnless(LT.LC_time, "LocaleTime's LC directives cannot handle " "empty strings") *************** *** 99,140 **** self.failUnlessEqual(self.LT_ins.lang, _strptime._getlang()) - def test_by_hand_input(self): - # Test passed-in initialization value checks - self.failUnless(_strptime.LocaleTime(f_weekday=range(7)), - "Argument size check for f_weekday failed") - self.assertRaises(TypeError, _strptime.LocaleTime, f_weekday=range(8)) - self.assertRaises(TypeError, _strptime.LocaleTime, f_weekday=range(6)) - self.failUnless(_strptime.LocaleTime(a_weekday=range(7)), - "Argument size check for a_weekday failed") - self.assertRaises(TypeError, _strptime.LocaleTime, a_weekday=range(8)) - self.assertRaises(TypeError, _strptime.LocaleTime, a_weekday=range(6)) - self.failUnless(_strptime.LocaleTime(f_month=range(12)), - "Argument size check for f_month failed") - self.assertRaises(TypeError, _strptime.LocaleTime, f_month=range(11)) - self.assertRaises(TypeError, _strptime.LocaleTime, f_month=range(13)) - self.failUnless(len(_strptime.LocaleTime(f_month=range(12)).f_month) == 13, - "dummy value for f_month not added") - self.failUnless(_strptime.LocaleTime(a_month=range(12)), - "Argument size check for a_month failed") - self.assertRaises(TypeError, _strptime.LocaleTime, a_month=range(11)) - self.assertRaises(TypeError, _strptime.LocaleTime, a_month=range(13)) - self.failUnless(len(_strptime.LocaleTime(a_month=range(12)).a_month) == 13, - "dummy value for a_month not added") - self.failUnless(_strptime.LocaleTime(am_pm=range(2)), - "Argument size check for am_pm failed") - self.assertRaises(TypeError, _strptime.LocaleTime, am_pm=range(1)) - self.assertRaises(TypeError, _strptime.LocaleTime, am_pm=range(3)) - self.failUnless(_strptime.LocaleTime(timezone=range(2)), - "Argument size check for timezone failed") - self.assertRaises(TypeError, _strptime.LocaleTime, timezone=range(1)) - self.assertRaises(TypeError, _strptime.LocaleTime, timezone=range(3)) - - def test_unknowntimezone(self): - # Handle timezone set to ('','') properly. - # Fixes bug #661354 - locale_time = _strptime.LocaleTime(timezone=('','')) - self.failUnless("%Z" not in locale_time.LC_date, - "when timezone == ('',''), string.replace('','%Z') is " - "occuring") class TimeRETests(unittest.TestCase): --- 107,110 ---- *************** *** 146,164 **** self.locale_time = _strptime.LocaleTime() - def test_getitem(self): - # Make sure that __getitem__ works properly - self.failUnless(self.time_re['m'], - "Fetching 'm' directive (built-in) failed") - self.failUnless(self.time_re['b'], - "Fetching 'b' directive (built w/ __tupleToRE) failed") - for name in self.locale_time.a_month: - self.failUnless(self.time_re['b'].find(name) != -1, - "Not all abbreviated month names in regex") - self.failUnless(self.time_re['c'], - "Fetching 'c' directive (built w/ format) failed") - self.failUnless(self.time_re['c'].find('%') == -1, - "Conversion of 'c' directive failed; '%' found") - self.assertRaises(KeyError, self.time_re.__getitem__, '1') - def test_pattern(self): # Test TimeRE.pattern --- 116,119 ---- *************** *** 211,215 **** # Make sure when tuple or something has no values no regex is generated. # Fixes bug #661354 ! test_locale = _strptime.LocaleTime(timezone=('','')) self.failUnless(_strptime.TimeRE(test_locale).pattern("%Z") == '', "with timezone == ('',''), TimeRE().pattern('%Z') != ''") --- 166,171 ---- # Make sure when tuple or something has no values no regex is generated. # Fixes bug #661354 ! test_locale = _strptime.LocaleTime() ! test_locale.timezone = (sets.ImmutableSet(), sets.ImmutableSet()) self.failUnless(_strptime.TimeRE(test_locale).pattern("%Z") == '', "with timezone == ('',''), TimeRE().pattern('%Z') != ''") *************** *** 414,417 **** --- 370,410 ---- "Calculation of day of the week failed;" "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) + + + class CacheTests(unittest.TestCase): + """Test that caching works properly.""" + + def test_time_re_recreation(self): + # Make sure cache is recreated when current locale does not match what + # cached object was created with. + _strptime.strptime("10", "%d") + _strptime._TimeRE_cache.locale_time.lang = "Ni" + original_time_re = id(_strptime._TimeRE_cache) + _strptime.strptime("10", "%d") + self.failIfEqual(original_time_re, id(_strptime._TimeRE_cache)) + + def test_regex_cleanup(self): + # Make sure cached regexes are discarded when cache becomes "full". + try: + del _strptime._regex_cache['%d'] + except KeyError: + pass + bogus_key = 0 + while len(_strptime._regex_cache) <= _strptime._CACHE_MAX_SIZE: + _strptime._regex_cache[bogus_key] = None + bogus_key += 1 + _strptime.strptime("10", "%d") + self.failUnlessEqual(len(_strptime._regex_cache), 1) + + def test_new_localetime(self): + # A new LocaleTime instance should be created when a new TimeRE object + # is created. + locale_time_id = id(_strptime._TimeRE_cache.locale_time) + _strptime._TimeRE_cache.locale_time.lang = "Ni" + _strptime.strptime("10", "%d") + self.failIfEqual(locale_time_id, + id(_strptime._TimeRE_cache.locale_time)) + + def test_main(): test_support.run_unittest( *************** *** 423,426 **** --- 416,420 ---- JulianTests, CalculationTests, + CacheTests ) From bcannon at users.sourceforge.net Mon Aug 4 22:02:51 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Aug 5 00:02:58 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv18944/Lib Modified Files: _strptime.py Log Message: Re-introduce caching of TimeRE and compiled regexes with added thread-safety. Also remove now unnecessary property attributes for thread safety (no longer have lazy attributes) and code simplicity reasons. Timezone storage has been reworked to be simpler and more flexible. All values in LocaleTime instances are lower-cased. This is all done to simplify the module. The module now assumes nothing beyond the strptime function will be exposed for general use beyond providing functionality for strptime. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** _strptime.py 24 Jul 2003 20:02:28 -0000 1.23 --- _strptime.py 5 Aug 2003 04:02:49 -0000 1.24 *************** *** 2,8 **** CLASSES: ! LocaleTime -- Discovers and/or stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing ! time information as is returned by time.strftime() FUNCTIONS: --- 2,8 ---- CLASSES: ! LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing ! time information FUNCTIONS: *************** *** 10,16 **** strptime -- Calculates the time struct represented by the passed-in string - Requires Python 2.2.1 or higher (mainly because of the use of property()). - Can be used in Python 2.2 if the following line is added: - True = 1; False = 0 """ import time --- 10,13 ---- *************** *** 20,23 **** --- 17,25 ---- from re import IGNORECASE from datetime import date as datetime_date + from sets import ImmutableSet as sets_ImmutableSet + try: + from thread import allocate_lock as _thread_allocate_lock + except: + from dummy_thread import allocate_lock as _thread_allocate_lock __author__ = "Brett Cannon" *************** *** 33,42 **** """Stores and handles locale-specific information related to time. ! This is not thread-safe! Attributes are lazily calculated and no ! precaution is taken to check to see if the locale information has changed ! since the creation of the instance in use. ! ! ATTRIBUTES (all read-only after instance creation! Instance variables that ! store the values have mangled names): f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) --- 35,39 ---- """Stores and handles locale-specific information related to time. ! ATTRIBUTES: f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) *************** *** 50,110 **** LC_time -- format string for time representation (string) timezone -- daylight- and non-daylight-savings timezone representation ! (3-item list; code tacks on blank item at end for ! possible lack of timezone such as UTC) ! lang -- Language used by instance (string) """ ! def __init__(self, f_weekday=None, a_weekday=None, f_month=None, ! a_month=None, am_pm=None, LC_date_time=None, LC_time=None, ! LC_date=None, timezone=None, lang=None): ! """Optionally set attributes with passed-in values.""" ! if f_weekday is None: ! self.__f_weekday = None ! elif len(f_weekday) == 7: ! self.__f_weekday = list(f_weekday) ! else: ! raise TypeError("full weekday names must be a 7-item sequence") ! if a_weekday is None: ! self.__a_weekday = None ! elif len(a_weekday) == 7: ! self.__a_weekday = list(a_weekday) ! else: ! raise TypeError( ! "abbreviated weekday names must be a 7-item sequence") ! if f_month is None: ! self.__f_month = None ! elif len(f_month) == 12: ! self.__f_month = self.__pad(f_month, True) ! else: ! raise TypeError("full month names must be a 12-item sequence") ! if a_month is None: ! self.__a_month = None ! elif len(a_month) == 12: ! self.__a_month = self.__pad(a_month, True) ! else: ! raise TypeError( ! "abbreviated month names must be a 12-item sequence") ! if am_pm is None: ! self.__am_pm = None ! elif len(am_pm) == 2: ! self.__am_pm = am_pm ! else: ! raise TypeError("AM/PM representation must be a 2-item sequence") ! self.__LC_date_time = LC_date_time ! self.__LC_time = LC_time ! self.__LC_date = LC_date ! self.__timezone = timezone ! if timezone: ! if len(timezone) != 2: ! raise TypeError("timezone names must contain 2 items") ! else: ! self.__timezone = self.__pad(timezone, False) ! if lang: ! self.__lang = lang ! else: ! self.__lang = _getlang() def __pad(self, seq, front): ! # Add '' to seq to either front (is True), else the back. seq = list(seq) if front: --- 47,81 ---- LC_time -- format string for time representation (string) timezone -- daylight- and non-daylight-savings timezone representation ! (2-item list of sets) ! lang -- Language used by instance (2-item tuple) """ ! def __init__(self): ! """Set all attributes. ! ! Order of methods called matters for dependency reasons. ! ! The locale language is set at the offset and then checked again before ! exiting. This is to make sure that the attributes were not set with a ! mix of information from more than one locale. This would most likely ! happen when using threads where one thread calls a locale-dependent ! function while another thread changes the locale while the function in ! the other thread is still running. Proper coding would call for ! locks to prevent changing the locale while locale-dependent code is ! running. The check here is done in case someone does not think about ! doing this. ! ! """ ! self.lang = _getlang() ! self.__calc_weekday() ! self.__calc_month() ! self.__calc_am_pm() ! self.__calc_timezone() ! self.__calc_date_time() ! if _getlang() != self.lang: ! raise ValueError("locale changed during initialization") def __pad(self, seq, front): ! # Add '' to seq to either the front (is True), else the back. seq = list(seq) if front: *************** *** 114,223 **** return seq - def __set_nothing(self, stuff): - # Raise TypeError when trying to set an attribute. - raise TypeError("attribute does not support assignment") - - def __get_f_weekday(self): - # Fetch self.f_weekday. - if not self.__f_weekday: - self.__calc_weekday() - return self.__f_weekday - - def __get_a_weekday(self): - # Fetch self.a_weekday. - if not self.__a_weekday: - self.__calc_weekday() - return self.__a_weekday - - f_weekday = property(__get_f_weekday, __set_nothing, - doc="Full weekday names") - a_weekday = property(__get_a_weekday, __set_nothing, - doc="Abbreviated weekday names") - - def __get_f_month(self): - # Fetch self.f_month. - if not self.__f_month: - self.__calc_month() - return self.__f_month - - def __get_a_month(self): - # Fetch self.a_month. - if not self.__a_month: - self.__calc_month() - return self.__a_month - - f_month = property(__get_f_month, __set_nothing, - doc="Full month names (dummy value at index 0)") - a_month = property(__get_a_month, __set_nothing, - doc="Abbreviated month names (dummy value at index 0)") - - def __get_am_pm(self): - # Fetch self.am_pm. - if not self.__am_pm: - self.__calc_am_pm() - return self.__am_pm - - am_pm = property(__get_am_pm, __set_nothing, doc="AM/PM representation") - - def __get_timezone(self): - # Fetch self.timezone. - if not self.__timezone: - self.__calc_timezone() - return self.__timezone - - timezone = property(__get_timezone, __set_nothing, - doc="Timezone representation (dummy value at index 2)") - - def __get_LC_date_time(self): - # Fetch self.LC_date_time. - if not self.__LC_date_time: - self.__calc_date_time() - return self.__LC_date_time - - def __get_LC_date(self): - # Fetch self.LC_date. - if not self.__LC_date: - self.__calc_date_time() - return self.__LC_date - - def __get_LC_time(self): - # Fetch self.LC_time. - if not self.__LC_time: - self.__calc_date_time() - return self.__LC_time - - LC_date_time = property( - __get_LC_date_time, __set_nothing, - doc= - "Format string for locale's date/time representation ('%c' format)") - LC_date = property(__get_LC_date, __set_nothing, - doc="Format string for locale's date representation ('%x' format)") - LC_time = property(__get_LC_time, __set_nothing, - doc="Format string for locale's time representation ('%X' format)") - - lang = property(lambda self: self.__lang, __set_nothing, - doc="Language used for instance") - def __calc_weekday(self): ! # Set self.__a_weekday and self.__f_weekday using the calendar # module. ! a_weekday = [calendar.day_abbr[i] for i in range(7)] ! f_weekday = [calendar.day_name[i] for i in range(7)] ! if not self.__a_weekday: ! self.__a_weekday = a_weekday ! if not self.__f_weekday: ! self.__f_weekday = f_weekday def __calc_month(self): ! # Set self.__f_month and self.__a_month using the calendar module. ! a_month = [calendar.month_abbr[i] for i in range(13)] ! f_month = [calendar.month_name[i] for i in range(13)] ! if not self.__a_month: ! self.__a_month = a_month ! if not self.__f_month: ! self.__f_month = f_month def __calc_am_pm(self): ! # Set self.__am_pm by using time.strftime(). # The magic date (1999,3,17,hour,44,55,2,76,0) is not really that --- 85,105 ---- return seq def __calc_weekday(self): ! # Set self.a_weekday and self.f_weekday using the calendar # module. ! a_weekday = [calendar.day_abbr[i].lower() for i in range(7)] ! f_weekday = [calendar.day_name[i].lower() for i in range(7)] ! self.a_weekday = a_weekday ! self.f_weekday = f_weekday def __calc_month(self): ! # Set self.f_month and self.a_month using the calendar module. ! a_month = [calendar.month_abbr[i].lower() for i in range(13)] ! f_month = [calendar.month_name[i].lower() for i in range(13)] ! self.a_month = a_month ! self.f_month = f_month def __calc_am_pm(self): ! # Set self.am_pm by using time.strftime(). # The magic date (1999,3,17,hour,44,55,2,76,0) is not really that *************** *** 227,235 **** for hour in (01,22): time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) ! am_pm.append(time.strftime("%p", time_tuple)) ! self.__am_pm = am_pm def __calc_date_time(self): ! # Set self.__date_time, self.__date, & self.__time by using # time.strftime(). --- 109,117 ---- for hour in (01,22): time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0)) ! am_pm.append(time.strftime("%p", time_tuple).lower()) ! self.am_pm = am_pm def __calc_date_time(self): ! # Set self.date_time, self.date, & self.time by using # time.strftime(). *************** *** 240,258 **** time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) date_time = [None, None, None] ! date_time[0] = time.strftime("%c", time_tuple) ! date_time[1] = time.strftime("%x", time_tuple) ! date_time[2] = time.strftime("%X", time_tuple) ! for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): ! current_format = date_time[offset] ! for old, new in ( ! ('%', '%%'), (self.f_weekday[2], '%A'), (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), (self.a_month[3], '%b'), (self.am_pm[1], '%p'), - (self.timezone[0], '%Z'), (self.timezone[1], '%Z'), ('1999', '%Y'), ('99', '%y'), ('22', '%H'), ('44', '%M'), ('55', '%S'), ('76', '%j'), ('17', '%d'), ('03', '%m'), ('3', '%m'), # '3' needed for when no leading zero. ! ('2', '%w'), ('10', '%I')): # Must deal with possible lack of locale info # manifesting itself as the empty string (e.g., Swedish's --- 122,141 ---- time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0)) date_time = [None, None, None] ! date_time[0] = time.strftime("%c", time_tuple).lower() ! date_time[1] = time.strftime("%x", time_tuple).lower() ! date_time[2] = time.strftime("%X", time_tuple).lower() ! replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'), (self.f_month[3], '%B'), (self.a_weekday[2], '%a'), (self.a_month[3], '%b'), (self.am_pm[1], '%p'), ('1999', '%Y'), ('99', '%y'), ('22', '%H'), ('44', '%M'), ('55', '%S'), ('76', '%j'), ('17', '%d'), ('03', '%m'), ('3', '%m'), # '3' needed for when no leading zero. ! ('2', '%w'), ('10', '%I')] ! replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone ! for tz in tz_values]) ! for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')): ! current_format = date_time[offset] ! for old, new in replacement_pairs: # Must deal with possible lack of locale info # manifesting itself as the empty string (e.g., Swedish's *************** *** 267,291 **** U_W = '%W' date_time[offset] = current_format.replace('11', U_W) ! if not self.__LC_date_time: ! self.__LC_date_time = date_time[0] ! if not self.__LC_date: ! self.__LC_date = date_time[1] ! if not self.__LC_time: ! self.__LC_time = date_time[2] def __calc_timezone(self): ! # Set self.__timezone by using time.tzname. ! # ! # Empty string used for matching when timezone is not used/needed. try: time.tzset() except AttributeError: pass ! time_zones = ["UTC", "GMT"] if time.daylight: ! time_zones.extend(time.tzname) else: ! time_zones.append(time.tzname[0]) ! self.__timezone = self.__pad(time_zones, 0) --- 150,169 ---- U_W = '%W' date_time[offset] = current_format.replace('11', U_W) ! self.LC_date_time = date_time[0] ! self.LC_date = date_time[1] ! self.LC_time = date_time[2] def __calc_timezone(self): ! # Set self.timezone by using time.tzname. try: time.tzset() except AttributeError: pass ! no_saving = sets_ImmutableSet(["utc", "gmt", time.tzname[0].lower()]) if time.daylight: ! has_saving = sets_ImmutableSet([time.tzname[1].lower()]) else: ! has_saving = sets_ImmutableSet() ! self.timezone = (no_saving, has_saving) *************** *** 294,302 **** def __init__(self, locale_time=None): ! """Init inst with non-locale regexes and store LocaleTime object.""" ! #XXX: Does 'Y' need to worry about having less or more than 4 digits? base = super(TimeRE, self) base.__init__({ ! # The " \d" option is to make %c from ANSI C work 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", 'H': r"(?P2[0-3]|[0-1]\d|\d)", --- 172,187 ---- def __init__(self, locale_time=None): ! """Create keys/values. ! ! Order of execution is important for dependency reasons. ! ! """ ! if locale_time: ! self.locale_time = locale_time ! else: ! self.locale_time = LocaleTime() base = super(TimeRE, self) base.__init__({ ! # The " \d" part of the regex is to make %c from ANSI C work 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])", 'H': r"(?P2[0-3]|[0-1]\d|\d)", *************** *** 310,365 **** # W is set below by using 'U' 'y': r"(?P\d\d)", ! 'Y': r"(?P\d\d\d\d)"}) base.__setitem__('W', base.__getitem__('U')) ! if locale_time: ! self.locale_time = locale_time ! else: ! self.locale_time = LocaleTime() ! ! def __getitem__(self, fetch): ! """Try to fetch regex; if it does not exist, construct it.""" ! try: ! return super(TimeRE, self).__getitem__(fetch) ! except KeyError: ! constructors = { ! 'A': lambda: self.__seqToRE(self.locale_time.f_weekday, fetch), ! 'a': lambda: self.__seqToRE(self.locale_time.a_weekday, fetch), ! 'B': lambda: self.__seqToRE(self.locale_time.f_month[1:], ! fetch), ! 'b': lambda: self.__seqToRE(self.locale_time.a_month[1:], ! fetch), ! 'c': lambda: self.pattern(self.locale_time.LC_date_time), ! 'p': lambda: self.__seqToRE(self.locale_time.am_pm, fetch), ! 'x': lambda: self.pattern(self.locale_time.LC_date), ! 'X': lambda: self.pattern(self.locale_time.LC_time), ! 'Z': lambda: self.__seqToRE(self.locale_time.timezone, fetch), ! '%': lambda: '%', ! } ! if fetch in constructors: ! self[fetch] = constructors[fetch]() ! return self[fetch] ! else: ! raise def __seqToRE(self, to_convert, directive): ! """Convert a list to a regex string for matching a directive.""" ! def sorter(a, b): ! """Sort based on length. ! ! Done in case for some strange reason that names in the locale only ! differ by a suffix and thus want the name with the suffix to match ! first. ! """ ! try: ! a_length = len(a) ! except TypeError: ! a_length = 0 ! try: ! b_length = len(b) ! except TypeError: ! b_length = 0 ! return cmp(b_length, a_length) ! ! to_convert = to_convert[:] # Don't want to change value in-place. for value in to_convert: if value != '': --- 195,224 ---- # W is set below by using 'U' 'y': r"(?P\d\d)", ! #XXX: Does 'Y' need to worry about having less or more than ! # 4 digits? ! 'Y': r"(?P\d\d\d\d)", ! 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'), ! 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'), ! 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'), ! 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'), ! 'p': self.__seqToRE(self.locale_time.am_pm, 'p'), ! 'Z': self.__seqToRE([tz for tz_names in self.locale_time.timezone ! for tz in tz_names], ! 'Z'), ! '%': '%'}) base.__setitem__('W', base.__getitem__('U')) ! base.__setitem__('c', self.pattern(self.locale_time.LC_date_time)) ! base.__setitem__('x', self.pattern(self.locale_time.LC_date)) ! base.__setitem__('X', self.pattern(self.locale_time.LC_time)) 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: if value != '': *************** *** 367,371 **** else: return '' ! to_convert.sort(sorter) regex = '|'.join(to_convert) regex = '(?P<%s>%s' % (directive, regex) --- 226,233 ---- 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) *************** *** 373,377 **** def pattern(self, format): ! """Return re pattern for the format string. Need to make sure that any characters that might be interpreted as --- 235,239 ---- def pattern(self, format): ! """Return regex pattern for the format string. Need to make sure that any characters that might be interpreted as *************** *** 398,407 **** return re_compile(self.pattern(format), IGNORECASE) def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" ! time_re = TimeRE() ! locale_time = time_re.locale_time ! format_regex = time_re.compile(format) found = format_regex.match(data_string) if not found: --- 260,287 ---- return re_compile(self.pattern(format), IGNORECASE) + _cache_lock = _thread_allocate_lock() + # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock + # first! + _TimeRE_cache = TimeRE() + _CACHE_MAX_SIZE = 5 + _regex_cache = {} def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" ! global _TimeRE_cache ! _cache_lock.acquire() ! try: ! time_re = _TimeRE_cache ! locale_time = time_re.locale_time ! if _getlang() != locale_time.lang: ! _TimeRE_cache = TimeRE() ! if len(_regex_cache) > _CACHE_MAX_SIZE: ! _regex_cache.clear() ! format_regex = _regex_cache.get(format) ! if not format_regex: ! format_regex = time_re.compile(format) ! _regex_cache[format] = format_regex ! finally: ! _cache_lock.release() found = format_regex.match(data_string) if not found: *************** *** 433,439 **** month = int(found_dict['m']) elif group_key == 'B': ! month = _insensitiveindex(locale_time.f_month, found_dict['B']) elif group_key == 'b': ! month = _insensitiveindex(locale_time.a_month, found_dict['b']) elif group_key == 'd': day = int(found_dict['d']) --- 313,319 ---- month = int(found_dict['m']) elif group_key == 'B': ! month = locale_time.f_month.index(found_dict['B'].lower()) elif group_key == 'b': ! month = locale_time.a_month.index(found_dict['b'].lower()) elif group_key == 'd': day = int(found_dict['d']) *************** *** 444,448 **** ampm = found_dict.get('p', '').lower() # If there was no AM/PM indicator, we'll treat this like AM ! if ampm in ('', locale_time.am_pm[0].lower()): # We're in AM so the hour is correct unless we're # looking at 12 midnight. --- 324,328 ---- ampm = found_dict.get('p', '').lower() # If there was no AM/PM indicator, we'll treat this like AM ! if ampm in ('', locale_time.am_pm[0]): # We're in AM so the hour is correct unless we're # looking at 12 midnight. *************** *** 450,454 **** if hour == 12: hour = 0 ! elif ampm == locale_time.am_pm[1].lower(): # We're in PM so we need to add 12 to the hour unless # we're looking at 12 noon. --- 330,334 ---- if hour == 12: hour = 0 ! elif ampm == locale_time.am_pm[1]: # We're in PM so we need to add 12 to the hour unless # we're looking at 12 noon. *************** *** 461,469 **** second = int(found_dict['S']) elif group_key == 'A': ! weekday = _insensitiveindex(locale_time.f_weekday, ! found_dict['A']) elif group_key == 'a': ! weekday = _insensitiveindex(locale_time.a_weekday, ! found_dict['a']) elif group_key == 'w': weekday = int(found_dict['w']) --- 341,347 ---- second = int(found_dict['S']) elif group_key == 'A': ! weekday = locale_time.f_weekday.index(found_dict['A'].lower()) elif group_key == 'a': ! weekday = locale_time.a_weekday.index(found_dict['a'].lower()) elif group_key == 'w': weekday = int(found_dict['w']) *************** *** 482,493 **** pass #Deals with bad locale setup where timezone info is # the same; first found on FreeBSD 4.4. ! elif found_zone in ("utc", "gmt"): ! tz = 0 ! elif locale_time.timezone[2].lower() == found_zone: ! tz = 0 ! elif time.daylight and \ ! locale_time.timezone[3].lower() == found_zone: ! tz = 1 ! # Cannot pre-calculate datetime_date() since can change in Julian #calculation and thus could have different value for the day of the week --- 360,367 ---- pass #Deals with bad locale setup where timezone info is # the same; first found on FreeBSD 4.4. ! else: ! for value, tz_values in enumerate(locale_time.timezone): ! if found_zone in tz_values: ! tz = value # Cannot pre-calculate datetime_date() since can change in Julian #calculation and thus could have different value for the day of the week *************** *** 508,522 **** hour, minute, second, weekday, julian, tz)) - - def _insensitiveindex(lst, findme): - # Perform a case-insensitive index search. - - #XXX : If LocaleTime is not exposed, then consider removing this and - # just lowercase when LocaleTime sets its vars and lowercasing - # search values. - findme = findme.lower() - for key,item in enumerate(lst): - if item.lower() == findme: - return key - else: - raise ValueError("value not in list") --- 382,383 ---- From fdrake at users.sourceforge.net Mon Aug 4 23:00:25 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Aug 5 01:00:28 2003 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl,1.138,1.139 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv26630 Modified Files: python.perl Log Message: init_myformat(): None of the "mark" values can be empty strings, or LaTeX2HTML feels free to remove a surrounding element that contains no other content. Since such an element is typically a named anchor used for hyperlinking, they should not be removed. Unfortunatley, making sure these marks are non-empty is the most direct way of avoiding this behavior. Thanks to Dave Kuhlman for tracking this down; this was some excellent detective work! Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** python.perl 5 Aug 2003 03:45:37 -0000 1.138 --- python.perl 5 Aug 2003 05:00:23 -0000 1.139 *************** *** 720,726 **** sub init_myformat(){ ! $anchor_invisible_mark = ' '; ! $anchor_invisible_mark2 = ''; ! $anchor_mark = ''; $icons{'anchor_mark'} = ''; } --- 720,733 ---- sub init_myformat(){ ! # These markers must be non-empty or the main latex2html script ! # may remove a surrounding element that has not other content as ! # "extraneous"; this ensures these elements (usually hyperlink ! # targets) are not removed improperly. We use comments since ! # there's no meaningful actual content. ! # Thanks to Dave Kuhlman for figuring why some named anchors were ! # being lost. ! $anchor_invisible_mark = ''; ! $anchor_invisible_mark2 = ''; ! $anchor_mark = ''; $icons{'anchor_mark'} = ''; } From loewis at users.sourceforge.net Mon Aug 4 23:51:22 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:51:26 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib IOBinding.py, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv820/Lib/idlelib Modified Files: IOBinding.py Log Message: Make sure eol_convention is an ASCII string. Fixes #774680. Will backport to 2.3. Index: IOBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/IOBinding.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** IOBinding.py 14 Jun 2003 17:56:25 -0000 1.19 --- IOBinding.py 5 Aug 2003 05:51:20 -0000 1.20 *************** *** 253,256 **** --- 253,259 ---- if firsteol: self.eol_convention = firsteol.group(0) + if isinstance(self.eol_convention, unicode): + # Make sure it is an ASCII string + self.eol_convention = self.eol_convention.encode("ascii") chars = self.eol_re.sub(r"\n", chars) From loewis at users.sourceforge.net Mon Aug 4 23:52:20 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:52:24 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib IOBinding.py, 1.19, 1.19.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv937 Modified Files: Tag: release23-maint IOBinding.py Log Message: Make sure eol_convention is an ASCII string. Fixes #774680. Index: IOBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/IOBinding.py,v retrieving revision 1.19 retrieving revision 1.19.8.1 diff -C2 -d -r1.19 -r1.19.8.1 *** IOBinding.py 14 Jun 2003 17:56:25 -0000 1.19 --- IOBinding.py 5 Aug 2003 05:52:18 -0000 1.19.8.1 *************** *** 253,256 **** --- 253,259 ---- if firsteol: self.eol_convention = firsteol.group(0) + if isinstance(self.eol_convention, unicode): + # Make sure it is an ASCII string + self.eol_convention = self.eol_convention.encode("ascii") chars = self.eol_re.sub(r"\n", chars) From loewis at users.sourceforge.net Mon Aug 4 23:54:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:54:21 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libgettext.tex,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1149 Modified Files: libgettext.tex Log Message: Patch #781126: Fix markup for add_fallback. Will backport to 2.3. Index: libgettext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgettext.tex,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libgettext.tex 22 Jul 2003 00:49:11 -0000 1.20 --- libgettext.tex 5 Aug 2003 05:54:15 -0000 1.21 *************** *** 217,221 **** \end{methoddesc} ! \begin{methoddesc}{NullTranslations}{add_fallback}{fallback} Add \var{fallback} as the fallback object for the current translation object. A translation object should consult the fallback if it cannot --- 217,221 ---- \end{methoddesc} ! \begin{methoddesc}[NullTranslations]{add_fallback}{fallback} Add \var{fallback} as the fallback object for the current translation object. A translation object should consult the fallback if it cannot From loewis at users.sourceforge.net Mon Aug 4 23:54:50 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:54:52 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libgettext.tex, 1.20, 1.20.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1278 Modified Files: Tag: release23-maint libgettext.tex Log Message: Patch #781126: Fix markup for add_fallback. Index: libgettext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgettext.tex,v retrieving revision 1.20 retrieving revision 1.20.6.1 diff -C2 -d -r1.20 -r1.20.6.1 *** libgettext.tex 22 Jul 2003 00:49:11 -0000 1.20 --- libgettext.tex 5 Aug 2003 05:54:48 -0000 1.20.6.1 *************** *** 217,221 **** \end{methoddesc} ! \begin{methoddesc}{NullTranslations}{add_fallback}{fallback} Add \var{fallback} as the fallback object for the current translation object. A translation object should consult the fallback if it cannot --- 217,221 ---- \end{methoddesc} ! \begin{methoddesc}[NullTranslations]{add_fallback}{fallback} Add \var{fallback} as the fallback object for the current translation object. A translation object should consult the fallback if it cannot From loewis at users.sourceforge.net Mon Aug 4 23:59:15 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:59:19 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_normalization.py, 1.7, 1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1881/Lib/test Modified Files: test_normalization.py Log Message: Correct URL of normalization file. Fixes #781065. Will backport to 2.3. Index: test_normalization.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_normalization.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_normalization.py 10 May 2003 07:36:55 -0000 1.7 --- test_normalization.py 5 Aug 2003 05:59:13 -0000 1.8 *************** *** 4,8 **** from unicodedata import normalize ! TESTDATAFILE = "NormalizationTest" + os.extsep + "txt" # This search allows using a build directory just inside the source --- 4,8 ---- from unicodedata import normalize ! TESTDATAFILE = "NormalizationTest-3.2.0" + os.extsep + "txt" # This search allows using a build directory just inside the source *************** *** 43,47 **** if skip_expected: raise TestSkipped(TESTDATAFILE + " not found, download from " + ! "http://www.unicode.org/Public/UNIDATA/" + TESTDATAFILE) part1_data = {} --- 43,47 ---- if skip_expected: raise TestSkipped(TESTDATAFILE + " not found, download from " + ! "http://www.unicode.org/Public/3.2-Update/" + TESTDATAFILE) part1_data = {} From loewis at users.sourceforge.net Mon Aug 4 23:59:49 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 01:59:53 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_normalization.py, 1.7, 1.7.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1987/Lib/test Modified Files: Tag: release23-maint test_normalization.py Log Message: Correct URL for normalization file. Fixes #781065. Index: test_normalization.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_normalization.py,v retrieving revision 1.7 retrieving revision 1.7.8.1 diff -C2 -d -r1.7 -r1.7.8.1 *** test_normalization.py 10 May 2003 07:36:55 -0000 1.7 --- test_normalization.py 5 Aug 2003 05:59:47 -0000 1.7.8.1 *************** *** 4,8 **** from unicodedata import normalize ! TESTDATAFILE = "NormalizationTest" + os.extsep + "txt" # This search allows using a build directory just inside the source --- 4,8 ---- from unicodedata import normalize ! TESTDATAFILE = "NormalizationTest-3.2.0" + os.extsep + "txt" # This search allows using a build directory just inside the source *************** *** 43,47 **** if skip_expected: raise TestSkipped(TESTDATAFILE + " not found, download from " + ! "http://www.unicode.org/Public/UNIDATA/" + TESTDATAFILE) part1_data = {} --- 43,47 ---- if skip_expected: raise TestSkipped(TESTDATAFILE + " not found, download from " + ! "http://www.unicode.org/Public/3.2-Update/" + TESTDATAFILE) part1_data = {} From loewis at users.sourceforge.net Tue Aug 5 00:06:20 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:06:23 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.2,1.831.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv3184/Misc Modified Files: Tag: release23-maint NEWS Log Message: List recently-fixed bugs. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.2 retrieving revision 1.831.4.3 diff -C2 -d -r1.831.4.2 -r1.831.4.3 *** NEWS 4 Aug 2003 22:53:49 -0000 1.831.4.2 --- NEWS 5 Aug 2003 06:06:18 -0000 1.831.4.3 *************** *** 19,24 **** --- 19,30 ---- ------- + - Bug #781065 was fixed: test_normalization is updated to the current + URL of the Unicode 3.2 normalization file. + IDLE ---- + + - Bug #774680 was fixed: IDLE now does not fail to save the file anymore + if the Tk buffer is not a Unicode string, yet eol_convention is. Build From loewis at users.sourceforge.net Tue Aug 5 00:19:49 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:19:52 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py, 1.84, 1.85 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv4991/Lib/test Modified Files: test_unicode.py Log Message: Support trailing dots in DNS names. Fixes #782510. Will backport to 2.3. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** test_unicode.py 18 May 2003 12:31:08 -0000 1.84 --- test_unicode.py 5 Aug 2003 06:19:47 -0000 1.85 *************** *** 525,528 **** --- 525,532 ---- # UTF8_ERROR cases in PyUnicode_DecodeUTF8 + def test_codecs_idna(self): + # Test whether trailing dot is preserved + self.assertEqual(u"www.python.org.".encode("idna"), "www.python.org.") + def test_codecs_errors(self): # Error handling (encoding) From loewis at users.sourceforge.net Tue Aug 5 00:19:49 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:19:54 2003 Subject: [Python-checkins] python/dist/src/Lib/encodings idna.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv4991/Lib/encodings Modified Files: idna.py Log Message: Support trailing dots in DNS names. Fixes #782510. Will backport to 2.3. Index: idna.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/idna.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** idna.py 24 Apr 2003 16:02:49 -0000 1.2 --- idna.py 5 Aug 2003 06:19:47 -0000 1.3 *************** *** 151,158 **** result = [] ! for label in dots.split(input): result.append(ToASCII(label)) # Join with U+002E ! return ".".join(result), len(input) def decode(self,input,errors='strict'): --- 151,164 ---- result = [] ! labels = dots.split(input) ! if labels and len(labels[-1])==0: ! trailing_dot = '.' ! del labels[-1] ! else: ! trailing_dot = '' ! for label in labels: result.append(ToASCII(label)) # Join with U+002E ! return ".".join(result)+trailing_dot, len(input) def decode(self,input,errors='strict'): *************** *** 169,177 **** labels = input.split(".") result = [] for label in labels: result.append(ToUnicode(label)) ! return u".".join(result), len(input) class StreamWriter(Codec,codecs.StreamWriter): --- 175,189 ---- labels = input.split(".") + if labels and len(labels[-1]) == 0: + trailing_dot = u'.' + del labels[-1] + else: + trailing_dot = u'' + result = [] for label in labels: result.append(ToUnicode(label)) ! return u".".join(result)+trailing_dot, len(input) class StreamWriter(Codec,codecs.StreamWriter): From loewis at users.sourceforge.net Tue Aug 5 00:20:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:20:28 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py, 1.84, 1.84.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv5231/Lib/test Modified Files: Tag: release23-maint test_unicode.py Log Message: Support trailing dots in DNS names. Fixes #782510. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.84 retrieving revision 1.84.8.1 diff -C2 -d -r1.84 -r1.84.8.1 *** test_unicode.py 18 May 2003 12:31:08 -0000 1.84 --- test_unicode.py 5 Aug 2003 06:20:23 -0000 1.84.8.1 *************** *** 525,528 **** --- 525,532 ---- # UTF8_ERROR cases in PyUnicode_DecodeUTF8 + def test_codecs_idna(self): + # Test whether trailing dot is preserved + self.assertEqual(u"www.python.org.".encode("idna"), "www.python.org.") + def test_codecs_errors(self): # Error handling (encoding) From loewis at users.sourceforge.net Tue Aug 5 00:20:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:20:30 2003 Subject: [Python-checkins] python/dist/src/Lib/encodings idna.py, 1.2, 1.2.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv5231/Lib/encodings Modified Files: Tag: release23-maint idna.py Log Message: Support trailing dots in DNS names. Fixes #782510. Index: idna.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/idna.py,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** idna.py 24 Apr 2003 16:02:49 -0000 1.2 --- idna.py 5 Aug 2003 06:20:23 -0000 1.2.12.1 *************** *** 151,158 **** result = [] ! for label in dots.split(input): result.append(ToASCII(label)) # Join with U+002E ! return ".".join(result), len(input) def decode(self,input,errors='strict'): --- 151,164 ---- result = [] ! labels = dots.split(input) ! if labels and len(labels[-1])==0: ! trailing_dot = '.' ! del labels[-1] ! else: ! trailing_dot = '' ! for label in labels: result.append(ToASCII(label)) # Join with U+002E ! return ".".join(result)+trailing_dot, len(input) def decode(self,input,errors='strict'): *************** *** 169,177 **** labels = input.split(".") result = [] for label in labels: result.append(ToUnicode(label)) ! return u".".join(result), len(input) class StreamWriter(Codec,codecs.StreamWriter): --- 175,189 ---- labels = input.split(".") + if labels and len(labels[-1]) == 0: + trailing_dot = u'.' + del labels[-1] + else: + trailing_dot = u'' + result = [] for label in labels: result.append(ToUnicode(label)) ! return u".".join(result)+trailing_dot, len(input) class StreamWriter(Codec,codecs.StreamWriter): From loewis at users.sourceforge.net Tue Aug 5 00:20:26 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:20:34 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.3,1.831.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv5231/Misc Modified Files: Tag: release23-maint NEWS Log Message: Support trailing dots in DNS names. Fixes #782510. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.3 retrieving revision 1.831.4.4 diff -C2 -d -r1.831.4.3 -r1.831.4.4 *** NEWS 5 Aug 2003 06:06:18 -0000 1.831.4.3 --- NEWS 5 Aug 2003 06:20:23 -0000 1.831.4.4 *************** *** 19,23 **** ------- ! - Bug #781065 was fixed: test_normalization is updated to the current URL of the Unicode 3.2 normalization file. --- 19,23 ---- ------- ! - Bug #781065: test_normalization is updated to the current URL of the Unicode 3.2 normalization file. *************** *** 25,30 **** ---- ! - Bug #774680 was fixed: IDLE now does not fail to save the file anymore if the Tk buffer is not a Unicode string, yet eol_convention is. Build --- 25,33 ---- ---- ! - Bug #774680: IDLE now does not fail to save the file anymore if the Tk buffer is not a Unicode string, yet eol_convention is. + + - Bug #782510: The idna codec would fail to support names with a + trailing full-stop. Build From loewis at users.sourceforge.net Tue Aug 5 00:25:08 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:25:12 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271, 1.272 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv5991/Modules Modified Files: socketmodule.c Log Message: Patch #781722: Reject AF_INET6 if IPv6 is disabled. Will backport to 2.3. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** socketmodule.c 17 Jul 2003 16:58:48 -0000 1.271 --- socketmodule.c 5 Aug 2003 06:25:06 -0000 1.272 *************** *** 2963,2966 **** --- 2963,2974 ---- } + #ifndef ENABLE_IPV6 + if(af == AF_INET6) { + PyErr_SetString(socket_error, + "can't use AF_INET6, IPv6 is disabled"); + return NULL; + } + #endif + retval = inet_pton(af, ip, packed); if (retval < 0) { From loewis at users.sourceforge.net Tue Aug 5 00:26:48 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:26:52 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.4,1.831.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv6316/Misc Modified Files: Tag: release23-maint NEWS Log Message: Patch #781722: Reject AF_INET6 if IPv6 is disabled. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.4 retrieving revision 1.831.4.5 diff -C2 -d -r1.831.4.4 -r1.831.4.5 *** NEWS 5 Aug 2003 06:20:23 -0000 1.831.4.4 --- NEWS 5 Aug 2003 06:26:32 -0000 1.831.4.5 *************** *** 16,19 **** --- 16,22 ---- ----------------- + - Patch #781722: Gracefully reject AF_INET6 in socket.inet_pton + if IPv6 is disabled. + Library ------- From loewis at users.sourceforge.net Tue Aug 5 00:26:48 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:26:54 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271, 1.271.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv6316/Modules Modified Files: Tag: release23-maint socketmodule.c Log Message: Patch #781722: Reject AF_INET6 if IPv6 is disabled. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271 retrieving revision 1.271.6.1 diff -C2 -d -r1.271 -r1.271.6.1 *** socketmodule.c 17 Jul 2003 16:58:48 -0000 1.271 --- socketmodule.c 5 Aug 2003 06:26:46 -0000 1.271.6.1 *************** *** 2963,2966 **** --- 2963,2974 ---- } + #ifndef ENABLE_IPV6 + if(af == AF_INET6) { + PyErr_SetString(socket_error, + "can't use AF_INET6, IPv6 is disabled"); + return NULL; + } + #endif + retval = inet_pton(af, ip, packed); if (retval < 0) { From bcannon at users.sourceforge.net Tue Aug 5 00:27:06 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Tue Aug 5 02:27:09 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.834,1.835 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv6403/Misc Modified Files: NEWS Log Message: Mention caching and better thread-safety for Lib/_strptime.py Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.834 retrieving revision 1.835 diff -C2 -d -r1.834 -r1.835 *** NEWS 2 Aug 2003 07:42:55 -0000 1.834 --- NEWS 5 Aug 2003 06:27:04 -0000 1.835 *************** *** 22,25 **** --- 22,29 ---- ------- + - _strptime.py now has a behind-the-scense caching mechanism for the most + recent TimeRE instance used along with the last five unique directive + patterns. The overall module was also made more thread-safe. + Tools/Demos ----------- From loewis at users.sourceforge.net Tue Aug 5 00:30:47 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Tue Aug 5 02:30:52 2003 Subject: [Python-checkins] python/dist/src/Misc/RPM python-2.2.spec, 1.1.2.5, 1.1.2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Misc/RPM In directory sc8-pr-cvs1:/tmp/cvs-serv7003 Modified Files: Tag: release22-maint python-2.2.spec Log Message: Patch #772696: Delete .cvsignore files. Index: python-2.2.spec =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/RPM/Attic/python-2.2.spec,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** python-2.2.spec 13 Jun 2003 19:30:53 -0000 1.1.2.5 --- python-2.2.spec 5 Aug 2003 06:30:45 -0000 1.1.2.6 *************** *** 27,31 **** %define name python %define version 2.2.3 ! %define release 1 %define __prefix /usr %define libvers %(echo "%{version}" | awk -F. '{ printf "%s.%s", $1, $2 }') --- 27,31 ---- %define name python %define version 2.2.3 ! %define release 2 %define __prefix /usr %define libvers %(echo "%{version}" | awk -F. '{ printf "%s.%s", $1, $2 }') *************** *** 122,125 **** --- 122,130 ---- %changelog + * Wed Jul 16 2003 Sean Reifschneider + [Release 2.2.3-2] + - Removing .cvsignore files in the build, so that they don't cause problems + with the packaged file list. Reported by David Hutchinson. + * Sun Oct 06 2002 Sean Reifschneider [Release 2.2.2b1-1] *************** *** 201,204 **** --- 206,212 ---- ./configure %{ipv6} %{pymalloc} --prefix=%{__prefix} make + + # remove .cvsignore files + find . -name .cvsignore | xargs rm -f # fix paths From anthonybaxter at users.sourceforge.net Tue Aug 5 00:33:59 2003 From: anthonybaxter at users.sourceforge.net (anthonybaxter@users.sourceforge.net) Date: Tue Aug 5 02:34:01 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.835,1.836 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv7350 Modified Files: NEWS Log Message: forgot to commit this - note about the signal module SIGRT(MIN,MAX) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.835 retrieving revision 1.836 diff -C2 -d -r1.835 -r1.836 *** NEWS 5 Aug 2003 06:27:04 -0000 1.835 --- NEWS 5 Aug 2003 06:33:56 -0000 1.836 *************** *** 19,22 **** --- 19,24 ---- ----------------- + - The signal module now exposes SIGRTMIN and SIGRTMAX (if available). + Library ------- From rhettinger at users.sourceforge.net Tue Aug 5 05:24:02 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Aug 5 07:24:05 2003 Subject: [Python-checkins] python/dist/src/Modules arraymodule.c,2.90,2.91 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20212 Modified Files: arraymodule.c Log Message: SF bug #782369: Massive memory leak in array module Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem. Added missing NULL check. Clarified code by converting an "if" to an "else if". Will backport to 2.3. Index: arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.90 retrieving revision 2.91 diff -C2 -d -r2.90 -r2.91 *** arraymodule.c 23 May 2003 10:01:07 -0000 2.90 --- arraymodule.c 5 Aug 2003 11:23:59 -0000 2.91 *************** *** 1759,1769 **** PyObject *v = PySequence_GetItem(initial, i); if (setarrayitem(a, i, v) != 0) { Py_DECREF(a); return NULL; } } ! } ! if (initial != NULL && PyString_Check(initial)) { PyObject *t_initial = Py_BuildValue("(O)", initial); --- 1759,1774 ---- PyObject *v = PySequence_GetItem(initial, i); + if (v == NULL) { + Py_DECREF(a); + return NULL; + } if (setarrayitem(a, i, v) != 0) { + Py_DECREF(v); Py_DECREF(a); return NULL; } + Py_DECREF(v); } ! } else if (initial != NULL && PyString_Check(initial)) { PyObject *t_initial = Py_BuildValue("(O)", initial); From rhettinger at users.sourceforge.net Tue Aug 5 05:40:24 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Aug 5 07:40:27 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libfuture.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22999 Modified Files: libfuture.tex Log Message: SF patch #782810: typo in libfuture.tex (Contributed by George Yoshida) Index: libfuture.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuture.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** libfuture.tex 28 May 2003 11:57:52 -0000 1.1 --- libfuture.tex 5 Aug 2003 11:40:21 -0000 1.2 *************** *** 24,28 **** \end{itemize} ! Each statment in \file{__future__.py} is of the form: \begin{verbatim} --- 24,28 ---- \end{itemize} ! Each statement in \file{__future__.py} is of the form: \begin{verbatim} From rhettinger at users.sourceforge.net Tue Aug 5 06:23:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Aug 5 08:23:24 2003 Subject: [Python-checkins] python/dist/src/Doc/lib librandom.tex,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30058/Doc/lib Modified Files: librandom.tex Log Message: Removed deprecated functions Index: librandom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librandom.tex,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** librandom.tex 29 Dec 2002 23:03:38 -0000 1.33 --- librandom.tex 5 Aug 2003 12:23:19 -0000 1.34 *************** *** 169,184 **** \end{funcdesc} - \begin{funcdesc}{cunifvariate}{mean, arc} - Circular uniform distribution. \var{mean} is the mean angle, and - \var{arc} is the range of the distribution, centered around the mean - angle. Both values must be expressed in radians, and can range - between 0 and \emph{pi}. Returned values range between - \code{\var{mean} - \var{arc}/2} and \code{\var{mean} + - \var{arc}/2} and are normalized to between 0 and \emph{pi}. - - \deprecated{2.3}{Instead, use \code{(\var{mean} + \var{arc} * - (random.random() - 0.5)) \% math.pi}.} - \end{funcdesc} - \begin{funcdesc}{expovariate}{lambd} Exponential distribution. \var{lambd} is 1.0 divided by the desired --- 169,172 ---- From rhettinger at users.sourceforge.net Tue Aug 5 06:23:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Aug 5 08:23:28 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv30058/Lib Modified Files: random.py Log Message: Removed deprecated functions Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** random.py 24 Jun 2003 20:29:04 -0000 1.51 --- random.py 5 Aug 2003 12:23:18 -0000 1.52 *************** *** 46,51 **** __all__ = ["Random","seed","random","uniform","randint","choice","sample", "randrange","shuffle","normalvariate","lognormvariate", ! "cunifvariate","expovariate","vonmisesvariate","gammavariate", ! "stdgamma","gauss","betavariate","paretovariate","weibullvariate", "getstate","setstate","jumpahead"] --- 46,51 ---- __all__ = ["Random","seed","random","uniform","randint","choice","sample", "randrange","shuffle","normalvariate","lognormvariate", ! "expovariate","vonmisesvariate","gammavariate", ! "gauss","betavariate","paretovariate","weibullvariate", "getstate","setstate","jumpahead"] *************** *** 309,335 **** return _exp(self.normalvariate(mu, sigma)) - ## -------------------- circular uniform -------------------- - - def cunifvariate(self, mean, arc): - """Circular uniform distribution. - - mean is the mean angle, and arc is the range of the distribution, - centered around the mean angle. Both values must be expressed in - radians. Returned values range between mean - arc/2 and - mean + arc/2 and are normalized to between 0 and pi. - - Deprecated in version 2.3. Use: - (mean + arc * (Random.random() - 0.5)) % Math.pi - - """ - # mean: mean angle (in radians between 0 and pi) - # arc: range of distribution (in radians between 0 and pi) - import warnings - warnings.warn("The cunifvariate function is deprecated; Use (mean " - "+ arc * (Random.random() - 0.5)) % Math.pi instead", - DeprecationWarning) - - return (mean + arc * (self.random() - 0.5)) % _pi - ## -------------------- exponential distribution -------------------- --- 309,312 ---- *************** *** 466,490 **** return x * beta - - def stdgamma(self, alpha, ainv, bbb, ccc): - # This method was (and shall remain) undocumented. - # This method is deprecated - # for the following reasons: - # 1. Returns same as .gammavariate(alpha, 1.0) - # 2. Requires caller to provide 3 extra arguments - # that are functions of alpha anyway - # 3. Can't be used for alpha < 0.5 - - # ainv = sqrt(2 * alpha - 1) - # bbb = alpha - log(4) - # ccc = alpha + ainv - import warnings - warnings.warn("The stdgamma function is deprecated; " - "use gammavariate() instead", - DeprecationWarning) - return self.gammavariate(alpha, 1.0) - - - ## -------------------- Gauss (faster alternative) -------------------- --- 443,446 ---- *************** *** 756,760 **** _test_generator(N, 'normalvariate(0.0, 1.0)') _test_generator(N, 'lognormvariate(0.0, 1.0)') - _test_generator(N, 'cunifvariate(0.0, 1.0)') _test_generator(N, 'vonmisesvariate(0.0, 1.0)') _test_generator(N, 'gammavariate(0.01, 1.0)') --- 712,715 ---- *************** *** 787,795 **** normalvariate = _inst.normalvariate lognormvariate = _inst.lognormvariate - cunifvariate = _inst.cunifvariate expovariate = _inst.expovariate vonmisesvariate = _inst.vonmisesvariate gammavariate = _inst.gammavariate - stdgamma = _inst.stdgamma gauss = _inst.gauss betavariate = _inst.betavariate --- 742,748 ---- From rhettinger at users.sourceforge.net Tue Aug 5 06:32:44 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Aug 5 08:32:46 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.836,1.837 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv31639 Modified Files: NEWS Log Message: Removed deprecated functions Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.836 retrieving revision 1.837 diff -C2 -d -r1.836 -r1.837 *** NEWS 5 Aug 2003 06:33:56 -0000 1.836 --- NEWS 5 Aug 2003 12:32:41 -0000 1.837 *************** *** 24,30 **** ------- ! - _strptime.py now has a behind-the-scense caching mechanism for the most recent TimeRE instance used along with the last five unique directive patterns. The overall module was also made more thread-safe. Tools/Demos --- 24,33 ---- ------- ! - _strptime.py now has a behind-the-scenes caching mechanism for the most recent TimeRE instance used along with the last five unique directive patterns. The overall module was also made more thread-safe. + + - random.cunifvariate() and random.stdgamma() were deprecated in Py2.3 + and removed in Py2.4. Tools/Demos From doerwalter at users.sourceforge.net Tue Aug 5 09:34:36 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 5 11:34:40 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_complex.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1188/Lib/test Modified Files: test_complex.py Log Message: Check both __div__ and __truediv__ in division tests. (From SF patch #543867) Index: test_complex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_complex.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_complex.py 15 Jul 2003 18:47:27 -0000 1.12 --- test_complex.py 5 Aug 2003 15:34:34 -0000 1.13 *************** *** 1,3 **** ! import unittest, os from test import test_support --- 1,3 ---- ! import unittest, os, math from test import test_support *************** *** 56,61 **** --- 56,69 ---- q = z / x self.assertClose(q, y) + q = z.__div__(x) + self.assertClose(q, y) + q = z.__truediv__(x) + self.assertClose(q, y) if y != 0: q = z / y + self.assertClose(q, x) + q = z.__div__(y) + self.assertClose(q, x) + q = z.__truediv__(y) self.assertClose(q, x) From doerwalter at users.sourceforge.net Tue Aug 5 09:55:41 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 5 11:55:44 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_complex.py, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv5704/Lib/test Modified Files: test_complex.py Log Message: Remove useless import. Index: test_complex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_complex.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_complex.py 5 Aug 2003 15:34:34 -0000 1.13 --- test_complex.py 5 Aug 2003 15:55:38 -0000 1.14 *************** *** 1,3 **** ! import unittest, os, math from test import test_support --- 1,3 ---- ! import unittest, os from test import test_support From doerwalter at users.sourceforge.net Tue Aug 5 10:01:11 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 5 12:01:15 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_complex.py, 1.12, 1.12.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6771/Lib/test Modified Files: Tag: release23-maint test_complex.py Log Message: Backport: * Check both __div__ and __truediv__ in division tests. (From SF patch #543867) * Remove useless import. Index: test_complex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_complex.py,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** test_complex.py 15 Jul 2003 18:47:27 -0000 1.12 --- test_complex.py 5 Aug 2003 16:01:08 -0000 1.12.6.1 *************** *** 56,62 **** --- 56,74 ---- q = z / x self.assertClose(q, y) + q = z.__div__(x) + self.assertClose(q, y) + q = z.__truediv__(x) + self.assertClose(q, y) + q2 = z.__floordiv__(x) + self.assertClose(q2, math.floor(q.real)+0j) if y != 0: q = z / y self.assertClose(q, x) + q = z.__div__(y) + self.assertClose(q, x) + q = z.__truediv__(y) + self.assertClose(q, x) + q2 = z.__floordiv__(y) + self.assertClose(q2, math.floor(q.real)+0j) def test_div(self): From doerwalter at users.sourceforge.net Tue Aug 5 10:12:12 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 5 12:28:48 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_complex.py, 1.12.6.1, 1.12.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv8390/Lib/test Modified Files: Tag: release23-maint test_complex.py Log Message: Remove __floordiv__ test, as it's deprecated. Index: test_complex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_complex.py,v retrieving revision 1.12.6.1 retrieving revision 1.12.6.2 diff -C2 -d -r1.12.6.1 -r1.12.6.2 *** test_complex.py 5 Aug 2003 16:01:08 -0000 1.12.6.1 --- test_complex.py 5 Aug 2003 16:12:09 -0000 1.12.6.2 *************** *** 60,65 **** q = z.__truediv__(x) self.assertClose(q, y) - q2 = z.__floordiv__(x) - self.assertClose(q2, math.floor(q.real)+0j) if y != 0: q = z / y --- 60,63 ---- *************** *** 69,74 **** q = z.__truediv__(y) self.assertClose(q, x) - q2 = z.__floordiv__(y) - self.assertClose(q2, math.floor(q.real)+0j) def test_div(self): --- 67,70 ---- From mhammond at users.sourceforge.net Tue Aug 5 20:47:00 2003 From: mhammond at users.sourceforge.net (mhammond@users.sourceforge.net) Date: Tue Aug 5 22:47:03 2003 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300, 2.301 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv23522/Modules Modified Files: posixmodule.c Log Message: Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename. Will also check in on the 2.3 branch. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.300 retrieving revision 2.301 diff -C2 -d -r2.300 -r2.301 *** posixmodule.c 11 Jun 2003 00:18:09 -0000 2.300 --- posixmodule.c 6 Aug 2003 02:46:58 -0000 2.301 *************** *** 4608,4612 **** #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:lstat", STAT, "u:lstat", _wstati64); #else return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); --- 4608,4612 ---- #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:lstat", STAT, "U:lstat", _wstati64); #else return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); From mhammond at users.sourceforge.net Tue Aug 5 20:47:00 2003 From: mhammond at users.sourceforge.net (mhammond@users.sourceforge.net) Date: Tue Aug 5 22:47:07 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode_file.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv23522/Lib/test Modified Files: test_unicode_file.py Log Message: Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename. Will also check in on the 2.3 branch. Index: test_unicode_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode_file.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_unicode_file.py 24 Apr 2003 16:02:53 -0000 1.9 --- test_unicode_file.py 6 Aug 2003 02:46:58 -0000 1.10 *************** *** 26,29 **** --- 26,31 ---- if os.stat(TESTFN_ENCODED) != os.stat(TESTFN_UNICODE): print "os.stat() did not agree on the 2 filenames" + if os.lstat(TESTFN_ENCODED) != os.lstat(TESTFN_UNICODE): + print "os.lstat() did not agree on the 2 filenames" os.chmod(TESTFN_ENCODED, 0777) os.chmod(TESTFN_UNICODE, 0777) From mhammond at users.sourceforge.net Tue Aug 5 20:47:59 2003 From: mhammond at users.sourceforge.net (mhammond@users.sourceforge.net) Date: Tue Aug 5 22:48:01 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode_file.py, 1.9, 1.9.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv23796/Lib/test Modified Files: Tag: release23-maint test_unicode_file.py Log Message: Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename. Also checked in on trunk. Index: test_unicode_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode_file.py,v retrieving revision 1.9 retrieving revision 1.9.10.1 diff -C2 -d -r1.9 -r1.9.10.1 *** test_unicode_file.py 24 Apr 2003 16:02:53 -0000 1.9 --- test_unicode_file.py 6 Aug 2003 02:47:57 -0000 1.9.10.1 *************** *** 26,29 **** --- 26,31 ---- if os.stat(TESTFN_ENCODED) != os.stat(TESTFN_UNICODE): print "os.stat() did not agree on the 2 filenames" + if os.lstat(TESTFN_ENCODED) != os.lstat(TESTFN_UNICODE): + print "os.lstat() did not agree on the 2 filenames" os.chmod(TESTFN_ENCODED, 0777) os.chmod(TESTFN_UNICODE, 0777) From mhammond at users.sourceforge.net Tue Aug 5 20:47:59 2003 From: mhammond at users.sourceforge.net (mhammond@users.sourceforge.net) Date: Tue Aug 5 22:48:05 2003 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300, 2.300.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv23796/Modules Modified Files: Tag: release23-maint posixmodule.c Log Message: Demonstrate and fix [ 783882 ] os.lstat crashes with Unicode filename. Also checked in on trunk. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.300 retrieving revision 2.300.8.1 diff -C2 -d -r2.300 -r2.300.8.1 *** posixmodule.c 11 Jun 2003 00:18:09 -0000 2.300 --- posixmodule.c 6 Aug 2003 02:47:56 -0000 2.300.8.1 *************** *** 4608,4612 **** #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:lstat", STAT, "u:lstat", _wstati64); #else return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); --- 4608,4612 ---- #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS ! return posix_do_stat(self, args, "et:lstat", STAT, "U:lstat", _wstati64); #else return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); From rhettinger at users.sourceforge.net Wed Aug 6 00:47:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 6 02:47:21 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libfuture.tex, 1.1, 1.1.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22299 Modified Files: Tag: release23-maint libfuture.tex Log Message: Backport typo fix Index: libfuture.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuture.tex,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -C2 -d -r1.1 -r1.1.10.1 *** libfuture.tex 28 May 2003 11:57:52 -0000 1.1 --- libfuture.tex 6 Aug 2003 06:47:15 -0000 1.1.10.1 *************** *** 24,28 **** \end{itemize} ! Each statment in \file{__future__.py} is of the form: \begin{verbatim} --- 24,28 ---- \end{itemize} ! Each statement in \file{__future__.py} is of the form: \begin{verbatim} From rhettinger at users.sourceforge.net Wed Aug 6 00:52:51 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 6 02:52:55 2003 Subject: [Python-checkins] python/dist/src/Modules arraymodule.c, 2.90, 2.90.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv23103 Modified Files: Tag: release23-maint arraymodule.c Log Message: Backport SF bug #782369: Massive memory leak in array module Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem. Added missing NULL check. Clarified code by converting an "if" to an "else if". Index: arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.90 retrieving revision 2.90.8.1 diff -C2 -d -r2.90 -r2.90.8.1 *** arraymodule.c 23 May 2003 10:01:07 -0000 2.90 --- arraymodule.c 6 Aug 2003 06:52:49 -0000 2.90.8.1 *************** *** 1759,1769 **** PyObject *v = PySequence_GetItem(initial, i); if (setarrayitem(a, i, v) != 0) { Py_DECREF(a); return NULL; } } ! } ! if (initial != NULL && PyString_Check(initial)) { PyObject *t_initial = Py_BuildValue("(O)", initial); --- 1759,1774 ---- PyObject *v = PySequence_GetItem(initial, i); + if (v == NULL) { + Py_DECREF(a); + return NULL; + } if (setarrayitem(a, i, v) != 0) { + Py_DECREF(v); Py_DECREF(a); return NULL; } + Py_DECREF(v); } ! } else if (initial != NULL && PyString_Check(initial)) { PyObject *t_initial = Py_BuildValue("(O)", initial); From rhettinger at users.sourceforge.net Wed Aug 6 00:55:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 6 02:55:14 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.5,1.831.4.6 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv23341 Modified Files: Tag: release23-maint NEWS Log Message: Backport SF bug #782369: Massive memory leak in array module Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem. Added missing NULL check. Clarified code by converting an "if" to an "else if". Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.5 retrieving revision 1.831.4.6 diff -C2 -d -r1.831.4.5 -r1.831.4.6 *** NEWS 5 Aug 2003 06:26:32 -0000 1.831.4.5 --- NEWS 6 Aug 2003 06:55:09 -0000 1.831.4.6 *************** *** 25,28 **** --- 25,30 ---- URL of the Unicode 3.2 normalization file. + - Bug #782369: fix memory leak in array module. + IDLE ---- From rhettinger at users.sourceforge.net Wed Aug 6 00:57:40 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 6 02:57:43 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libexcs.tex, 1.52, 1.52.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23682 Modified Files: Tag: release23-maint libexcs.tex Log Message: Backport doc update: Clarified that TypeErrors can be raised by any function (not just builtins). The issue arose in a thread on comp.lang.python. Index: libexcs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libexcs.tex,v retrieving revision 1.52 retrieving revision 1.52.10.1 diff -C2 -d -r1.52 -r1.52.10.1 *** libexcs.tex 29 May 2003 02:17:22 -0000 1.52 --- libexcs.tex 6 Aug 2003 06:57:38 -0000 1.52.10.1 *************** *** 323,327 **** \begin{excdesc}{TypeError} ! Raised when a built-in operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. --- 323,327 ---- \begin{excdesc}{TypeError} ! Raised when an operation or function is applied to an object of inappropriate type. The associated value is a string giving details about the type mismatch. From bcannon at users.sourceforge.net Wed Aug 6 15:17:11 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Wed Aug 6 18:24:29 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py,1.23,1.23.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv22315a/Lib Modified Files: Tag: release23-maint _strptime.py Log Message: Re-introduction of caching. Not thread-safe against the changing of locale in the middle of executing time.strptime . Added new tests for caching mechanism; taken from 2.4 branch and tweaked appropriately. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.23 retrieving revision 1.23.4.1 diff -C2 -d -r1.23 -r1.23.4.1 *** _strptime.py 24 Jul 2003 20:02:28 -0000 1.23 --- _strptime.py 6 Aug 2003 21:17:09 -0000 1.23.4.1 *************** *** 398,407 **** return re_compile(self.pattern(format), IGNORECASE) def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" ! time_re = TimeRE() ! locale_time = time_re.locale_time ! format_regex = time_re.compile(format) found = format_regex.match(data_string) if not found: --- 398,423 ---- return re_compile(self.pattern(format), IGNORECASE) + # Cached TimeRE; probably only need one instance ever so cache it for performance + _locale_cache = TimeRE() + # Cached regex objects; same reason as for TimeRE cache + _regex_cache = dict() def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string.""" ! global _locale_cache ! global _regex_cache ! locale_time = _locale_cache.locale_time ! # If the language changes, caches are invalidated, so clear them ! if locale_time.lang != _getlang(): ! _locale_cache = TimeRE() ! _regex_cache.clear() ! format_regex = _regex_cache.get(format) ! if not format_regex: ! # Limit regex cache size to prevent major bloating of the module; ! # The value 5 is arbitrary ! if len(_regex_cache) > 5: ! _regex_cache.clear() ! format_regex = _locale_cache.compile(format) ! _regex_cache[format] = format_regex found = format_regex.match(data_string) if not found: From bcannon at users.sourceforge.net Wed Aug 6 15:17:11 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Wed Aug 6 18:24:33 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.6,1.831.4.7 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv22315a/Misc Modified Files: Tag: release23-maint NEWS Log Message: Re-introduction of caching. Not thread-safe against the changing of locale in the middle of executing time.strptime . Added new tests for caching mechanism; taken from 2.4 branch and tweaked appropriately. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.6 retrieving revision 1.831.4.7 diff -C2 -d -r1.831.4.6 -r1.831.4.7 *** NEWS 6 Aug 2003 06:55:09 -0000 1.831.4.6 --- NEWS 6 Aug 2003 21:17:09 -0000 1.831.4.7 *************** *** 27,30 **** --- 27,34 ---- - Bug #782369: fix memory leak in array module. + - Caching in _strptime.py has been re-introduced. This leads to a large + performance boost at the cost of being thread-safe from locale changes + while executing time.strptime() . + IDLE ---- From bcannon at users.sourceforge.net Wed Aug 6 15:17:11 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Wed Aug 6 18:24:37 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.19.4.1, 1.19.4.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv22315a/Lib/test Modified Files: Tag: release23-maint test_strptime.py Log Message: Re-introduction of caching. Not thread-safe against the changing of locale in the middle of executing time.strptime . Added new tests for caching mechanism; taken from 2.4 branch and tweaked appropriately. Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.19.4.1 retrieving revision 1.19.4.2 diff -C2 -d -r1.19.4.1 -r1.19.4.2 *** test_strptime.py 4 Aug 2003 22:49:42 -0000 1.19.4.1 --- test_strptime.py 6 Aug 2003 21:17:09 -0000 1.19.4.2 *************** *** 418,421 **** --- 418,461 ---- "Calculation of day of the week failed;" "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) + + class CacheTests(unittest.TestCase): + """Test that caching works properly.""" + + def test_time_re_recreation(self): + # Make sure cache is recreated when current locale does not match what + # cached object was created with. + _strptime.strptime("10", "%d") + _strptime._locale_cache.locale_time = _strptime.LocaleTime(lang="Ni") + original_time_re = id(_strptime._locale_cache) + _strptime.strptime("10", "%d") + self.failIfEqual(original_time_re, id(_strptime._locale_cache)) + + def test_regex_cleanup(self): + # Make sure cached regexes are discarded when cache becomes "full". + try: + del _strptime._regex_cache['%d'] + except KeyError: + pass + bogus_key = 0 + while len(_strptime._regex_cache) <= 5: + _strptime._regex_cache[bogus_key] = None + bogus_key += 1 + _strptime.strptime("10", "%d") + self.failUnlessEqual(len(_strptime._regex_cache), 1) + + def test_new_localetime(self): + # A new LocaleTime instance should be created when a new TimeRE object + # is created. + _strptime._locale_cache.locale_time = _strptime.LocaleTime(lang="Ni") + locale_time_id = id(_strptime._locale_cache.locale_time) + locale_time_lang = _strptime._locale_cache.locale_time.lang + _strptime.strptime("10", "%d") + self.failIfEqual(locale_time_id, + id(_strptime._locale_cache.locale_time)) + self.failIfEqual(locale_time_lang, + _strptime._locale_cache.locale_time.lang) + + + def test_main(): test_support.run_unittest( *************** *** 427,430 **** --- 467,471 ---- JulianTests, CalculationTests, + CacheTests ) From bcannon at users.sourceforge.net Wed Aug 6 23:27:44 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 7 01:27:49 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.7,1.831.4.8 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv30284/Misc Modified Files: Tag: release23-maint NEWS Log Message: Fix wording of cache announcement. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.7 retrieving revision 1.831.4.8 diff -C2 -d -r1.831.4.7 -r1.831.4.8 *** NEWS 6 Aug 2003 21:17:09 -0000 1.831.4.7 --- NEWS 7 Aug 2003 05:27:42 -0000 1.831.4.8 *************** *** 28,33 **** - Caching in _strptime.py has been re-introduced. This leads to a large ! performance boost at the cost of being thread-safe from locale changes ! while executing time.strptime() . IDLE --- 28,33 ---- - Caching in _strptime.py has been re-introduced. This leads to a large ! performance boost at the cost of not being thread-safe from locale ! changes while executing time.strptime() . IDLE From loewis at users.sourceforge.net Thu Aug 7 05:55:17 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Aug 7 07:55:25 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.272, 1.273 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv24210/Modules Modified Files: socketmodule.c Log Message: Release host name memory. Fixes #783312. Will backport to 2.3. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.272 retrieving revision 1.273 diff -C2 -d -r1.272 -r1.273 *** socketmodule.c 5 Aug 2003 06:25:06 -0000 1.272 --- socketmodule.c 7 Aug 2003 11:55:15 -0000 1.273 *************** *** 957,961 **** struct sockaddr_in* addr; char *host; ! int port; addr=(struct sockaddr_in*)&(s->sock_addr).in; if (!PyTuple_Check(args)) { --- 957,961 ---- struct sockaddr_in* addr; char *host; ! int port, result; addr=(struct sockaddr_in*)&(s->sock_addr).in; if (!PyTuple_Check(args)) { *************** *** 970,974 **** "idna", &host, &port)) return 0; ! if (setipaddr(host, (struct sockaddr *)addr, sizeof(*addr), AF_INET) < 0) return 0; addr->sin_family = AF_INET; --- 970,977 ---- "idna", &host, &port)) return 0; ! result = setipaddr(host, (struct sockaddr *)addr, ! sizeof(*addr), AF_INET); ! PyMem_Free(host); ! if (result < 0) return 0; addr->sin_family = AF_INET; *************** *** 984,988 **** struct sockaddr_in6* addr; char *host; ! int port, flowinfo, scope_id; addr = (struct sockaddr_in6*)&(s->sock_addr).in6; flowinfo = scope_id = 0; --- 987,991 ---- struct sockaddr_in6* addr; char *host; ! int port, flowinfo, scope_id, result; addr = (struct sockaddr_in6*)&(s->sock_addr).in6; flowinfo = scope_id = 0; *************** *** 992,996 **** return 0; } ! if (setipaddr(host, (struct sockaddr *)addr, sizeof(*addr), AF_INET6) < 0) return 0; addr->sin6_family = s->sock_family; --- 995,1002 ---- return 0; } ! result = setipaddr(host, (struct sockaddr *)addr, ! sizeof(*addr), AF_INET6); ! PyMem_Free(host); ! if (result < 0) return 0; addr->sin6_family = s->sock_family; *************** *** 3101,3105 **** } else { PyErr_SetString(socket_error, "Int or String expected"); ! return NULL; } memset(&hints, 0, sizeof(hints)); --- 3107,3111 ---- } else { PyErr_SetString(socket_error, "Int or String expected"); ! goto err; } memset(&hints, 0, sizeof(hints)); *************** *** 3115,3119 **** if (error) { set_gaierror(error); ! return NULL; } --- 3121,3125 ---- if (error) { set_gaierror(error); ! goto err; } From loewis at users.sourceforge.net Thu Aug 7 05:56:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Aug 7 07:56:28 2003 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.1, 1.271.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv26983/Modules Modified Files: Tag: release23-maint socketmodule.c Log Message: Release host name memory. Fixes #783312. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.1 retrieving revision 1.271.6.2 diff -C2 -d -r1.271.6.1 -r1.271.6.2 *** socketmodule.c 5 Aug 2003 06:26:46 -0000 1.271.6.1 --- socketmodule.c 7 Aug 2003 11:56:22 -0000 1.271.6.2 *************** *** 957,961 **** struct sockaddr_in* addr; char *host; ! int port; addr=(struct sockaddr_in*)&(s->sock_addr).in; if (!PyTuple_Check(args)) { --- 957,961 ---- struct sockaddr_in* addr; char *host; ! int port, result; addr=(struct sockaddr_in*)&(s->sock_addr).in; if (!PyTuple_Check(args)) { *************** *** 970,974 **** "idna", &host, &port)) return 0; ! if (setipaddr(host, (struct sockaddr *)addr, sizeof(*addr), AF_INET) < 0) return 0; addr->sin_family = AF_INET; --- 970,977 ---- "idna", &host, &port)) return 0; ! result = setipaddr(host, (struct sockaddr *)addr, ! sizeof(*addr), AF_INET); ! PyMem_Free(host); ! if (result < 0) return 0; addr->sin_family = AF_INET; *************** *** 984,988 **** struct sockaddr_in6* addr; char *host; ! int port, flowinfo, scope_id; addr = (struct sockaddr_in6*)&(s->sock_addr).in6; flowinfo = scope_id = 0; --- 987,991 ---- struct sockaddr_in6* addr; char *host; ! int port, flowinfo, scope_id, result; addr = (struct sockaddr_in6*)&(s->sock_addr).in6; flowinfo = scope_id = 0; *************** *** 992,996 **** return 0; } ! if (setipaddr(host, (struct sockaddr *)addr, sizeof(*addr), AF_INET6) < 0) return 0; addr->sin6_family = s->sock_family; --- 995,1002 ---- return 0; } ! result = setipaddr(host, (struct sockaddr *)addr, ! sizeof(*addr), AF_INET6); ! PyMem_Free(host); ! if (result < 0) return 0; addr->sin6_family = s->sock_family; *************** *** 3101,3105 **** } else { PyErr_SetString(socket_error, "Int or String expected"); ! return NULL; } memset(&hints, 0, sizeof(hints)); --- 3107,3111 ---- } else { PyErr_SetString(socket_error, "Int or String expected"); ! goto err; } memset(&hints, 0, sizeof(hints)); *************** *** 3115,3119 **** if (error) { set_gaierror(error); ! return NULL; } --- 3121,3125 ---- if (error) { set_gaierror(error); ! goto err; } From loewis at users.sourceforge.net Thu Aug 7 05:56:25 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Aug 7 07:56:31 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.8,1.831.4.9 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv26983/Misc Modified Files: Tag: release23-maint NEWS Log Message: Release host name memory. Fixes #783312. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.8 retrieving revision 1.831.4.9 diff -C2 -d -r1.831.4.8 -r1.831.4.9 *** NEWS 7 Aug 2003 05:27:42 -0000 1.831.4.8 --- NEWS 7 Aug 2003 11:56:23 -0000 1.831.4.9 *************** *** 19,22 **** --- 19,24 ---- if IPv6 is disabled. + - Bug #783312: Release host name memory in socket calls. + Library ------- From fdrake at users.sourceforge.net Thu Aug 7 08:31:10 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 7 10:31:17 2003 Subject: [Python-checkins] python/dist/src/Doc/mac libaepack.tex, 1.3, 1.4 undoc.tex, 1.10, 1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv22665 Modified Files: libaepack.tex undoc.tex Log Message: Fix hyperlinks and one class reference. Backporting to Python 2.3 branch. Index: libaepack.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libaepack.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libaepack.tex 11 Apr 2003 15:35:26 -0000 1.3 --- libaepack.tex 7 Aug 2003 14:31:08 -0000 1.4 *************** *** 13,17 **** Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{AE}. The \module{aepack} module defines the following functions: --- 13,17 ---- Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{Carbon.AE}. The \module{aepack} module defines the following functions: *************** *** 39,43 **** If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AE.AEDesc} object. If the conversion \var{x} is not defined above, this function returns --- 39,43 ---- If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AEDesc} object. If the conversion \var{x} is not defined above, this function returns Index: undoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/undoc.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** undoc.tex 30 Jul 2003 02:55:27 -0000 1.10 --- undoc.tex 7 Aug 2003 14:31:08 -0000 1.11 *************** *** 87,91 **** \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \refmodule{distutils}\refbimodindex{distutils} but can be used separately for more control. --- 87,91 ---- \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \module{distutils}\refbimodindex{distutils} but can be used separately for more control. From fdrake at users.sourceforge.net Thu Aug 7 08:31:30 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 7 10:31:46 2003 Subject: [Python-checkins] python/dist/src/Doc/mac libaepack.tex, 1.3, 1.3.10.1 undoc.tex, 1.9.12.1, 1.9.12.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv22728 Modified Files: Tag: release23-branch libaepack.tex undoc.tex Log Message: Fix hyperlinks and one class reference. Backported from trunk Index: libaepack.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libaepack.tex,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** libaepack.tex 11 Apr 2003 15:35:26 -0000 1.3 --- libaepack.tex 7 Aug 2003 14:31:28 -0000 1.3.10.1 *************** *** 13,17 **** Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{AE}. The \module{aepack} module defines the following functions: --- 13,17 ---- Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{Carbon.AE}. The \module{aepack} module defines the following functions: *************** *** 39,43 **** If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AE.AEDesc} object. If the conversion \var{x} is not defined above, this function returns --- 39,43 ---- If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AEDesc} object. If the conversion \var{x} is not defined above, this function returns Index: undoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/undoc.tex,v retrieving revision 1.9.12.1 retrieving revision 1.9.12.2 diff -C2 -d -r1.9.12.1 -r1.9.12.2 *** undoc.tex 30 Jul 2003 02:52:32 -0000 1.9.12.1 --- undoc.tex 7 Aug 2003 14:31:28 -0000 1.9.12.2 *************** *** 87,91 **** \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \refmodule{distutils}\refbimodindex{distutils} but can be used separately for more control. --- 87,91 ---- \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \module{distutils}\refbimodindex{distutils} but can be used separately for more control. From mwh at users.sourceforge.net Thu Aug 7 08:58:12 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 7 10:58:17 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py, 1.196, 1.197 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv27561/Lib/test Modified Files: test_descr.py Log Message: Repair refcounting on error return from type_set_bases. Include a test case that failed for one of my efforts to repair this. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** test_descr.py 29 Jun 2003 15:44:07 -0000 1.196 --- test_descr.py 7 Aug 2003 14:58:10 -0000 1.197 *************** *** 3587,3590 **** --- 3587,3597 ---- try: + D.__bases__ = (C, C) + except TypeError: + pass + else: + raise TestFailed, "didn't detect repeated base classes" + + try: D.__bases__ = (E,) except TypeError: From mwh at users.sourceforge.net Thu Aug 7 08:58:12 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 7 10:58:21 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.241,2.242 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv27561/Objects Modified Files: typeobject.c Log Message: Repair refcounting on error return from type_set_bases. Include a test case that failed for one of my efforts to repair this. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241 retrieving revision 2.242 diff -C2 -d -r2.241 -r2.242 *** typeobject.c 16 Jul 2003 16:17:57 -0000 2.241 --- typeobject.c 7 Aug 2003 14:58:09 -0000 2.242 *************** *** 304,313 **** bail: type->tp_bases = old_bases; type->tp_base = old_base; type->tp_mro = old_mro; - - Py_DECREF(value); - Py_DECREF(new_base); return -1; --- 304,316 ---- bail: + Py_DECREF(type->tp_bases); + Py_DECREF(type->tp_base); + if (type->tp_mro != old_mro) { + Py_DECREF(type->tp_mro); + } + type->tp_bases = old_bases; type->tp_base = old_base; type->tp_mro = old_mro; return -1; From mwh at python.net Thu Aug 7 17:04:03 2003 From: mwh at python.net (Michael Hudson) Date: Thu Aug 7 11:04:09 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.241,2.242 In-Reply-To: (mwh@users.sourceforge.net's message of "Thu, 07 Aug 2003 07:58:12 -0700") References: Message-ID: <2mekzxpl0c.fsf@starship.python.net> mwh@users.sourceforge.net writes: > Update of /cvsroot/python/python/dist/src/Objects > In directory sc8-pr-cvs1:/tmp/cvs-serv27561/Objects > > Modified Files: > typeobject.c > Log Message: > Repair refcounting on error return from type_set_bases. > > Include a test case that failed for one of my efforts to repair this. > Update of /cvsroot/python/python/dist/src/Lib/test > In directory sc8-pr-cvs1:/tmp/cvs-serv27561/Lib/test > > Modified Files: > test_descr.py Gah, I should have flagged these as 23 candiates... -- If you don't have friends with whom to share links and conversation, you have social problems and you should confront them instead of joining a cultlike pseudo-community. -- "Quit Slashdot.org Today!" (http://www.cs.washington.edu/homes/klee/misc/slashdot.html#faq) From mwh at users.sourceforge.net Thu Aug 7 09:09:00 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 7 11:09:04 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c, 2.241, 2.241.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv29834/Objects Modified Files: Tag: release23-maint typeobject.c Log Message: As penance for forgetting to flag my last checkins as bugfix candidates, just do the backport. These changes do not apply to release22-maint. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241 retrieving revision 2.241.6.1 diff -C2 -d -r2.241 -r2.241.6.1 *** typeobject.c 16 Jul 2003 16:17:57 -0000 2.241 --- typeobject.c 7 Aug 2003 15:08:55 -0000 2.241.6.1 *************** *** 304,313 **** bail: type->tp_bases = old_bases; type->tp_base = old_base; type->tp_mro = old_mro; - - Py_DECREF(value); - Py_DECREF(new_base); return -1; --- 304,316 ---- bail: + Py_DECREF(type->tp_bases); + Py_DECREF(type->tp_base); + if (type->tp_mro != old_mro) { + Py_DECREF(type->tp_mro); + } + type->tp_bases = old_bases; type->tp_base = old_base; type->tp_mro = old_mro; return -1; From mwh at users.sourceforge.net Thu Aug 7 09:09:27 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 7 11:32:43 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py, 1.196, 1.196.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv29834/Lib/test Modified Files: Tag: release23-maint test_descr.py Log Message: As penance for forgetting to flag my last checkins as bugfix candidates, just do the backport. These changes do not apply to release22-maint. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.196 retrieving revision 1.196.8.1 diff -C2 -d -r1.196 -r1.196.8.1 *** test_descr.py 29 Jun 2003 15:44:07 -0000 1.196 --- test_descr.py 7 Aug 2003 15:08:54 -0000 1.196.8.1 *************** *** 3587,3590 **** --- 3587,3597 ---- try: + D.__bases__ = (C, C) + except TypeError: + pass + else: + raise TestFailed, "didn't detect repeated base classes" + + try: D.__bases__ = (E,) except TypeError: From fdrake at users.sourceforge.net Thu Aug 7 09:58:43 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 7 11:58:47 2003 Subject: [Python-checkins] python/dist/src/Doc/tools push-docs.sh, 1.15, 1.15.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv5868 Modified Files: Tag: release23-branch push-docs.sh Log Message: control where this lands by default in dev/doc/ on python.org Index: push-docs.sh =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/push-docs.sh,v retrieving revision 1.15 retrieving revision 1.15.16.1 diff -C2 -d -r1.15 -r1.15.16.1 *** push-docs.sh 4 Apr 2002 18:06:06 -0000 1.15 --- push-docs.sh 7 Aug 2003 15:58:41 -0000 1.15.16.1 *************** *** 60,63 **** --- 60,68 ---- fi + if [ "$DOCTYPE" = 'maint' ] ; then + # 'maint' is a symlink + DOCTYPE='maint23' + fi + START="`pwd`" MYDIR="`dirname $0`" From fdrake at users.sourceforge.net Thu Aug 7 10:05:11 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 7 12:05:14 2003 Subject: [Python-checkins] python/dist/src/Doc/tools push-docs.sh, 1.15, 1.15.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1:/tmp/cvs-serv7224 Modified Files: Tag: release23-maint push-docs.sh Log Message: control where this lands by default in dev/doc/ on python.org, but check it in on the right branch this time Index: push-docs.sh =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/push-docs.sh,v retrieving revision 1.15 retrieving revision 1.15.18.1 diff -C2 -d -r1.15 -r1.15.18.1 *** push-docs.sh 4 Apr 2002 18:06:06 -0000 1.15 --- push-docs.sh 7 Aug 2003 16:05:08 -0000 1.15.18.1 *************** *** 60,63 **** --- 60,68 ---- fi + if [ "$DOCTYPE" = 'maint' ] ; then + # 'maint' is a symlink + DOCTYPE='maint23' + fi + START="`pwd`" MYDIR="`dirname $0`" From fdrake at users.sourceforge.net Thu Aug 7 10:10:30 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 7 12:10:34 2003 Subject: [Python-checkins] python/dist/src/Doc/mac libaepack.tex, 1.3, 1.3.12.1 undoc.tex, 1.9.14.1, 1.9.14.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv8215 Modified Files: Tag: release23-maint libaepack.tex undoc.tex Log Message: Fix hyperlinks and one class reference. Backported from trunk, but to the right branch this time. Index: libaepack.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libaepack.tex,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -C2 -d -r1.3 -r1.3.12.1 *** libaepack.tex 11 Apr 2003 15:35:26 -0000 1.3 --- libaepack.tex 7 Aug 2003 16:10:28 -0000 1.3.12.1 *************** *** 13,17 **** Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{AE}. The \module{aepack} module defines the following functions: --- 13,17 ---- Python variables to AppleEvent descriptors and back (unpacking). Within Python the AppleEvent descriptor is handled by Python objects ! of built-in type \class{AEDesc}, defined in module \refmodule{Carbon.AE}. The \module{aepack} module defines the following functions: *************** *** 39,43 **** If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AE.AEDesc} object. If the conversion \var{x} is not defined above, this function returns --- 39,43 ---- If \var{x} is a Python instance then this function attempts to call an \method{__aepack__()} method. This method should return an ! \class{AEDesc} object. If the conversion \var{x} is not defined above, this function returns Index: undoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/undoc.tex,v retrieving revision 1.9.14.1 retrieving revision 1.9.14.2 diff -C2 -d -r1.9.14.1 -r1.9.14.2 *** undoc.tex 4 Aug 2003 22:49:42 -0000 1.9.14.1 --- undoc.tex 7 Aug 2003 16:10:28 -0000 1.9.14.2 *************** *** 87,91 **** \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \refmodule{distutils}\refbimodindex{distutils} but can be used separately for more control. --- 87,91 ---- \module{mkcwproject} creates project files for the Metrowerks CodeWarrior development environment. It is a helper module for ! \module{distutils}\refbimodindex{distutils} but can be used separately for more control. From bcannon at users.sourceforge.net Thu Aug 7 19:52:11 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 7 21:52:14 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py, 1.23.4.1, 1.23.4.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv20984/Lib Modified Files: Tag: release23-maint _strptime.py Log Message: Fix docstring for LocaleTime. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.23.4.1 retrieving revision 1.23.4.2 diff -C2 -d -r1.23.4.1 -r1.23.4.2 *** _strptime.py 6 Aug 2003 21:17:09 -0000 1.23.4.1 --- _strptime.py 8 Aug 2003 01:52:08 -0000 1.23.4.2 *************** *** 41,47 **** f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) ! f_month -- full weekday names (14-item list; dummy value in [0], which is added by code) ! a_month -- abbreviated weekday names (13-item list, dummy value in [0], which is added by code) am_pm -- AM/PM representation (2-item list) --- 41,47 ---- f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) ! f_month -- full month names (13-item list; dummy value in [0], which is added by code) ! a_month -- abbreviated month names (13-item list, dummy value in [0], which is added by code) am_pm -- AM/PM representation (2-item list) From bcannon at users.sourceforge.net Thu Aug 7 19:53:07 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 7 21:53:10 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv21081/Lib Modified Files: _strptime.py Log Message: Fix docstring in LocaleTime. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** _strptime.py 5 Aug 2003 04:02:49 -0000 1.24 --- _strptime.py 8 Aug 2003 01:53:05 -0000 1.25 *************** *** 38,44 **** f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) ! f_month -- full weekday names (14-item list; dummy value in [0], which is added by code) ! a_month -- abbreviated weekday names (13-item list, dummy value in [0], which is added by code) am_pm -- AM/PM representation (2-item list) --- 38,44 ---- f_weekday -- full weekday names (7-item list) a_weekday -- abbreviated weekday names (7-item list) ! f_month -- full month names (13-item list; dummy value in [0], which is added by code) ! a_month -- abbreviated month names (13-item list, dummy value in [0], which is added by code) am_pm -- AM/PM representation (2-item list) From rhettinger at users.sourceforge.net Thu Aug 7 20:40:30 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Aug 7 22:40:33 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27599 Modified Files: libitertools.tex Log Message: Improve docs: * Simplify the pure python examples * Add a quantify() example Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libitertools.tex 22 Jul 2003 06:33:13 -0000 1.12 --- libitertools.tex 8 Aug 2003 02:40:28 -0000 1.13 *************** *** 79,83 **** Does not currently support python long integers. Often used as an argument to \function{imap()} to generate consecutive data points. ! Also, used in \function{izip()} to add sequence numbers. Equivalent to: \begin{verbatim} --- 79,83 ---- Does not currently support python long integers. Often used as an argument to \function{imap()} to generate consecutive data points. ! Also, used with \function{izip()} to add sequence numbers. Equivalent to: \begin{verbatim} *************** *** 104,110 **** yield element saved.append(element) ! if len(saved) == 0: ! return ! while True: for element in saved: yield element --- 104,108 ---- yield element saved.append(element) ! while saved: for element in saved: yield element *************** *** 125,135 **** def dropwhile(predicate, iterable): iterable = iter(iterable) ! while True: ! x = iterable.next() ! if predicate(x): continue # drop when predicate is true yield x - break - while True: - yield iterable.next() \end{verbatim} \end{funcdesc} --- 123,132 ---- def dropwhile(predicate, iterable): iterable = iter(iterable) ! for x in iterable: ! if not predicate(x): ! yield x ! break ! for x in iterable: yield x \end{verbatim} \end{funcdesc} *************** *** 210,216 **** def islice(iterable, *args): s = slice(*args) ! next = s.start or 0 ! stop = s.stop ! step = s.step or 1 for cnt, element in enumerate(iterable): if cnt < next: --- 207,211 ---- def islice(iterable, *args): s = slice(*args) ! next, stop, step = s.start or 0, s.stop, s.step or 1 for cnt, element in enumerate(iterable): if cnt < next: *************** *** 279,285 **** \begin{verbatim} def takewhile(predicate, iterable): ! iterable = iter(iterable) ! while True: ! x = iterable.next() if predicate(x): yield x --- 274,278 ---- \begin{verbatim} def takewhile(predicate, iterable): ! for x in iterable: if predicate(x): yield x *************** *** 358,361 **** --- 351,358 ---- ... "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)) >>> def padnone(seq): From rhettinger at users.sourceforge.net Thu Aug 7 20:41:55 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Aug 7 22:41:59 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12, 1.12.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28009 Modified Files: Tag: release23-maint libitertools.tex Log Message: Improve docs: * Simplify the pure python examples * Add a quantify() example Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** libitertools.tex 22 Jul 2003 06:33:13 -0000 1.12 --- libitertools.tex 8 Aug 2003 02:41:53 -0000 1.12.6.1 *************** *** 79,83 **** Does not currently support python long integers. Often used as an argument to \function{imap()} to generate consecutive data points. ! Also, used in \function{izip()} to add sequence numbers. Equivalent to: \begin{verbatim} --- 79,83 ---- Does not currently support python long integers. Often used as an argument to \function{imap()} to generate consecutive data points. ! Also, used with \function{izip()} to add sequence numbers. Equivalent to: \begin{verbatim} *************** *** 104,110 **** yield element saved.append(element) ! if len(saved) == 0: ! return ! while True: for element in saved: yield element --- 104,108 ---- yield element saved.append(element) ! while saved: for element in saved: yield element *************** *** 125,135 **** def dropwhile(predicate, iterable): iterable = iter(iterable) ! while True: ! x = iterable.next() ! if predicate(x): continue # drop when predicate is true yield x - break - while True: - yield iterable.next() \end{verbatim} \end{funcdesc} --- 123,132 ---- def dropwhile(predicate, iterable): iterable = iter(iterable) ! for x in iterable: ! if not predicate(x): ! yield x ! break ! for x in iterable: yield x \end{verbatim} \end{funcdesc} *************** *** 210,216 **** def islice(iterable, *args): s = slice(*args) ! next = s.start or 0 ! stop = s.stop ! step = s.step or 1 for cnt, element in enumerate(iterable): if cnt < next: --- 207,211 ---- def islice(iterable, *args): s = slice(*args) ! next, stop, step = s.start or 0, s.stop, s.step or 1 for cnt, element in enumerate(iterable): if cnt < next: *************** *** 279,285 **** \begin{verbatim} def takewhile(predicate, iterable): ! iterable = iter(iterable) ! while True: ! x = iterable.next() if predicate(x): yield x --- 274,278 ---- \begin{verbatim} def takewhile(predicate, iterable): ! for x in iterable: if predicate(x): yield x *************** *** 358,361 **** --- 351,358 ---- ... "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)) >>> def padnone(seq): From rhettinger at users.sourceforge.net Thu Aug 7 22:33:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 00:33:24 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv10183 Modified Files: test_itertools.py Log Message: Re-sync doc tests with the doc updates. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_itertools.py 29 Jun 2003 20:36:23 -0000 1.15 --- test_itertools.py 8 Aug 2003 04:33:19 -0000 1.16 *************** *** 472,484 **** >>> def all(pred, seq): ... "Returns True if pred(x) is True for every element in the iterable" ! ... return not nth(ifilterfalse(pred, seq), 0) >>> def some(pred, seq): ... "Returns True if pred(x) is True for at least one element in the iterable" ! ... return bool(nth(ifilter(pred, seq), 0)) >>> def no(pred, seq): ... "Returns True if pred(x) is False for every element in the iterable" ! ... return not nth(ifilter(pred, seq), 0) >>> def padnone(seq): --- 472,488 ---- >>> 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)) >>> def padnone(seq): From rhettinger at users.sourceforge.net Thu Aug 7 23:10:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 01:10:47 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.837,1.838 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Misc Modified Files: NEWS Log Message: Modified itertools.izip() to match the behavior of __builtin__.zip() which can now take zero arguments. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.837 retrieving revision 1.838 diff -C2 -d -r1.837 -r1.838 *** NEWS 5 Aug 2003 12:32:41 -0000 1.837 --- NEWS 8 Aug 2003 05:10:40 -0000 1.838 *************** *** 24,27 **** --- 24,30 ---- ------- + - 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 recent TimeRE instance used along with the last five unique directive From rhettinger at users.sourceforge.net Thu Aug 7 23:10:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 01:10:50 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.16, 1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Lib/test Modified Files: test_itertools.py Log Message: Modified itertools.izip() to match the behavior of __builtin__.zip() which can now take zero arguments. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_itertools.py 8 Aug 2003 04:33:19 -0000 1.16 --- test_itertools.py 8 Aug 2003 05:10:41 -0000 1.17 *************** *** 88,92 **** self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3))) self.assertEqual(list(izip('abcdef')), zip('abcdef')) ! self.assertRaises(TypeError, izip) self.assertRaises(TypeError, izip, 3) self.assertRaises(TypeError, izip, range(3), 3) --- 88,92 ---- self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3))) self.assertEqual(list(izip('abcdef')), zip('abcdef')) ! self.assertEqual(list(izip()), zip()) self.assertRaises(TypeError, izip, 3) self.assertRaises(TypeError, izip, range(3), 3) *************** *** 200,203 **** --- 200,205 ---- def test_StopIteration(self): + self.assertRaises(StopIteration, izip().next) + for f in (chain, cycle, izip): self.assertRaises(StopIteration, f([]).next) *************** *** 540,543 **** --- 542,548 ---- >>> no(lambda x: x%2==0, [1, 2, 5, 9]) False + + >>> quantify(lambda x: x%2==0, xrange(99)) + 50 >>> list(window('abc')) From rhettinger at users.sourceforge.net Thu Aug 7 23:10:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 01:10:53 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.18, 1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Modules Modified Files: itertoolsmodule.c Log Message: Modified itertools.izip() to match the behavior of __builtin__.zip() which can now take zero arguments. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** itertoolsmodule.c 14 Jul 2003 07:07:12 -0000 1.18 --- itertoolsmodule.c 8 Aug 2003 05:10:41 -0000 1.19 *************** *** 1511,1520 **** int tuplesize = PySequence_Length(args); - if (tuplesize < 1) { - PyErr_SetString(PyExc_TypeError, - "izip() requires at least one sequence"); - return NULL; - } - /* args must be a tuple */ assert(PyTuple_Check(args)); --- 1511,1514 ---- *************** *** 1599,1602 **** --- 1593,1598 ---- PyObject *item; + if (tuplesize == 0) + return NULL; if (result->ob_refcnt == 1) { for (i=0 ; i < tuplesize ; i++) { From rhettinger at users.sourceforge.net Thu Aug 7 23:10:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 01:10:56 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Doc/lib Modified Files: libitertools.tex Log Message: Modified itertools.izip() to match the behavior of __builtin__.zip() which can now take zero arguments. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libitertools.tex 8 Aug 2003 02:40:28 -0000 1.13 --- libitertools.tex 8 Aug 2003 05:10:41 -0000 1.14 *************** *** 227,234 **** def izip(*iterables): iterables = map(iter, iterables) ! while True: result = [i.next() for i in iterables] yield tuple(result) \end{verbatim} \end{funcdesc} --- 227,237 ---- def izip(*iterables): iterables = map(iter, iterables) ! while iterables: result = [i.next() for i in iterables] yield tuple(result) \end{verbatim} + + \versionchanged[When no iterables are specified, returns a zero length + iterator instead of raising a TypeError exception]{2.4} \end{funcdesc} From rhettinger at users.sourceforge.net Fri Aug 8 05:06:02 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 07:06:10 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129, 1.129.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1419 Modified Files: Tag: release23-maint libstdtypes.tex Log Message: SF bug #775836: change 0,1 to False,True in dict.has_key doc Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129 retrieving revision 1.129.8.1 diff -C2 -d -r1.129 -r1.129.8.1 *** libstdtypes.tex 16 Jul 2003 05:11:27 -0000 1.129 --- libstdtypes.tex 8 Aug 2003 11:05:59 -0000 1.129.8.1 *************** *** 1126,1130 **** \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} \lineiii{\var{a}.has_key(\var{k})} ! {\code{1} if \var{a} has a key \var{k}, else \code{0}} {} \lineiii{\var{k} \code{in} \var{a}} --- 1126,1130 ---- \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} \lineiii{\var{a}.has_key(\var{k})} ! {\code{True} if \var{a} has a key \var{k}, else \code{False}} {} \lineiii{\var{k} \code{in} \var{a}} From rhettinger at users.sourceforge.net Fri Aug 8 05:08:02 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 07:08:05 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129, 1.130 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv1698 Modified Files: libstdtypes.tex Log Message: SF bug #775836: change 0,1 to False,True in dict.has_key doc Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** libstdtypes.tex 16 Jul 2003 05:11:27 -0000 1.129 --- libstdtypes.tex 8 Aug 2003 11:07:59 -0000 1.130 *************** *** 1126,1130 **** \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} \lineiii{\var{a}.has_key(\var{k})} ! {\code{1} if \var{a} has a key \var{k}, else \code{0}} {} \lineiii{\var{k} \code{in} \var{a}} --- 1126,1130 ---- \lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{} \lineiii{\var{a}.has_key(\var{k})} ! {\code{True} if \var{a} has a key \var{k}, else \code{False}} {} \lineiii{\var{k} \code{in} \var{a}} From rhettinger at users.sourceforge.net Fri Aug 8 06:20:05 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:20:09 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_StringIO.py, 1.16, 1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv12432/Lib/test Modified Files: test_StringIO.py Log Message: SF bug #770485: cStringIO does not set closed attr Index: test_StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_StringIO.py 1 May 2003 17:45:30 -0000 1.16 --- test_StringIO.py 8 Aug 2003 12:20:03 -0000 1.17 *************** *** 56,59 **** --- 56,69 ---- self.assertRaises(ValueError, f.write, 'frobnitz') + def test_closed_flag(self): + f = self.MODULE.StringIO() + self.assertEqual(f.closed, False) + f.close() + self.assertEqual(f.closed, True) + f = self.MODULE.StringIO("abc") + self.assertEqual(f.closed, False) + f.close() + self.assertEqual(f.closed, True) + def test_iterator(self): eq = self.assertEqual From rhettinger at users.sourceforge.net Fri Aug 8 06:20:05 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:20:13 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.40,2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12432/Modules Modified Files: cStringIO.c Log Message: SF bug #770485: cStringIO does not set closed attr Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** cStringIO.c 24 Apr 2003 15:50:11 -0000 2.40 --- cStringIO.c 8 Aug 2003 12:20:03 -0000 2.41 *************** *** 89,92 **** --- 89,108 ---- static PyObject * + IO_get_closed(IOobject *self, void *closure) + { + PyObject *result = Py_False; + + if (self->buf == NULL) + result = Py_True; + Py_INCREF(result); + return result; + } + + static PyGetSetDef file_getsetlist[] = { + {"closed", (getter)IO_get_closed, NULL, "True if the file is closed"}, + {0}, + }; + + static PyObject * IO_flush(IOobject *self, PyObject *unused) { *************** *** 456,459 **** --- 472,476 ---- {"softspace", T_INT, offsetof(Oobject, softspace), 0, "flag indicating that a space needs to be printed; used by print"}, + /* getattr(f, "closed") is implemented without this table */ {NULL} /* Sentinel */ }; *************** *** 499,503 **** (iternextfunc)IO_iternext, /*tp_iternext */ O_methods, /*tp_methods */ ! O_memberlist /*tp_members */ }; --- 516,521 ---- (iternextfunc)IO_iternext, /*tp_iternext */ O_methods, /*tp_methods */ ! O_memberlist, /*tp_members */ ! file_getsetlist, /*tp_getset */ }; *************** *** 615,619 **** PyObject_SelfIter, /* tp_iter */ (iternextfunc)IO_iternext, /* tp_iternext */ ! I_methods /* tp_methods */ }; --- 633,639 ---- PyObject_SelfIter, /* tp_iter */ (iternextfunc)IO_iternext, /* tp_iternext */ ! I_methods, /* tp_methods */ ! 0, /* tp_members */ ! file_getsetlist, /* tp_getset */ }; From rhettinger at users.sourceforge.net Fri Aug 8 06:20:05 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:20:16 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.838,1.839 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12432/Misc Modified Files: NEWS Log Message: SF bug #770485: cStringIO does not set closed attr Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.838 retrieving revision 1.839 diff -C2 -d -r1.838 -r1.839 *** NEWS 8 Aug 2003 05:10:40 -0000 1.838 --- NEWS 8 Aug 2003 12:20:02 -0000 1.839 *************** *** 19,22 **** --- 19,24 ---- ----------------- + - cStringIO now supports the f.closed attribute. + - The signal module now exposes SIGRTMIN and SIGRTMAX (if available). From rhettinger at users.sourceforge.net Fri Aug 8 06:22:32 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:22:37 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_StringIO.py, 1.16, 1.16.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv12956/Lib/test Modified Files: Tag: release23-maint test_StringIO.py Log Message: SF bug #770485: cStringIO does not set closed attr Index: test_StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v retrieving revision 1.16 retrieving revision 1.16.8.1 diff -C2 -d -r1.16 -r1.16.8.1 *** test_StringIO.py 1 May 2003 17:45:30 -0000 1.16 --- test_StringIO.py 8 Aug 2003 12:22:30 -0000 1.16.8.1 *************** *** 56,59 **** --- 56,69 ---- self.assertRaises(ValueError, f.write, 'frobnitz') + def test_closed_flag(self): + f = self.MODULE.StringIO() + self.assertEqual(f.closed, False) + f.close() + self.assertEqual(f.closed, True) + f = self.MODULE.StringIO("abc") + self.assertEqual(f.closed, False) + f.close() + self.assertEqual(f.closed, True) + def test_iterator(self): eq = self.assertEqual From rhettinger at users.sourceforge.net Fri Aug 8 06:22:32 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:22:40 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.9,1.831.4.10 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12956/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF bug #770485: cStringIO does not set closed attr Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.9 retrieving revision 1.831.4.10 diff -C2 -d -r1.831.4.9 -r1.831.4.10 *** NEWS 7 Aug 2003 11:56:23 -0000 1.831.4.9 --- NEWS 8 Aug 2003 12:22:30 -0000 1.831.4.10 *************** *** 16,19 **** --- 16,21 ---- ----------------- + - Bug #770485: cStringIO did not support the f.closed attribute. + - Patch #781722: Gracefully reject AF_INET6 in socket.inet_pton if IPv6 is disabled. From rhettinger at users.sourceforge.net Fri Aug 8 06:22:32 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 08:22:43 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c, 2.40, 2.40.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12956/Modules Modified Files: Tag: release23-maint cStringIO.c Log Message: SF bug #770485: cStringIO does not set closed attr Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.40 retrieving revision 2.40.10.1 diff -C2 -d -r2.40 -r2.40.10.1 *** cStringIO.c 24 Apr 2003 15:50:11 -0000 2.40 --- cStringIO.c 8 Aug 2003 12:22:30 -0000 2.40.10.1 *************** *** 89,92 **** --- 89,108 ---- static PyObject * + IO_get_closed(IOobject *self, void *closure) + { + PyObject *result = Py_False; + + if (self->buf == NULL) + result = Py_True; + Py_INCREF(result); + return result; + } + + static PyGetSetDef file_getsetlist[] = { + {"closed", (getter)IO_get_closed, NULL, "True if the file is closed"}, + {0}, + }; + + static PyObject * IO_flush(IOobject *self, PyObject *unused) { *************** *** 456,459 **** --- 472,476 ---- {"softspace", T_INT, offsetof(Oobject, softspace), 0, "flag indicating that a space needs to be printed; used by print"}, + /* getattr(f, "closed") is implemented without this table */ {NULL} /* Sentinel */ }; *************** *** 499,503 **** (iternextfunc)IO_iternext, /*tp_iternext */ O_methods, /*tp_methods */ ! O_memberlist /*tp_members */ }; --- 516,521 ---- (iternextfunc)IO_iternext, /*tp_iternext */ O_methods, /*tp_methods */ ! O_memberlist, /*tp_members */ ! file_getsetlist, /*tp_getset */ }; *************** *** 615,619 **** PyObject_SelfIter, /* tp_iter */ (iternextfunc)IO_iternext, /* tp_iternext */ ! I_methods /* tp_methods */ }; --- 633,639 ---- PyObject_SelfIter, /* tp_iter */ (iternextfunc)IO_iternext, /* tp_iternext */ ! I_methods, /* tp_methods */ ! 0, /* tp_members */ ! file_getsetlist, /* tp_getset */ }; From mwh at users.sourceforge.net Fri Aug 8 07:57:24 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 8 09:57:29 2003 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.242,2.243 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv29176 Modified Files: typeobject.c Log Message: /* XXX From here until type is allocated, "return NULL" leaks bases! */ Sure looks like it to me! When I run the leak2.py script I posted to python-dev, I only see three reference leaks in all of test_descr. When I run test_descr.test_main, I still see 46 leaks. This clearly demands posting a yelp to python-dev :-) This certainly should be applied to release23-maint, and in all likelyhood release22-maint as well. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.242 retrieving revision 2.243 diff -C2 -d -r2.242 -r2.243 *** typeobject.c 7 Aug 2003 14:58:09 -0000 2.242 --- typeobject.c 8 Aug 2003 13:57:22 -0000 2.243 *************** *** 1619,1628 **** /* Calculate best base, and check that all bases are type objects */ base = best_base(bases); ! if (base == NULL) return NULL; if (!PyType_HasFeature(base, Py_TPFLAGS_BASETYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not an acceptable base type", base->tp_name); return NULL; } --- 1619,1631 ---- /* Calculate best base, and check that all bases are type objects */ base = best_base(bases); ! if (base == NULL) { ! Py_DECREF(bases); return NULL; + } if (!PyType_HasFeature(base, Py_TPFLAGS_BASETYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not an acceptable base type", base->tp_name); + Py_DECREF(bases); return NULL; } *************** *** 1651,1656 **** else slots = PySequence_Tuple(slots); ! if (slots == NULL) return NULL; assert(PyTuple_Check(slots)); --- 1654,1661 ---- else slots = PySequence_Tuple(slots); ! if (slots == NULL) { ! Py_DECREF(bases); return NULL; + } assert(PyTuple_Check(slots)); *************** *** 1663,1666 **** --- 1668,1672 ---- base->tp_name); bad_slots: + Py_DECREF(bases); Py_DECREF(slots); return NULL; *************** *** 1774,1777 **** --- 1780,1784 ---- if (type == NULL) { Py_XDECREF(slots); + Py_DECREF(bases); return NULL; } From rhettinger at users.sourceforge.net Fri Aug 8 17:31:38 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 19:31:41 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.196,1.196.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv26154 Modified Files: Tag: release23-maint tut.tex Log Message: Explain argument unpacking Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196 retrieving revision 1.196.8.1 diff -C2 -d -r1.196 -r1.196.8.1 *** tut.tex 15 Jul 2003 23:16:01 -0000 1.196 --- tut.tex 8 Aug 2003 23:31:35 -0000 1.196.8.1 *************** *** 1578,1581 **** --- 1578,1599 ---- + \subsection{Unpacking Argument Lists \label{unpacking-arguments}} + + The reverse situation occurs when the arguments are already in a list + or tuple but need to be unpacked for a function call requiring separate + positional arguments. For instance, the built-in \function{range()} + function expects separate \var{start} and \var{stop} arguments. If they + are not available separately, write the function call with the + \code{*}-operator to unpack the arguments out of a list or tuple: + + \begin{verbatim} + >>> range(3, 6) # normal call with separate arguments + [3, 4, 5] + >>> args = [3, 6] + >>> range(*args) # call with arguments unpacked from a list + [3, 4, 5] + \end{verbatim} + + \subsection{Lambda Forms \label{lambda}} From rhettinger at users.sourceforge.net Fri Aug 8 17:32:48 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 8 19:32:51 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.196,1.197 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv26289 Modified Files: tut.tex Log Message: Explain argument unpacking Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** tut.tex 15 Jul 2003 23:16:01 -0000 1.196 --- tut.tex 8 Aug 2003 23:32:46 -0000 1.197 *************** *** 1578,1581 **** --- 1578,1599 ---- + \subsection{Unpacking Argument Lists \label{unpacking-arguments}} + + The reverse situation occurs when the arguments are already in a list + or tuple but need to be unpacked for a function call requiring separate + positional arguments. For instance, the built-in \function{range()} + function expects separate \var{start} and \var{stop} arguments. If they + are not available separately, write the function call with the + \code{*}-operator to unpack the arguments out of a list or tuple: + + \begin{verbatim} + >>> range(3, 6) # normal call with separate arguments + [3, 4, 5] + >>> args = [3, 6] + >>> range(*args) # call with arguments unpacked from a list + [3, 4, 5] + \end{verbatim} + + \subsection{Lambda Forms \label{lambda}} From kbk at users.sourceforge.net Fri Aug 8 19:51:31 2003 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Fri Aug 8 21:51:34 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib config-main.def, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv9417 Modified Files: config-main.def Log Message: IDLEfork Bug 782759 backported to 23-maint Index: config-main.def =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/config-main.def,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** config-main.def 1 Jun 2003 01:08:32 -0000 1.19 --- config-main.def 9 Aug 2003 01:51:28 -0000 1.20 *************** *** 14,21 **** # user configuration # ------------------- ! # ~/.idlerc/idle-main.cfg the user general config file ! # ~/.idlerc/idle-extensions.cfg the user extension config file ! # ~/.idlerc/idle-highlight.cfg the user highlighting config file ! # ~/.idlerc/idle-keys.cfg the user keybinding config file # # Any options the user saves through the config dialog will be saved to --- 14,26 ---- # user configuration # ------------------- ! # ~/.idlerc/config-main.cfg the user general config file ! # ~/.idlerc/config-extensions.cfg the user extension config file ! # ~/.idlerc/config-highlight.cfg the user highlighting config file ! # ~/.idlerc/config-keys.cfg the user keybinding config file ! # ! # On Windows2000 and Windows XP the .idlerc directory is at ! # Documents and Settings\\.idlerc ! # ! # On Windows98 it is at c:\.idlerc # # Any options the user saves through the config dialog will be saved to From kbk at users.sourceforge.net Fri Aug 8 21:10:04 2003 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Fri Aug 8 23:10:07 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib config-main.def, 1.19, 1.19.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv17164 Modified Files: Tag: release23-maint config-main.def Log Message: IDLEfork Bug 782759 config-main.def user configuration doc incorrect Index: config-main.def =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/config-main.def,v retrieving revision 1.19 retrieving revision 1.19.8.1 diff -C2 -d -r1.19 -r1.19.8.1 *** config-main.def 1 Jun 2003 01:08:32 -0000 1.19 --- config-main.def 9 Aug 2003 03:10:01 -0000 1.19.8.1 *************** *** 14,21 **** # user configuration # ------------------- ! # ~/.idlerc/idle-main.cfg the user general config file ! # ~/.idlerc/idle-extensions.cfg the user extension config file ! # ~/.idlerc/idle-highlight.cfg the user highlighting config file ! # ~/.idlerc/idle-keys.cfg the user keybinding config file # # Any options the user saves through the config dialog will be saved to --- 14,26 ---- # user configuration # ------------------- ! # ~/.idlerc/config-main.cfg the user general config file ! # ~/.idlerc/config-extensions.cfg the user extension config file ! # ~/.idlerc/config-highlight.cfg the user highlighting config file ! # ~/.idlerc/config-keys.cfg the user keybinding config file ! # ! # On Windows2000 and Windows XP the .idlerc directory is at ! # Documents and Settings\\.idlerc ! # ! # On Windows98 it is at c:\.idlerc # # Any options the user saves through the config dialog will be saved to From rhettinger at users.sourceforge.net Fri Aug 8 22:37:16 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 00:37:19 2003 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv30676 Modified Files: abstract.tex Log Message: SF patch #783807: Clarify PySequence_Setitem ref counting (Contributed by Jay T Miller.) Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** abstract.tex 16 Apr 2003 17:28:12 -0000 1.26 --- abstract.tex 9 Aug 2003 04:37:14 -0000 1.27 *************** *** 755,759 **** Assign object \var{v} to the \var{i}th element of \var{o}. Returns \code{-1} on failure. This is the equivalent of the Python ! statement \samp{\var{o}[\var{i}] = \var{v}}. \end{cfuncdesc} --- 755,760 ---- Assign object \var{v} to the \var{i}th element of \var{o}. Returns \code{-1} on failure. This is the equivalent of the Python ! statement \samp{\var{o}[\var{i}] = \var{v}}. This function \emph{does not} ! steal a reference to \var{v}. \end{cfuncdesc} From rhettinger at users.sourceforge.net Fri Aug 8 22:38:27 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 00:38:30 2003 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex, 1.26, 1.26.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv31042 Modified Files: Tag: release23-maint abstract.tex Log Message: SF patch #783807: Clarify PySequence_Setitem ref counting (Contributed by Jay T Miller.) Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.26 retrieving revision 1.26.12.1 diff -C2 -d -r1.26 -r1.26.12.1 *** abstract.tex 16 Apr 2003 17:28:12 -0000 1.26 --- abstract.tex 9 Aug 2003 04:38:25 -0000 1.26.12.1 *************** *** 755,759 **** Assign object \var{v} to the \var{i}th element of \var{o}. Returns \code{-1} on failure. This is the equivalent of the Python ! statement \samp{\var{o}[\var{i}] = \var{v}}. \end{cfuncdesc} --- 755,760 ---- Assign object \var{v} to the \var{i}th element of \var{o}. Returns \code{-1} on failure. This is the equivalent of the Python ! statement \samp{\var{o}[\var{i}] = \var{v}}. This function \emph{does not} ! steal a reference to \var{v}. \end{cfuncdesc} From rhettinger at users.sourceforge.net Fri Aug 8 23:01:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 01:01:46 2003 Subject: [Python-checkins] python/dist/src/Lib BaseHTTPServer.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv1427 Modified Files: BaseHTTPServer.py Log Message: SF patch #747364: BaseHTTPServer doesn't need StringIO intermediary (Contributed by Andrew Dalke.) Index: BaseHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/BaseHTTPServer.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** BaseHTTPServer.py 2 Jun 2003 14:25:43 -0000 1.27 --- BaseHTTPServer.py 9 Aug 2003 05:01:41 -0000 1.28 *************** *** 76,80 **** import mimetools import SocketServer - import cStringIO # Default error message --- 76,79 ---- *************** *** 277,291 **** self.command, self.path, self.request_version = command, path, version - # Deal with pipelining - bytes = "" - while 1: - line = self.rfile.readline() - bytes = bytes + line - if line == '\r\n' or line == '\n' or line == '': - break - # Examine the headers and look for a Connection directive ! hfile = cStringIO.StringIO(bytes) ! self.headers = self.MessageClass(hfile) conntype = self.headers.get('Connection', "") --- 276,281 ---- self.command, self.path, self.request_version = command, path, version # Examine the headers and look for a Connection directive ! self.headers = self.MessageClass(self.rfile, 0) conntype = self.headers.get('Connection', "") From loewis at users.sourceforge.net Sat Aug 9 03:06:55 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:07:00 2003 Subject: [Python-checkins] python/dist/src configure, 1.417, 1.418 configure.in, 1.428, 1.429 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv28379 Modified Files: configure configure.in Log Message: Patch #771998: Put braces around variables. Will backport to 2.3. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.417 retrieving revision 1.418 diff -C2 -d -r1.417 -r1.418 *** configure 30 Jul 2003 17:39:46 -0000 1.417 --- configure 9 Aug 2003 09:06:51 -0000 1.418 *************** *** 1,6 **** #! /bin/sh ! # From configure.in Revision: 1.427 . # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.53 for python 2.4. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 --- 1,6 ---- #! /bin/sh ! # From configure.in Revision: 1.428 . # Guess values for system-dependent variables and create Makefiles. [...13492 lines suppressed...] rm -f $ac_file *************** *** 18829,18834 **** if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null ! $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which --- 19663,19671 ---- if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null ! $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.428 retrieving revision 1.429 diff -C2 -d -r1.428 -r1.429 *** configure.in 30 Jul 2003 17:39:48 -0000 1.428 --- configure.in 9 Aug 2003 09:06:52 -0000 1.429 *************** *** 509,518 **** LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ;; Linux*|GNU*|NetBSD*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH INSTSONAME="$LDLIBRARY".$SOVERSION ;; --- 509,518 ---- LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} ;; Linux*|GNU*|NetBSD*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} INSTSONAME="$LDLIBRARY".$SOVERSION ;; *************** *** 520,529 **** LDLIBRARY='libpython$(VERSION).sl' BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=SHLIB_PATH=`pwd`:$SHLIB_PATH ;; OSF*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ;; atheos*) --- 520,529 ---- LDLIBRARY='libpython$(VERSION).sl' BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH} ;; OSF*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} ;; atheos*) From loewis at users.sourceforge.net Sat Aug 9 03:08:00 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:08:04 2003 Subject: [Python-checkins] python/dist/src configure, 1.416, 1.416.4.1 configure.in, 1.427, 1.427.4.1 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv28519 Modified Files: Tag: release23-maint configure configure.in Log Message: Patch #771998: Put braces around variables. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.416 retrieving revision 1.416.4.1 diff -C2 -d -r1.416 -r1.416.4.1 *** configure 23 Jul 2003 22:17:27 -0000 1.416 --- configure 9 Aug 2003 09:07:55 -0000 1.416.4.1 *************** *** 1,6 **** #! /bin/sh ! # From configure.in Revision: 1.426 . # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.53 for python 2.3. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 --- 1,6 ---- #! /bin/sh ! # From configure.in Revision: 1.427 . # Guess values for system-dependent variables and create Makefiles. [...13492 lines suppressed...] rm -f $ac_file *************** *** 18829,18834 **** if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null ! $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which --- 19663,19671 ---- if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null ! $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.427 retrieving revision 1.427.4.1 diff -C2 -d -r1.427 -r1.427.4.1 *** configure.in 23 Jul 2003 22:17:27 -0000 1.427 --- configure.in 9 Aug 2003 09:07:56 -0000 1.427.4.1 *************** *** 509,518 **** LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ;; Linux*|GNU*|NetBSD*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH INSTSONAME="$LDLIBRARY".$SOVERSION ;; --- 509,518 ---- LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} ;; Linux*|GNU*|NetBSD*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} INSTSONAME="$LDLIBRARY".$SOVERSION ;; *************** *** 520,529 **** LDLIBRARY='libpython$(VERSION).sl' BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=SHLIB_PATH=`pwd`:$SHLIB_PATH ;; OSF*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH ;; atheos*) --- 520,529 ---- LDLIBRARY='libpython$(VERSION).sl' BLDLIBRARY='-Wl,+b,$(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=SHLIB_PATH=`pwd`:${SHLIB_PATH} ;; OSF*) LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)' ! RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} ;; atheos*) From loewis at users.sourceforge.net Sat Aug 9 03:47:13 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:47:16 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.195, 2.196 sysmodule.c, 2.120, 2.121 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv32549/Python Modified Files: pythonrun.c sysmodule.c Log Message: Move initialization of sys.std{in,out}.encoding to Py_Initialize. Verify that the encoding actually exists. Fixes #775985. Will backport to 2.3. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.195 retrieving revision 2.196 diff -C2 -d -r2.195 -r2.196 *** pythonrun.c 16 Jul 2003 01:54:38 -0000 2.195 --- pythonrun.c 9 Aug 2003 09:47:11 -0000 2.196 *************** *** 78,82 **** without acquiring the import lock */ ! PyObject *PyModule_GetWarningsModule() { PyObject *typ, *val, *tb; --- 78,82 ---- without acquiring the import lock */ ! PyObject *PyModule_GetWarningsModule(void) { PyObject *typ, *val, *tb; *************** *** 143,146 **** --- 143,151 ---- PyObject *bimod, *sysmod; char *p; + #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET) + char *codeset; + char *saved_locale; + PyObject *sys_stream, *sys_isatty; + #endif extern void _Py_ReadyTypes(void); *************** *** 228,246 **** user's preference, if the CODESET names a well-known Python codec, and Py_FileSystemDefaultEncoding isn't ! initialized by other means. */ ! if (!Py_FileSystemDefaultEncoding) { ! char *saved_locale = setlocale(LC_CTYPE, NULL); ! char *codeset; ! setlocale(LC_CTYPE, ""); ! codeset = nl_langinfo(CODESET); ! if (*codeset) { ! PyObject *enc = PyCodec_Encoder(codeset); ! if (enc) { ! Py_FileSystemDefaultEncoding = strdup(codeset); ! Py_DECREF(enc); ! } else ! PyErr_Clear(); } ! setlocale(LC_CTYPE, saved_locale); } #endif --- 233,282 ---- user's preference, if the CODESET names a well-known Python codec, and Py_FileSystemDefaultEncoding isn't ! initialized by other means. Also set the encoding of ! stdin and stdout if these are terminals. */ ! ! saved_locale = setlocale(LC_CTYPE, NULL); ! setlocale(LC_CTYPE, ""); ! codeset = nl_langinfo(CODESET); ! if (codeset && *codeset) { ! PyObject *enc = PyCodec_Encoder(codeset); ! if (enc) { ! codeset = strdup(codeset); ! Py_DECREF(enc); ! } else { ! codeset = NULL; ! PyErr_Clear(); } ! } else ! codeset = NULL; ! setlocale(LC_CTYPE, saved_locale); ! ! if (codeset) { ! sys_stream = PySys_GetObject("stdout"); ! sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); ! if (!sys_isatty) ! PyErr_Clear(); ! if(sys_isatty && PyObject_IsTrue(sys_isatty)) { ! if (!PyFile_SetEncoding(sys_stream, codeset)) ! Py_FatalError("Cannot set codeset of stdin"); ! } ! Py_XDECREF(sys_stream); ! Py_XDECREF(sys_isatty); ! ! sys_stream = PySys_GetObject("stdout"); ! sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); ! if (!sys_isatty) ! PyErr_Clear(); ! if(sys_isatty && PyObject_IsTrue(sys_isatty)) { ! if (!PyFile_SetEncoding(sys_stream, codeset)) ! Py_FatalError("Cannot set codeset of stdout"); ! } ! Py_XDECREF(sys_stream); ! Py_XDECREF(sys_isatty); ! ! if (!Py_FileSystemDefaultEncoding) ! Py_FileSystemDefaultEncoding = codeset; ! else ! free(codeset); } #endif Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.120 retrieving revision 2.121 diff -C2 -d -r2.120 -r2.121 *** sysmodule.c 6 Jul 2003 18:36:54 -0000 2.120 --- sysmodule.c 9 Aug 2003 09:47:11 -0000 2.121 *************** *** 906,912 **** char buf[10]; #endif - #if defined(HAVE_LANGINFO_H) && defined(CODESET) - char *oldloc, *codeset; - #endif m = Py_InitModule3("sys", sys_methods, sys_doc); --- 906,909 ---- *************** *** 931,949 **** #endif - #if defined(HAVE_LANGINFO_H) && defined(CODESET) - oldloc = setlocale(LC_CTYPE, 0); - setlocale(LC_CTYPE, ""); - codeset = nl_langinfo(CODESET); - setlocale(LC_CTYPE, oldloc); - if(codeset && isatty(fileno(stdin))){ - if (!PyFile_SetEncoding(sysin, codeset)) - return NULL; - } - if(codeset && isatty(fileno(stdout))) { - if (!PyFile_SetEncoding(sysout, codeset)) - return NULL; - } - #endif - PyDict_SetItemString(sysdict, "stdin", sysin); PyDict_SetItemString(sysdict, "stdout", sysout); --- 928,931 ---- From loewis at users.sourceforge.net Sat Aug 9 03:48:31 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:48:33 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.10,1.831.4.11 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv406/Misc Modified Files: Tag: release23-maint NEWS Log Message: Move initialization of sys.std{in,out}.encoding to Py_Initialize. Verify that the encoding actually exists. Fixes #775985. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.10 retrieving revision 1.831.4.11 diff -C2 -d -r1.831.4.10 -r1.831.4.11 *** NEWS 8 Aug 2003 12:22:30 -0000 1.831.4.10 --- NEWS 9 Aug 2003 09:48:28 -0000 1.831.4.11 *************** *** 13,16 **** --- 13,18 ---- ----------------- + - Bug #775985: Only set stdout.encoding if a codec is available. + Extension modules ----------------- From loewis at users.sourceforge.net Sat Aug 9 03:48:31 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:48:37 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.195, 2.195.6.1 sysmodule.c, 2.120, 2.120.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv406/Python Modified Files: Tag: release23-maint pythonrun.c sysmodule.c Log Message: Move initialization of sys.std{in,out}.encoding to Py_Initialize. Verify that the encoding actually exists. Fixes #775985. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.195 retrieving revision 2.195.6.1 diff -C2 -d -r2.195 -r2.195.6.1 *** pythonrun.c 16 Jul 2003 01:54:38 -0000 2.195 --- pythonrun.c 9 Aug 2003 09:48:29 -0000 2.195.6.1 *************** *** 78,82 **** without acquiring the import lock */ ! PyObject *PyModule_GetWarningsModule() { PyObject *typ, *val, *tb; --- 78,82 ---- without acquiring the import lock */ ! PyObject *PyModule_GetWarningsModule(void) { PyObject *typ, *val, *tb; *************** *** 143,146 **** --- 143,151 ---- PyObject *bimod, *sysmod; char *p; + #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(CODESET) + char *codeset; + char *saved_locale; + PyObject *sys_stream, *sys_isatty; + #endif extern void _Py_ReadyTypes(void); *************** *** 228,246 **** user's preference, if the CODESET names a well-known Python codec, and Py_FileSystemDefaultEncoding isn't ! initialized by other means. */ ! if (!Py_FileSystemDefaultEncoding) { ! char *saved_locale = setlocale(LC_CTYPE, NULL); ! char *codeset; ! setlocale(LC_CTYPE, ""); ! codeset = nl_langinfo(CODESET); ! if (*codeset) { ! PyObject *enc = PyCodec_Encoder(codeset); ! if (enc) { ! Py_FileSystemDefaultEncoding = strdup(codeset); ! Py_DECREF(enc); ! } else ! PyErr_Clear(); } ! setlocale(LC_CTYPE, saved_locale); } #endif --- 233,282 ---- user's preference, if the CODESET names a well-known Python codec, and Py_FileSystemDefaultEncoding isn't ! initialized by other means. Also set the encoding of ! stdin and stdout if these are terminals. */ ! ! saved_locale = setlocale(LC_CTYPE, NULL); ! setlocale(LC_CTYPE, ""); ! codeset = nl_langinfo(CODESET); ! if (codeset && *codeset) { ! PyObject *enc = PyCodec_Encoder(codeset); ! if (enc) { ! codeset = strdup(codeset); ! Py_DECREF(enc); ! } else { ! codeset = NULL; ! PyErr_Clear(); } ! } else ! codeset = NULL; ! setlocale(LC_CTYPE, saved_locale); ! ! if (codeset) { ! sys_stream = PySys_GetObject("stdout"); ! sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); ! if (!sys_isatty) ! PyErr_Clear(); ! if(sys_isatty && PyObject_IsTrue(sys_isatty)) { ! if (!PyFile_SetEncoding(sys_stream, codeset)) ! Py_FatalError("Cannot set codeset of stdin"); ! } ! Py_XDECREF(sys_stream); ! Py_XDECREF(sys_isatty); ! ! sys_stream = PySys_GetObject("stdout"); ! sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); ! if (!sys_isatty) ! PyErr_Clear(); ! if(sys_isatty && PyObject_IsTrue(sys_isatty)) { ! if (!PyFile_SetEncoding(sys_stream, codeset)) ! Py_FatalError("Cannot set codeset of stdout"); ! } ! Py_XDECREF(sys_stream); ! Py_XDECREF(sys_isatty); ! ! if (!Py_FileSystemDefaultEncoding) ! Py_FileSystemDefaultEncoding = codeset; ! else ! free(codeset); } #endif Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.120 retrieving revision 2.120.6.1 diff -C2 -d -r2.120 -r2.120.6.1 *** sysmodule.c 6 Jul 2003 18:36:54 -0000 2.120 --- sysmodule.c 9 Aug 2003 09:48:29 -0000 2.120.6.1 *************** *** 906,912 **** char buf[10]; #endif - #if defined(HAVE_LANGINFO_H) && defined(CODESET) - char *oldloc, *codeset; - #endif m = Py_InitModule3("sys", sys_methods, sys_doc); --- 906,909 ---- *************** *** 931,949 **** #endif - #if defined(HAVE_LANGINFO_H) && defined(CODESET) - oldloc = setlocale(LC_CTYPE, 0); - setlocale(LC_CTYPE, ""); - codeset = nl_langinfo(CODESET); - setlocale(LC_CTYPE, oldloc); - if(codeset && isatty(fileno(stdin))){ - if (!PyFile_SetEncoding(sysin, codeset)) - return NULL; - } - if(codeset && isatty(fileno(stdout))) { - if (!PyFile_SetEncoding(sysout, codeset)) - return NULL; - } - #endif - PyDict_SetItemString(sysdict, "stdin", sysin); PyDict_SetItemString(sysdict, "stdout", sysout); --- 928,931 ---- From loewis at users.sourceforge.net Sat Aug 9 03:52:44 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:52:46 2003 Subject: [Python-checkins] python/dist/src/Lib/lib-tk Tkconstants.py, 1.8, 1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory sc8-pr-cvs1:/tmp/cvs-serv929/Lib/lib-tk Modified Files: Tkconstants.py Log Message: Add HIDDEN. Fixes #777664. Index: Tkconstants.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkconstants.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Tkconstants.py 9 Aug 2000 19:37:16 -0000 1.8 --- Tkconstants.py 9 Aug 2003 09:52:42 -0000 1.9 *************** *** 71,74 **** --- 71,76 ---- DISABLED='disabled' ACTIVE='active' + # Canvas state + HIDDEN='hidden' # Menu item types From loewis at users.sourceforge.net Sat Aug 9 03:53:53 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:53:56 2003 Subject: [Python-checkins] python/dist/src/Lib/lib-tk Tkconstants.py, 1.8, 1.8.42.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory sc8-pr-cvs1:/tmp/cvs-serv1047/Lib/lib-tk Modified Files: Tag: release23-maint Tkconstants.py Log Message: Add HIDDEN. Fixes #777664. Index: Tkconstants.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkconstants.py,v retrieving revision 1.8 retrieving revision 1.8.42.1 diff -C2 -d -r1.8 -r1.8.42.1 *** Tkconstants.py 9 Aug 2000 19:37:16 -0000 1.8 --- Tkconstants.py 9 Aug 2003 09:53:51 -0000 1.8.42.1 *************** *** 71,74 **** --- 71,76 ---- DISABLED='disabled' ACTIVE='active' + # Canvas state + HIDDEN='hidden' # Menu item types From loewis at users.sourceforge.net Sat Aug 9 03:53:53 2003 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Aug 9 05:54:00 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.11,1.831.4.12 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv1047/Misc Modified Files: Tag: release23-maint NEWS Log Message: Add HIDDEN. Fixes #777664. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.11 retrieving revision 1.831.4.12 diff -C2 -d -r1.831.4.11 -r1.831.4.12 *** NEWS 9 Aug 2003 09:48:28 -0000 1.831.4.11 --- NEWS 9 Aug 2003 09:53:51 -0000 1.831.4.12 *************** *** 28,31 **** --- 28,33 ---- ------- + - Bug #777664: Add Tkconstants.HIDDEN. + - Bug #781065: test_normalization is updated to the current URL of the Unicode 3.2 normalization file. From rhettinger at users.sourceforge.net Sat Aug 9 12:20:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:20:24 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.12,1.831.4.13 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20698/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two consequetive calls to random.seed() are much more likely to produce different sequences. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.12 retrieving revision 1.831.4.13 diff -C2 -d -r1.831.4.12 -r1.831.4.13 *** NEWS 9 Aug 2003 09:53:51 -0000 1.831.4.12 --- NEWS 9 Aug 2003 18:20:16 -0000 1.831.4.13 *************** *** 28,31 **** --- 28,34 ---- ------- + - Bug #778964: random.seed() now uses fractional seconds so that + rapid successive, seeding calls will produce different sequences. + - Bug #777664: Add Tkconstants.HIDDEN. From rhettinger at users.sourceforge.net Sat Aug 9 12:20:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:20:28 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.51,1.51.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv20698/Lib Modified Files: Tag: release23-maint random.py Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two consequetive calls to random.seed() are much more likely to produce different sequences. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.51 retrieving revision 1.51.8.1 diff -C2 -d -r1.51 -r1.51.8.1 *** random.py 24 Jun 2003 20:29:04 -0000 1.51 --- random.py 9 Aug 2003 18:20:16 -0000 1.51.8.1 *************** *** 95,98 **** --- 95,101 ---- """ + if a is None: + import time + a = long(time.time() * 256) # use fractional seconds super(Random, self).seed(a) self.gauss_next = None From rhettinger at users.sourceforge.net Sat Aug 9 12:20:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:20:32 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_random.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-serv20698/Lib/test Modified Files: Tag: release23-maint test_random.py Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two consequetive calls to random.seed() are much more likely to produce different sequences. Index: test_random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_random.py,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -C2 -d -r1.12 -r1.12.8.1 *** test_random.py 24 Jun 2003 20:29:04 -0000 1.12 --- test_random.py 9 Aug 2003 18:20:16 -0000 1.12.8.1 *************** *** 21,25 **** self.gen.seed() state1 = self.gen.getstate() ! time.sleep(1.1) self.gen.seed() # diffent seeds at different times state2 = self.gen.getstate() --- 21,25 ---- self.gen.seed() state1 = self.gen.getstate() ! time.sleep(0.1) self.gen.seed() # diffent seeds at different times state2 = self.gen.getstate() From rhettinger at users.sourceforge.net Sat Aug 9 12:30:59 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:31:06 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.839,1.840 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv21858/Misc Modified Files: NEWS Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two successive calls to random.seed() are much more likely to produce different sequences. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.839 retrieving revision 1.840 diff -C2 -d -r1.839 -r1.840 *** NEWS 8 Aug 2003 12:20:02 -0000 1.839 --- NEWS 9 Aug 2003 18:30:57 -0000 1.840 *************** *** 26,29 **** --- 26,33 ---- ------- + - 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. + - itertools.izip() with no arguments now returns an empty iterator instead of raising a TypeError exception. From rhettinger at users.sourceforge.net Sat Aug 9 12:30:59 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:31:11 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv21858/Lib Modified Files: random.py Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two successive calls to random.seed() are much more likely to produce different sequences. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** random.py 5 Aug 2003 12:23:18 -0000 1.52 --- random.py 9 Aug 2003 18:30:57 -0000 1.53 *************** *** 95,98 **** --- 95,101 ---- """ + if a is None: + import time + a = long(time.time() * 256) # use fractional seconds super(Random, self).seed(a) self.gauss_next = None From rhettinger at users.sourceforge.net Sat Aug 9 12:30:59 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 9 14:31:15 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_random.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv21858/Lib/test Modified Files: test_random.py Log Message: SF bug #778964: bad seed in python 2.3 random The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two successive calls to random.seed() are much more likely to produce different sequences. Index: test_random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_random.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_random.py 24 Jun 2003 20:29:04 -0000 1.12 --- test_random.py 9 Aug 2003 18:30:57 -0000 1.13 *************** *** 21,25 **** self.gen.seed() state1 = self.gen.getstate() ! time.sleep(1.1) self.gen.seed() # diffent seeds at different times state2 = self.gen.getstate() --- 21,25 ---- self.gen.seed() state1 = self.gen.getstate() ! time.sleep(0.1) self.gen.seed() # diffent seeds at different times state2 = self.gen.getstate() From bcannon at users.sourceforge.net Mon Aug 11 01:19:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 03:19:10 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py, 1.23.4.2, 1.23.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv397/Lib Modified Files: Tag: release23-maint _strptime.py Log Message: Fix bug where handling issue of time.tzname[0] == time.tzname[1] and time.daylight were all true. Add an explicit test for this issue. Closes bug #783952 . Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.23.4.2 retrieving revision 1.23.4.3 diff -C2 -d -r1.23.4.2 -r1.23.4.3 *** _strptime.py 8 Aug 2003 01:52:08 -0000 1.23.4.2 --- _strptime.py 11 Aug 2003 07:19:05 -0000 1.23.4.3 *************** *** 494,503 **** # it can be something other than -1. found_zone = found_dict['Z'].lower() ! if locale_time.timezone[0] == locale_time.timezone[1] and \ ! time.daylight: ! pass #Deals with bad locale setup where timezone info is ! # the same; first found on FreeBSD 4.4. ! elif found_zone in ("utc", "gmt"): tz = 0 elif locale_time.timezone[2].lower() == found_zone: tz = 0 --- 494,503 ---- # it can be something other than -1. found_zone = found_dict['Z'].lower() ! if found_zone in ("utc", "gmt"): tz = 0 + elif time.tzname[0] == time.tzname[1] and \ + time.daylight: + continue #Deals with bad locale setup where timezone info is + # the same; first found on FreeBSD 4.4. elif locale_time.timezone[2].lower() == found_zone: tz = 0 From bcannon at users.sourceforge.net Mon Aug 11 01:19:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 03:19:15 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.19.4.2, 1.19.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv397/Lib/test Modified Files: Tag: release23-maint test_strptime.py Log Message: Fix bug where handling issue of time.tzname[0] == time.tzname[1] and time.daylight were all true. Add an explicit test for this issue. Closes bug #783952 . Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.19.4.2 retrieving revision 1.19.4.3 diff -C2 -d -r1.19.4.2 -r1.19.4.3 *** test_strptime.py 6 Aug 2003 21:17:09 -0000 1.19.4.2 --- test_strptime.py 11 Aug 2003 07:19:06 -0000 1.19.4.3 *************** *** 320,323 **** --- 320,346 ---- "time.daylight but timezone value not set to -1") + def test_bad_timezone(self): + # Explicitly test possibility of bad timezone; + # when time.tzname[0] == time.tzname[1] and time.daylight + if sys.platform == "mac": + return # MacOS9 has severely broken timezone support. + try: + original_tzname = time.tzname + original_daylight = time.daylight + time.tzname = ("PDT", "PDT") + time.daylight = 1 + # Need to make sure that timezone is not calculated since that + # calls time.tzset and overrides temporary changes to time . + _strptime._locale_cache = _strptime.TimeRE(_strptime.LocaleTime( + timezone=("PDT", "PDT"))) + _strptime._regex_cache.clear() + tz_value = _strptime.strptime("PDT", "%Z")[8] + self.failUnlessEqual(tz_value, -1) + finally: + time.tzname = original_tzname + time.daylight = original_daylight + _strptime._locale_cache = _strptime.TimeRE() + _strptime._regex_cache.clear() + def test_date_time(self): # Test %c directive From bcannon at users.sourceforge.net Mon Aug 11 01:21:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 03:21:11 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.13,1.831.4.14 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv1090/Misc Modified Files: Tag: release23-maint NEWS Log Message: Add note of closing of bug #783952. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.13 retrieving revision 1.831.4.14 diff -C2 -d -r1.831.4.13 -r1.831.4.14 *** NEWS 9 Aug 2003 18:20:16 -0000 1.831.4.13 --- NEWS 11 Aug 2003 07:21:03 -0000 1.831.4.14 *************** *** 42,45 **** --- 42,49 ---- changes while executing time.strptime() . + - Bug #783952: time.strptime() now properly handles issue of + time.tzname[0] == time.tzname[1] while time.daylight is set to be + true. + IDLE ---- From bcannon at users.sourceforge.net Mon Aug 11 01:24:07 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 03:24:16 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv1618/Lib Modified Files: _strptime.py Log Message: Fix handling of bad locale setup where time.tzname[0] == time.tzname[1] and time.daylight is true. Add an explicit test for this situation. Fixed some wording in docstrings. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** _strptime.py 8 Aug 2003 01:53:05 -0000 1.25 --- _strptime.py 11 Aug 2003 07:24:05 -0000 1.26 *************** *** 65,68 **** --- 65,72 ---- running. The check here is done in case someone does not think about doing this. + + Only other possible issue is if someone changed the timezone and did + not call tz.tzset . That is an issue for the programmer, though, + since changing the timezone is worthless without that call. """ *************** *** 156,159 **** --- 160,165 ---- def __calc_timezone(self): # Set self.timezone by using time.tzname. + # Do not worry about possibility of time.tzname[0] == timetzname[1] + # and time.daylight; handle that in strptime . try: time.tzset() *************** *** 238,242 **** Need to make sure that any characters that might be interpreted as ! regex syntax is escaped. """ --- 244,248 ---- Need to make sure that any characters that might be interpreted as ! regex syntax are escaped. """ *************** *** 264,272 **** # first! _TimeRE_cache = TimeRE() ! _CACHE_MAX_SIZE = 5 _regex_cache = {} def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): ! """Return a time struct based on the input data and the format string.""" global _TimeRE_cache _cache_lock.acquire() --- 270,278 ---- # first! _TimeRE_cache = TimeRE() ! _CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache _regex_cache = {} def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): ! """Return a time struct based on the input string and the format string.""" global _TimeRE_cache _cache_lock.acquire() *************** *** 356,367 **** # it can be something other than -1. found_zone = found_dict['Z'].lower() ! if locale_time.timezone[0] == locale_time.timezone[1] and \ ! time.daylight: ! pass #Deals with bad locale setup where timezone info is ! # the same; first found on FreeBSD 4.4. ! else: ! for value, tz_values in enumerate(locale_time.timezone): ! if found_zone in tz_values: tz = value # Cannot pre-calculate datetime_date() since can change in Julian #calculation and thus could have different value for the day of the week --- 362,376 ---- # it can be something other than -1. found_zone = found_dict['Z'].lower() ! for value, tz_values in enumerate(locale_time.timezone): ! if found_zone in tz_values: ! # Deal with bad locale setup where timezone names are the ! # same and yet time.daylight is true; too ambiguous to ! # be able to tell what timezone has daylight savings ! if time.tzname[0] == time.tzname[1] and \ ! time.daylight: ! break ! else: tz = value + break # Cannot pre-calculate datetime_date() since can change in Julian #calculation and thus could have different value for the day of the week From bcannon at users.sourceforge.net Mon Aug 11 01:24:08 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 03:24:20 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.20, 1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1618/Lib/test Modified Files: test_strptime.py Log Message: Fix handling of bad locale setup where time.tzname[0] == time.tzname[1] and time.daylight is true. Add an explicit test for this situation. Fixed some wording in docstrings. Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_strptime.py 5 Aug 2003 04:02:49 -0000 1.20 --- test_strptime.py 11 Aug 2003 07:24:05 -0000 1.21 *************** *** 6,9 **** --- 6,10 ---- import re import sets + import sys from test import test_support *************** *** 259,262 **** --- 260,266 ---- strp_output = _strptime.strptime("GMT", "%Z") self.failUnlessEqual(strp_output.tm_isdst, 0) + if sys.platform == "mac": + # Timezones don't really work on MacOS9 + return time_tuple = time.localtime() strf_output = time.strftime("%Z") #UTC does not have a timezone *************** *** 271,274 **** --- 275,294 ---- "LocaleTime().timezone has duplicate values and " "time.daylight but timezone value not set to -1") + + def test_bad_timezone(self): + # Explicitly test possibility of bad timezone; + # when time.tzname[0] == time.tzname[1] and time.daylight + if sys.platform == "mac": + return #MacOS9 has severely broken timezone support. + try: + original_tzname = time.tzname + original_daylight = time.daylight + time.tzname = ("PDT", "PDT") + time.daylight = 1 + tz_value = _strptime.strptime("PDT", "%Z")[8] + self.failUnlessEqual(tz_value, -1) + finally: + time.tzname = original_tzname + time.daylight = original_daylight def test_date_time(self): From jackjansen at users.sourceforge.net Mon Aug 11 05:08:51 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 11 07:08:54 2003 Subject: [Python-checkins] python/dist/src/Lib platform.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv3502 Modified Files: platform.py Log Message: Bug fix for #780461: 'sysu' gestalt selector is meaningless on MacOSX, but attempting to get it resulted in a crash. Fixed. Backport candidate. Index: platform.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/platform.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** platform.py 5 Aug 2003 03:52:04 -0000 1.6 --- platform.py 11 Aug 2003 11:08:49 -0000 1.7 *************** *** 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 *************** *** 558,561 **** --- 559,563 ---- try: import gestalt + import MacOS except ImportError: return release,versioninfo,machine From jackjansen at users.sourceforge.net Mon Aug 11 05:16:12 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Mon Aug 11 07:16:14 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Doc setup.py,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv4557 Modified Files: Tag: release23-maint setup.py Log Message: Version number was wrong (2.3b1). Fixed. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/OSX/Doc/setup.py,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** setup.py 28 Jun 2003 23:38:04 -0000 1.4 --- setup.py 11 Aug 2003 11:16:09 -0000 1.4.8.1 *************** *** 35,39 **** self.build_dest = None self.download = 0 ! self.doc_version = '2.3b1' # Only needed if download is true def finalize_options(self): --- 35,39 ---- self.build_dest = None self.download = 0 ! self.doc_version = '2.3' # Only needed if download is true def finalize_options(self): From mwh at python.net Mon Aug 11 14:07:58 2003 From: mwh at python.net (Michael Hudson) Date: Mon Aug 11 08:10:18 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.195, 2.196 sysmodule.c, 2.120, 2.121 In-Reply-To: (loewis@users.sourceforge.net's message of "Sat, 09 Aug 2003 02:47:13 -0700") References: Message-ID: <2moeywpfc1.fsf@starship.python.net> loewis@users.sourceforge.net writes: > Update of /cvsroot/python/python/dist/src/Python > In directory sc8-pr-cvs1:/tmp/cvs-serv32549/Python > > Modified Files: > pythonrun.c sysmodule.c > Log Message: > Move initialization of sys.std{in,out}.encoding to Py_Initialize. > Verify that the encoding actually exists. Fixes #775985. > Will backport to 2.3. These changes seem to make a debug build of Python crap out on exit (during the final GC, the GC code is fiddling with an object that's been sprayed with pymalloc's 'deadbyte' value). Next stop, actually looking at the changes... Cheers, mwh -- For every complex problem, there is a solution that is simple, neat, and wrong. -- H. L. Mencken From jlt63 at users.sourceforge.net Mon Aug 11 06:13:16 2003 From: jlt63 at users.sourceforge.net (jlt63@users.sourceforge.net) Date: Mon Aug 11 08:13:19 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_netrc.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv13033 Modified Files: test_netrc.py Log Message: Unconditionally opening the temp file in text mode causes this test to fail under Cygwin. The attached patch corrects this problem. I tested this patch under Red Hat Linux 8.0 too. Index: test_netrc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_netrc.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_netrc.py 17 Feb 2003 14:51:41 -0000 1.5 --- test_netrc.py 11 Aug 2003 12:13:14 -0000 1.6 *************** *** 1,4 **** ! import netrc, os, unittest from test import test_support --- 1,4 ---- ! import netrc, os, unittest, sys from test import test_support *************** *** 23,27 **** def setUp (self): ! fp = open(temp_filename, 'wt') fp.write(TEST_NETRC) fp.close() --- 23,30 ---- def setUp (self): ! mode = 'w' ! if sys.platform not in ['cygwin']: ! mode += 't' ! fp = open(temp_filename, mode) fp.write(TEST_NETRC) fp.close() From jlt63 at users.sourceforge.net Mon Aug 11 06:13:47 2003 From: jlt63 at users.sourceforge.net (jlt63@users.sourceforge.net) Date: Mon Aug 11 08:13:49 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_netrc.py, 1.5, 1.5.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv13087 Modified Files: Tag: release23-maint test_netrc.py Log Message: Unconditionally opening the temp file in text mode causes this test to fail under Cygwin. The attached patch corrects this problem. I tested this patch under Red Hat Linux 8.0 too. Index: test_netrc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_netrc.py,v retrieving revision 1.5 retrieving revision 1.5.14.1 diff -C2 -d -r1.5 -r1.5.14.1 *** test_netrc.py 17 Feb 2003 14:51:41 -0000 1.5 --- test_netrc.py 11 Aug 2003 12:13:45 -0000 1.5.14.1 *************** *** 1,4 **** ! import netrc, os, unittest from test import test_support --- 1,4 ---- ! import netrc, os, unittest, sys from test import test_support *************** *** 23,27 **** def setUp (self): ! fp = open(temp_filename, 'wt') fp.write(TEST_NETRC) fp.close() --- 23,30 ---- def setUp (self): ! mode = 'w' ! if sys.platform not in ['cygwin']: ! mode += 't' ! fp = open(temp_filename, mode) fp.write(TEST_NETRC) fp.close() From mwh at python.net Mon Aug 11 14:17:08 2003 From: mwh at python.net (Michael Hudson) Date: Mon Aug 11 08:17:11 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.195, 2.196 sysmodule.c, 2.120, 2.121 In-Reply-To: <2moeywpfc1.fsf@starship.python.net> (Michael Hudson's message of "Mon, 11 Aug 2003 13:07:58 +0100") References: <2moeywpfc1.fsf@starship.python.net> Message-ID: <2mllu0pewr.fsf@starship.python.net> Michael Hudson writes: B> loewis@users.sourceforge.net writes: > >> Update of /cvsroot/python/python/dist/src/Python >> In directory sc8-pr-cvs1:/tmp/cvs-serv32549/Python >> >> Modified Files: >> pythonrun.c sysmodule.c >> Log Message: >> Move initialization of sys.std{in,out}.encoding to Py_Initialize. >> Verify that the encoding actually exists. Fixes #775985. >> Will backport to 2.3. > > These changes seem to make a debug build of Python crap out on exit > (during the final GC, the GC code is fiddling with an object that's > been sprayed with pymalloc's 'deadbyte' value). > > Next stop, actually looking at the changes... Got it: it looks like PySys_GetObject returns a borrowed reference. You also set the encoding of sys.stdout twice -- the error message suggests that you meant stdin the first time. I'll fix that too. Cheers, mwh -- I'm a keen cyclist and I stop at red lights. Those who don't need hitting with a great big slapping machine. -- Colin Davidson, cam.misc From mwh at users.sourceforge.net Mon Aug 11 06:20:26 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon Aug 11 08:20:29 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c,2.196,2.197 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv14168/Python Modified Files: pythonrun.c Log Message: Fix refcounting and cut & paste error (?) in last checkin. This should go onto release23-maint, too. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.196 retrieving revision 2.197 diff -C2 -d -r2.196 -r2.197 *** pythonrun.c 9 Aug 2003 09:47:11 -0000 2.196 --- pythonrun.c 11 Aug 2003 12:20:24 -0000 2.197 *************** *** 253,257 **** if (codeset) { ! sys_stream = PySys_GetObject("stdout"); sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); if (!sys_isatty) --- 253,257 ---- if (codeset) { ! sys_stream = PySys_GetObject("stdin"); sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); if (!sys_isatty) *************** *** 261,265 **** Py_FatalError("Cannot set codeset of stdin"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); --- 261,264 ---- *************** *** 272,276 **** Py_FatalError("Cannot set codeset of stdout"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); --- 271,274 ---- From mwh at users.sourceforge.net Mon Aug 11 06:21:42 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon Aug 11 08:21:45 2003 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.195.6.1, 2.195.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv14520 Modified Files: Tag: release23-maint pythonrun.c Log Message: Repeat my refcount & cut&paste fixes on the branch. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.195.6.1 retrieving revision 2.195.6.2 diff -C2 -d -r2.195.6.1 -r2.195.6.2 *** pythonrun.c 9 Aug 2003 09:48:29 -0000 2.195.6.1 --- pythonrun.c 11 Aug 2003 12:21:40 -0000 2.195.6.2 *************** *** 253,257 **** if (codeset) { ! sys_stream = PySys_GetObject("stdout"); sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); if (!sys_isatty) --- 253,257 ---- if (codeset) { ! sys_stream = PySys_GetObject("stdin"); sys_isatty = PyObject_CallMethod(sys_stream, "isatty", ""); if (!sys_isatty) *************** *** 261,265 **** Py_FatalError("Cannot set codeset of stdin"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); --- 261,264 ---- *************** *** 272,276 **** Py_FatalError("Cannot set codeset of stdout"); } - Py_XDECREF(sys_stream); Py_XDECREF(sys_isatty); --- 271,274 ---- From montanaro at users.sourceforge.net Mon Aug 11 07:09:15 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Mon Aug 11 09:09:19 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.41,2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv23543 Modified Files: cStringIO.c Log Message: typos Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** cStringIO.c 8 Aug 2003 12:20:03 -0000 2.41 --- cStringIO.c 11 Aug 2003 13:09:12 -0000 2.42 *************** *** 53,57 **** #define IOOOBJECT(O) ((IOobject*)(O)) ! /* Declarations for objects of type StringO */ typedef struct { /* Subtype of IOobject */ --- 53,57 ---- #define IOOOBJECT(O) ((IOobject*)(O)) ! /* Declarations for objects of type StringIO */ typedef struct { /* Subtype of IOobject */ *************** *** 488,492 **** PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringO", /*tp_name*/ sizeof(Oobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- 488,492 ---- PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringIO", /*tp_name*/ sizeof(Oobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ *************** *** 541,545 **** } ! /* End of code for StringO objects */ /* -------------------------------------------------------- */ --- 541,545 ---- } ! /* End of code for StringIO objects */ /* -------------------------------------------------------- */ From montanaro at users.sourceforge.net Mon Aug 11 07:15:13 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Mon Aug 11 09:15:18 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv24456 Modified Files: cStringIO.c Log Message: shit - just change the visible name, not the comments - strictly speaking, the tp_name is not correct, but what's exposed to users is known visibly as "StringIO", not "StringI" or "StringO". Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.42 retrieving revision 2.43 diff -C2 -d -r2.42 -r2.43 *** cStringIO.c 11 Aug 2003 13:09:12 -0000 2.42 --- cStringIO.c 11 Aug 2003 13:15:11 -0000 2.43 *************** *** 53,57 **** #define IOOOBJECT(O) ((IOobject*)(O)) ! /* Declarations for objects of type StringIO */ typedef struct { /* Subtype of IOobject */ --- 53,57 ---- #define IOOOBJECT(O) ((IOobject*)(O)) ! /* Declarations for objects of type StringO */ typedef struct { /* Subtype of IOobject */ *************** *** 541,545 **** } ! /* End of code for StringIO objects */ /* -------------------------------------------------------- */ --- 541,545 ---- } ! /* End of code for StringO objects */ /* -------------------------------------------------------- */ *************** *** 606,610 **** PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringI", /*tp_name*/ sizeof(Iobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- 606,610 ---- PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringIO", /*tp_name*/ sizeof(Iobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ From just at letterror.com Mon Aug 11 16:36:23 2003 From: just at letterror.com (Just van Rossum) Date: Mon Aug 11 09:38:01 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43 In-Reply-To: Message-ID: montanaro@users.sourceforge.net wrote: > Modified Files: > cStringIO.c > Log Message: > shit - just change the visible name, not the comments - strictly speaking, > the tp_name is not correct, but what's exposed to users is known visibly as > "StringIO", not "StringI" or "StringO". And now there are two distinct types with the same name. What's the point of that? Just From skip at pobox.com Mon Aug 11 10:37:40 2003 From: skip at pobox.com (Skip Montanaro) Date: Mon Aug 11 10:38:01 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43 In-Reply-To: References: Message-ID: <16183.43572.620256.149275@montanaro.dyndns.org> >>>>> "Just" == Just van Rossum writes: Just> montanaro@users.sourceforge.net wrote: >> Modified Files: >> cStringIO.c >> Log Message: >> shit - just change the visible name, not the comments - strictly >> speaking, the tp_name is not correct, but what's exposed to users is >> known visibly as "StringIO", not "StringI" or "StringO". Just> And now there are two distinct types with the same name. What's Just> the point of that? Yes, but I believe those names are only used in stuff like tracebacks. StringO and StringI are not documented as user-visible types: >>> import cStringIO >>> dir(cStringIO) ['InputType', 'OutputType', 'StringIO', '__doc__', '__file__', '__name__', 'cStringIO_CAPI'] so displaying them in tracebacks is at best confusing. It's simply an implementation detail that under the covers different types are used when reading and writing: >>> type(cStringIO.StringIO("sdfsfd")) >>> type(cStringIO.StringIO()) On the other hand, I can see that this would be confusing: >>> t = cStringIO.StringIO() >>> t.write("bar") >>> s = cStringIO.StringIO("sdfsfd") >>> s.write("bar") Traceback (most recent call last): File "", line 1, in ? AttributeError: 'cStringIO.StringIO' object has no attribute 'write' whereas before my checkin the traceback would at least name a different type: AttributeError: 'cStringIO.StringI' object has no attribute 'write' Maybe my change was hasty. If so, mention of StringI and StringO should be made in the StringIO/cStringIO docs. Skip From guido at python.org Mon Aug 11 08:42:17 2003 From: guido at python.org (Guido van Rossum) Date: Mon Aug 11 10:42:47 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43 In-Reply-To: Your message of "Mon, 11 Aug 2003 09:37:40 CDT." <16183.43572.620256.149275@montanaro.dyndns.org> References: <16183.43572.620256.149275@montanaro.dyndns.org> Message-ID: <200308111442.h7BEgIE29887@12-236-84-31.client.attbi.com> > Maybe my change was hasty. If so, mention of StringI and StringO should be > made in the StringIO/cStringIO docs. I'd like the dstinction between StringI and StringO back, as long as it exists. (Even though I think it's unfortunate that it must exist -- the Python module doesn't need it, and occasionally it's useful to be able to switch between reading and writing on the fly.) --Guido van Rossum (home page: http://www.python.org/~guido/) From skip at pobox.com Mon Aug 11 10:49:15 2003 From: skip at pobox.com (Skip Montanaro) Date: Mon Aug 11 10:49:24 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43 In-Reply-To: <200308111442.h7BEgIE29887@12-236-84-31.client.attbi.com> References: <16183.43572.620256.149275@montanaro.dyndns.org> <200308111442.h7BEgIE29887@12-236-84-31.client.attbi.com> Message-ID: <16183.44267.200905.289062@montanaro.dyndns.org> >> Maybe my change was hasty. If so, mention of StringI and StringO >> should be made in the StringIO/cStringIO docs. Guido> I'd like the dstinction between StringI and StringO back, as long Guido> as it exists. Okay, I'll switch it back and make a mention of the two types somewhere in the StringIO docs. Skip From montanaro at users.sourceforge.net Mon Aug 11 08:51:17 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Mon Aug 11 10:51:20 2003 Subject: [Python-checkins] python/dist/src/Modules cStringIO.c,2.43,2.44 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv8404 Modified Files: cStringIO.c Log Message: reverting to 2.41 version (distinct tp_names) - will add verbiage to the docs Index: cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -d -r2.43 -r2.44 *** cStringIO.c 11 Aug 2003 13:15:11 -0000 2.43 --- cStringIO.c 11 Aug 2003 14:51:15 -0000 2.44 *************** *** 488,492 **** PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringIO", /*tp_name*/ sizeof(Oobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- 488,492 ---- PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringO", /*tp_name*/ sizeof(Oobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ *************** *** 606,610 **** PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringIO", /*tp_name*/ sizeof(Iobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- 606,610 ---- PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ ! "cStringIO.StringI", /*tp_name*/ sizeof(Iobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ From montanaro at users.sourceforge.net Mon Aug 11 09:06:09 2003 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Mon Aug 11 11:06:12 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstringio.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11311 Modified Files: libstringio.tex Log Message: add a statement identifying StringI and StringO objects. Index: libstringio.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstringio.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libstringio.tex 31 Jan 2003 05:17:33 -0000 1.7 --- libstringio.tex 11 Aug 2003 15:06:07 -0000 1.8 *************** *** 63,67 **** \function{StringIO()} with a string parameter creates a read-only object. Unlike an object created without a string parameter, it does not have ! write methods. The following data objects are provided as well: --- 63,68 ---- \function{StringIO()} with a string parameter creates a read-only object. Unlike an object created without a string parameter, it does not have ! write methods. These objects are not generally visible. They turn up in ! tracebacks as \class{StringI} and \class{StringO}. The following data objects are provided as well: From mwh at users.sourceforge.net Mon Aug 11 10:14:09 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon Aug 11 12:14:13 2003 Subject: [Python-checkins] python/dist/src/Objects frameobject.c,2.73,2.74 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv28574 Modified Files: frameobject.c Log Message: Fix silly typo in comment. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.73 retrieving revision 2.74 diff -C2 -d -r2.73 -r2.74 *** frameobject.c 5 Feb 2003 22:39:29 -0000 2.73 --- frameobject.c 11 Aug 2003 16:14:06 -0000 2.74 *************** *** 610,614 **** if ((code->co_flags & (CO_NEWLOCALS | CO_OPTIMIZED)) == (CO_NEWLOCALS | CO_OPTIMIZED)) ! locals = NULL; /* PyFrame_Fast2Locals() will set. */ else if (code->co_flags & CO_NEWLOCALS) { locals = PyDict_New(); --- 610,614 ---- if ((code->co_flags & (CO_NEWLOCALS | CO_OPTIMIZED)) == (CO_NEWLOCALS | CO_OPTIMIZED)) ! locals = NULL; /* PyFrame_FastToLocals() will set. */ else if (code->co_flags & CO_NEWLOCALS) { locals = PyDict_New(); From mwh at users.sourceforge.net Mon Aug 11 10:18:45 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon Aug 11 12:18:49 2003 Subject: [Python-checkins] python/dist/src/Misc README,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv29704/Misc Modified Files: README Log Message: mention pymemcompat.h in Misc/README Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/README,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** README 11 Jul 2002 01:01:49 -0000 1.18 --- README 11 Aug 2003 16:18:43 -0000 1.19 *************** *** 21,24 **** --- 21,25 ---- Porting Mini-FAQ on porting to new platforms PURIFY.README Information for Purify users + pymemcompat.h Memory interface compatibility file. python.man UNIX man page for the python interpreter python-mode.el Emacs mode for editing Python programs From akuchling at users.sourceforge.net Mon Aug 11 10:20:41 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Mon Aug 11 12:20:44 2003 Subject: [Python-checkins] python/dist/src/Lib/compiler ast.py, 1.21, 1.22 visitor.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv30061 Modified Files: ast.py visitor.py Log Message: Comment typo fixes Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/ast.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ast.py 23 Feb 2002 22:35:33 -0000 1.21 --- ast.py 11 Aug 2003 16:20:39 -0000 1.22 *************** *** 284,288 **** class Expression(Node): ! # Expression is an artifical node class to support "eval" nodes["expression"] = "Expression" def __init__(self, node): --- 284,288 ---- class Expression(Node): ! # Expression is an artificial node class to support "eval" nodes["expression"] = "Expression" def __init__(self, node): Index: visitor.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/visitor.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** visitor.py 18 Apr 2002 16:26:40 -0000 1.11 --- visitor.py 11 Aug 2003 16:20:39 -0000 1.12 *************** *** 67,71 **** This visitor-driver is only useful for development, when it's ! helpful to develop a visitor incremently, and get feedback on what you still have to do. """ --- 67,71 ---- This visitor-driver is only useful for development, when it's ! helpful to develop a visitor incrementally, and get feedback on what you still have to do. """ From mwh at users.sourceforge.net Mon Aug 11 11:32:04 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Mon Aug 11 13:32:08 2003 Subject: [Python-checkins] python/dist/src/Objects intobject.c,2.105,2.106 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv9770 Modified Files: intobject.c Log Message: Add a couple of decrefs to error paths. Now test_descr only appears to leak two references & I think this are in fact illusory (it's to do with things getting resurrected in __del__ methods & it's easy to be believe confusion occurs when that happens ). Woohoo! Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.105 retrieving revision 2.106 diff -C2 -d -r2.105 -r2.106 *** intobject.c 28 Jun 2003 20:04:24 -0000 2.105 --- intobject.c 11 Aug 2003 17:32:02 -0000 2.106 *************** *** 948,957 **** PyErr_SetString(PyExc_ValueError, "value must convertable to an int"); return NULL; } ival = PyLong_AsLong(tmp); ! if (ival == -1 && PyErr_Occurred()) return NULL; ! } else { ival = ((PyIntObject *)tmp)->ob_ival; --- 948,959 ---- PyErr_SetString(PyExc_ValueError, "value must convertable to an int"); + Py_DECREF(tmp); return NULL; } ival = PyLong_AsLong(tmp); ! if (ival == -1 && PyErr_Occurred()) { ! Py_DECREF(tmp); return NULL; ! } } else { ival = ((PyIntObject *)tmp)->ob_ival; From bcannon at users.sourceforge.net Mon Aug 11 13:06:15 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Aug 11 15:06:18 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.21, 1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv2850/Lib/test Modified Files: test_strptime.py Log Message: Fix bug in test_bad_timezone where test was assuming locale knew of PDT. Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_strptime.py 11 Aug 2003 07:24:05 -0000 1.21 --- test_strptime.py 11 Aug 2003 19:06:13 -0000 1.22 *************** *** 281,290 **** if sys.platform == "mac": return #MacOS9 has severely broken timezone support. try: original_tzname = time.tzname original_daylight = time.daylight ! time.tzname = ("PDT", "PDT") time.daylight = 1 ! tz_value = _strptime.strptime("PDT", "%Z")[8] self.failUnlessEqual(tz_value, -1) finally: --- 281,291 ---- if sys.platform == "mac": return #MacOS9 has severely broken timezone support. + tz_name= time.tzname[0] try: original_tzname = time.tzname original_daylight = time.daylight ! time.tzname = (tz_name, tz_name) time.daylight = 1 ! tz_value = _strptime.strptime(tz_name, "%Z")[8] self.failUnlessEqual(tz_value, -1) finally: From rhettinger at users.sourceforge.net Mon Aug 11 17:43:07 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:43:11 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.1, 1.196.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv22111/tut Modified Files: Tag: release23-maint tut.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.1 retrieving revision 1.196.8.2 diff -C2 -d -r1.196.8.1 -r1.196.8.2 *** tut.tex 8 Aug 2003 23:31:35 -0000 1.196.8.1 --- tut.tex 11 Aug 2003 23:43:04 -0000 1.196.8.2 *************** *** 4486,4490 **** statement names, the current local variables, and the available module names. For dotted expressions such as \code{string.a}, it will ! evaluate the the expression up to the final \character{.} and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a --- 4486,4490 ---- statement names, the current local variables, and the available module names. For dotted expressions such as \code{string.a}, it will ! evaluate the expression up to the final \character{.} and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a From rhettinger at users.sourceforge.net Mon Aug 11 17:43:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:43:16 2003 Subject: [Python-checkins] python/dist/src/Doc/api init.tex,1.10,1.10.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv22111/api Modified Files: Tag: release23-maint init.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.10 retrieving revision 1.10.8.1 diff -C2 -d -r1.10 -r1.10.8.1 *** init.tex 2 Jul 2003 21:38:34 -0000 1.10 --- init.tex 11 Aug 2003 23:43:04 -0000 1.10.8.1 *************** *** 781,785 **** \begin{cfuncdesc}{void}{PyEval_SetTrace}{Py_tracefunc func, PyObject *obj} ! Set the the tracing function to \var{func}. This is similar to \cfunction{PyEval_SetProfile()}, except the tracing function does receive line-number events. --- 781,785 ---- \begin{cfuncdesc}{void}{PyEval_SetTrace}{Py_tracefunc func, PyObject *obj} ! Set the tracing function to \var{func}. This is similar to \cfunction{PyEval_SetProfile()}, except the tracing function does receive line-number events. From rhettinger at users.sourceforge.net Mon Aug 11 17:43:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:43:21 2003 Subject: [Python-checkins] python/dist/src/Doc/ext newtypes.tex, 1.31, 1.31.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1:/tmp/cvs-serv22111/ext Modified Files: Tag: release23-maint newtypes.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.31 retrieving revision 1.31.8.1 diff -C2 -d -r1.31 -r1.31.8.1 *** newtypes.tex 1 Jul 2003 16:17:50 -0000 1.31 --- newtypes.tex 11 Aug 2003 23:43:04 -0000 1.31.8.1 *************** *** 1408,1412 **** In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source ! distribution. Go the the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find --- 1408,1412 ---- In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source ! distribution. Go the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find From rhettinger at users.sourceforge.net Mon Aug 11 17:43:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:43:26 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcgi.tex, 1.40, 1.40.10.1 libcodecs.tex, 1.22, 1.22.8.1 libcurses.tex, 1.42, 1.42.8.1 libdoctest.tex, 1.17, 1.17.8.1 libfuncs.tex, 1.143, 1.143.8.1 libgettext.tex, 1.20.6.1, 1.20.6.2 libpickle.tex, 1.42, 1.42.10.1 libre.tex, 1.101, 1.101.8.1 libstdwin.tex, 1.25, 1.25.26.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22111/lib Modified Files: Tag: release23-maint libcgi.tex libcodecs.tex libcurses.tex libdoctest.tex libfuncs.tex libgettext.tex libpickle.tex libre.tex libstdwin.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: libcgi.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgi.tex,v retrieving revision 1.40 retrieving revision 1.40.10.1 diff -C2 -d -r1.40 -r1.40.10.1 *** libcgi.tex 13 May 2003 02:50:36 -0000 1.40 --- libcgi.tex 11 Aug 2003 23:43:04 -0000 1.40.10.1 *************** *** 102,106 **** is also supported. Form fields containing empty strings are ignored and do not appear in the dictionary; to keep such values, provide ! a true value for the the optional \var{keep_blank_values} keyword parameter when creating the \class{FieldStorage} instance. --- 102,106 ---- is also supported. Form fields containing empty strings are ignored and do not appear in the dictionary; to keep such values, provide ! a true value for the optional \var{keep_blank_values} keyword parameter when creating the \class{FieldStorage} instance. Index: libcodecs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodecs.tex,v retrieving revision 1.22 retrieving revision 1.22.8.1 diff -C2 -d -r1.22 -r1.22.8.1 *** libcodecs.tex 16 Jul 2003 05:17:23 -0000 1.22 --- libcodecs.tex 11 Aug 2003 23:43:04 -0000 1.22.8.1 *************** *** 506,510 **** \var{encode}, \var{decode} must adhere to the \class{Codec} interface, \var{Reader}, \var{Writer} must be factory functions or ! classes providing objects of the the \class{StreamReader} and \class{StreamWriter} interface respectively. --- 506,510 ---- \var{encode}, \var{decode} must adhere to the \class{Codec} interface, \var{Reader}, \var{Writer} must be factory functions or ! classes providing objects of the \class{StreamReader} and \class{StreamWriter} interface respectively. Index: libcurses.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcurses.tex,v retrieving revision 1.42 retrieving revision 1.42.8.1 diff -C2 -d -r1.42 -r1.42.8.1 *** libcurses.tex 14 Jul 2003 18:36:47 -0000 1.42 --- libcurses.tex 11 Aug 2003 23:43:04 -0000 1.42.8.1 *************** *** 338,342 **** displayed and the location on the screen to be used for the display. The arguments are pminrow, pmincol, sminrow, smincol, smaxrow, ! smaxcol; the p arguments refer to the upper left corner of the the pad region to be displayed and the s arguments define a clipping box on the screen within which the pad region is to be displayed. --- 338,342 ---- displayed and the location on the screen to be used for the display. The arguments are pminrow, pmincol, sminrow, smincol, smaxrow, ! smaxcol; the p arguments refer to the upper left corner of the pad region to be displayed and the s arguments define a clipping box on the screen within which the pad region is to be displayed. *************** *** 791,795 **** the entire string is inserted. All characters to the right of ! the cursor are shifted right, with the the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). --- 791,795 ---- the entire string is inserted. All characters to the right of ! the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). *************** *** 799,803 **** Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of ! the cursor are shifted right, with the the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). --- 799,803 ---- Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of ! the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). Index: libdoctest.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdoctest.tex,v retrieving revision 1.17 retrieving revision 1.17.8.1 diff -C2 -d -r1.17 -r1.17.8.1 *** libdoctest.tex 17 Jul 2003 16:00:01 -0000 1.17 --- libdoctest.tex 11 Aug 2003 23:43:04 -0000 1.17.8.1 *************** *** 200,204 **** dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ! \code{M.__test__} are searched even if the the tester has been directed to skip over private names in the rest of the module. In output, a key \code{K} in \code{M.__test__} appears with name --- 200,204 ---- dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ! \code{M.__test__} are searched even if the tester has been directed to skip over private names in the rest of the module. In output, a key \code{K} in \code{M.__test__} appears with name Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.143 retrieving revision 1.143.8.1 diff -C2 -d -r1.143 -r1.143.8.1 *** libfuncs.tex 5 Jul 2003 17:37:58 -0000 1.143 --- libfuncs.tex 11 Aug 2003 23:43:04 -0000 1.143.8.1 *************** *** 69,73 **** If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments ! to be added to the end of the the argument list. Calling \function{apply()} is different from just calling \code{\var{function}(\var{args})}, since in that case there is always --- 69,73 ---- If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments ! to be added to the end of the argument list. Calling \function{apply()} is different from just calling \code{\var{function}(\var{args})}, since in that case there is always Index: libgettext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgettext.tex,v retrieving revision 1.20.6.1 retrieving revision 1.20.6.2 diff -C2 -d -r1.20.6.1 -r1.20.6.2 *** libgettext.tex 5 Aug 2003 05:54:48 -0000 1.20.6.1 --- libgettext.tex 11 Aug 2003 23:43:04 -0000 1.20.6.2 *************** *** 392,396 **** For compatibility with this older module, the function ! \function{Catalog()} is an alias for the the \function{translation()} function described above. --- 392,396 ---- For compatibility with this older module, the function ! \function{Catalog()} is an alias for the \function{translation()} function described above. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.42 retrieving revision 1.42.10.1 diff -C2 -d -r1.42 -r1.42.10.1 *** libpickle.tex 25 Jun 2003 15:07:45 -0000 1.42 --- libpickle.tex 11 Aug 2003 23:43:04 -0000 1.42.10.1 *************** *** 658,662 **** \class{Unpickler}, overriding the \method{load_global()} method. \method{load_global()} should read two lines from the pickle ! data stream where the first line will the the name of the module containing the class and the second line will be the name of the instance's class. It then looks up the class, possibly importing the --- 658,662 ---- \class{Unpickler}, overriding the \method{load_global()} method. \method{load_global()} should read two lines from the pickle ! data stream where the first line will the name of the module containing the class and the second line will be the name of the instance's class. It then looks up the class, possibly importing the Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.101 retrieving revision 1.101.8.1 diff -C2 -d -r1.101 -r1.101.8.1 *** libre.tex 16 Jul 2003 16:19:08 -0000 1.101 --- libre.tex 11 Aug 2003 23:43:04 -0000 1.101.8.1 *************** *** 741,745 **** If a \var{groupN} argument is zero, the 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 \exception{IndexError} exception is raised. --- 741,745 ---- If a \var{groupN} argument is zero, the 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 \exception{IndexError} exception is raised. Index: libstdwin.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdwin.tex,v retrieving revision 1.25 retrieving revision 1.25.26.1 diff -C2 -d -r1.25 -r1.25.26.1 *** libstdwin.tex 20 Oct 2001 04:24:09 -0000 1.25 --- libstdwin.tex 11 Aug 2003 23:43:04 -0000 1.25.26.1 *************** *** 394,398 **** \begin{methoddesc}[window]{setwinpos}{h, v} ! Set the the position of the window's upper left corner (relative to the upper left corner of the screen). \end{methoddesc} --- 394,398 ---- \begin{methoddesc}[window]{setwinpos}{h, v} ! Set the position of the window's upper left corner (relative to the upper left corner of the screen). \end{methoddesc} From rhettinger at users.sourceforge.net Mon Aug 11 17:43:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:43:31 2003 Subject: [Python-checkins] python/dist/src/Doc/mac libframework.tex, 1.9, 1.9.42.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv22111/mac Modified Files: Tag: release23-maint libframework.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: libframework.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libframework.tex,v retrieving revision 1.9 retrieving revision 1.9.42.1 diff -C2 -d -r1.9 -r1.9.42.1 *** libframework.tex 14 Oct 2000 04:53:31 -0000 1.9 --- libframework.tex 11 Aug 2003 23:43:04 -0000 1.9.42.1 *************** *** 175,179 **** Called early in the event loop to handle modeless dialog events. The default method simply dispatches the event to the relevant dialog (not ! through the the \code{DialogWindow} object involved). Override if you need special handling of dialog events (keyboard shortcuts, etc). \end{methoddesc} --- 175,179 ---- Called early in the event loop to handle modeless dialog events. The default method simply dispatches the event to the relevant dialog (not ! through the \code{DialogWindow} object involved). Override if you need special handling of dialog events (keyboard shortcuts, etc). \end{methoddesc} From rhettinger at users.sourceforge.net Mon Aug 11 17:57:03 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 19:57:06 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.35,1.35.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv24588 Modified Files: Tag: release23-maint ref7.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.35 retrieving revision 1.35.16.1 diff -C2 -d -r1.35 -r1.35.16.1 *** ref7.tex 18 Oct 2002 15:20:32 -0000 1.35 --- ref7.tex 11 Aug 2003 23:57:01 -0000 1.35.16.1 *************** *** 436,440 **** \strong{Programmer's note:} variables defined in the class definition are class variables; they are shared by all instances. To define ! instance variables, they must be given a value in the the \method{__init__()} method or in another method. Both class and instance variables are accessible through the notation --- 436,440 ---- \strong{Programmer's note:} variables defined in the class definition are class variables; they are shared by all instances. To define ! instance variables, they must be given a value in the \method{__init__()} method or in another method. Both class and instance variables are accessible through the notation From rhettinger at users.sourceforge.net Mon Aug 11 18:01:19 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:22 2003 Subject: [Python-checkins] python/dist/src/Doc/mac libframework.tex, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory sc8-pr-cvs1:/tmp/cvs-serv25233/mac Modified Files: libframework.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: libframework.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libframework.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libframework.tex 14 Oct 2000 04:53:31 -0000 1.9 --- libframework.tex 12 Aug 2003 00:01:17 -0000 1.10 *************** *** 175,179 **** Called early in the event loop to handle modeless dialog events. The default method simply dispatches the event to the relevant dialog (not ! through the the \code{DialogWindow} object involved). Override if you need special handling of dialog events (keyboard shortcuts, etc). \end{methoddesc} --- 175,179 ---- Called early in the event loop to handle modeless dialog events. The default method simply dispatches the event to the relevant dialog (not ! through the \code{DialogWindow} object involved). Override if you need special handling of dialog events (keyboard shortcuts, etc). \end{methoddesc} From rhettinger at users.sourceforge.net Mon Aug 11 18:01:19 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:30 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref7.tex,1.35,1.36 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv25233/ref Modified Files: ref7.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ref7.tex 18 Oct 2002 15:20:32 -0000 1.35 --- ref7.tex 12 Aug 2003 00:01:17 -0000 1.36 *************** *** 436,440 **** \strong{Programmer's note:} variables defined in the class definition are class variables; they are shared by all instances. To define ! instance variables, they must be given a value in the the \method{__init__()} method or in another method. Both class and instance variables are accessible through the notation --- 436,440 ---- \strong{Programmer's note:} variables defined in the class definition are class variables; they are shared by all instances. To define ! instance variables, they must be given a value in the \method{__init__()} method or in another method. Both class and instance variables are accessible through the notation From rhettinger at users.sourceforge.net Mon Aug 11 18:01:19 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:37 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcgi.tex, 1.40, 1.41 libcodecs.tex, 1.22, 1.23 libcurses.tex, 1.42, 1.43 libdoctest.tex, 1.17, 1.18 libfuncs.tex, 1.144, 1.145 libgettext.tex, 1.21, 1.22 libpickle.tex, 1.42, 1.43 libre.tex, 1.101, 1.102 libstdwin.tex, 1.25, 1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv25233/lib Modified Files: libcgi.tex libcodecs.tex libcurses.tex libdoctest.tex libfuncs.tex libgettext.tex libpickle.tex libre.tex libstdwin.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: libcgi.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgi.tex,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** libcgi.tex 13 May 2003 02:50:36 -0000 1.40 --- libcgi.tex 12 Aug 2003 00:01:14 -0000 1.41 *************** *** 102,106 **** is also supported. Form fields containing empty strings are ignored and do not appear in the dictionary; to keep such values, provide ! a true value for the the optional \var{keep_blank_values} keyword parameter when creating the \class{FieldStorage} instance. --- 102,106 ---- is also supported. Form fields containing empty strings are ignored and do not appear in the dictionary; to keep such values, provide ! a true value for the optional \var{keep_blank_values} keyword parameter when creating the \class{FieldStorage} instance. Index: libcodecs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodecs.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libcodecs.tex 16 Jul 2003 05:17:23 -0000 1.22 --- libcodecs.tex 12 Aug 2003 00:01:15 -0000 1.23 *************** *** 506,510 **** \var{encode}, \var{decode} must adhere to the \class{Codec} interface, \var{Reader}, \var{Writer} must be factory functions or ! classes providing objects of the the \class{StreamReader} and \class{StreamWriter} interface respectively. --- 506,510 ---- \var{encode}, \var{decode} must adhere to the \class{Codec} interface, \var{Reader}, \var{Writer} must be factory functions or ! classes providing objects of the \class{StreamReader} and \class{StreamWriter} interface respectively. Index: libcurses.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcurses.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** libcurses.tex 14 Jul 2003 18:36:47 -0000 1.42 --- libcurses.tex 12 Aug 2003 00:01:15 -0000 1.43 *************** *** 338,342 **** displayed and the location on the screen to be used for the display. The arguments are pminrow, pmincol, sminrow, smincol, smaxrow, ! smaxcol; the p arguments refer to the upper left corner of the the pad region to be displayed and the s arguments define a clipping box on the screen within which the pad region is to be displayed. --- 338,342 ---- displayed and the location on the screen to be used for the display. The arguments are pminrow, pmincol, sminrow, smincol, smaxrow, ! smaxcol; the p arguments refer to the upper left corner of the pad region to be displayed and the s arguments define a clipping box on the screen within which the pad region is to be displayed. *************** *** 791,795 **** the entire string is inserted. All characters to the right of ! the cursor are shifted right, with the the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). --- 791,795 ---- the entire string is inserted. All characters to the right of ! the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). *************** *** 799,803 **** Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of ! the cursor are shifted right, with the the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). --- 799,803 ---- Insert a character string (as many characters as will fit on the line) before the character under the cursor. All characters to the right of ! the cursor are shifted right, with the rightmost characters on the line being lost. The cursor position does not change (after moving to \var{y}, \var{x}, if specified). Index: libdoctest.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdoctest.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** libdoctest.tex 17 Jul 2003 16:00:01 -0000 1.17 --- libdoctest.tex 12 Aug 2003 00:01:15 -0000 1.18 *************** *** 200,204 **** dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ! \code{M.__test__} are searched even if the the tester has been directed to skip over private names in the rest of the module. In output, a key \code{K} in \code{M.__test__} appears with name --- 200,204 ---- dict, and each entry maps a (string) name to a function object, class object, or string. Function and class object docstrings found from ! \code{M.__test__} are searched even if the tester has been directed to skip over private names in the rest of the module. In output, a key \code{K} in \code{M.__test__} appears with name Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** libfuncs.tex 2 Aug 2003 07:42:57 -0000 1.144 --- libfuncs.tex 12 Aug 2003 00:01:15 -0000 1.145 *************** *** 69,73 **** If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments ! to be added to the end of the the argument list. Calling \function{apply()} is different from just calling \code{\var{function}(\var{args})}, since in that case there is always --- 69,73 ---- If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments ! to be added to the end of the argument list. Calling \function{apply()} is different from just calling \code{\var{function}(\var{args})}, since in that case there is always Index: libgettext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgettext.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libgettext.tex 5 Aug 2003 05:54:15 -0000 1.21 --- libgettext.tex 12 Aug 2003 00:01:15 -0000 1.22 *************** *** 392,396 **** For compatibility with this older module, the function ! \function{Catalog()} is an alias for the the \function{translation()} function described above. --- 392,396 ---- For compatibility with this older module, the function ! \function{Catalog()} is an alias for the \function{translation()} function described above. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** libpickle.tex 25 Jun 2003 15:07:45 -0000 1.42 --- libpickle.tex 12 Aug 2003 00:01:15 -0000 1.43 *************** *** 658,662 **** \class{Unpickler}, overriding the \method{load_global()} method. \method{load_global()} should read two lines from the pickle ! data stream where the first line will the the name of the module containing the class and the second line will be the name of the instance's class. It then looks up the class, possibly importing the --- 658,662 ---- \class{Unpickler}, overriding the \method{load_global()} method. \method{load_global()} should read two lines from the pickle ! data stream where the first line will the name of the module containing the class and the second line will be the name of the instance's class. It then looks up the class, possibly importing the Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** libre.tex 16 Jul 2003 16:19:08 -0000 1.101 --- libre.tex 12 Aug 2003 00:01:15 -0000 1.102 *************** *** 741,745 **** If a \var{groupN} argument is zero, the 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 \exception{IndexError} exception is raised. --- 741,745 ---- If a \var{groupN} argument is zero, the 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 \exception{IndexError} exception is raised. Index: libstdwin.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdwin.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** libstdwin.tex 20 Oct 2001 04:24:09 -0000 1.25 --- libstdwin.tex 12 Aug 2003 00:01:16 -0000 1.26 *************** *** 394,398 **** \begin{methoddesc}[window]{setwinpos}{h, v} ! Set the the position of the window's upper left corner (relative to the upper left corner of the screen). \end{methoddesc} --- 394,398 ---- \begin{methoddesc}[window]{setwinpos}{h, v} ! Set the position of the window's upper left corner (relative to the upper left corner of the screen). \end{methoddesc} From rhettinger at users.sourceforge.net Mon Aug 11 18:01:20 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:45 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.197,1.198 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv25233/tut Modified Files: tut.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** tut.tex 8 Aug 2003 23:32:46 -0000 1.197 --- tut.tex 12 Aug 2003 00:01:17 -0000 1.198 *************** *** 4486,4490 **** statement names, the current local variables, and the available module names. For dotted expressions such as \code{string.a}, it will ! evaluate the the expression up to the final \character{.} and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a --- 4486,4490 ---- statement names, the current local variables, and the available module names. For dotted expressions such as \code{string.a}, it will ! evaluate the expression up to the final \character{.} and then suggest completions from the attributes of the resulting object. Note that this may execute application-defined code if an object with a From rhettinger at users.sourceforge.net Mon Aug 11 18:01:46 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:53 2003 Subject: [Python-checkins] python/dist/src/Doc/ext newtypes.tex,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1:/tmp/cvs-serv25233/ext Modified Files: newtypes.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** newtypes.tex 1 Jul 2003 16:17:50 -0000 1.31 --- newtypes.tex 12 Aug 2003 00:01:14 -0000 1.32 *************** *** 1408,1412 **** In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source ! distribution. Go the the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find --- 1408,1412 ---- In order to learn how to implement any specific method for your new datatype, do the following: Download and unpack the Python source ! distribution. Go the \file{Objects} directory, then search the C source files for \code{tp_} plus the function you want (for example, \code{tp_print} or \code{tp_compare}). You will find From rhettinger at users.sourceforge.net Mon Aug 11 18:01:46 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 11 20:01:58 2003 Subject: [Python-checkins] python/dist/src/Doc/api init.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv25233/api Modified Files: init.tex Log Message: SF patch#786531 'the the' typo. Contributed by George Yoshida Index: init.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** init.tex 2 Jul 2003 21:38:34 -0000 1.10 --- init.tex 12 Aug 2003 00:01:14 -0000 1.11 *************** *** 781,785 **** \begin{cfuncdesc}{void}{PyEval_SetTrace}{Py_tracefunc func, PyObject *obj} ! Set the the tracing function to \var{func}. This is similar to \cfunction{PyEval_SetProfile()}, except the tracing function does receive line-number events. --- 781,785 ---- \begin{cfuncdesc}{void}{PyEval_SetTrace}{Py_tracefunc func, PyObject *obj} ! Set the tracing function to \var{func}. This is similar to \cfunction{PyEval_SetProfile()}, except the tracing function does receive line-number events. From doerwalter at users.sourceforge.net Tue Aug 12 11:32:45 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:32:52 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_codeccallbacks.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv14601/Lib/test Modified Files: test_codeccallbacks.py Log Message: Enhance message for UnicodeEncodeError and UnicodeTranslateError. If there is only one bad character it will now be printed in a form that is a valid Python string. Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_codeccallbacks.py 1 May 2003 17:45:36 -0000 1.12 --- test_codeccallbacks.py 12 Aug 2003 17:32:43 -0000 1.13 *************** *** 259,263 **** UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character '\ufc' in position 1: ouch" ) self.check_exceptionobjectargs( --- 259,263 ---- UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( *************** *** 269,274 **** UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\ufc' in position 0: ouch" ) def test_unicodedecodeerror(self): --- 269,290 ---- UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\xfc' in position 0: ouch" ! ) ! self.check_exceptionobjectargs( ! UnicodeEncodeError, ! ["ascii", u"\u0100x", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\u0100' in position 0: ouch" ) + self.check_exceptionobjectargs( + UnicodeEncodeError, + ["ascii", u"\uffffx", 0, 1, "ouch"], + "'ascii' codec can't encode character '\\uffff' in position 0: ouch" + ) + if sys.maxunicode > 0xffff: + self.check_exceptionobjectargs( + UnicodeEncodeError, + ["ascii", u"\U00010000x", 0, 1, "ouch"], + "'ascii' codec can't encode character '\\U00010000' in position 0: ouch" + ) def test_unicodedecodeerror(self): *************** *** 288,293 **** UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character '\\ufc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, --- 304,325 ---- UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character '\\xfc' in position 1: ouch" ! ) ! self.check_exceptionobjectargs( ! UnicodeTranslateError, ! [u"g\u0100rk", 1, 2, "ouch"], ! "can't translate character '\\u0100' in position 1: ouch" ) + self.check_exceptionobjectargs( + UnicodeTranslateError, + [u"g\uffffrk", 1, 2, "ouch"], + "can't translate character '\\uffff' in position 1: ouch" + ) + if sys.maxunicode > 0xffff: + self.check_exceptionobjectargs( + UnicodeTranslateError, + [u"g\U00010000rk", 1, 2, "ouch"], + "can't translate character '\\U00010000' in position 1: ouch" + ) self.check_exceptionobjectargs( UnicodeTranslateError, From doerwalter at users.sourceforge.net Tue Aug 12 11:32:45 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:32:57 2003 Subject: [Python-checkins] python/dist/src/Python exceptions.c,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv14601/Python Modified Files: exceptions.c Log Message: Enhance message for UnicodeEncodeError and UnicodeTranslateError. If there is only one bad character it will now be printed in a form that is a valid Python string. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** exceptions.c 24 Feb 2003 15:33:31 -0000 1.44 --- exceptions.c 12 Aug 2003 17:32:43 -0000 1.45 *************** *** 1252,1259 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't encode character '\\u%x' in position %d: %.400s", PyString_AS_STRING(encodingObj), ! (int)PyUnicode_AS_UNICODE(objectObj)[start], start, PyString_AS_STRING(reasonObj) --- 1252,1267 ---- if (end==start+1) { + int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; + char *format; + if (badchar <= 0xff) + format = "'%.400s' codec can't encode character '\\x%02x' in position %d: %.400s"; + else if (badchar <= 0xffff) + format = "'%.400s' codec can't encode character '\\u%04x' in position %d: %.400s"; + else + format = "'%.400s' codec can't encode character '\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), ! format, PyString_AS_STRING(encodingObj), ! badchar, start, PyString_AS_STRING(reasonObj) *************** *** 1330,1334 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't decode byte 0x%x in position %d: %.400s", PyString_AS_STRING(encodingObj), ((int)PyString_AS_STRING(objectObj)[start])&0xff, --- 1338,1342 ---- if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't decode byte 0x%02x in position %d: %.400s", PyString_AS_STRING(encodingObj), ((int)PyString_AS_STRING(objectObj)[start])&0xff, *************** *** 1439,1445 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "can't translate character '\\u%x' in position %d: %.400s", ! (int)PyUnicode_AS_UNICODE(objectObj)[start], start, PyString_AS_STRING(reasonObj) --- 1447,1461 ---- if (end==start+1) { + int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; + char *format; + if (badchar <= 0xff) + format = "can't translate character '\\x%02x' in position %d: %.400s"; + else if (badchar <= 0xffff) + format = "can't translate character '\\u%04x' in position %d: %.400s"; + else + format = "can't translate character '\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), ! format, ! badchar, start, PyString_AS_STRING(reasonObj) From doerwalter at users.sourceforge.net Tue Aug 12 11:34:51 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:34:55 2003 Subject: [Python-checkins] python/dist/src/Python exceptions.c,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv14911/Python Modified Files: exceptions.c Log Message: Add a unicode prefix to the characters in the UnicodeEncodeError and UnicodeTranslateError message. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** exceptions.c 12 Aug 2003 17:32:43 -0000 1.45 --- exceptions.c 12 Aug 2003 17:34:49 -0000 1.46 *************** *** 1255,1263 **** char *format; if (badchar <= 0xff) ! format = "'%.400s' codec can't encode character '\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) ! format = "'%.400s' codec can't encode character '\\u%04x' in position %d: %.400s"; else ! format = "'%.400s' codec can't encode character '\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, --- 1255,1263 ---- char *format; if (badchar <= 0xff) ! format = "'%.400s' codec can't encode character u'\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) ! format = "'%.400s' codec can't encode character u'\\u%04x' in position %d: %.400s"; else ! format = "'%.400s' codec can't encode character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, *************** *** 1450,1458 **** char *format; if (badchar <= 0xff) ! format = "can't translate character '\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) ! format = "can't translate character '\\u%04x' in position %d: %.400s"; else ! format = "can't translate character '\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, --- 1450,1458 ---- char *format; if (badchar <= 0xff) ! format = "can't translate character u'\\x%02x' in position %d: %.400s"; else if (badchar <= 0xffff) ! format = "can't translate character u'\\u%04x' in position %d: %.400s"; else ! format = "can't translate character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), format, From doerwalter at users.sourceforge.net Tue Aug 12 11:34:51 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:34:59 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_codeccallbacks.py, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv14911/Lib/test Modified Files: test_codeccallbacks.py Log Message: Add a unicode prefix to the characters in the UnicodeEncodeError and UnicodeTranslateError message. Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_codeccallbacks.py 12 Aug 2003 17:32:43 -0000 1.13 --- test_codeccallbacks.py 12 Aug 2003 17:34:49 -0000 1.14 *************** *** 259,263 **** UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( --- 259,263 ---- UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character u'\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( *************** *** 269,283 **** UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\xfc' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\u0100x", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\u0100' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\uffffx", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\uffff' in position 0: ouch" ) if sys.maxunicode > 0xffff: --- 269,283 ---- UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\xfc' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\u0100x", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\u0100' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\uffffx", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\uffff' in position 0: ouch" ) if sys.maxunicode > 0xffff: *************** *** 285,289 **** UnicodeEncodeError, ["ascii", u"\U00010000x", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\\U00010000' in position 0: ouch" ) --- 285,289 ---- UnicodeEncodeError, ["ascii", u"\U00010000x", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\U00010000' in position 0: ouch" ) *************** *** 304,318 **** UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], ! "can't translate character '\\u0100' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\uffffrk", 1, 2, "ouch"], ! "can't translate character '\\uffff' in position 1: ouch" ) if sys.maxunicode > 0xffff: --- 304,318 ---- UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character u'\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\u0100rk", 1, 2, "ouch"], ! "can't translate character u'\\u0100' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, [u"g\uffffrk", 1, 2, "ouch"], ! "can't translate character u'\\uffff' in position 1: ouch" ) if sys.maxunicode > 0xffff: *************** *** 320,324 **** UnicodeTranslateError, [u"g\U00010000rk", 1, 2, "ouch"], ! "can't translate character '\\U00010000' in position 1: ouch" ) self.check_exceptionobjectargs( --- 320,324 ---- UnicodeTranslateError, [u"g\U00010000rk", 1, 2, "ouch"], ! "can't translate character u'\\U00010000' in position 1: ouch" ) self.check_exceptionobjectargs( From doerwalter at users.sourceforge.net Tue Aug 12 11:38:24 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:38:28 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_codeccallbacks.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-serv15853/Lib/test Modified Files: Tag: release23-maint test_codeccallbacks.py Log Message: Backport checkins: * Enhance message for UnicodeEncodeError and UnicodeTranslateError. If there is only one bad character it will now be printed in a form that is a valid Python string. * Add a unicode prefix to the characters in the UnicodeEncodeError and UnicodeTranslateError message. Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -C2 -d -r1.12 -r1.12.8.1 *** test_codeccallbacks.py 1 May 2003 17:45:36 -0000 1.12 --- test_codeccallbacks.py 12 Aug 2003 17:38:22 -0000 1.12.8.1 *************** *** 259,263 **** UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character '\ufc' in position 1: ouch" ) self.check_exceptionobjectargs( --- 259,263 ---- UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], ! "'ascii' codec can't encode character u'\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( *************** *** 269,274 **** UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character '\ufc' in position 0: ouch" ) def test_unicodedecodeerror(self): --- 269,290 ---- UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\xfc' in position 0: ouch" ! ) ! self.check_exceptionobjectargs( ! UnicodeEncodeError, ! ["ascii", u"\u0100x", 0, 1, "ouch"], ! "'ascii' codec can't encode character u'\\u0100' in position 0: ouch" ) + self.check_exceptionobjectargs( + UnicodeEncodeError, + ["ascii", u"\uffffx", 0, 1, "ouch"], + "'ascii' codec can't encode character u'\\uffff' in position 0: ouch" + ) + if sys.maxunicode > 0xffff: + self.check_exceptionobjectargs( + UnicodeEncodeError, + ["ascii", u"\U00010000x", 0, 1, "ouch"], + "'ascii' codec can't encode character u'\\U00010000' in position 0: ouch" + ) def test_unicodedecodeerror(self): *************** *** 288,293 **** UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character '\\ufc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeTranslateError, --- 304,325 ---- UnicodeTranslateError, [u"g\xfcrk", 1, 2, "ouch"], ! "can't translate character u'\\xfc' in position 1: ouch" ! ) ! self.check_exceptionobjectargs( ! UnicodeTranslateError, ! [u"g\u0100rk", 1, 2, "ouch"], ! "can't translate character u'\\u0100' in position 1: ouch" ) + self.check_exceptionobjectargs( + UnicodeTranslateError, + [u"g\uffffrk", 1, 2, "ouch"], + "can't translate character u'\\uffff' in position 1: ouch" + ) + if sys.maxunicode > 0xffff: + self.check_exceptionobjectargs( + UnicodeTranslateError, + [u"g\U00010000rk", 1, 2, "ouch"], + "can't translate character u'\\U00010000' in position 1: ouch" + ) self.check_exceptionobjectargs( UnicodeTranslateError, From doerwalter at users.sourceforge.net Tue Aug 12 11:38:24 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Tue Aug 12 13:38:32 2003 Subject: [Python-checkins] python/dist/src/Python exceptions.c, 1.44, 1.44.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv15853/Python Modified Files: Tag: release23-maint exceptions.c Log Message: Backport checkins: * Enhance message for UnicodeEncodeError and UnicodeTranslateError. If there is only one bad character it will now be printed in a form that is a valid Python string. * Add a unicode prefix to the characters in the UnicodeEncodeError and UnicodeTranslateError message. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.44 retrieving revision 1.44.10.1 diff -C2 -d -r1.44 -r1.44.10.1 *** exceptions.c 24 Feb 2003 15:33:31 -0000 1.44 --- exceptions.c 12 Aug 2003 17:38:21 -0000 1.44.10.1 *************** *** 1252,1259 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't encode character '\\u%x' in position %d: %.400s", PyString_AS_STRING(encodingObj), ! (int)PyUnicode_AS_UNICODE(objectObj)[start], start, PyString_AS_STRING(reasonObj) --- 1252,1267 ---- if (end==start+1) { + int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; + char *format; + if (badchar <= 0xff) + format = "'%.400s' codec can't encode character u'\\x%02x' in position %d: %.400s"; + else if (badchar <= 0xffff) + format = "'%.400s' codec can't encode character u'\\u%04x' in position %d: %.400s"; + else + format = "'%.400s' codec can't encode character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), ! format, PyString_AS_STRING(encodingObj), ! badchar, start, PyString_AS_STRING(reasonObj) *************** *** 1330,1334 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't decode byte 0x%x in position %d: %.400s", PyString_AS_STRING(encodingObj), ((int)PyString_AS_STRING(objectObj)[start])&0xff, --- 1338,1342 ---- if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "'%.400s' codec can't decode byte 0x%02x in position %d: %.400s", PyString_AS_STRING(encodingObj), ((int)PyString_AS_STRING(objectObj)[start])&0xff, *************** *** 1439,1445 **** if (end==start+1) { PyOS_snprintf(buffer, sizeof(buffer), ! "can't translate character '\\u%x' in position %d: %.400s", ! (int)PyUnicode_AS_UNICODE(objectObj)[start], start, PyString_AS_STRING(reasonObj) --- 1447,1461 ---- if (end==start+1) { + int badchar = (int)PyUnicode_AS_UNICODE(objectObj)[start]; + char *format; + if (badchar <= 0xff) + format = "can't translate character u'\\x%02x' in position %d: %.400s"; + else if (badchar <= 0xffff) + format = "can't translate character u'\\u%04x' in position %d: %.400s"; + else + format = "can't translate character u'\\U%08x' in position %d: %.400s"; PyOS_snprintf(buffer, sizeof(buffer), ! format, ! badchar, start, PyString_AS_STRING(reasonObj) From eprice at users.sourceforge.net Tue Aug 12 17:04:26 2003 From: eprice at users.sourceforge.net (eprice@users.sourceforge.net) Date: Tue Aug 12 19:04:32 2003 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.11, 1.12 test_Decimal.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1:/tmp/cvs-serv7049 Modified Files: Decimal.py test_Decimal.py Log Message: Updated to add tointegral function and unittest. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Decimal.py 4 Jul 2003 03:11:42 -0000 1.11 --- Decimal.py 12 Aug 2003 23:04:23 -0000 1.12 *************** *** 1644,1647 **** --- 1644,1648 ---- context = getcontext() + #Because the spot << doesn't work with really big exponents if n._isinfinity() or n.adjusted() > 8: return context.raise_error(InvalidOperation, 'x ** INF') *************** *** 1687,1691 **** firstprec = context.prec ! if firstprec + elength + 1 > ABSOLUTE_MAX_EXP: return context.raise_error(Overflow, 'Too much precision.', sign) --- 1688,1692 ---- firstprec = context.prec ! if not modulo and firstprec + elength + 1 > ABSOLUTE_MAX_EXP: return context.raise_error(Overflow, 'Too much precision.', sign) *************** *** 1824,1827 **** --- 1825,1842 ---- return self.rescale(0, rounding, context=context) + def tointegral(self, rounding = None, context=None): + """Rounds to the nearest integer, without raising inexact, rounded.""" + if context is None: + context = getcontext() + ans = self._check_nans(context=context) + if ans: + return ans + if self._exp >= 0: + return self + flags = context.ignore_flags(Rounded, Inexact) + ans = self.rescale(0, rounding, context=context) + context.regard_flags(flags) + return ans + def sqrt(self, context=None): """Return the square root of self. *************** *** 2232,2235 **** --- 2247,2252 ---- def tosci(self, a): return a.sci(context=self) + def tointegral(self, a): + return a.tointegral(context=self) def trim(self, a): return a.trim(context=self) Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_Decimal.py 2 Jul 2003 23:50:01 -0000 1.2 --- test_Decimal.py 12 Aug 2003 23:04:23 -0000 1.3 *************** *** 268,277 **** self.eval_file(dir + 'inexact' + '.decTest') ! def test_integer(self): ! """Tests the Decimal class on Cowlishaw's integer tests. ! ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. ! """ ! self.eval_file(dir + 'integer' + '.decTest') def test_max(self): --- 268,277 ---- self.eval_file(dir + 'inexact' + '.decTest') ! #def test_integer(self): ! # """Tests the Decimal class on Cowlishaw's integer tests. ! # ! # See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. ! # """ ! # self.eval_file(dir + 'integer' + '.decTest') def test_max(self): *************** *** 379,382 **** --- 379,389 ---- """ self.eval_file(dir + 'subtract' + '.decTest') + + def test_tointegral(self): + """Tests the Decimal class on Cowlishaw's tointegral tests. + + See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. + """ + self.eval_file(dir + 'tointegral' + '.decTest') def test_trim(self): From eprice at users.sourceforge.net Tue Aug 12 17:05:33 2003 From: eprice at users.sourceforge.net (eprice@users.sourceforge.net) Date: Tue Aug 12 19:05:37 2003 Subject: [Python-checkins] python/nondist/sandbox/decimal/tests tointegral.decTest, NONE, 1.1 abs.decTest, 1.3, 1.4 add.decTest, 1.3, 1.4 base.decTest, 1.3, 1.4 clamp.decTest, 1.3, 1.4 compare.decTest, 1.3, 1.4 decimal64.decTest, 1.3, 1.4 divide.decTest, 1.3, 1.4 divideint.decTest, 1.3, 1.4 inexact.decTest, 1.3, 1.4 max.decTest, 1.3, 1.4 min.decTest, 1.3, 1.4 minus.decTest, 1.3, 1.4 multiply.decTest, 1.3, 1.4 normalize.decTest, 1.3, 1.4 plus.decTest, 1.3, 1.4 power.decTest, 1.3, 1.4 quantize.decTest, 1.1, 1.2 randomBound32.decTest, 1.3, 1.4 randoms.decTest, 1.3, 1.4 remainder.decTest, 1.3, 1.4 remainderNear.decTest, 1.3, 1.4 rescale.decTest, 1.3, 1.4 rounding.decTest, 1.3, 1.4 squareroot.decTest, 1.3, 1.4 subtract.decTest, 1.3, 1.4 testall.decTest, 1.3, 1.4 trim.decTest, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal/tests In directory sc8-pr-cvs1:/tmp/cvs-serv7408 Modified Files: abs.decTest add.decTest base.decTest clamp.decTest compare.decTest decimal64.decTest divide.decTest divideint.decTest inexact.decTest max.decTest min.decTest minus.decTest multiply.decTest normalize.decTest plus.decTest power.decTest quantize.decTest randomBound32.decTest randoms.decTest remainder.decTest remainderNear.decTest rescale.decTest rounding.decTest squareroot.decTest subtract.decTest testall.decTest trim.decTest Added Files: tointegral.decTest Log Message: Updated tests, added test --- NEW FILE: tointegral.decTest --- ------------------------------------------------------------------------ -- tointegral.decTest -- round decimal to integral value -- -- Copyright (c) IBM Corporation, 2001, 2003. All rights reserved. -- ------------------------------------------------------------------------ -- Please see the document "General Decimal Arithmetic Testcases" -- -- at http://www2.hursley.ibm.com/decimal for the description of -- -- these testcases. -- -- -- -- These testcases are experimental ('beta' versions), and they -- -- may contain errors. They are offered on an as-is basis. In -- -- particular, achieving the same results as the tests here is not -- -- a guarantee that an implementation complies with any Standard -- -- or specification. The tests are not exhaustive. -- -- -- -- Please send comments, suggestions, and corrections to the author: -- -- Mike Cowlishaw, IBM Fellow -- -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ version: 2.28 -- This set of tests tests the extended specification 'round-to-integral -- value' operation (from IEEE 854, later modified in 754r). -- All non-zero results are defined as being those from either copy or -- quantize, so those are assumed to have been tested. -- Note that 754r requires that not be set, and we similarly -- assume Rounded is not set. extended: 1 precision: 9 rounding: half_up maxExponent: 999 minExponent: -999 intx001 tointegral 0 -> 0 intx002 tointegral 0.0 -> 0 intx003 tointegral 0.1 -> 0 intx004 tointegral 0.2 -> 0 intx005 tointegral 0.3 -> 0 intx006 tointegral 0.4 -> 0 intx007 tointegral 0.5 -> 1 intx008 tointegral 0.6 -> 1 intx009 tointegral 0.7 -> 1 intx010 tointegral 0.8 -> 1 intx011 tointegral 0.9 -> 1 intx012 tointegral 1 -> 1 intx013 tointegral 1.0 -> 1 intx014 tointegral 1.1 -> 1 intx015 tointegral 1.2 -> 1 intx016 tointegral 1.3 -> 1 intx017 tointegral 1.4 -> 1 intx018 tointegral 1.5 -> 2 intx019 tointegral 1.6 -> 2 intx020 tointegral 1.7 -> 2 intx021 tointegral 1.8 -> 2 intx022 tointegral 1.9 -> 2 -- negatives intx031 tointegral -0 -> -0 intx032 tointegral -0.0 -> -0 intx033 tointegral -0.1 -> -0 intx034 tointegral -0.2 -> -0 intx035 tointegral -0.3 -> -0 intx036 tointegral -0.4 -> -0 intx037 tointegral -0.5 -> -1 intx038 tointegral -0.6 -> -1 intx039 tointegral -0.7 -> -1 intx040 tointegral -0.8 -> -1 intx041 tointegral -0.9 -> -1 intx042 tointegral -1 -> -1 intx043 tointegral -1.0 -> -1 intx044 tointegral -1.1 -> -1 intx045 tointegral -1.2 -> -1 intx046 tointegral -1.3 -> -1 intx047 tointegral -1.4 -> -1 intx048 tointegral -1.5 -> -2 intx049 tointegral -1.6 -> -2 intx050 tointegral -1.7 -> -2 intx051 tointegral -1.8 -> -2 intx052 tointegral -1.9 -> -2 -- next two would be NaN using quantize(x, 0) intx053 tointegral 10E+30 -> 1.0E+31 intx054 tointegral -10E+30 -> -1.0E+31 -- numbers around precision precision: 9 intx060 tointegral '56267E-10' -> '0' intx061 tointegral '56267E-5' -> '1' intx062 tointegral '56267E-2' -> '563' intx063 tointegral '56267E-1' -> '5627' intx065 tointegral '56267E-0' -> '56267' intx066 tointegral '56267E+0' -> '56267' intx067 tointegral '56267E+1' -> '5.6267E+5' intx068 tointegral '56267E+2' -> '5.6267E+6' intx069 tointegral '56267E+3' -> '5.6267E+7' intx070 tointegral '56267E+4' -> '5.6267E+8' intx071 tointegral '56267E+5' -> '5.6267E+9' intx072 tointegral '56267E+6' -> '5.6267E+10' intx073 tointegral '1.23E+96' -> '1.23E+96' intx074 tointegral '1.23E+384' -> '1.23E+384' intx075 tointegral '1.23E+999' -> '1.23E+999' intx080 tointegral '-56267E-10' -> '-0' intx081 tointegral '-56267E-5' -> '-1' intx082 tointegral '-56267E-2' -> '-563' intx083 tointegral '-56267E-1' -> '-5627' intx085 tointegral '-56267E-0' -> '-56267' intx086 tointegral '-56267E+0' -> '-56267' intx087 tointegral '-56267E+1' -> '-5.6267E+5' intx088 tointegral '-56267E+2' -> '-5.6267E+6' intx089 tointegral '-56267E+3' -> '-5.6267E+7' intx090 tointegral '-56267E+4' -> '-5.6267E+8' intx091 tointegral '-56267E+5' -> '-5.6267E+9' intx092 tointegral '-56267E+6' -> '-5.6267E+10' intx093 tointegral '-1.23E+96' -> '-1.23E+96' intx094 tointegral '-1.23E+384' -> '-1.23E+384' intx095 tointegral '-1.23E+999' -> '-1.23E+999' -- specials and zeros intx120 tointegral 'Inf' -> Infinity intx121 tointegral '-Inf' -> -Infinity intx122 tointegral NaN -> NaN intx123 tointegral sNaN -> NaN Invalid_operation intx124 tointegral 0 -> 0 intx125 tointegral -0 -> -0 intx126 tointegral 0.000 -> 0 intx127 tointegral 0.00 -> 0 intx128 tointegral 0.0 -> 0 intx129 tointegral 0 -> 0 intx130 tointegral 0E-3 -> 0 intx131 tointegral 0E-2 -> 0 intx132 tointegral 0E-1 -> 0 intx133 tointegral 0E-0 -> 0 intx134 tointegral 0E+1 -> 0E+1 intx135 tointegral 0E+2 -> 0E+2 intx136 tointegral 0E+3 -> 0E+3 intx137 tointegral 0E+4 -> 0E+4 intx138 tointegral 0E+5 -> 0E+5 intx139 tointegral -0.000 -> -0 intx140 tointegral -0.00 -> -0 intx141 tointegral -0.0 -> -0 intx142 tointegral -0 -> -0 intx143 tointegral -0E-3 -> -0 intx144 tointegral -0E-2 -> -0 intx145 tointegral -0E-1 -> -0 intx146 tointegral -0E-0 -> -0 intx147 tointegral -0E+1 -> -0E+1 intx148 tointegral -0E+2 -> -0E+2 intx149 tointegral -0E+3 -> -0E+3 intx150 tointegral -0E+4 -> -0E+4 intx151 tointegral -0E+5 -> -0E+5 -- examples rounding: half_up precision: 9 intx200 tointegral 2.1 -> 2 intx201 tointegral 100 -> 100 intx202 tointegral 100.0 -> 100 intx203 tointegral 101.5 -> 102 intx204 tointegral -101.5 -> -102 intx205 tointegral 10E+5 -> 1.0E+6 intx206 tointegral 7.89E+77 -> 7.89E+77 intx207 tointegral -Inf -> -Infinity Index: abs.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/abs.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** abs.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- abs.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. Index: add.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/add.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** add.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- add.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 precision: 9 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 precision: 9 *************** *** 305,310 **** addx269 add '123456789' 1.1 -> '123456790' Inexact Rounded - rounding: half_up - -- input preparation tests (operands should not be rounded) precision: 3 --- 305,308 ---- *************** *** 400,403 **** --- 398,418 ---- addx363 add 10000E+1 10000E-50 -> 100000.0 Rounded Inexact + -- a curiosity from JSR 13 testing + rounding: half_down + precision: 10 + addx370 add 99999999 81512 -> 100081511 + precision: 6 + addx371 add 99999999 81512 -> 1.00082E+8 Rounded Inexact + rounding: half_up + precision: 10 + addx372 add 99999999 81512 -> 100081511 + precision: 6 + addx373 add 99999999 81512 -> 1.00082E+8 Rounded Inexact + rounding: half_even + precision: 10 + addx374 add 99999999 81512 -> 100081511 + precision: 6 + addx375 add 99999999 81512 -> 1.00082E+8 Rounded Inexact + -- ulp replacement tests precision: 9 *************** *** 547,550 **** --- 562,573 ---- addx552 add 0 1234567896 -> 1234567896 + -- verify a query + precision: 16 + maxExponent: +394 + minExponent: -393 + rounding: down + addx561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded + addx562 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded + -- some more residue effects with extreme rounding precision: 9 *************** *** 972,975 **** --- 995,1058 ---- addx1025 add 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow addx1026 add 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow + + -- And for round down full and subnormal results + precision: 16 + maxExponent: +394 + minExponent: -393 + rounding: down + + addx1100 add 1e+2 -1e-393 -> 99.99999999999999 Rounded Inexact + addx1101 add 1e+1 -1e-393 -> 9.999999999999999 Rounded Inexact + addx1103 add +1 -1e-393 -> 0.9999999999999999 Rounded Inexact + addx1104 add 1e-1 -1e-393 -> 0.09999999999999999 Rounded Inexact + addx1105 add 1e-2 -1e-393 -> 0.009999999999999999 Rounded Inexact + addx1106 add 1e-3 -1e-393 -> 0.0009999999999999999 Rounded Inexact + addx1107 add 1e-4 -1e-393 -> 0.00009999999999999999 Rounded Inexact + addx1108 add 1e-5 -1e-393 -> 0.000009999999999999999 Rounded Inexact + addx1109 add 1e-6 -1e-393 -> 9.999999999999999E-7 Rounded Inexact + + rounding: ceiling + addx1110 add -1e+2 +1e-393 -> -99.99999999999999 Rounded Inexact + addx1111 add -1e+1 +1e-393 -> -9.999999999999999 Rounded Inexact + addx1113 add -1 +1e-393 -> -0.9999999999999999 Rounded Inexact + addx1114 add -1e-1 +1e-393 -> -0.09999999999999999 Rounded Inexact + addx1115 add -1e-2 +1e-393 -> -0.009999999999999999 Rounded Inexact + addx1116 add -1e-3 +1e-393 -> -0.0009999999999999999 Rounded Inexact + addx1117 add -1e-4 +1e-393 -> -0.00009999999999999999 Rounded Inexact + addx1118 add -1e-5 +1e-393 -> -0.000009999999999999999 Rounded Inexact + addx1119 add -1e-6 +1e-393 -> -9.999999999999999E-7 Rounded Inexact + + rounding: down + precision: 7 + maxExponent: +96 + minExponent: -95 + addx1130 add 1 -1e-200 -> 0.9999999 Rounded Inexact + -- subnormal boundary + addx1131 add 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact + addx1132 add 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact + addx1133 add 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow + addx1134 add 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow + addx1135 add 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow + addx1136 add 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow + addx1137 add 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal + addx1138 add 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow + addx1139 add 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow + addx1140 add 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow + addx1141 add 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow + addx1142 add 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow + addx1143 add 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow + addx1144 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow + + addx1151 add 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow + addx1152 add 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow + addx1153 add 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow + addx1154 add 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow + addx1155 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow + addx1156 add 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow + addx1157 add 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow + + addx1160 add 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow + addx1161 add 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow + -- Null tests Index: base.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/base.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** base.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- base.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This file tests base conversions from string to a decimal number --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This file tests base conversions from string to a decimal number Index: clamp.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/clamp.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** clamp.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- clamp.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of tests uses the same limits as the 8-byte concrete --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests uses the same limits as the 8-byte concrete Index: compare.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/compare.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compare.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- compare.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- Note that we cannot assume add/subtract tests cover paths adequately, --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- Note that we cannot assume add/subtract tests cover paths adequately, Index: decimal64.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/decimal64.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** decimal64.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- decimal64.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of tests is for the eight-byte concrete representation. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests is for the eight-byte concrete representation. Index: divide.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divide.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** divide.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- divide.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: divideint.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divideint.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** divideint.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- divideint.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: inexact.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/inexact.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inexact.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- inexact.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: max.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/max.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** max.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- max.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- we assume that base comparison is tested in compare.decTest, so --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- we assume that base comparison is tested in compare.decTest, so Index: min.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/min.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** min.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- min.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- we assume that base comparison is tested in compare.decTest, so --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- we assume that base comparison is tested in compare.decTest, so Index: minus.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/minus.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** minus.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- minus.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. Index: multiply.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/multiply.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** multiply.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- multiply.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: normalize.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/normalize.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** normalize.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- normalize.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: plus.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/plus.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plus.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- plus.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. Index: power.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/power.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** power.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- power.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- This set of testcases tests raising numbers to an integer power only. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of testcases tests raising numbers to an integer power only. Index: quantize.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/quantize.decTest,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** quantize.decTest 2 Jul 2003 23:51:16 -0000 1.1 --- quantize.decTest 12 Aug 2003 23:05:30 -0000 1.2 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- Most of the tests here assume a "regular pattern", where the --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- Most of the tests here assume a "regular pattern", where the Index: randomBound32.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randomBound32.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** randomBound32.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- randomBound32.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- These testcases test calculations at precisions 31, 32, and 33, to --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- These testcases test calculations at precisions 31, 32, and 33, to Index: randoms.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randoms.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** randoms.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- randoms.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: remainder.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainder.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** remainder.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- remainder.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: remainderNear.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainderNear.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** remainderNear.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- remainderNear.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: rescale.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rescale.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rescale.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- rescale.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- [obsolete] Quantize.decTest has the improved version --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- [obsolete] Quantize.decTest has the improved version Index: rounding.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rounding.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rounding.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- rounding.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- These tests require that implementations take account of residues in --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- These tests require that implementations take account of residues in Index: squareroot.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/squareroot.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** squareroot.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- squareroot.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: subtract.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/subtract.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** subtract.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- subtract.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 Index: testall.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/testall.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testall.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- testall.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 -- core tests (using Extended: 1) -------------------------------------- --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- core tests (using Extended: 1) -------------------------------------- *************** *** 29,33 **** dectest: divideint dectest: inexact - dectest: integer dectest: max dectest: min --- 29,32 ---- *************** *** 45,48 **** --- 44,48 ---- dectest: squareroot dectest: subtract + dectest: tointegral dectest: trim Index: trim.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/trim.decTest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** trim.decTest 2 Jul 2003 23:51:16 -0000 1.3 --- trim.decTest 12 Aug 2003 23:05:30 -0000 1.4 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.26 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 From akuchling at users.sourceforge.net Tue Aug 12 19:11:57 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Aug 12 21:12:01 2003 Subject: [Python-checkins] python/nondist/peps pep-0102.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv26467 Modified Files: pep-0102.txt Log Message: Note python.org changes for new releases Index: pep-0102.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0102.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0102.txt 31 Jul 2003 15:12:25 -0000 1.10 --- pep-0102.txt 13 Aug 2003 01:11:55 -0000 1.11 *************** *** 373,376 **** --- 373,390 ---- lose patience . + The python.org site also needs some tweaking when a new bugfix release + is issued. + + ___ The documentation should be installed at doc//. + + ___ Add a link from doc//index.ht to the + documentation for the new version. + + ___ All older doc//index.ht files should be updated to + point to the documentation for the new version. + + ___ /robots.txt should be modified to prevent the old version's + documentation from being crawled by search engines. + Windows Notes From fdrake at acm.org Tue Aug 12 22:18:08 2003 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Tue Aug 12 21:18:48 2003 Subject: [Python-checkins] python/nondist/peps pep-0102.txt,1.10,1.11 In-Reply-To: References: Message-ID: <16185.37328.680244.760064@grendel.zope.com> akuchling@users.sourceforge.net writes: > Modified Files: > pep-0102.txt > Log Message: > Note python.org changes for new releases Thanks, Andrew! -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From rhettinger at users.sourceforge.net Wed Aug 13 12:06:36 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 13 14:06:42 2003 Subject: [Python-checkins] python/nondist/peps pep-0000.txt, 1.249, 1.250 pep-0308.txt, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv13064 Modified Files: pep-0000.txt pep-0308.txt Log Message: Indicate the rejection of PEP 308 for an if-then-else expression. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.249 retrieving revision 1.250 diff -C2 -d -r1.249 -r1.250 *** pep-0000.txt 29 Jul 2003 04:43:29 -0000 1.249 --- pep-0000.txt 13 Aug 2003 18:06:34 -0000 1.250 *************** *** 110,114 **** S 305 CSV File API Montanaro, et al S 307 Extensions to the pickle protocol GvR, Peters - S 308 If-then-else expression GvR, Hettinger S 309 Built-in Curry Type Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore --- 110,113 ---- *************** *** 185,188 **** --- 184,188 ---- SR 289 Generator Comprehensions Hettinger SR 295 Interpretation of multiline string constants Koltsov + SR 308 If-then-else expression GvR, Hettinger SD 316 Programming by Contract for Python Way SR 317 Eliminate Implicit Exception Instantiation Taschuk *************** *** 321,325 **** I 306 How to Change Python's Grammar Hudson S 307 Extensions to the pickle protocol GvR, Peters ! S 308 If-then-else expression GvR, Hettinger S 309 Built-in Curry Type Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore --- 321,325 ---- I 306 How to Change Python's Grammar Hudson S 307 Extensions to the pickle protocol GvR, Peters ! SR 308 If-then-else expression GvR, Hettinger S 309 Built-in Curry Type Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore Index: pep-0308.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0308.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pep-0308.txt 13 Feb 2003 15:01:53 -0000 1.19 --- pep-0308.txt 13 Aug 2003 18:06:34 -0000 1.20 *************** *** 4,8 **** Last-Modified: $Date$ Author: Guido van Rossum, Raymond D. Hettinger ! Status: Draft Type: Standards Track Content-Type: text/plain --- 4,8 ---- Last-Modified: $Date$ Author: Guido van Rossum, Raymond D. Hettinger ! Status: Rejected Type: Standards Track Content-Type: text/plain *************** *** 31,34 **** --- 31,41 ---- discussion, and a discussion of short-circuit behavior. + Following the discussion, a vote was held. While there was an overall + interest in having some form of if-then-else expressions, no one + format was able to draw majority support. Accordingly, the PEP was + rejected due to the lack of an overwhelming majority for change. + Also, a Python design principle has been to prefer the status quo + whenever there are doubts about which path to take. + Proposal *************** *** 236,239 **** --- 243,371 ---- The BDFL's position is that short-circuit behavior is essential for an if-then-else construct to be added to the language. + + + Detailed Results of Voting + + + Votes rejecting all options: 82 + Votes with rank ordering: 436 + --- + Total votes received: 518 + + + ACCEPT REJECT TOTAL + --------------------- --------------------- ----- + Rank1 Rank2 Rank3 Rank1 Rank2 Rank3 + Letter + A 51 33 19 18 20 20 161 + B 45 46 21 9 24 23 168 + C 94 54 29 20 20 18 235 + D 71 40 31 5 28 31 206 + E 7 7 10 3 5 32 + F 14 19 10 7 17 67 + G 7 6 10 1 2 4 30 + H 20 22 17 4 10 25 98 + I 16 20 9 5 5 20 75 + J 6 17 5 1 10 39 + K 1 6 4 13 24 + L 1 2 3 3 9 + M 7 3 4 2 5 11 32 + N 2 3 4 2 11 + O 1 6 5 1 4 9 26 + P 5 3 6 1 5 7 27 + Q 18 7 15 6 5 11 62 + Z 1 1 + --- --- --- --- --- --- ---- + Total 363 286 202 73 149 230 1303 + RejectAll 82 82 82 246 + --- --- --- --- --- --- ---- + Total 363 286 202 155 231 312 1549 + + + CHOICE KEY + ---------- + A. x if C else y + B. if C then x else y + C. (if C: x else: y) + D. C ? x : y + E. C ? x ! y + F. cond(C, x, y) + G. C ?? x || y + H. C then x else y + I. x when C else y + J. C ? x else y + K. C -> x else y + L. C -> (x, y) + M. [x if C else y] + N. ifelse C: x else y + O. + P. C and x else y + Q. any write-in vote + + + Detail for write-in votes and their ranking: + -------------------------------------------- + 3: Q reject y x C elsethenif + 2: Q accept (C ? x ! y) + 3: Q reject ... + 3: Q accept ? C : x : y + 3: Q accept (x if C, y otherwise) + 3: Q reject ... + 3: Q reject NONE + 1: Q accept select : ( : ; [ : ; ]* elseval) + 2: Q reject if C: t else: f + 3: Q accept C selects x else y + 2: Q accept iff(C, x, y) # "if-function" + 1: Q accept (y, x)[C] + 1: Q accept C true: x false: y + 3: Q accept C then: x else: y + 3: Q reject + 3: Q accept (if C: x elif C2: y else: z) + 3: Q accept C -> x : y + 1: Q accept x (if C), y + 1: Q accept if c: x else: y + 3: Q accept (c).{True:1, False:2} + 2: Q accept if c: x else: y + 3: Q accept (c).{True:1, False:2} + 3: Q accept if C: x else y + 1: Q accept (x if C else y) + 1: Q accept ifelse(C, x, y) + 2: Q reject x or y <- C + 1: Q accept (C ? x : y) required parens + 1: Q accept iif(C, x, y) + 1: Q accept ?(C, x, y) + 1: Q accept switch-case + 2: Q accept multi-line if/else + 1: Q accept C: x else: y + 2: Q accept (C): x else: y + 3: Q accept if C: x else: y + 1: Q accept x if C, else y + 1: Q reject choice: c1->a; c2->b; ...; z + 3: Q accept [if C then x else y] + 3: Q reject no other choice has x as the first element + 1: Q accept (x,y) ? C + 3: Q accept x if C else y (The "else y" being optional) + 1: Q accept (C ? x , y) + 1: Q accept any outcome (i.e form or plain rejection) from a usability study + 1: Q reject (x if C else y) + 1: Q accept (x if C else y) + 2: Q reject NONE + 3: Q reject NONE + 3: Q accept (C ? x else y) + 3: Q accept x when C else y + 2: Q accept (x if C else y) + 2: Q accept cond(C1, x1, C2, x2, C3, x3,...) + 1: Q accept (if C1: x elif C2: y else: z) + 1: Q reject cond(C, :x, :y) + 3: Q accept (C and [x] or [y])[0] + 2: Q reject + 3: Q reject + 3: Q reject all else + 1: Q reject no-change + 3: Q reject deliberately omitted as I have no interest in any other proposal + 2: Q reject (C then x else Y) + 1: Q accept if C: x else: y + 1: Q reject (if C then x else y) + 3: Q reject C?(x, y) From akuchling at users.sourceforge.net Wed Aug 13 17:08:13 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Aug 13 19:08:31 2003 Subject: [Python-checkins] python/dist/src/Modules _cursesmodule.c, 2.71, 2.72 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv2954 Modified Files: _cursesmodule.c Log Message: [Patch #739124] Add use_default_colors() to curses module Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.71 retrieving revision 2.72 diff -C2 -d -r2.71 -r2.72 *** _cursesmodule.c 21 Nov 2002 14:17:51 -0000 2.71 --- _cursesmodule.c 13 Aug 2003 23:08:11 -0000 2.72 *************** *** 48,52 **** scr_init scr_restore scr_set scrl set_curterm set_term setterm tgetent tgetflag tgetnum tgetstr tgoto timeout tputs ! use_default_colors vidattr vidputs waddchnstr waddchstr wchgat wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl --- 48,52 ---- scr_init scr_restore scr_set scrl set_curterm set_term setterm tgetent tgetflag tgetnum tgetstr tgoto timeout tputs ! vidattr vidputs waddchnstr waddchstr wchgat wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl *************** *** 2355,2358 **** --- 2355,2378 ---- } + #ifndef STRICT_SYSV_CURSES + static PyObject * + PyCurses_Use_Default_Colors(PyObject *self) + { + int code; + + PyCursesInitialised + PyCursesInitialisedColor + + code = use_default_colors(); + if (code != ERR) { + Py_INCREF(Py_None); + return Py_None; + } else { + PyErr_SetString(PyCursesError, "use_default_colors() returned ERR"); + return NULL; + } + } + #endif /* STRICT_SYSV_CURSES */ + /* List of functions defined in the module */ *************** *** 2435,2438 **** --- 2455,2461 ---- {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS}, {"use_env", (PyCFunction)PyCurses_Use_Env, METH_VARARGS}, + #ifndef STRICT_SYSV_CURSES + {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_NOARGS}, + #endif {NULL, NULL} /* sentinel */ }; From akuchling at users.sourceforge.net Wed Aug 13 17:08:41 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Aug 13 19:08:54 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_curses.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv3016 Modified Files: test_curses.py Log Message: [Patch #739124] Add use_default_colors() to curses module Index: test_curses.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_curses.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_curses.py 6 Apr 2003 09:01:05 -0000 1.3 --- test_curses.py 13 Aug 2003 23:08:39 -0000 1.4 *************** *** 182,185 **** --- 182,188 ---- curses.pair_number(0) + if hasattr(curses, 'use_default_colors'): + curses.use_default_colors() + if hasattr(curses, 'keyname'): curses.keyname(13) From akuchling at users.sourceforge.net Wed Aug 13 17:09:18 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Aug 13 19:09:23 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcurses.tex,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3115 Modified Files: libcurses.tex Log Message: [Patch #739124] Add use_default_colors() to curses module Index: libcurses.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcurses.tex,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** libcurses.tex 12 Aug 2003 00:01:15 -0000 1.43 --- libcurses.tex 13 Aug 2003 23:09:16 -0000 1.44 *************** *** 538,541 **** --- 538,550 ---- \end{funcdesc} + \begin{funcdesc}{use_default_colors}{} + Allow use of default values for colors on terminals supporting this + feature. Use this to support transparency in your + application. The default color is assigned to the color number -1. + After calling this function, + \function{init_pair(x, curses.COLOR_RED, -1)} initializes, for instance, + color pair \var{x} to a red foreground color on the default background. + \end{funcdesc} + \subsection{Window Objects \label{curses-window-objects}} From akuchling at users.sourceforge.net Wed Aug 13 17:09:46 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Aug 13 19:09:51 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv3193 Modified Files: whatsnew24.tex Log Message: [Patch #739124] Add use_default_colors() to curses module Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** whatsnew24.tex 30 Jul 2003 19:14:09 -0000 1.1 --- whatsnew24.tex 13 Aug 2003 23:09:44 -0000 1.2 *************** *** 70,75 **** \begin{itemize} ! \item Descriptions go here. ! \end{itemize} --- 70,78 ---- \begin{itemize} ! \item The \module{curses} modules now supports the ncurses extension ! \function{use_default_colors()}. On platforms where the terminal ! supports transparency, this makes it possible to use a transparent background. ! (Contributed by J\"org Lehmann.) ! \end{itemize} From akuchling at users.sourceforge.net Wed Aug 13 17:11:07 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Wed Aug 13 19:11:18 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS, 1.840, 1.841 ACKS, 1.243, 1.244 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv3412 Modified Files: NEWS ACKS Log Message: [Patch #739124] Add use_default_colors() to curses module Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.840 retrieving revision 1.841 diff -C2 -d -r1.840 -r1.841 *** NEWS 9 Aug 2003 18:30:57 -0000 1.840 --- NEWS 13 Aug 2003 23:11:04 -0000 1.841 *************** *** 23,26 **** --- 23,28 ---- - The signal module now exposes SIGRTMIN and SIGRTMAX (if available). + - curses module now supports use_default_colors(). [patch #739124] + Library ------- Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.243 retrieving revision 1.244 diff -C2 -d -r1.243 -r1.244 *** ACKS 17 Jul 2003 19:18:50 -0000 1.243 --- ACKS 13 Aug 2003 23:11:04 -0000 1.244 *************** *** 326,329 **** --- 326,330 ---- Luc Lefebvre Kip Lehman + Joerg Lehmann Marc-Andre Lemburg William Lewis From fdrake at users.sourceforge.net Wed Aug 13 22:51:26 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 14 00:51:50 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcurses.tex,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20107 Modified Files: libcurses.tex Log Message: fix markup Index: libcurses.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcurses.tex,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** libcurses.tex 13 Aug 2003 23:09:16 -0000 1.44 --- libcurses.tex 14 Aug 2003 04:51:24 -0000 1.45 *************** *** 543,547 **** application. The default color is assigned to the color number -1. After calling this function, ! \function{init_pair(x, curses.COLOR_RED, -1)} initializes, for instance, color pair \var{x} to a red foreground color on the default background. \end{funcdesc} --- 543,547 ---- application. The default color is assigned to the color number -1. After calling this function, ! \code{init_pair(x, curses.COLOR_RED, -1)} initializes, for instance, color pair \var{x} to a red foreground color on the default background. \end{funcdesc} From akuchling at users.sourceforge.net Thu Aug 14 07:11:30 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Aug 14 09:12:29 2003 Subject: [Python-checkins] python/dist/src/Lib reconvert.py,1.6,1.6.28.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv9527 Modified Files: Tag: release23-branch reconvert.py Log Message: Remove specific Python version from #! Index: reconvert.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/reconvert.py,v retrieving revision 1.6 retrieving revision 1.6.28.1 diff -C2 -d -r1.6 -r1.6.28.1 *** reconvert.py 4 Sep 2001 15:18:54 -0000 1.6 --- reconvert.py 14 Aug 2003 13:11:28 -0000 1.6.28.1 *************** *** 1,3 **** ! #! /usr/bin/env python1.5 r"""Convert old ("regex") regular expressions to new syntax ("re"). --- 1,3 ---- ! #! /usr/bin/env python r"""Convert old ("regex") regular expressions to new syntax ("re"). From kbk at users.sourceforge.net Thu Aug 14 08:54:30 2003 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Thu Aug 14 10:54:35 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib NEWS.txt, 1.23, 1.24 PyShell.py, 1.81, 1.82 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv30724 Modified Files: NEWS.txt PyShell.py Log Message: IDLE didn't start correctly when Python was installed in "Program Files" on W2K and XP. Python Bugs 780451, 784183 Backported to 2.2-maint Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NEWS.txt 27 Jul 2003 03:24:18 -0000 1.23 --- NEWS.txt 14 Aug 2003 14:54:28 -0000 1.24 *************** *** 1,2 **** --- 1,14 ---- + What's New in IDLE 1.0+? + =================================== + + *Release date: XX-XXX-2003* + + - IDLE didn't start correctly when Python was installed in "Program Files" on + W2K and XP. Python Bugs 780451, 784183 + + - config-main.def documentation incorrectly referred to idle- instead of + config- filenames. SF 782759 Also added note about .idlerc location. + + What's New in IDLE 1.0? =================================== Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/PyShell.py,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** PyShell.py 27 Jul 2003 03:24:18 -0000 1.81 --- PyShell.py 14 Aug 2003 14:54:28 -0000 1.82 *************** *** 319,323 **** def spawn_subprocess(self): args = self.subprocess_arglist ! self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) def build_subprocess_arglist(self): --- 319,323 ---- def spawn_subprocess(self): args = self.subprocess_arglist ! self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args) def build_subprocess_arglist(self): *************** *** 332,336 **** else: command = "__import__('run').main(" + `del_exitf` + ")" ! return [sys.executable] + w + ["-c", command, str(self.port)] def start_subprocess(self): --- 332,341 ---- else: command = "__import__('run').main(" + `del_exitf` + ")" ! if sys.platform[:3] == 'win' and ' ' in sys.executable: ! # handle embedded space in path by quoting the argument ! decorated_exec = '"%s"' % sys.executable ! else: ! decorated_exec = sys.executable ! return [decorated_exec] + w + ["-c", command, str(self.port)] def start_subprocess(self): From kbk at users.sourceforge.net Thu Aug 14 09:15:08 2003 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Thu Aug 14 11:15:16 2003 Subject: [Python-checkins] python/dist/src/Lib/idlelib NEWS.txt, 1.23, 1.23.4.1 PyShell.py, 1.81, 1.81.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv1659 Modified Files: Tag: release23-maint NEWS.txt PyShell.py Log Message: - IDLE didn't start correctly when Python was installed in "Program Files" on W2K and XP. Python Bugs 780451, 784183 Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.23 retrieving revision 1.23.4.1 diff -C2 -d -r1.23 -r1.23.4.1 *** NEWS.txt 27 Jul 2003 03:24:18 -0000 1.23 --- NEWS.txt 14 Aug 2003 15:15:02 -0000 1.23.4.1 *************** *** 1,2 **** --- 1,13 ---- + What's New in IDLE 1.0.1? + =================================== + + *Release date: XX-XXX-2003* + + - IDLE didn't start correctly when Python was installed in "Program Files" on + W2K and XP. Python Bugs 780451, 784183 + + - config-main.def documentation incorrectly referred to idle- instead of + config- filenames. SF 782759 Also added note about .idlerc location. + What's New in IDLE 1.0? =================================== Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/PyShell.py,v retrieving revision 1.81 retrieving revision 1.81.4.1 diff -C2 -d -r1.81 -r1.81.4.1 *** PyShell.py 27 Jul 2003 03:24:18 -0000 1.81 --- PyShell.py 14 Aug 2003 15:15:02 -0000 1.81.4.1 *************** *** 319,323 **** def spawn_subprocess(self): args = self.subprocess_arglist ! self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) def build_subprocess_arglist(self): --- 319,323 ---- def spawn_subprocess(self): args = self.subprocess_arglist ! self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args) def build_subprocess_arglist(self): *************** *** 332,336 **** else: command = "__import__('run').main(" + `del_exitf` + ")" ! return [sys.executable] + w + ["-c", command, str(self.port)] def start_subprocess(self): --- 332,341 ---- else: command = "__import__('run').main(" + `del_exitf` + ")" ! if sys.platform == 'win32' and ' ' in sys.executable: ! # handle embedded space in path by quoting the argument ! decorated_exec = '"%s"' % sys.executable ! else: ! decorated_exec = sys.executable ! return [decorated_exec] + w + ["-c", command, str(self.port)] def start_subprocess(self): From fdrake at users.sourceforge.net Thu Aug 14 09:52:35 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Aug 14 11:52:39 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts logmerge.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv10180 Modified Files: logmerge.py Log Message: When piping output into a pager like "less", quiting the pager before the output was consumed would cause and exception to be raise in logmerge; suppress this specific error, because it's not helpful. Index: logmerge.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/logmerge.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** logmerge.py 20 Apr 2003 00:59:24 -0000 1.11 --- logmerge.py 14 Aug 2003 15:52:33 -0000 1.12 *************** *** 35,39 **** """ ! import os, sys, getopt, re sep1 = '='*77 + '\n' # file separator --- 35,39 ---- """ ! import os, sys, errno, getopt, re sep1 = '='*77 + '\n' # file separator *************** *** 178,180 **** prevtext = text ! main() --- 178,184 ---- prevtext = text ! try: ! main() ! except IOError, e: ! if e.errno != errno.EPIPE: ! raise From mwh at users.sourceforge.net Thu Aug 14 11:04:30 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 14 13:04:34 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.156,2.157 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv28429 Modified Files: listobject.c Log Message: Fix reference leak noted in test_types: Check for a[:] = a _before_ calling PySequence_Fast on a. release23-maint candidate Reference leak doesn't happen with head of release22-maint. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.156 retrieving revision 2.157 diff -C2 -d -r2.156 -r2.157 *** listobject.c 17 Jun 2003 19:27:38 -0000 2.156 --- listobject.c 14 Aug 2003 17:04:28 -0000 2.157 *************** *** 473,485 **** else { char msg[256]; - PyOS_snprintf(msg, sizeof(msg), - "must assign sequence" - " (not \"%.200s\") to slice", - v->ob_type->tp_name); - v_as_SF = PySequence_Fast(v, msg); - if(v_as_SF == NULL) - return -1; - n = PySequence_Fast_GET_SIZE(v_as_SF); - if (a == b) { /* Special case "a[i:j] = a" -- copy b first */ --- 473,476 ---- *************** *** 492,495 **** --- 483,495 ---- return ret; } + + PyOS_snprintf(msg, sizeof(msg), + "must assign sequence" + " (not \"%.200s\") to slice", + v->ob_type->tp_name); + v_as_SF = PySequence_Fast(v, msg); + if(v_as_SF == NULL) + return -1; + n = PySequence_Fast_GET_SIZE(v_as_SF); } if (ilow < 0) From mwh at users.sourceforge.net Thu Aug 14 11:26:01 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Aug 14 13:26:04 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.156, 2.156.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv374 Modified Files: Tag: release23-maint listobject.c Log Message: And backport-2-3-4: Fix reference leak noted in test_types: Check for a[:] = a _before_ calling PySequence_Fast on a. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.156 retrieving revision 2.156.8.1 diff -C2 -d -r2.156 -r2.156.8.1 *** listobject.c 17 Jun 2003 19:27:38 -0000 2.156 --- listobject.c 14 Aug 2003 17:25:59 -0000 2.156.8.1 *************** *** 473,485 **** else { char msg[256]; - PyOS_snprintf(msg, sizeof(msg), - "must assign sequence" - " (not \"%.200s\") to slice", - v->ob_type->tp_name); - v_as_SF = PySequence_Fast(v, msg); - if(v_as_SF == NULL) - return -1; - n = PySequence_Fast_GET_SIZE(v_as_SF); - if (a == b) { /* Special case "a[i:j] = a" -- copy b first */ --- 473,476 ---- *************** *** 492,495 **** --- 483,495 ---- return ret; } + + PyOS_snprintf(msg, sizeof(msg), + "must assign sequence" + " (not \"%.200s\") to slice", + v->ob_type->tp_name); + v_as_SF = PySequence_Fast(v, msg); + if(v_as_SF == NULL) + return -1; + n = PySequence_Fast_GET_SIZE(v_as_SF); } if (ilow < 0) From python at rcn.com Thu Aug 14 16:34:48 2003 From: python at rcn.com (Raymond Hettinger) Date: Thu Aug 14 15:38:54 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.156, 2.156.8.1 References: Message-ID: <00b801c3629b$20920800$2a03a044@oemcomputer> > - n = PySequence_Fast_GET_SIZE(v_as_SF); This leaves n uninitialized on the path where a==b. Raymond From rhettinger at users.sourceforge.net Thu Aug 14 13:58:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Aug 14 15:58:40 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.29, 1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv29602 Modified Files: libcfgparser.tex Log Message: SF patch #787929: reflect the introduce of boolean type(libcfgparser.tex) (Contributed by George Yoshida.) Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** libcfgparser.tex 31 Dec 2002 17:23:26 -0000 1.29 --- libcfgparser.tex 14 Aug 2003 19:58:35 -0000 1.30 *************** *** 218,225 **** A convenience method which coerces the \var{option} in the specified \var{section} to a Boolean value. Note that the accepted values ! for the option are \code{1}, \code{yes}, \code{true}, and \code{on}, ! which cause this method to return true, and \code{0}, \code{no}, ! \code{false}, and \code{off}, which cause it to return false. These ! values are checked in a case-insensitive manner. Any other value will cause it to raise \exception{ValueError}. \end{methoddesc} --- 218,225 ---- A convenience method which coerces the \var{option} in the specified \var{section} to a Boolean value. Note that the accepted values ! for the option are \code{"1"}, \code{"yes"}, \code{"true"}, and \code{"on"}, ! which cause this method to return \code{True}, and \code{"0"}, \code{"no"}, ! \code{"false"}, and \code{"off"}, which cause it to return \code{False}. These ! string values are checked in a case-insensitive manner. Any other value will cause it to raise \exception{ValueError}. \end{methoddesc} From rhettinger at users.sourceforge.net Thu Aug 14 14:01:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Aug 14 16:01:47 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.29, 1.29.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30220 Modified Files: Tag: release23-maint libcfgparser.tex Log Message: SF patch #787929: reflect the introduce of boolean type(libcfgparser.tex) (Contributed by George Yoshida.) Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.29 retrieving revision 1.29.16.1 diff -C2 -d -r1.29 -r1.29.16.1 *** libcfgparser.tex 31 Dec 2002 17:23:26 -0000 1.29 --- libcfgparser.tex 14 Aug 2003 20:01:40 -0000 1.29.16.1 *************** *** 218,225 **** A convenience method which coerces the \var{option} in the specified \var{section} to a Boolean value. Note that the accepted values ! for the option are \code{1}, \code{yes}, \code{true}, and \code{on}, ! which cause this method to return true, and \code{0}, \code{no}, ! \code{false}, and \code{off}, which cause it to return false. These ! values are checked in a case-insensitive manner. Any other value will cause it to raise \exception{ValueError}. \end{methoddesc} --- 218,225 ---- A convenience method which coerces the \var{option} in the specified \var{section} to a Boolean value. Note that the accepted values ! for the option are \code{"1"}, \code{"yes"}, \code{"true"}, and \code{"on"}, ! which cause this method to return \code{True}, and \code{"0"}, \code{"no"}, ! \code{"false"}, and \code{"off"}, which cause it to return \code{False}. These ! string values are checked in a case-insensitive manner. Any other value will cause it to raise \exception{ValueError}. \end{methoddesc} From doerwalter at users.sourceforge.net Thu Aug 14 14:25:31 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Aug 14 16:25:34 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190, 2.191 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv1205/Objects Modified Files: unicodeobject.c Log Message: Fix refcount leak in PyUnicode_EncodeCharmap(). The bug surfaces when an encoding error occurs and the callback name is unknown, i.e. when the callback has to be called. The problem was that the fact that the callback has already been looked up was only recorded in a local variable in charmap_encoding_error(), because charmap_encoding_error() got it's own copy of the errorHandler pointer instead of a pointer to the pointer in PyUnicode_EncodeCharmap(). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190 retrieving revision 2.191 diff -C2 -d -r2.190 -r2.191 *** unicodeobject.c 1 Jul 2003 00:13:27 -0000 2.190 --- unicodeobject.c 14 Aug 2003 20:25:29 -0000 2.191 *************** *** 2877,2881 **** const Py_UNICODE *p, int size, int *inpos, PyObject *mapping, PyObject **exceptionObject, ! int *known_errorHandler, PyObject *errorHandler, const char *errors, PyObject **res, int *respos) { --- 2877,2881 ---- const Py_UNICODE *p, int size, int *inpos, PyObject *mapping, PyObject **exceptionObject, ! int *known_errorHandler, PyObject **errorHandler, const char *errors, PyObject **res, int *respos) { *************** *** 2960,2964 **** break; default: ! repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, encoding, reason, p, size, exceptionObject, collstartpos, collendpos, &newpos); --- 2960,2964 ---- break; default: ! repunicode = unicode_encode_call_errorhandler(errors, errorHandler, encoding, reason, p, size, exceptionObject, collstartpos, collendpos, &newpos); *************** *** 3025,3029 **** if (charmap_encoding_error(p, size, &inpos, mapping, &exc, ! &known_errorHandler, errorHandler, errors, &res, &respos)) goto onError; --- 3025,3029 ---- if (charmap_encoding_error(p, size, &inpos, mapping, &exc, ! &known_errorHandler, &errorHandler, errors, &res, &respos)) goto onError; From doerwalter at users.sourceforge.net Thu Aug 14 14:26:46 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Aug 14 16:26:48 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190, 2.190.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv1393/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkins: Fix refcount leak in PyUnicode_EncodeCharmap(). The bug surfaces when an encoding error occurs and the callback name is unknown, i.e. when the callback has to be called. The problem was that the fact that the callback has already been looked up was only recorded in a local variable in charmap_encoding_error(), because charmap_encoding_error() got it's own copy of the errorHandler pointer instead of a pointer to the pointer in PyUnicode_EncodeCharmap(). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190 retrieving revision 2.190.6.1 diff -C2 -d -r2.190 -r2.190.6.1 *** unicodeobject.c 1 Jul 2003 00:13:27 -0000 2.190 --- unicodeobject.c 14 Aug 2003 20:26:44 -0000 2.190.6.1 *************** *** 2877,2881 **** const Py_UNICODE *p, int size, int *inpos, PyObject *mapping, PyObject **exceptionObject, ! int *known_errorHandler, PyObject *errorHandler, const char *errors, PyObject **res, int *respos) { --- 2877,2881 ---- const Py_UNICODE *p, int size, int *inpos, PyObject *mapping, PyObject **exceptionObject, ! int *known_errorHandler, PyObject **errorHandler, const char *errors, PyObject **res, int *respos) { *************** *** 2960,2964 **** break; default: ! repunicode = unicode_encode_call_errorhandler(errors, &errorHandler, encoding, reason, p, size, exceptionObject, collstartpos, collendpos, &newpos); --- 2960,2964 ---- break; default: ! repunicode = unicode_encode_call_errorhandler(errors, errorHandler, encoding, reason, p, size, exceptionObject, collstartpos, collendpos, &newpos); *************** *** 3025,3029 **** if (charmap_encoding_error(p, size, &inpos, mapping, &exc, ! &known_errorHandler, errorHandler, errors, &res, &respos)) goto onError; --- 3025,3029 ---- if (charmap_encoding_error(p, size, &inpos, mapping, &exc, ! &known_errorHandler, &errorHandler, errors, &res, &respos)) goto onError; From nascheme at users.sourceforge.net Thu Aug 14 14:37:36 2003 From: nascheme at users.sourceforge.net (nascheme@users.sourceforge.net) Date: Thu Aug 14 16:37:40 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.293,2.294 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv3768/Python Modified Files: bltinmodule.c Log Message: Make filter(bool, ...) as fast as filter(None, ...). Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.293 retrieving revision 2.294 diff -C2 -d -r2.293 -r2.294 *** bltinmodule.c 2 Aug 2003 07:42:56 -0000 2.293 --- bltinmodule.c 14 Aug 2003 20:37:34 -0000 2.294 *************** *** 198,202 **** } ! if (func == Py_None) { ok = PyObject_IsTrue(item); } --- 198,202 ---- } ! if (func == (PyObject *)&PyBool_Type || func == Py_None) { ok = PyObject_IsTrue(item); } From doerwalter at users.sourceforge.net Thu Aug 14 14:59:09 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Aug 14 16:59:13 2003 Subject: [Python-checkins] python/dist/src/Python exceptions.c,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv7153/Python Modified Files: exceptions.c Log Message: Fix refcount leak in the UnicodeError constructor: When parsing the constructor arguments failed, a reference to the argument tuple was leaked. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** exceptions.c 12 Aug 2003 17:34:49 -0000 1.46 --- exceptions.c 14 Aug 2003 20:59:07 -0000 1.47 *************** *** 1192,1196 **** &PyInt_Type, &end, &PyString_Type, &reason)) ! return NULL; if (PyObject_SetAttrString(self, "args", args)) --- 1192,1196 ---- &PyInt_Type, &end, &PyString_Type, &reason)) ! goto finally; if (PyObject_SetAttrString(self, "args", args)) From doerwalter at users.sourceforge.net Thu Aug 14 15:00:31 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Aug 14 17:00:34 2003 Subject: [Python-checkins] python/dist/src/Python exceptions.c, 1.44.10.1, 1.44.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv7474/Python Modified Files: Tag: release23-maint exceptions.c Log Message: Backport checkin: Fix refcount leak in the UnicodeError constructor: When parsing the constructor arguments failed, a reference to the argument tuple was leaked. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.44.10.1 retrieving revision 1.44.10.2 diff -C2 -d -r1.44.10.1 -r1.44.10.2 *** exceptions.c 12 Aug 2003 17:38:21 -0000 1.44.10.1 --- exceptions.c 14 Aug 2003 21:00:28 -0000 1.44.10.2 *************** *** 1192,1196 **** &PyInt_Type, &end, &PyString_Type, &reason)) ! return NULL; if (PyObject_SetAttrString(self, "args", args)) --- 1192,1196 ---- &PyInt_Type, &end, &PyString_Type, &reason)) ! goto finally; if (PyObject_SetAttrString(self, "args", args)) From nascheme at users.sourceforge.net Thu Aug 14 16:57:49 2003 From: nascheme at users.sourceforge.net (nascheme@users.sourceforge.net) Date: Thu Aug 14 18:57:55 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.198,1.199 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv25556/tut Modified Files: tut.tex Log Message: Don't introduce map(None, ...) in the tutorial. In practice, zip() is usually preferred. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** tut.tex 12 Aug 2003 00:01:17 -0000 1.198 --- tut.tex 14 Aug 2003 22:57:46 -0000 1.199 *************** *** 1837,1853 **** many arguments as there are sequences and is called with the corresponding item from each sequence (or \code{None} if some sequence ! is shorter than another). If \code{None} is passed for the function, ! a function returning its argument(s) is substituted. ! ! Combining these two special cases, we see that ! \samp{map(None, \var{list1}, \var{list2})} is a convenient way of ! turning a pair of lists into a list of pairs. For example: \begin{verbatim} >>> seq = range(8) ! >>> def square(x): return x*x ... ! >>> map(None, seq, map(square, seq)) ! [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49)] \end{verbatim} --- 1837,1848 ---- many arguments as there are sequences and is called with the corresponding item from each sequence (or \code{None} if some sequence ! is shorter than another). For example: \begin{verbatim} >>> seq = range(8) ! >>> def add(x, y): return x+y ... ! >>> map(add, seq, seq) ! [0, 2, 4, 6, 8, 10, 12, 14] \end{verbatim} From tim_one at users.sourceforge.net Thu Aug 14 19:16:39 2003 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Thu Aug 14 21:16:41 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.841,1.842 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12181/Misc Modified Files: NEWS Log Message: complex_new(): This could leak when the argument was neither string nor number. This accounts for the 2 refcount leaks per test_complex run Michael Hudson discovered (I figured only I would have the stomach to look for leaks in floating-point code ). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.841 retrieving revision 1.842 diff -C2 -d -r1.841 -r1.842 *** NEWS 13 Aug 2003 23:11:04 -0000 1.841 --- NEWS 15 Aug 2003 01:16:36 -0000 1.842 *************** *** 13,16 **** --- 13,19 ---- ----------------- + - complex(obj) could leak a little memory if obj wasn't a string or + number. + - zip() with no arguments now returns an empty list instead of raising a TypeError exception. From tim_one at users.sourceforge.net Thu Aug 14 19:16:39 2003 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Thu Aug 14 21:16:47 2003 Subject: [Python-checkins] python/dist/src/Objects complexobject.c, 2.67, 2.68 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv12181/Objects Modified Files: complexobject.c Log Message: complex_new(): This could leak when the argument was neither string nor number. This accounts for the 2 refcount leaks per test_complex run Michael Hudson discovered (I figured only I would have the stomach to look for leaks in floating-point code ). Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** complexobject.c 17 Jun 2003 20:22:24 -0000 2.67 --- complexobject.c 15 Aug 2003 01:16:37 -0000 2.68 *************** *** 883,886 **** --- 883,889 ---- PyErr_SetString(PyExc_TypeError, "complex() argument must be a string or a number"); + if (own_r) { + Py_DECREF(r); + } return NULL; } From mwh at python.net Fri Aug 15 12:50:01 2003 From: mwh at python.net (Michael Hudson) Date: Fri Aug 15 06:50:03 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.156, 2.156.8.1 In-Reply-To: <00b801c3629b$20920800$2a03a044@oemcomputer> ("Raymond Hettinger"'s message of "Thu, 14 Aug 2003 15:34:48 -0400") References: <00b801c3629b$20920800$2a03a044@oemcomputer> Message-ID: <2m3cg3p546.fsf@starship.python.net> "Raymond Hettinger" writes: >> - n = PySequence_Fast_GET_SIZE(v_as_SF); > > This leaves n uninitialized on the path where a==b. Shit! You're right, of course. I wonder how this made it past make test? Cheers, mwh -- >> REVIEW OF THE YEAR, 2000 << It was shit. Give us another one. -- NTK Now, 2000-12-29, http://www.ntk.net/ From mwh at users.sourceforge.net Fri Aug 15 06:06:44 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 15 08:07:24 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.157,2.158 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv1941 Modified Files: listobject.c Log Message: My last fix left n used unitialized in tha a==b case. Fix, by not using n at all in that case. Needs to be applied to release23-maint, too. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.157 retrieving revision 2.158 diff -C2 -d -r2.157 -r2.158 *** listobject.c 14 Aug 2003 17:04:28 -0000 2.157 --- listobject.c 15 Aug 2003 12:06:41 -0000 2.158 *************** *** 476,480 **** /* Special case "a[i:j] = a" -- copy b first */ int ret; ! v = list_slice(b, 0, n); if (v == NULL) return -1; --- 476,480 ---- /* Special case "a[i:j] = a" -- copy b first */ int ret; ! v = list_slice(b, 0, b->ob_size); if (v == NULL) return -1; From mwh at users.sourceforge.net Fri Aug 15 06:26:07 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 15 08:26:10 2003 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.156.8.1, 2.156.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv5274 Modified Files: Tag: release23-maint listobject.c Log Message: Backport my fix to my fix: My last fix left n used unitialized in tha a==b case. Fix, by not using n at all in that case. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.156.8.1 retrieving revision 2.156.8.2 diff -C2 -d -r2.156.8.1 -r2.156.8.2 *** listobject.c 14 Aug 2003 17:25:59 -0000 2.156.8.1 --- listobject.c 15 Aug 2003 12:26:05 -0000 2.156.8.2 *************** *** 476,480 **** /* Special case "a[i:j] = a" -- copy b first */ int ret; ! v = list_slice(b, 0, n); if (v == NULL) return -1; --- 476,480 ---- /* Special case "a[i:j] = a" -- copy b first */ int ret; ! v = list_slice(b, 0, b->ob_size); if (v == NULL) return -1; From mwh at users.sourceforge.net Fri Aug 15 07:03:33 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 15 09:03:36 2003 Subject: [Python-checkins] python/dist/src/Modules _testcapimodule.c, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv10360/Modules Modified Files: _testcapimodule.c Log Message: Fix silly leak in test used in test_exceptions. Index: _testcapimodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_testcapimodule.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** _testcapimodule.c 24 Apr 2003 16:14:27 -0000 1.24 --- _testcapimodule.c 15 Aug 2003 13:03:30 -0000 1.25 *************** *** 545,548 **** --- 545,549 ---- } PyErr_SetObject(exc, exc_args); + Py_DECREF(exc_args); return NULL; } From mwh at users.sourceforge.net Fri Aug 15 07:07:49 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 15 09:07:53 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_descr.py, 1.197, 1.198 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv10737/Lib/test Modified Files: test_descr.py Log Message: Fix for [ 784825 ] fix obscure crash in descriptor handling Should be applied to release23-maint and in all likelyhood release22-maint, too. Certainly doesn't apply to release21-maint. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** test_descr.py 7 Aug 2003 14:58:10 -0000 1.197 --- test_descr.py 15 Aug 2003 13:07:47 -0000 1.198 *************** *** 3939,3942 **** --- 3939,3972 ---- pass + def vicious_descriptor_nonsense(): + # A potential segfault spotted by Thomas Wouters in mail to + # python-dev 2003-04-17, turned into an example & fixed by Michael + # Hudson just less than four months later... + if verbose: + print "Testing vicious_descriptor_nonsense..." + + class Evil(object): + def __hash__(self): + return hash('attr') + def __eq__(self, other): + del C.attr + return 0 + + class Descr(object): + def __get__(self, ob, type=None): + return 1 + + class C(object): + attr = Descr() + + c = C() + c.__dict__[Evil()] = 0 + + vereq(c.attr, 1) + # this makes a crash more likely: + import gc; gc.collect() + vereq(hasattr(c, 'attr'), False) + + def test_main(): weakref_segfault() # Must be first, somehow *************** *** 4030,4033 **** --- 4060,4064 ---- carloverre() filefault() + vicious_descriptor_nonsense() if verbose: print "All OK" From mwh at users.sourceforge.net Fri Aug 15 07:07:49 2003 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Fri Aug 15 09:07:59 2003 Subject: [Python-checkins] python/dist/src/Objects object.c, 2.209, 2.210 typeobject.c, 2.243, 2.244 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv10737/Objects Modified Files: object.c typeobject.c Log Message: Fix for [ 784825 ] fix obscure crash in descriptor handling Should be applied to release23-maint and in all likelyhood release22-maint, too. Certainly doesn't apply to release21-maint. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.209 retrieving revision 2.210 diff -C2 -d -r2.209 -r2.210 *** object.c 18 Apr 2003 00:45:58 -0000 2.209 --- object.c 15 Aug 2003 13:07:46 -0000 2.210 *************** *** 1413,1416 **** --- 1413,1418 ---- } + Py_XINCREF(descr); + f = NULL; if (descr != NULL && *************** *** 1419,1422 **** --- 1421,1425 ---- if (f != NULL && PyDescr_IsData(descr)) { res = f(descr, obj, (PyObject *)obj->ob_type); + Py_DECREF(descr); goto done; } *************** *** 1446,1449 **** --- 1449,1453 ---- if (res != NULL) { Py_INCREF(res); + Py_XDECREF(descr); goto done; } *************** *** 1453,1462 **** if (f != NULL) { res = f(descr, obj, (PyObject *)obj->ob_type); goto done; } if (descr != NULL) { - Py_INCREF(descr); res = descr; goto done; } --- 1457,1467 ---- if (f != NULL) { res = f(descr, obj, (PyObject *)obj->ob_type); + Py_DECREF(descr); goto done; } if (descr != NULL) { res = descr; + /* descr was already increfed above */ goto done; } Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.243 retrieving revision 2.244 diff -C2 -d -r2.243 -r2.244 *** typeobject.c 8 Aug 2003 13:57:22 -0000 2.243 --- typeobject.c 15 Aug 2003 13:07:46 -0000 2.244 *************** *** 2011,2014 **** --- 2011,2015 ---- (PyObject *)metatype); } + Py_INCREF(meta_attribute); } *************** *** 2019,2022 **** --- 2020,2026 ---- /* Implement descriptor functionality, if any */ descrgetfunc local_get = attribute->ob_type->tp_descr_get; + + Py_XDECREF(meta_attribute); + if (local_get != NULL) { /* NULL 2nd argument indicates the descriptor was *************** *** 2032,2042 **** /* No attribute found in local __dict__ (or bases): use the * descriptor from the metatype, if any */ ! if (meta_get != NULL) ! return meta_get(meta_attribute, (PyObject *)type, ! (PyObject *)metatype); /* If an ordinary attribute was found on the metatype, return it now */ if (meta_attribute != NULL) { - Py_INCREF(meta_attribute); return meta_attribute; } --- 2036,2049 ---- /* No attribute found in local __dict__ (or bases): use the * descriptor from the metatype, if any */ ! if (meta_get != NULL) { ! PyObject *res; ! res = meta_get(meta_attribute, (PyObject *)type, ! (PyObject *)metatype); ! Py_DECREF(meta_attribute); ! return res; ! } /* If an ordinary attribute was found on the metatype, return it now */ if (meta_attribute != NULL) { return meta_attribute; } From doerwalter at users.sourceforge.net Fri Aug 15 09:00:31 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 11:00:36 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.191, 2.192 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv29617/Objects Modified Files: unicodeobject.c Log Message: Fix another refcounting leak (in PyUnicode_DecodeUnicodeEscape()). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.191 retrieving revision 2.192 diff -C2 -d -r2.191 -r2.192 *** unicodeobject.c 14 Aug 2003 20:25:29 -0000 2.191 --- unicodeobject.c 15 Aug 2003 15:00:26 -0000 2.192 *************** *** 1835,1838 **** --- 1835,1840 ---- if (_PyUnicode_Resize(&v, (int)(p - PyUnicode_AS_UNICODE(v)))) goto onError; + Py_XDECREF(errorHandler); + Py_XDECREF(exc); return (PyObject *)v; From doerwalter at users.sourceforge.net Fri Aug 15 09:01:28 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 11:01:31 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190.6.1, 2.190.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv29813/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkin: Fix another refcounting leak (in PyUnicode_DecodeUnicodeEscape()). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.1 retrieving revision 2.190.6.2 diff -C2 -d -r2.190.6.1 -r2.190.6.2 *** unicodeobject.c 14 Aug 2003 20:26:44 -0000 2.190.6.1 --- unicodeobject.c 15 Aug 2003 15:01:26 -0000 2.190.6.2 *************** *** 1835,1838 **** --- 1835,1840 ---- if (_PyUnicode_Resize(&v, (int)(p - PyUnicode_AS_UNICODE(v)))) goto onError; + Py_XDECREF(errorHandler); + Py_XDECREF(exc); return (PyObject *)v; From doerwalter at users.sourceforge.net Fri Aug 15 10:26:37 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 12:26:42 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.192, 2.193 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv18633/Objects Modified Files: unicodeobject.c Log Message: Fix another refcounting leak in PyUnicode_EncodeCharmap(). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.192 retrieving revision 2.193 diff -C2 -d -r2.192 -r2.193 *** unicodeobject.c 15 Aug 2003 15:00:26 -0000 2.192 --- unicodeobject.c 15 Aug 2003 16:26:34 -0000 2.193 *************** *** 3028,3033 **** &exc, &known_errorHandler, &errorHandler, errors, ! &res, &respos)) goto onError; } else --- 3028,3035 ---- &exc, &known_errorHandler, &errorHandler, errors, ! &res, &respos)) { ! Py_DECREF(x); goto onError; + } } else From doerwalter at users.sourceforge.net Fri Aug 15 10:27:34 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 12:27:38 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190.6.2, 2.190.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv18915/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkin: Fix another refcounting leak in PyUnicode_EncodeCharmap(). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.2 retrieving revision 2.190.6.3 diff -C2 -d -r2.190.6.2 -r2.190.6.3 *** unicodeobject.c 15 Aug 2003 15:01:26 -0000 2.190.6.2 --- unicodeobject.c 15 Aug 2003 16:27:32 -0000 2.190.6.3 *************** *** 3028,3033 **** &exc, &known_errorHandler, &errorHandler, errors, ! &res, &respos)) goto onError; } else --- 3028,3035 ---- &exc, &known_errorHandler, &errorHandler, errors, ! &res, &respos)) { ! Py_DECREF(x); goto onError; + } } else From doerwalter at users.sourceforge.net Fri Aug 15 10:52:22 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 12:52:25 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.193, 2.194 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv23454/Objects Modified Files: unicodeobject.c Log Message: Fix refcounting leak in charmaptranslate_lookup() Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.193 retrieving revision 2.194 diff -C2 -d -r2.193 -r2.194 *** unicodeobject.c 15 Aug 2003 16:26:34 -0000 2.193 --- unicodeobject.c 15 Aug 2003 16:52:19 -0000 2.194 *************** *** 3203,3206 **** --- 3203,3207 ---- PyErr_SetString(PyExc_TypeError, "character mapping must return integer, None or unicode"); + Py_DECREF(x); return -1; } From doerwalter at users.sourceforge.net Fri Aug 15 10:52:35 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 12:52:39 2003 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190.6.3, 2.190.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv23505/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkin: Fix refcounting leak in charmaptranslate_lookup() Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.3 retrieving revision 2.190.6.4 diff -C2 -d -r2.190.6.3 -r2.190.6.4 *** unicodeobject.c 15 Aug 2003 16:27:32 -0000 2.190.6.3 --- unicodeobject.c 15 Aug 2003 16:52:33 -0000 2.190.6.4 *************** *** 3203,3206 **** --- 3203,3207 ---- PyErr_SetString(PyExc_TypeError, "character mapping must return integer, None or unicode"); + Py_DECREF(x); return -1; } From doerwalter at users.sourceforge.net Fri Aug 15 11:36:27 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 13:36:31 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_builtin.py, 1.21, 1.21.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv31231/Lib/test Modified Files: Tag: release23-maint test_builtin.py Log Message: Backport checkin: Make a copy of L before appending, so the global L remains unchanged (and sys.gettotalrefcount() remains constant). Fix a few typos. Index: test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.21 retrieving revision 1.21.8.1 diff -C2 -d -r1.21 -r1.21.8.1 *** test_builtin.py 18 Jun 2003 14:26:18 -0000 1.21 --- test_builtin.py 15 Aug 2003 17:36:25 -0000 1.21.8.1 *************** *** 365,371 **** def test_filter_subclasses(self): ! # test, that filter() never returns tuple, str or unicode subclasses ! # and that the result always go's through __getitem__ ! funcs = (None, lambda x: True) class tuple2(tuple): def __getitem__(self, index): --- 365,371 ---- def test_filter_subclasses(self): ! # test that filter() never returns tuple, str or unicode subclasses ! # and that the result always goes through __getitem__ ! funcs = (None, bool, lambda x: True) class tuple2(tuple): def __getitem__(self, index): *************** *** 631,635 **** ('1' + '0'*100, 10L**100) ] ! L2 = L if have_unicode: L2 += [ --- 631,635 ---- ('1' + '0'*100, 10L**100) ] ! L2 = L[:] if have_unicode: L2 += [ From doerwalter at users.sourceforge.net Fri Aug 15 11:52:42 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Aug 15 13:52:45 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_builtin.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1114/Lib/test Modified Files: test_builtin.py Log Message: Make a copy of L before appending, so the global L remains unchanged (and sys.gettotalrefcount() remains constant). Fix a few typos. Index: test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_builtin.py 2 Aug 2003 07:42:56 -0000 1.22 --- test_builtin.py 15 Aug 2003 17:52:39 -0000 1.23 *************** *** 365,371 **** def test_filter_subclasses(self): ! # test, that filter() never returns tuple, str or unicode subclasses ! # and that the result always go's through __getitem__ ! funcs = (None, lambda x: True) class tuple2(tuple): def __getitem__(self, index): --- 365,371 ---- def test_filter_subclasses(self): ! # test that filter() never returns tuple, str or unicode subclasses ! # and that the result always goes through __getitem__ ! funcs = (None, bool, lambda x: True) class tuple2(tuple): def __getitem__(self, index): *************** *** 631,635 **** ('1' + '0'*100, 10L**100) ] ! L2 = L if have_unicode: L2 += [ --- 631,635 ---- ('1' + '0'*100, 10L**100) ] ! L2 = L[:] if have_unicode: L2 += [ From bwarsaw at users.sourceforge.net Fri Aug 15 12:18:07 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Fri Aug 15 14:18:10 2003 Subject: [Python-checkins] python/dist/src setup.py,1.38.2.4,1.38.2.5 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv5851 Modified Files: Tag: release21-maint setup.py Log Message: Backport this fix: http://mail.python.org/pipermail/python-checkins/2003-April/035592.html so that Python 2.1-maint can be built on RedHat 9 Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.38.2.4 retrieving revision 1.38.2.5 diff -C2 -d -r1.38.2.4 -r1.38.2.5 *** setup.py 8 Aug 2002 19:56:28 -0000 1.38.2.4 --- setup.py 15 Aug 2003 18:18:04 -0000 1.38.2.5 *************** *** 304,309 **** ] ) ! if (ssl_incs is not None and ! ssl_libs is not None): exts.append( Extension('_socket', ['socketmodule.c'], include_dirs = ssl_incs, --- 304,313 ---- ] ) ! krb5_h = find_file('krb5.h', inc_dirs, ! ['/usr/kerberos/include']) ! if krb5_h: ! ssl_incs += krb5_h ! ! if ssl_incs is not None and ssl_libs is not None: exts.append( Extension('_socket', ['socketmodule.c'], include_dirs = ssl_incs, From nnorwitz at users.sourceforge.net Fri Aug 15 14:05:48 2003 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri Aug 15 16:05:51 2003 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.179,2.180 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv27284/Objects Modified Files: fileobject.c Log Message: Fix SF #789402, Memory leak on open() If opening a directory, the exception would leak. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.179 retrieving revision 2.180 diff -C2 -d -r2.179 -r2.180 *** fileobject.c 18 May 2003 12:56:25 -0000 2.179 --- fileobject.c 15 Aug 2003 20:05:45 -0000 2.180 *************** *** 100,103 **** --- 100,104 ---- EISDIR, msg); PyErr_SetObject(PyExc_IOError, exc); + Py_XDECREF(exc); return NULL; } From rhettinger at users.sourceforge.net Fri Aug 15 15:14:53 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 17:14:59 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.14,1.831.4.15 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv9535/Misc Modified Files: Tag: release23-maint NEWS Log Message: Make sets.py compatible with Py2.2 Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.14 retrieving revision 1.831.4.15 diff -C2 -d -r1.831.4.14 -r1.831.4.15 *** NEWS 11 Aug 2003 07:21:03 -0000 1.831.4.14 --- NEWS 15 Aug 2003 21:14:50 -0000 1.831.4.15 *************** *** 28,31 **** --- 28,33 ---- ------- + - sets.py can now run under Py2.2 + - Bug #778964: random.seed() now uses fractional seconds so that rapid successive, seeding calls will produce different sequences. From rhettinger at users.sourceforge.net Fri Aug 15 15:14:54 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 17:15:05 2003 Subject: [Python-checkins] python/dist/src/Lib sets.py,1.44,1.44.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv9535/Lib Modified Files: Tag: release23-maint sets.py Log Message: Make sets.py compatible with Py2.2 Index: sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v retrieving revision 1.44 retrieving revision 1.44.8.1 diff -C2 -d -r1.44 -r1.44.8.1 *** sets.py 26 Jun 2003 18:49:28 -0000 1.44 --- sets.py 15 Aug 2003 21:14:51 -0000 1.44.8.1 *************** *** 55,61 **** # improvements. __all__ = ['BaseSet', 'Set', 'ImmutableSet'] - from itertools import ifilter, ifilterfalse class BaseSet(object): --- 55,79 ---- # improvements. + from __future__ import generators + try: + from itertools import ifilter, ifilterfalse + except ImportError: + # Code to make the module run under Py2.2 + def ifilter(predicate, iterable): + if predicate is None: + def predicate(x): + return x + for x in iterable: + if predicate(x): + yield x + def ifilterfalse(predicate, iterable): + if predicate is None: + def predicate(x): + return x + for x in iterable: + if not predicate(x): + yield x __all__ = ['BaseSet', 'Set', 'ImmutableSet'] class BaseSet(object): From rhettinger at users.sourceforge.net Fri Aug 15 15:17:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 17:17:10 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.842,1.843 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv10139/Misc Modified Files: NEWS Log Message: Make sets.py compatible with Py2.2 Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.842 retrieving revision 1.843 diff -C2 -d -r1.842 -r1.843 *** NEWS 15 Aug 2003 01:16:36 -0000 1.842 --- NEWS 15 Aug 2003 21:17:04 -0000 1.843 *************** *** 31,34 **** --- 31,36 ---- ------- + - sets.py now runs under Py2.2 + - 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 From rhettinger at users.sourceforge.net Fri Aug 15 15:17:06 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 17:17:15 2003 Subject: [Python-checkins] python/dist/src/Lib sets.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv10139/Lib Modified Files: sets.py Log Message: Make sets.py compatible with Py2.2 Index: sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** sets.py 26 Jun 2003 18:49:28 -0000 1.44 --- sets.py 15 Aug 2003 21:17:04 -0000 1.45 *************** *** 55,61 **** # improvements. __all__ = ['BaseSet', 'Set', 'ImmutableSet'] - from itertools import ifilter, ifilterfalse class BaseSet(object): --- 55,79 ---- # improvements. + from __future__ import generators + try: + from itertools import ifilter, ifilterfalse + except ImportError: + # Code to make the module run under Py2.2 + def ifilter(predicate, iterable): + if predicate is None: + def predicate(x): + return x + for x in iterable: + if predicate(x): + yield x + def ifilterfalse(predicate, iterable): + if predicate is None: + def predicate(x): + return x + for x in iterable: + if not predicate(x): + yield x __all__ = ['BaseSet', 'Set', 'ImmutableSet'] class BaseSet(object): From rhettinger at users.sourceforge.net Fri Aug 15 19:00:02 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 21:04:02 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_sets.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv8357 Modified Files: test_sets.py Log Message: Keep doctests in sync with the docs. Index: test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_sets.py 1 May 2003 17:45:48 -0000 1.24 --- test_sets.py 16 Aug 2003 00:59:59 -0000 1.25 *************** *** 635,642 **** >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> management = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | management # union ! >>> engineering_management = engineers & programmers # intersection ! >>> fulltime_management = management - engineers - programmers # difference >>> engineers.add('Marvin') >>> print engineers --- 635,642 ---- >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> managers = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | managers # union ! >>> engineering_management = engineers & managers # intersection ! >>> fulltime_management = managers - engineers - programmers # difference >>> engineers.add('Marvin') >>> print engineers *************** *** 647,651 **** >>> employees.issuperset(engineers) True ! >>> for group in [engineers, programmers, management, employees]: ... group.discard('Susan') # unconditionally remove element ... print group --- 647,651 ---- >>> employees.issuperset(engineers) True ! >>> for group in [engineers, programmers, managers, employees]: ... group.discard('Susan') # unconditionally remove element ... print group From rhettinger at users.sourceforge.net Fri Aug 15 18:56:43 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 15 21:11:20 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libsets.tex,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv7354 Modified Files: libsets.tex Log Message: Incorporate documentation suggestions from feedback on comp.lang.python. * Positive wording for the description of why < and > and = can all be False. * Move to a three column table format that puts long method names side-by-side with their operator equivalents * Mention that KeyError can be raised by Set.pop() and Set.remove(). * Minor tweaks to the examples. Will backport as soon as Fred rebuilds the docs so I can confirm the tables formatted properly Index: libsets.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsets.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libsets.tex 14 Feb 2003 03:42:11 -0000 1.11 --- libsets.tex 16 Aug 2003 00:56:40 -0000 1.12 *************** *** 66,104 **** the following operations: ! \begin{tableii}{c|l}{code}{Operation}{Result} ! \lineii{len(\var{s})}{cardinality of set \var{s}} \hline ! \lineii{\var{x} in \var{s}} {test \var{x} for membership in \var{s}} ! \lineii{\var{x} not in \var{s}} {test \var{x} for non-membership in \var{s}} ! \lineii{\var{s}.issubset(\var{t})} ! {test whether every element in \var{s} is in \var{t}; ! \code{\var{s} <= \var{t}} is equivalent} ! \lineii{\var{s}.issuperset(\var{t})} ! {test whether every element in \var{t} is in \var{s}; ! \code{\var{s} >= \var{t}} is equivalent} \hline ! \lineii{\var{s} | \var{t}} ! {new set with elements from both \var{s} and \var{t}} ! \lineii{\var{s}.union(\var{t})} {new set with elements from both \var{s} and \var{t}} ! \lineii{\var{s} \&\ \var{t}} ! {new set with elements common to \var{s} and \var{t}} ! \lineii{\var{s}.intersection(\var{t})} {new set with elements common to \var{s} and \var{t}} ! \lineii{\var{s} - \var{t}} ! {new set with elements in \var{s} but not in \var{t}} ! \lineii{\var{s}.difference(\var{t})} {new set with elements in \var{s} but not in \var{t}} ! \lineii{\var{s} \^\ \var{t}} ! {new set with elements in either \var{s} or \var{t} but not both} ! \lineii{\var{s}.symmetric_difference(\var{t})} {new set with elements in either \var{s} or \var{t} but not both} ! \lineii{\var{s}.copy()} {new set with a shallow copy of \var{s}} ! \end{tableii} In addition, both \class{Set} and \class{ImmutableSet} --- 66,94 ---- the following operations: ! \begin{tableiii}{c|c|l}{code}{Operation}{Equivalent}{Result} ! \lineiii{len(\var{s})}{}{cardinality of set \var{s}} \hline ! \lineiii{\var{x} in \var{s}}{} {test \var{x} for membership in \var{s}} ! \lineiii{\var{x} not in \var{s}}{} {test \var{x} for non-membership in \var{s}} ! \lineiii{\var{s}.issubset(\var{t})}{\code{\var{s} <= \var{t}}} ! {test whether every element in \var{s} is in \var{t}} ! \lineiii{\var{s}.issuperset(\var{t})}{\code{\var{s} >= \var{t}}} ! {test whether every element in \var{t} is in \var{s}} \hline ! \lineiii{\var{s}.union(\var{t})}{\var{s} | \var{t}} {new set with elements from both \var{s} and \var{t}} ! \lineiii{\var{s}.intersection(\var{t})}{\var{s} \&\ \var{t}} {new set with elements common to \var{s} and \var{t}} ! \lineiii{\var{s}.difference(\var{t})}{\var{s} - \var{t}} {new set with elements in \var{s} but not in \var{t}} ! \lineiii{\var{s}.symmetric_difference(\var{t})}{\var{s} \^\ \var{t}} {new set with elements in either \var{s} or \var{t} but not both} ! \lineiii{\var{s}.copy()}{} {new set with a shallow copy of \var{s}} ! \end{tableiii} In addition, both \class{Set} and \class{ImmutableSet} *************** *** 113,118 **** The subset and equality comparisons do not generalize to a complete ordering function. For example, any two disjoint sets are not equal and ! are not subsets of each other, so \emph{none} of the following are true: ! \code{\var{a}<\var{b}}, \code{\var{a}==\var{b}}, or \code{\var{a}>\var{b}}. Accordingly, sets do not implement the \method{__cmp__} method. --- 103,109 ---- The subset and equality comparisons do not generalize to a complete ordering function. For example, any two disjoint sets are not equal and ! are not subsets of each other, so \emph{all} of the following return ! \code{False}: \code{\var{a}<\var{b}}, \code{\var{a}==\var{b}}, or ! \code{\var{a}>\var{b}}. Accordingly, sets do not implement the \method{__cmp__} method. *************** *** 123,127 **** but not found in \class{Set}: ! \begin{tableii}{c|l|c}{code}{Operation}{Result} \lineii{hash(\var{s})}{returns a hash value for \var{s}} \end{tableii} --- 114,118 ---- but not found in \class{Set}: ! \begin{tableii}{c|l}{code}{Operation}{Result} \lineii{hash(\var{s})}{returns a hash value for \var{s}} \end{tableii} *************** *** 130,167 **** but not found in \class{ImmutableSet}: ! \begin{tableii}{c|l}{code}{Operation}{Result} ! \lineii{\var{s} |= \var{t}} ! {return set \var{s} with elements added from \var{t}} ! \lineii{\var{s}.union_update(\var{t})} {return set \var{s} with elements added from \var{t}} ! \lineii{\var{s} \&= \var{t}} ! {return set \var{s} keeping only elements also found in \var{t}} ! \lineii{\var{s}.intersection_update(\var{t})} {return set \var{s} keeping only elements also found in \var{t}} ! \lineii{\var{s} -= \var{t}} ! {return set \var{s} after removing elements found in \var{t}} ! \lineii{\var{s}.difference_update(\var{t})} {return set \var{s} after removing elements found in \var{t}} ! \lineii{\var{s} \textasciicircum= \var{t}} ! {return set \var{s} with elements from \var{s} or \var{t} ! but not both} ! \lineii{\var{s}.symmetric_difference_update(\var{t})} {return set \var{s} with elements from \var{s} or \var{t} but not both} \hline ! \lineii{\var{s}.add(\var{x})} {add element \var{x} to set \var{s}} ! \lineii{\var{s}.remove(\var{x})} ! {remove \var{x} from set \var{s}} ! \lineii{\var{s}.discard(\var{x})} {removes \var{x} from set \var{s} if present} ! \lineii{\var{s}.pop()} ! {remove and return an arbitrary element from \var{s}} ! \lineii{\var{s}.update(\var{t})} {add elements from \var{t} to set \var{s}} ! \lineii{\var{s}.clear()} {remove all elements from set \var{s}} ! \end{tableii} --- 121,154 ---- but not found in \class{ImmutableSet}: ! \begin{tableiii}{c|c|l}{code}{Operation}{Equivalent}{Result} ! \lineiii{\var{s}.union_update(\var{t})} ! {\var{s} |= \var{t}} {return set \var{s} with elements added from \var{t}} ! \lineiii{\var{s}.intersection_update(\var{t})} ! {\var{s} \&= \var{t}} {return set \var{s} keeping only elements also found in \var{t}} ! \lineiii{\var{s}.difference_update(\var{t})} ! {\var{s} -= \var{t}} {return set \var{s} after removing elements found in \var{t}} ! \lineiii{\var{s}.symmetric_difference_update(\var{t})} ! {\var{s} \textasciicircum= \var{t}} {return set \var{s} with elements from \var{s} or \var{t} but not both} \hline ! \lineiii{\var{s}.add(\var{x})}{} {add element \var{x} to set \var{s}} ! \lineiii{\var{s}.remove(\var{x})}{} ! {remove \var{x} from set \var{s}; raises KeyError if not present} ! \lineiii{\var{s}.discard(\var{x})}{} {removes \var{x} from set \var{s} if present} ! \lineiii{\var{s}.pop()}{} ! {remove and return an arbitrary element from \var{s}; raises ! KeyError if empty} ! \lineiii{\var{s}.update(\var{t})}{} {add elements from \var{t} to set \var{s}} ! \lineiii{\var{s}.clear()}{} {remove all elements from set \var{s}} ! \end{tableiii} *************** *** 172,180 **** >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> management = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | management # union ! >>> engineering_management = engineers & programmers # intersection ! >>> fulltime_management = management - engineers - programmers # difference ! >>> engineers.add('Marvin') # add element >>> print engineers Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack']) --- 159,167 ---- >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> managers = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | managers # union ! >>> engineering_management = engineers & managers # intersection ! >>> fulltime_management = managers - engineers - programmers # difference ! >>> engineers.add('Marvin') # add element >>> print engineers Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack']) From fdrake at users.sourceforge.net Sat Aug 16 00:30:49 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Sat Aug 16 02:30:53 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.199,1.200 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv13371/tut Modified Files: tut.tex Log Message: Adjust some horizontal indentation to be consistent with the style used throughout the documentation. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** tut.tex 14 Aug 2003 22:57:46 -0000 1.199 --- tut.tex 16 Aug 2003 06:30:47 -0000 1.200 *************** *** 1235,1243 **** ... for x in range(2, n): ... if n % x == 0: ! ... print n, 'equals', x, '*', n/x ! ... break ... else: ! ... # loop fell through without finding a factor ! ... print n, 'is a prime number' ... 2 is a prime number --- 1235,1243 ---- ... for x in range(2, n): ... if n % x == 0: ! ... print n, 'equals', x, '*', n/x ! ... break ... else: ! ... # loop fell through without finding a factor ! ... print n, 'is a prime number' ... 2 is a prime number From fdrake at users.sourceforge.net Sat Aug 16 00:31:23 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Sat Aug 16 02:31:26 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.2, 1.196.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv13432/tut Modified Files: Tag: release23-maint tut.tex Log Message: Adjust some horizontal indentation to be consistent with the style used throughout the documentation. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.2 retrieving revision 1.196.8.3 diff -C2 -d -r1.196.8.2 -r1.196.8.3 *** tut.tex 11 Aug 2003 23:43:04 -0000 1.196.8.2 --- tut.tex 16 Aug 2003 06:31:21 -0000 1.196.8.3 *************** *** 1235,1243 **** ... for x in range(2, n): ... if n % x == 0: ! ... print n, 'equals', x, '*', n/x ! ... break ... else: ! ... # loop fell through without finding a factor ! ... print n, 'is a prime number' ... 2 is a prime number --- 1235,1243 ---- ... for x in range(2, n): ... if n % x == 0: ! ... print n, 'equals', x, '*', n/x ! ... break ... else: ! ... # loop fell through without finding a factor ! ... print n, 'is a prime number' ... 2 is a prime number From rhettinger at users.sourceforge.net Sun Aug 17 02:34:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 04:34:15 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.843,1.844 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12812/Misc Modified Files: NEWS Log Message: Improvements to set.py: * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Deprecated Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Will backport to Py2.3.1 so that the interface remains consistent across versions. The deprecation of update() will be changed to a FutureWarning. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.843 retrieving revision 1.844 diff -C2 -d -r1.843 -r1.844 *** NEWS 15 Aug 2003 21:17:04 -0000 1.843 --- NEWS 17 Aug 2003 08:34:09 -0000 1.844 *************** *** 31,35 **** ------- ! - sets.py now runs under Py2.2 - random.seed() with no arguments or None uses time.time() as a default --- 31,38 ---- ------- ! - sets.py now runs under Py2.2. In addition, the argument restrictions ! for most set methods (but not the operators) have been relaxed to ! 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 From rhettinger at users.sourceforge.net Sun Aug 17 02:34:12 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 04:34:22 2003 Subject: [Python-checkins] python/dist/src/Lib sets.py,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv12812/Lib Modified Files: sets.py Log Message: Improvements to set.py: * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Deprecated Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Will backport to Py2.3.1 so that the interface remains consistent across versions. The deprecation of update() will be changed to a FutureWarning. Index: sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** sets.py 15 Aug 2003 21:17:04 -0000 1.45 --- sets.py 17 Aug 2003 08:34:09 -0000 1.46 *************** *** 197,204 **** if not isinstance(other, BaseSet): return NotImplemented ! result = self.__class__() ! result._data = self._data.copy() ! result._data.update(other._data) ! return result def union(self, other): --- 197,201 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.union(other) def union(self, other): *************** *** 207,211 **** (I.e. all elements that are in either set.) """ ! return self | other def __and__(self, other): --- 204,210 ---- (I.e. all elements that are in either set.) """ ! result = self.__class__(self) ! result._update(other) ! return result def __and__(self, other): *************** *** 216,225 **** if not isinstance(other, BaseSet): return NotImplemented ! if len(self) <= len(other): ! little, big = self, other ! else: ! little, big = other, self ! common = ifilter(big._data.has_key, little) ! return self.__class__(common) def intersection(self, other): --- 215,219 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.intersection(other) def intersection(self, other): *************** *** 228,232 **** (I.e. all elements that are in both sets.) """ ! return self & other def __xor__(self, other): --- 222,233 ---- (I.e. all elements that are in both sets.) """ ! if not isinstance(other, BaseSet): ! other = Set(other) ! if len(self) <= len(other): ! little, big = self, other ! else: ! little, big = other, self ! common = ifilter(big._data.has_key, little) ! return self.__class__(common) def __xor__(self, other): *************** *** 237,245 **** if not isinstance(other, BaseSet): return NotImplemented result = self.__class__() data = result._data value = True selfdata = self._data ! otherdata = other._data for elt in ifilterfalse(otherdata.has_key, selfdata): data[elt] = value --- 238,256 ---- if not isinstance(other, BaseSet): return NotImplemented + return self.symmetric_difference(other) + + def symmetric_difference(self, other): + """Return the symmetric difference of two sets as a new set. + + (I.e. all elements that are in exactly one of the sets.) + """ result = self.__class__() data = result._data value = True selfdata = self._data ! try: ! otherdata = other._data ! except AttributeError: ! otherdata = Set(other)._data for elt in ifilterfalse(otherdata.has_key, selfdata): data[elt] = value *************** *** 248,258 **** return result - def symmetric_difference(self, other): - """Return the symmetric difference of two sets as a new set. - - (I.e. all elements that are in exactly one of the sets.) - """ - return self ^ other - def __sub__(self, other): """Return the difference of two sets as a new Set. --- 259,262 ---- *************** *** 262,271 **** if not isinstance(other, BaseSet): return NotImplemented ! result = self.__class__() ! data = result._data ! value = True ! for elt in ifilterfalse(other._data.has_key, self): ! data[elt] = value ! return result def difference(self, other): --- 266,270 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.difference(other) def difference(self, other): *************** *** 274,278 **** (I.e. all elements that are in this set and not in the other.) """ ! return self - other # Membership test --- 273,286 ---- (I.e. all elements that are in this set and not in the other.) """ ! result = self.__class__() ! data = result._data ! try: ! otherdata = other._data ! except AttributeError: ! otherdata = Set(other)._data ! value = True ! for elt in ifilterfalse(otherdata.has_key, self): ! data[elt] = value ! return result # Membership test *************** *** 442,446 **** def union_update(self, other): """Update a set with the union of itself and another.""" ! self |= other def __iand__(self, other): --- 450,454 ---- def union_update(self, other): """Update a set with the union of itself and another.""" ! self._update(other) def __iand__(self, other): *************** *** 452,462 **** def intersection_update(self, other): """Update a set with the intersection of itself and another.""" ! self &= other def __ixor__(self, other): """Update a set with the symmetric difference of itself and another.""" self._binary_sanity_check(other) data = self._data value = True for elt in other: if elt in data: --- 460,480 ---- def intersection_update(self, other): """Update a set with the intersection of itself and another.""" ! if isinstance(other, BaseSet): ! self &= other ! else: ! self._data = (self.intersection(other))._data def __ixor__(self, other): """Update a set with the symmetric difference of itself and another.""" self._binary_sanity_check(other) + self.symmetric_difference_update(other) + return self + + def symmetric_difference_update(self, other): + """Update a set with the symmetric difference of itself and another.""" data = self._data value = True + if not isinstance(other, BaseSet): + other = Set(other) for elt in other: if elt in data: *************** *** 464,484 **** else: data[elt] = value - return self - - def symmetric_difference_update(self, other): - """Update a set with the symmetric difference of itself and another.""" - self ^= other def __isub__(self, other): """Remove all elements of another set from this set.""" self._binary_sanity_check(other) ! data = self._data ! for elt in ifilter(data.has_key, other): ! del data[elt] return self def difference_update(self, other): """Remove all elements of another set from this set.""" ! self -= other # Python dict-like mass mutations: update, clear --- 482,499 ---- else: data[elt] = value def __isub__(self, other): """Remove all elements of another set from this set.""" self._binary_sanity_check(other) ! self.difference_update(other) return self def difference_update(self, other): """Remove all elements of another set from this set.""" ! data = self._data ! if not isinstance(other, BaseSet): ! other = Set(other) ! for elt in ifilter(data.has_key, other): ! del data[elt] # Python dict-like mass mutations: update, clear *************** *** 486,489 **** --- 501,508 ---- def update(self, iterable): """Add all values from an iterable (such as a list or file).""" + import warnings + warnings.warn("The update() method deprecated; " + "Use union_update() instead", + DeprecationWarning) self._update(iterable) From rhettinger at users.sourceforge.net Sun Aug 17 02:34:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 04:34:28 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libsets.tex,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12812/Doc/lib Modified Files: libsets.tex Log Message: Improvements to set.py: * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Deprecated Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Will backport to Py2.3.1 so that the interface remains consistent across versions. The deprecation of update() will be changed to a FutureWarning. Index: libsets.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsets.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libsets.tex 16 Aug 2003 00:56:40 -0000 1.12 --- libsets.tex 17 Aug 2003 08:34:09 -0000 1.13 *************** *** 92,95 **** --- 92,104 ---- \end{tableiii} + Note, this non-operator versions of \method{union()}, + \method{intersection()}, \method{difference()}, and + \method{symmetric_difference()} will accept any iterable as an argument. + In contrast, their operator based counterparts require their arguments to + be sets. This precludes error-prone constructions like + \code{Set('abc') \&\ 'cbs'} in favor of the more readable + \code{Set('abc').intersection('cbs')}. + \versionchanged[Formerly all arguments were required to be sets]{2.3.1} + In addition, both \class{Set} and \class{ImmutableSet} support set to set comparisons. Two sets are equal if and only if *************** *** 146,155 **** {remove and return an arbitrary element from \var{s}; raises KeyError if empty} - \lineiii{\var{s}.update(\var{t})}{} - {add elements from \var{t} to set \var{s}} \lineiii{\var{s}.clear()}{} {remove all elements from set \var{s}} \end{tableiii} \subsection{Example \label{set-example}} --- 155,171 ---- {remove and return an arbitrary element from \var{s}; raises KeyError if empty} \lineiii{\var{s}.clear()}{} {remove all elements from set \var{s}} \end{tableiii} + \versionchanged[Earlier versions had an \method{update()} method; use + \method{union_update()} instead]{2.3.1} + + Note, this non-operator versions of \method{union_update()}, + \method{intersection_update()}, \method{difference_update()}, and + \method{symmetric_difference_update()} will accept any iterable as + an argument. + \versionchanged[Formerly all arguments were required to be sets]{2.3.1} + \subsection{Example \label{set-example}} *************** *** 168,172 **** >>> employees.issuperset(engineers) # superset test False ! >>> employees.update(engineers) # update from another set >>> employees.issuperset(engineers) True --- 184,188 ---- >>> employees.issuperset(engineers) # superset test False ! >>> employees.union_update(engineers) # update from another set >>> employees.issuperset(engineers) True From rhettinger at users.sourceforge.net Sun Aug 17 02:34:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 04:34:34 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_sets.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv12812/Lib/test Modified Files: test_sets.py Log Message: Improvements to set.py: * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Deprecated Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Will backport to Py2.3.1 so that the interface remains consistent across versions. The deprecation of update() will be changed to a FutureWarning. Index: test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_sets.py 16 Aug 2003 00:59:59 -0000 1.25 --- test_sets.py 17 Aug 2003 08:34:09 -0000 1.26 *************** *** 153,157 **** def test_instancesWithoutException(self): ! """All of these iterables should load without exception.""" Set([1,2,3]) Set((1,2,3)) --- 153,157 ---- def test_instancesWithoutException(self): ! # All of these iterables should load without exception. Set([1,2,3]) Set((1,2,3)) *************** *** 393,405 **** def test_update_empty_tuple(self): ! self.set.update(()) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_overlap(self): ! self.set.update(("a",)) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_non_overlap(self): ! self.set.update(("a", "z")) self.assertEqual(self.set, Set(self.values + ["z"])) --- 393,405 ---- def test_update_empty_tuple(self): ! self.set.union_update(()) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_overlap(self): ! self.set.union_update(("a",)) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_non_overlap(self): ! self.set.union_update(("a", "z")) self.assertEqual(self.set, Set(self.values + ["z"])) *************** *** 504,508 **** self.assertRaises(TypeError, lambda: self.other >= self.set) ! def test_union_update(self): try: self.set |= self.other --- 504,508 ---- self.assertRaises(TypeError, lambda: self.other >= self.set) ! def test_union_update_operator(self): try: self.set |= self.other *************** *** 512,520 **** self.fail("expected TypeError") def test_union(self): self.assertRaises(TypeError, lambda: self.set | self.other) self.assertRaises(TypeError, lambda: self.other | self.set) ! def test_intersection_update(self): try: self.set &= self.other --- 512,530 ---- self.fail("expected TypeError") + def test_union_update(self): + if self.otherIsIterable: + self.set.union_update(self.other) + else: + self.assertRaises(TypeError, self.set.union_update, self.other) + def test_union(self): self.assertRaises(TypeError, lambda: self.set | self.other) self.assertRaises(TypeError, lambda: self.other | self.set) + if self.otherIsIterable: + self.set.union(self.other) + else: + self.assertRaises(TypeError, self.set.union, self.other) ! def test_intersection_update_operator(self): try: self.set &= self.other *************** *** 524,532 **** self.fail("expected TypeError") def test_intersection(self): self.assertRaises(TypeError, lambda: self.set & self.other) self.assertRaises(TypeError, lambda: self.other & self.set) ! def test_sym_difference_update(self): try: self.set ^= self.other --- 534,554 ---- self.fail("expected TypeError") + def test_intersection_update(self): + if self.otherIsIterable: + self.set.intersection_update(self.other) + else: + self.assertRaises(TypeError, + self.set.intersection_update, + self.other) + def test_intersection(self): self.assertRaises(TypeError, lambda: self.set & self.other) self.assertRaises(TypeError, lambda: self.other & self.set) + if self.otherIsIterable: + self.set.intersection(self.other) + else: + self.assertRaises(TypeError, self.set.intersection, self.other) ! def test_sym_difference_update_operator(self): try: self.set ^= self.other *************** *** 536,544 **** self.fail("expected TypeError") def test_sym_difference(self): self.assertRaises(TypeError, lambda: self.set ^ self.other) self.assertRaises(TypeError, lambda: self.other ^ self.set) ! def test_difference_update(self): try: self.set -= self.other --- 558,578 ---- self.fail("expected TypeError") + def test_sym_difference_update(self): + if self.otherIsIterable: + self.set.symmetric_difference_update(self.other) + else: + self.assertRaises(TypeError, + self.set.symmetric_difference_update, + self.other) + def test_sym_difference(self): self.assertRaises(TypeError, lambda: self.set ^ self.other) self.assertRaises(TypeError, lambda: self.other ^ self.set) + if self.otherIsIterable: + self.set.symmetric_difference(self.other) + else: + self.assertRaises(TypeError, self.set.symmetric_difference, self.other) ! def test_difference_update_operator(self): try: self.set -= self.other *************** *** 548,555 **** self.fail("expected TypeError") def test_difference(self): self.assertRaises(TypeError, lambda: self.set - self.other) self.assertRaises(TypeError, lambda: self.other - self.set) ! #------------------------------------------------------------------------------ --- 582,600 ---- self.fail("expected TypeError") + def test_difference_update(self): + if self.otherIsIterable: + self.set.difference_update(self.other) + else: + self.assertRaises(TypeError, + self.set.difference_update, + self.other) + def test_difference(self): self.assertRaises(TypeError, lambda: self.set - self.other) self.assertRaises(TypeError, lambda: self.other - self.set) ! if self.otherIsIterable: ! self.set.difference(self.other) ! else: ! self.assertRaises(TypeError, self.set.difference, self.other) #------------------------------------------------------------------------------ *************** *** 558,561 **** --- 603,607 ---- self.set = Set((1, 2, 3)) self.other = 19 + self.otherIsIterable = False #------------------------------------------------------------------------------ *************** *** 565,568 **** --- 611,615 ---- self.set = Set((1, 2, 3)) self.other = {1:2, 3:4} + self.otherIsIterable = True #------------------------------------------------------------------------------ *************** *** 572,575 **** --- 619,650 ---- self.set = Set((1, 2, 3)) self.other = operator.add + self.otherIsIterable = False + + #------------------------------------------------------------------------------ + + class TestOnlySetsTuple(TestOnlySetsInBinaryOps): + def setUp(self): + self.set = Set((1, 2, 3)) + self.other = (2, 4, 6) + self.otherIsIterable = True + + #------------------------------------------------------------------------------ + + class TestOnlySetsString(TestOnlySetsInBinaryOps): + def setUp(self): + self.set = Set((1, 2, 3)) + self.other = 'abc' + self.otherIsIterable = True + + #------------------------------------------------------------------------------ + + class TestOnlySetsGenerator(TestOnlySetsInBinaryOps): + def setUp(self): + def gen(): + for i in xrange(0, 10, 2): + yield i + self.set = Set((1, 2, 3)) + self.other = gen() + self.otherIsIterable = True #============================================================================== *************** *** 626,629 **** --- 701,747 ---- #============================================================================== + class TestIdentities(unittest.TestCase): + def setUp(self): + self.a = Set('abracadabra') + self.b = Set('alacazam') + + def test_binopsVsSubsets(self): + a, b = self.a, self.b + self.assert_(a - b < a) + self.assert_(b - a < b) + self.assert_(a & b < a) + self.assert_(a & b < b) + self.assert_(a | b > a) + self.assert_(a | b > b) + self.assert_(a ^ b < a | b) + + def test_commutativity(self): + a, b = self.a, self.b + self.assertEqual(a&b, b&a) + self.assertEqual(a|b, b|a) + self.assertEqual(a^b, b^a) + if a != b: + self.assertNotEqual(a-b, b-a) + + def test_summations(self): + # check that sums of parts equal the whole + a, b = self.a, self.b + self.assertEqual((a-b)|(a&b)|(b-a), a|b) + self.assertEqual((a&b)|(a^b), a|b) + self.assertEqual(a|(b-a), a|b) + self.assertEqual((a-b)|b, a|b) + self.assertEqual((a-b)|(a&b), a) + self.assertEqual((b-a)|(a&b), b) + self.assertEqual((a-b)|(b-a), a^b) + + def test_exclusion(self): + # check that inverse operations show non-overlap + a, b, zero = self.a, self.b, Set() + self.assertEqual((a-b)&b, zero) + self.assertEqual((b-a)&a, zero) + self.assertEqual((a&b)&(a^b), zero) + + #============================================================================== + libreftest = """ Example from the Library Reference: Doc/lib/libsets.tex *************** *** 644,648 **** >>> employees.issuperset(engineers) # superset test False ! >>> employees.update(engineers) # update from another set >>> employees.issuperset(engineers) True --- 762,766 ---- >>> employees.issuperset(engineers) # superset test False ! >>> employees.union_update(engineers) # update from another set >>> employees.issuperset(engineers) True *************** *** 681,689 **** TestOnlySetsDict, TestOnlySetsOperator, TestCopyingEmpty, TestCopyingSingleton, TestCopyingTriple, TestCopyingTuple, ! TestCopyingNested ) test_support.run_doctest(test_sets, verbose) --- 799,811 ---- TestOnlySetsDict, TestOnlySetsOperator, + TestOnlySetsTuple, + TestOnlySetsString, + TestOnlySetsGenerator, TestCopyingEmpty, TestCopyingSingleton, TestCopyingTriple, TestCopyingTuple, ! TestCopyingNested, ! TestIdentities, ) test_support.run_doctest(test_sets, verbose) From rhettinger at users.sourceforge.net Sun Aug 17 15:28:41 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 17:28:45 2003 Subject: [Python-checkins] python/dist/src/Modules getaddrinfo.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv21536 Modified Files: getaddrinfo.c Log Message: SF #784031: Byte-order bug in socket-module getaddrinfo.c Index: getaddrinfo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** getaddrinfo.c 17 Jul 2002 14:33:34 -0000 1.11 --- getaddrinfo.c 17 Aug 2003 21:28:39 -0000 1.12 *************** *** 422,425 **** --- 422,426 ---- case AF_INET: v4a = ((struct in_addr *)pton)->s_addr; + v4a = ntohl(v4a); if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) pai->ai_flags &= ~AI_CANONNAME; From rhettinger at users.sourceforge.net Sun Aug 17 15:29:34 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 17:29:37 2003 Subject: [Python-checkins] python/dist/src/Modules getaddrinfo.c, 1.11, 1.11.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv21807 Modified Files: Tag: release23-maint getaddrinfo.c Log Message: SF #784031: Byte-order bug in socket-module getaddrinfo.c Index: getaddrinfo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v retrieving revision 1.11 retrieving revision 1.11.14.1 diff -C2 -d -r1.11 -r1.11.14.1 *** getaddrinfo.c 17 Jul 2002 14:33:34 -0000 1.11 --- getaddrinfo.c 17 Aug 2003 21:29:32 -0000 1.11.14.1 *************** *** 422,425 **** --- 422,426 ---- case AF_INET: v4a = ((struct in_addr *)pton)->s_addr; + v4a = ntohl(v4a); if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) pai->ai_flags &= ~AI_CANONNAME; From rhettinger at users.sourceforge.net Sun Aug 17 16:09:00 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 18:09:04 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_sets.py, 1.24, 1.24.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv27709/Lib/test Modified Files: Tag: release23-maint test_sets.py Log Message: Backport improvements to set.py so that the interface will remain consistent across versions. * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Added a PendingDeprecationWarning for Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Index: test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.24 retrieving revision 1.24.8.1 diff -C2 -d -r1.24 -r1.24.8.1 *** test_sets.py 1 May 2003 17:45:48 -0000 1.24 --- test_sets.py 17 Aug 2003 22:08:58 -0000 1.24.8.1 *************** *** 153,157 **** def test_instancesWithoutException(self): ! """All of these iterables should load without exception.""" Set([1,2,3]) Set((1,2,3)) --- 153,157 ---- def test_instancesWithoutException(self): ! # All of these iterables should load without exception. Set([1,2,3]) Set((1,2,3)) *************** *** 393,405 **** def test_update_empty_tuple(self): ! self.set.update(()) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_overlap(self): ! self.set.update(("a",)) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_non_overlap(self): ! self.set.update(("a", "z")) self.assertEqual(self.set, Set(self.values + ["z"])) --- 393,405 ---- def test_update_empty_tuple(self): ! self.set.union_update(()) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_overlap(self): ! self.set.union_update(("a",)) self.assertEqual(self.set, Set(self.values)) def test_update_unit_tuple_non_overlap(self): ! self.set.union_update(("a", "z")) self.assertEqual(self.set, Set(self.values + ["z"])) *************** *** 504,508 **** self.assertRaises(TypeError, lambda: self.other >= self.set) ! def test_union_update(self): try: self.set |= self.other --- 504,508 ---- self.assertRaises(TypeError, lambda: self.other >= self.set) ! def test_union_update_operator(self): try: self.set |= self.other *************** *** 512,520 **** self.fail("expected TypeError") def test_union(self): self.assertRaises(TypeError, lambda: self.set | self.other) self.assertRaises(TypeError, lambda: self.other | self.set) ! def test_intersection_update(self): try: self.set &= self.other --- 512,530 ---- self.fail("expected TypeError") + def test_union_update(self): + if self.otherIsIterable: + self.set.union_update(self.other) + else: + self.assertRaises(TypeError, self.set.union_update, self.other) + def test_union(self): self.assertRaises(TypeError, lambda: self.set | self.other) self.assertRaises(TypeError, lambda: self.other | self.set) + if self.otherIsIterable: + self.set.union(self.other) + else: + self.assertRaises(TypeError, self.set.union, self.other) ! def test_intersection_update_operator(self): try: self.set &= self.other *************** *** 524,532 **** self.fail("expected TypeError") def test_intersection(self): self.assertRaises(TypeError, lambda: self.set & self.other) self.assertRaises(TypeError, lambda: self.other & self.set) ! def test_sym_difference_update(self): try: self.set ^= self.other --- 534,554 ---- self.fail("expected TypeError") + def test_intersection_update(self): + if self.otherIsIterable: + self.set.intersection_update(self.other) + else: + self.assertRaises(TypeError, + self.set.intersection_update, + self.other) + def test_intersection(self): self.assertRaises(TypeError, lambda: self.set & self.other) self.assertRaises(TypeError, lambda: self.other & self.set) + if self.otherIsIterable: + self.set.intersection(self.other) + else: + self.assertRaises(TypeError, self.set.intersection, self.other) ! def test_sym_difference_update_operator(self): try: self.set ^= self.other *************** *** 536,544 **** self.fail("expected TypeError") def test_sym_difference(self): self.assertRaises(TypeError, lambda: self.set ^ self.other) self.assertRaises(TypeError, lambda: self.other ^ self.set) ! def test_difference_update(self): try: self.set -= self.other --- 558,578 ---- self.fail("expected TypeError") + def test_sym_difference_update(self): + if self.otherIsIterable: + self.set.symmetric_difference_update(self.other) + else: + self.assertRaises(TypeError, + self.set.symmetric_difference_update, + self.other) + def test_sym_difference(self): self.assertRaises(TypeError, lambda: self.set ^ self.other) self.assertRaises(TypeError, lambda: self.other ^ self.set) + if self.otherIsIterable: + self.set.symmetric_difference(self.other) + else: + self.assertRaises(TypeError, self.set.symmetric_difference, self.other) ! def test_difference_update_operator(self): try: self.set -= self.other *************** *** 548,555 **** self.fail("expected TypeError") def test_difference(self): self.assertRaises(TypeError, lambda: self.set - self.other) self.assertRaises(TypeError, lambda: self.other - self.set) ! #------------------------------------------------------------------------------ --- 582,600 ---- self.fail("expected TypeError") + def test_difference_update(self): + if self.otherIsIterable: + self.set.difference_update(self.other) + else: + self.assertRaises(TypeError, + self.set.difference_update, + self.other) + def test_difference(self): self.assertRaises(TypeError, lambda: self.set - self.other) self.assertRaises(TypeError, lambda: self.other - self.set) ! if self.otherIsIterable: ! self.set.difference(self.other) ! else: ! self.assertRaises(TypeError, self.set.difference, self.other) #------------------------------------------------------------------------------ *************** *** 558,561 **** --- 603,607 ---- self.set = Set((1, 2, 3)) self.other = 19 + self.otherIsIterable = False #------------------------------------------------------------------------------ *************** *** 565,568 **** --- 611,615 ---- self.set = Set((1, 2, 3)) self.other = {1:2, 3:4} + self.otherIsIterable = True #------------------------------------------------------------------------------ *************** *** 572,575 **** --- 619,650 ---- self.set = Set((1, 2, 3)) self.other = operator.add + self.otherIsIterable = False + + #------------------------------------------------------------------------------ + + class TestOnlySetsTuple(TestOnlySetsInBinaryOps): + def setUp(self): + self.set = Set((1, 2, 3)) + self.other = (2, 4, 6) + self.otherIsIterable = True + + #------------------------------------------------------------------------------ + + class TestOnlySetsString(TestOnlySetsInBinaryOps): + def setUp(self): + self.set = Set((1, 2, 3)) + self.other = 'abc' + self.otherIsIterable = True + + #------------------------------------------------------------------------------ + + class TestOnlySetsGenerator(TestOnlySetsInBinaryOps): + def setUp(self): + def gen(): + for i in xrange(0, 10, 2): + yield i + self.set = Set((1, 2, 3)) + self.other = gen() + self.otherIsIterable = True #============================================================================== *************** *** 626,629 **** --- 701,747 ---- #============================================================================== + class TestIdentities(unittest.TestCase): + def setUp(self): + self.a = Set('abracadabra') + self.b = Set('alacazam') + + def test_binopsVsSubsets(self): + a, b = self.a, self.b + self.assert_(a - b < a) + self.assert_(b - a < b) + self.assert_(a & b < a) + self.assert_(a & b < b) + self.assert_(a | b > a) + self.assert_(a | b > b) + self.assert_(a ^ b < a | b) + + def test_commutativity(self): + a, b = self.a, self.b + self.assertEqual(a&b, b&a) + self.assertEqual(a|b, b|a) + self.assertEqual(a^b, b^a) + if a != b: + self.assertNotEqual(a-b, b-a) + + def test_summations(self): + # check that sums of parts equal the whole + a, b = self.a, self.b + self.assertEqual((a-b)|(a&b)|(b-a), a|b) + self.assertEqual((a&b)|(a^b), a|b) + self.assertEqual(a|(b-a), a|b) + self.assertEqual((a-b)|b, a|b) + self.assertEqual((a-b)|(a&b), a) + self.assertEqual((b-a)|(a&b), b) + self.assertEqual((a-b)|(b-a), a^b) + + def test_exclusion(self): + # check that inverse operations show non-overlap + a, b, zero = self.a, self.b, Set() + self.assertEqual((a-b)&b, zero) + self.assertEqual((b-a)&a, zero) + self.assertEqual((a&b)&(a^b), zero) + + #============================================================================== + libreftest = """ Example from the Library Reference: Doc/lib/libsets.tex *************** *** 635,642 **** >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> management = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | management # union ! >>> engineering_management = engineers & programmers # intersection ! >>> fulltime_management = management - engineers - programmers # difference >>> engineers.add('Marvin') >>> print engineers --- 753,760 ---- >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> managers = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | managers # union ! >>> engineering_management = engineers & managers # intersection ! >>> fulltime_management = managers - engineers - programmers # difference >>> engineers.add('Marvin') >>> print engineers *************** *** 644,651 **** >>> employees.issuperset(engineers) # superset test False ! >>> employees.update(engineers) # update from another set >>> employees.issuperset(engineers) True ! >>> for group in [engineers, programmers, management, employees]: ... group.discard('Susan') # unconditionally remove element ... print group --- 762,769 ---- >>> employees.issuperset(engineers) # superset test False ! >>> employees.union_update(engineers) # update from another set >>> employees.issuperset(engineers) True ! >>> for group in [engineers, programmers, managers, employees]: ... group.discard('Susan') # unconditionally remove element ... print group *************** *** 681,689 **** TestOnlySetsDict, TestOnlySetsOperator, TestCopyingEmpty, TestCopyingSingleton, TestCopyingTriple, TestCopyingTuple, ! TestCopyingNested ) test_support.run_doctest(test_sets, verbose) --- 799,811 ---- TestOnlySetsDict, TestOnlySetsOperator, + TestOnlySetsTuple, + TestOnlySetsString, + TestOnlySetsGenerator, TestCopyingEmpty, TestCopyingSingleton, TestCopyingTriple, TestCopyingTuple, ! TestCopyingNested, ! TestIdentities, ) test_support.run_doctest(test_sets, verbose) From rhettinger at users.sourceforge.net Sun Aug 17 16:09:00 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 18:09:11 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libsets.tex, 1.11, 1.11.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27709/Doc/lib Modified Files: Tag: release23-maint libsets.tex Log Message: Backport improvements to set.py so that the interface will remain consistent across versions. * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Added a PendingDeprecationWarning for Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Index: libsets.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsets.tex,v retrieving revision 1.11 retrieving revision 1.11.16.1 diff -C2 -d -r1.11 -r1.11.16.1 *** libsets.tex 14 Feb 2003 03:42:11 -0000 1.11 --- libsets.tex 17 Aug 2003 22:08:58 -0000 1.11.16.1 *************** *** 66,104 **** the following operations: ! \begin{tableii}{c|l}{code}{Operation}{Result} ! \lineii{len(\var{s})}{cardinality of set \var{s}} \hline ! \lineii{\var{x} in \var{s}} {test \var{x} for membership in \var{s}} ! \lineii{\var{x} not in \var{s}} {test \var{x} for non-membership in \var{s}} ! \lineii{\var{s}.issubset(\var{t})} ! {test whether every element in \var{s} is in \var{t}; ! \code{\var{s} <= \var{t}} is equivalent} ! \lineii{\var{s}.issuperset(\var{t})} ! {test whether every element in \var{t} is in \var{s}; ! \code{\var{s} >= \var{t}} is equivalent} \hline ! \lineii{\var{s} | \var{t}} ! {new set with elements from both \var{s} and \var{t}} ! \lineii{\var{s}.union(\var{t})} {new set with elements from both \var{s} and \var{t}} ! \lineii{\var{s} \&\ \var{t}} ! {new set with elements common to \var{s} and \var{t}} ! \lineii{\var{s}.intersection(\var{t})} {new set with elements common to \var{s} and \var{t}} ! \lineii{\var{s} - \var{t}} ! {new set with elements in \var{s} but not in \var{t}} ! \lineii{\var{s}.difference(\var{t})} {new set with elements in \var{s} but not in \var{t}} ! \lineii{\var{s} \^\ \var{t}} ! {new set with elements in either \var{s} or \var{t} but not both} ! \lineii{\var{s}.symmetric_difference(\var{t})} {new set with elements in either \var{s} or \var{t} but not both} ! \lineii{\var{s}.copy()} {new set with a shallow copy of \var{s}} ! \end{tableii} In addition, both \class{Set} and \class{ImmutableSet} --- 66,103 ---- the following operations: ! \begin{tableiii}{c|c|l}{code}{Operation}{Equivalent}{Result} ! \lineiii{len(\var{s})}{}{cardinality of set \var{s}} \hline ! \lineiii{\var{x} in \var{s}}{} {test \var{x} for membership in \var{s}} ! \lineiii{\var{x} not in \var{s}}{} {test \var{x} for non-membership in \var{s}} ! \lineiii{\var{s}.issubset(\var{t})}{\code{\var{s} <= \var{t}}} ! {test whether every element in \var{s} is in \var{t}} ! \lineiii{\var{s}.issuperset(\var{t})}{\code{\var{s} >= \var{t}}} ! {test whether every element in \var{t} is in \var{s}} \hline ! \lineiii{\var{s}.union(\var{t})}{\var{s} | \var{t}} {new set with elements from both \var{s} and \var{t}} ! \lineiii{\var{s}.intersection(\var{t})}{\var{s} \&\ \var{t}} {new set with elements common to \var{s} and \var{t}} ! \lineiii{\var{s}.difference(\var{t})}{\var{s} - \var{t}} {new set with elements in \var{s} but not in \var{t}} ! \lineiii{\var{s}.symmetric_difference(\var{t})}{\var{s} \^\ \var{t}} {new set with elements in either \var{s} or \var{t} but not both} ! \lineiii{\var{s}.copy()}{} {new set with a shallow copy of \var{s}} ! \end{tableiii} ! ! Note, this non-operator versions of \method{union()}, ! \method{intersection()}, \method{difference()}, and ! \method{symmetric_difference()} will accept any iterable as an argument. ! In contrast, their operator based counterparts require their arguments to ! be sets. This precludes error-prone constructions like ! \code{Set('abc') \&\ 'cbs'} in favor of the more readable ! \code{Set('abc').intersection('cbs')}. ! \versionchanged[Formerly all arguments were required to be sets]{2.3.1} In addition, both \class{Set} and \class{ImmutableSet} *************** *** 113,118 **** The subset and equality comparisons do not generalize to a complete ordering function. For example, any two disjoint sets are not equal and ! are not subsets of each other, so \emph{none} of the following are true: ! \code{\var{a}<\var{b}}, \code{\var{a}==\var{b}}, or \code{\var{a}>\var{b}}. Accordingly, sets do not implement the \method{__cmp__} method. --- 112,118 ---- The subset and equality comparisons do not generalize to a complete ordering function. For example, any two disjoint sets are not equal and ! are not subsets of each other, so \emph{all} of the following return ! \code{False}: \code{\var{a}<\var{b}}, \code{\var{a}==\var{b}}, or ! \code{\var{a}>\var{b}}. Accordingly, sets do not implement the \method{__cmp__} method. *************** *** 123,127 **** but not found in \class{Set}: ! \begin{tableii}{c|l|c}{code}{Operation}{Result} \lineii{hash(\var{s})}{returns a hash value for \var{s}} \end{tableii} --- 123,127 ---- but not found in \class{Set}: ! \begin{tableii}{c|l}{code}{Operation}{Result} \lineii{hash(\var{s})}{returns a hash value for \var{s}} \end{tableii} *************** *** 130,167 **** but not found in \class{ImmutableSet}: ! \begin{tableii}{c|l}{code}{Operation}{Result} ! \lineii{\var{s} |= \var{t}} ! {return set \var{s} with elements added from \var{t}} ! \lineii{\var{s}.union_update(\var{t})} {return set \var{s} with elements added from \var{t}} ! \lineii{\var{s} \&= \var{t}} ! {return set \var{s} keeping only elements also found in \var{t}} ! \lineii{\var{s}.intersection_update(\var{t})} {return set \var{s} keeping only elements also found in \var{t}} ! \lineii{\var{s} -= \var{t}} ! {return set \var{s} after removing elements found in \var{t}} ! \lineii{\var{s}.difference_update(\var{t})} {return set \var{s} after removing elements found in \var{t}} ! \lineii{\var{s} \textasciicircum= \var{t}} ! {return set \var{s} with elements from \var{s} or \var{t} ! but not both} ! \lineii{\var{s}.symmetric_difference_update(\var{t})} {return set \var{s} with elements from \var{s} or \var{t} but not both} \hline ! \lineii{\var{s}.add(\var{x})} {add element \var{x} to set \var{s}} ! \lineii{\var{s}.remove(\var{x})} ! {remove \var{x} from set \var{s}} ! \lineii{\var{s}.discard(\var{x})} {removes \var{x} from set \var{s} if present} ! \lineii{\var{s}.pop()} ! {remove and return an arbitrary element from \var{s}} ! \lineii{\var{s}.update(\var{t})} ! {add elements from \var{t} to set \var{s}} ! \lineii{\var{s}.clear()} {remove all elements from set \var{s}} ! \end{tableii} --- 130,170 ---- but not found in \class{ImmutableSet}: ! \begin{tableiii}{c|c|l}{code}{Operation}{Equivalent}{Result} ! \lineiii{\var{s}.union_update(\var{t})} ! {\var{s} |= \var{t}} {return set \var{s} with elements added from \var{t}} ! \lineiii{\var{s}.intersection_update(\var{t})} ! {\var{s} \&= \var{t}} {return set \var{s} keeping only elements also found in \var{t}} ! \lineiii{\var{s}.difference_update(\var{t})} ! {\var{s} -= \var{t}} {return set \var{s} after removing elements found in \var{t}} ! \lineiii{\var{s}.symmetric_difference_update(\var{t})} ! {\var{s} \textasciicircum= \var{t}} {return set \var{s} with elements from \var{s} or \var{t} but not both} \hline ! \lineiii{\var{s}.add(\var{x})}{} {add element \var{x} to set \var{s}} ! \lineiii{\var{s}.remove(\var{x})}{} ! {remove \var{x} from set \var{s}; raises KeyError if not present} ! \lineiii{\var{s}.discard(\var{x})}{} {removes \var{x} from set \var{s} if present} ! \lineiii{\var{s}.pop()}{} ! {remove and return an arbitrary element from \var{s}; raises ! KeyError if empty} ! \lineiii{\var{s}.clear()}{} {remove all elements from set \var{s}} ! \end{tableiii} ! ! \versionchanged[Earlier versions had an \method{update()} method; use ! \method{union_update()} instead]{2.3.1} ! ! Note, this non-operator versions of \method{union_update()}, ! \method{intersection_update()}, \method{difference_update()}, and ! \method{symmetric_difference_update()} will accept any iterable as ! an argument. ! \versionchanged[Formerly all arguments were required to be sets]{2.3.1} *************** *** 172,185 **** >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> management = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | management # union ! >>> engineering_management = engineers & programmers # intersection ! >>> fulltime_management = management - engineers - programmers # difference ! >>> engineers.add('Marvin') # add element >>> print engineers Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack']) >>> employees.issuperset(engineers) # superset test False ! >>> employees.update(engineers) # update from another set >>> employees.issuperset(engineers) True --- 175,188 ---- >>> engineers = Set(['John', 'Jane', 'Jack', 'Janice']) >>> programmers = Set(['Jack', 'Sam', 'Susan', 'Janice']) ! >>> managers = Set(['Jane', 'Jack', 'Susan', 'Zack']) ! >>> employees = engineers | programmers | managers # union ! >>> engineering_management = engineers & managers # intersection ! >>> fulltime_management = managers - engineers - programmers # difference ! >>> engineers.add('Marvin') # add element >>> print engineers Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack']) >>> employees.issuperset(engineers) # superset test False ! >>> employees.union_update(engineers) # update from another set >>> employees.issuperset(engineers) True From rhettinger at users.sourceforge.net Sun Aug 17 16:09:00 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 18:09:17 2003 Subject: [Python-checkins] python/dist/src/Lib sets.py,1.44.8.1,1.44.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv27709/Lib Modified Files: Tag: release23-maint sets.py Log Message: Backport improvements to set.py so that the interface will remain consistent across versions. * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Added a PendingDeprecationWarning for Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Index: sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v retrieving revision 1.44.8.1 retrieving revision 1.44.8.2 diff -C2 -d -r1.44.8.1 -r1.44.8.2 *** sets.py 15 Aug 2003 21:14:51 -0000 1.44.8.1 --- sets.py 17 Aug 2003 22:08:58 -0000 1.44.8.2 *************** *** 197,204 **** if not isinstance(other, BaseSet): return NotImplemented ! result = self.__class__() ! result._data = self._data.copy() ! result._data.update(other._data) ! return result def union(self, other): --- 197,201 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.union(other) def union(self, other): *************** *** 207,211 **** (I.e. all elements that are in either set.) """ ! return self | other def __and__(self, other): --- 204,210 ---- (I.e. all elements that are in either set.) """ ! result = self.__class__(self) ! result._update(other) ! return result def __and__(self, other): *************** *** 216,225 **** if not isinstance(other, BaseSet): return NotImplemented ! if len(self) <= len(other): ! little, big = self, other ! else: ! little, big = other, self ! common = ifilter(big._data.has_key, little) ! return self.__class__(common) def intersection(self, other): --- 215,219 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.intersection(other) def intersection(self, other): *************** *** 228,232 **** (I.e. all elements that are in both sets.) """ ! return self & other def __xor__(self, other): --- 222,233 ---- (I.e. all elements that are in both sets.) """ ! if not isinstance(other, BaseSet): ! other = Set(other) ! if len(self) <= len(other): ! little, big = self, other ! else: ! little, big = other, self ! common = ifilter(big._data.has_key, little) ! return self.__class__(common) def __xor__(self, other): *************** *** 237,245 **** if not isinstance(other, BaseSet): return NotImplemented result = self.__class__() data = result._data value = True selfdata = self._data ! otherdata = other._data for elt in ifilterfalse(otherdata.has_key, selfdata): data[elt] = value --- 238,256 ---- if not isinstance(other, BaseSet): return NotImplemented + return self.symmetric_difference(other) + + def symmetric_difference(self, other): + """Return the symmetric difference of two sets as a new set. + + (I.e. all elements that are in exactly one of the sets.) + """ result = self.__class__() data = result._data value = True selfdata = self._data ! try: ! otherdata = other._data ! except AttributeError: ! otherdata = Set(other)._data for elt in ifilterfalse(otherdata.has_key, selfdata): data[elt] = value *************** *** 248,258 **** return result - def symmetric_difference(self, other): - """Return the symmetric difference of two sets as a new set. - - (I.e. all elements that are in exactly one of the sets.) - """ - return self ^ other - def __sub__(self, other): """Return the difference of two sets as a new Set. --- 259,262 ---- *************** *** 262,271 **** if not isinstance(other, BaseSet): return NotImplemented ! result = self.__class__() ! data = result._data ! value = True ! for elt in ifilterfalse(other._data.has_key, self): ! data[elt] = value ! return result def difference(self, other): --- 266,270 ---- if not isinstance(other, BaseSet): return NotImplemented ! return self.difference(other) def difference(self, other): *************** *** 274,278 **** (I.e. all elements that are in this set and not in the other.) """ ! return self - other # Membership test --- 273,286 ---- (I.e. all elements that are in this set and not in the other.) """ ! result = self.__class__() ! data = result._data ! try: ! otherdata = other._data ! except AttributeError: ! otherdata = Set(other)._data ! value = True ! for elt in ifilterfalse(otherdata.has_key, self): ! data[elt] = value ! return result # Membership test *************** *** 442,446 **** def union_update(self, other): """Update a set with the union of itself and another.""" ! self |= other def __iand__(self, other): --- 450,454 ---- def union_update(self, other): """Update a set with the union of itself and another.""" ! self._update(other) def __iand__(self, other): *************** *** 452,462 **** def intersection_update(self, other): """Update a set with the intersection of itself and another.""" ! self &= other def __ixor__(self, other): """Update a set with the symmetric difference of itself and another.""" self._binary_sanity_check(other) data = self._data value = True for elt in other: if elt in data: --- 460,480 ---- def intersection_update(self, other): """Update a set with the intersection of itself and another.""" ! if isinstance(other, BaseSet): ! self &= other ! else: ! self._data = (self.intersection(other))._data def __ixor__(self, other): """Update a set with the symmetric difference of itself and another.""" self._binary_sanity_check(other) + self.symmetric_difference_update(other) + return self + + def symmetric_difference_update(self, other): + """Update a set with the symmetric difference of itself and another.""" data = self._data value = True + if not isinstance(other, BaseSet): + other = Set(other) for elt in other: if elt in data: *************** *** 464,484 **** else: data[elt] = value - return self - - def symmetric_difference_update(self, other): - """Update a set with the symmetric difference of itself and another.""" - self ^= other def __isub__(self, other): """Remove all elements of another set from this set.""" self._binary_sanity_check(other) ! data = self._data ! for elt in ifilter(data.has_key, other): ! del data[elt] return self def difference_update(self, other): """Remove all elements of another set from this set.""" ! self -= other # Python dict-like mass mutations: update, clear --- 482,499 ---- else: data[elt] = value def __isub__(self, other): """Remove all elements of another set from this set.""" self._binary_sanity_check(other) ! self.difference_update(other) return self def difference_update(self, other): """Remove all elements of another set from this set.""" ! data = self._data ! if not isinstance(other, BaseSet): ! other = Set(other) ! for elt in ifilter(data.has_key, other): ! del data[elt] # Python dict-like mass mutations: update, clear *************** *** 486,489 **** --- 501,508 ---- def update(self, iterable): """Add all values from an iterable (such as a list or file).""" + import warnings + warnings.warn("The update() method is going to be deprecated; " + "Use union_update() instead", + PendingDeprecationWarning) self._update(iterable) From rhettinger at users.sourceforge.net Sun Aug 17 16:09:01 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 17 18:09:23 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.15,1.831.4.16 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv27709/Misc Modified Files: Tag: release23-maint NEWS Log Message: Backport improvements to set.py so that the interface will remain consistent across versions. * Relaxed the argument restrictions for non-operator methods. They now allow any iterable instead of requiring a set. This makes the module a little easier to use and paves the way for an efficient C implementation which can take better advantage of iterable arguments while screening out immutables. * Added a PendingDeprecationWarning for Set.update() because it now duplicates Set.union_update() * Adapted the tests and docs to include the above changes. * Added more test coverage including testing identities and checking to make sure non-restartable generators work as arguments. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.15 retrieving revision 1.831.4.16 diff -C2 -d -r1.831.4.15 -r1.831.4.16 *** NEWS 15 Aug 2003 21:14:50 -0000 1.831.4.15 --- NEWS 17 Aug 2003 22:08:58 -0000 1.831.4.16 *************** *** 28,32 **** ------- ! - sets.py can now run under Py2.2 - Bug #778964: random.seed() now uses fractional seconds so that --- 28,35 ---- ------- ! - sets.py now runs under Py2.2. In addition, the argument restrictions ! for most set methods (but not the operators) have been relaxed to ! allow any iterable. Also the Set.update() has been deprecated because ! it duplicates Set.union_update(). - Bug #778964: random.seed() now uses fractional seconds so that From theller at users.sourceforge.net Mon Aug 18 11:53:35 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Mon Aug 18 13:53:39 2003 Subject: [Python-checkins] python/dist/src/PC getpathp.c,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv11050 Modified Files: getpathp.c Log Message: Remove a stray single quote. Will backport to release23-maint. Index: getpathp.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/getpathp.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** getpathp.c 29 Jan 2003 22:38:29 -0000 1.31 --- getpathp.c 18 Aug 2003 17:53:33 -0000 1.32 *************** *** 367,371 **** NULL, NULL); } ! wprogpath[MAXPATHLEN]=_T('\0')'; if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, --- 367,371 ---- NULL, NULL); } ! wprogpath[MAXPATHLEN]=_T('\0'); if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, From theller at users.sourceforge.net Mon Aug 18 11:54:12 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Mon Aug 18 13:54:15 2003 Subject: [Python-checkins] python/dist/src/PC getpathp.c,1.31,1.31.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv11191 Modified Files: Tag: release23-maint getpathp.c Log Message: Remove a stray single quote. Index: getpathp.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/getpathp.c,v retrieving revision 1.31 retrieving revision 1.31.12.1 diff -C2 -d -r1.31 -r1.31.12.1 *** getpathp.c 29 Jan 2003 22:38:29 -0000 1.31 --- getpathp.c 18 Aug 2003 17:54:10 -0000 1.31.12.1 *************** *** 367,371 **** NULL, NULL); } ! wprogpath[MAXPATHLEN]=_T('\0')'; if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, --- 367,371 ---- NULL, NULL); } ! wprogpath[MAXPATHLEN]=_T('\0'); if (GetModuleFileName(NULL, wprogpath, MAXPATHLEN)) { WideCharToMultiByte(CP_ACP, 0, From doerwalter at users.sourceforge.net Mon Aug 18 12:28:47 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Aug 18 14:28:52 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.294,2.295 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv16936/Python Modified Files: bltinmodule.c Log Message: Fix a crash: when sq_item failed the code continued blindly and used the NULL pointer. (Detected by Michael Hudson, patch provided by Neal Norwitz). Fix refcounting leak in filtertuple(). Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.294 retrieving revision 2.295 diff -C2 -d -r2.294 -r2.295 *** bltinmodule.c 14 Aug 2003 20:37:34 -0000 2.294 --- bltinmodule.c 18 Aug 2003 18:28:45 -0000 2.295 *************** *** 2175,2178 **** --- 2175,2180 ---- tuple->ob_type->tp_as_sequence->sq_item) { item = tuple->ob_type->tp_as_sequence->sq_item(tuple, i); + if (item == NULL) + goto Fail_1; } else { PyErr_SetString(PyExc_TypeError, "filter(): unsubscriptable tuple"); *************** *** 2185,2202 **** else { PyObject *arg = Py_BuildValue("(O)", item); ! if (arg == NULL) goto Fail_1; good = PyEval_CallObject(func, arg); Py_DECREF(arg); ! if (good == NULL) goto Fail_1; } ok = PyObject_IsTrue(good); Py_DECREF(good); if (ok) { - Py_INCREF(item); if (PyTuple_SetItem(result, j++, item) < 0) goto Fail_1; } } --- 2187,2209 ---- else { PyObject *arg = Py_BuildValue("(O)", item); ! if (arg == NULL) { ! Py_DECREF(item); goto Fail_1; + } good = PyEval_CallObject(func, arg); Py_DECREF(arg); ! if (good == NULL) { ! Py_DECREF(item); goto Fail_1; + } } ok = PyObject_IsTrue(good); Py_DECREF(good); if (ok) { if (PyTuple_SetItem(result, j++, item) < 0) goto Fail_1; } + else + Py_DECREF(item); } From doerwalter at users.sourceforge.net Mon Aug 18 12:34:13 2003 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Mon Aug 18 14:34:21 2003 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c, 2.292, 2.292.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv17833/Python Modified Files: Tag: release23-maint bltinmodule.c Log Message: Backport checkin: Fix a crash: when sq_item failed the code continued blindly and used the NULL pointer. (Detected by Michael Hudson, patch provided by Neal Norwitz). Fix refcounting leak in filtertuple(). Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.292 retrieving revision 2.292.10.1 diff -C2 -d -r2.292 -r2.292.10.1 *** bltinmodule.c 23 Apr 2003 13:34:35 -0000 2.292 --- bltinmodule.c 18 Aug 2003 18:34:09 -0000 2.292.10.1 *************** *** 2177,2180 **** --- 2177,2182 ---- tuple->ob_type->tp_as_sequence->sq_item) { item = tuple->ob_type->tp_as_sequence->sq_item(tuple, i); + if (item == NULL) + goto Fail_1; } else { PyErr_SetString(PyExc_TypeError, "filter(): unsubscriptable tuple"); *************** *** 2187,2204 **** else { PyObject *arg = Py_BuildValue("(O)", item); ! if (arg == NULL) goto Fail_1; good = PyEval_CallObject(func, arg); Py_DECREF(arg); ! if (good == NULL) goto Fail_1; } ok = PyObject_IsTrue(good); Py_DECREF(good); if (ok) { - Py_INCREF(item); if (PyTuple_SetItem(result, j++, item) < 0) goto Fail_1; } } --- 2189,2211 ---- else { PyObject *arg = Py_BuildValue("(O)", item); ! if (arg == NULL) { ! Py_DECREF(item); goto Fail_1; + } good = PyEval_CallObject(func, arg); Py_DECREF(arg); ! if (good == NULL) { ! Py_DECREF(item); goto Fail_1; + } } ok = PyObject_IsTrue(good); Py_DECREF(good); if (ok) { if (PyTuple_SetItem(result, j++, item) < 0) goto Fail_1; } + else + Py_DECREF(item); } From tim_one at users.sourceforge.net Mon Aug 18 17:52:11 2003 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon Aug 18 19:52:21 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts md5sum.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv14504/Tools/scripts Modified Files: md5sum.py Log Message: This started opening files in text mode by default in the 2.3 release, which is a disaster on Windows. Restored the binary default of all previous releases. Also minor code cleanups. Bugfix candidate! Index: md5sum.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/md5sum.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** md5sum.py 13 May 2003 17:39:26 -0000 1.3 --- md5sum.py 18 Aug 2003 23:52:09 -0000 1.4 *************** *** 7,16 **** bufsize = 8096 fnfilter = None ! rmode = 'r' usage = """ usage: sum5 [-b] [-t] [-l] [-s bufsize] [file ...] ! -b : read files in binary mode ! -t : read files in text mode (default) -l : print last pathname component only -s bufsize: read buffer size (default %d) --- 7,16 ---- bufsize = 8096 fnfilter = None ! rmode = 'rb' usage = """ usage: sum5 [-b] [-t] [-l] [-s bufsize] [file ...] ! -b : read files in binary mode (default) ! -t : read files in text mode (you almost certainly don't want this!) -l : print last pathname component only -s bufsize: read buffer size (default %d) *************** *** 41,45 **** return sts ! def printsum(filename, out = sys.stdout): try: fp = open(filename, rmode) --- 41,45 ---- return sts ! def printsum(filename, out=sys.stdout): try: fp = open(filename, rmode) *************** *** 53,62 **** return sts ! def printsumfp(fp, filename, out = sys.stdout): m = md5.new() try: while 1: data = fp.read(bufsize) ! if not data: break m.update(data) except IOError, msg: --- 53,63 ---- return sts ! def printsumfp(fp, filename, out=sys.stdout): m = md5.new() try: while 1: data = fp.read(bufsize) ! if not data: ! break m.update(data) except IOError, msg: *************** *** 66,70 **** return 0 ! def main(args = sys.argv[1:], out = sys.stdout): global fnfilter, rmode, bufsize try: --- 67,71 ---- return 0 ! def main(args = sys.argv[1:], out=sys.stdout): global fnfilter, rmode, bufsize try: *************** *** 76,84 **** if o == '-l': fnfilter = os.path.basename ! if o == '-b': rmode = 'rb' ! if o == '-t': rmode = 'r' ! if o == '-s': bufsize = int(a) if not args: --- 77,85 ---- if o == '-l': fnfilter = os.path.basename ! elif o == '-b': rmode = 'rb' ! elif o == '-t': rmode = 'r' ! elif o == '-s': bufsize = int(a) if not args: From tim_one at users.sourceforge.net Mon Aug 18 17:52:11 2003 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon Aug 18 19:52:31 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.844,1.845 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv14504/Misc Modified Files: NEWS Log Message: This started opening files in text mode by default in the 2.3 release, which is a disaster on Windows. Restored the binary default of all previous releases. Also minor code cleanups. Bugfix candidate! Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.844 retrieving revision 1.845 diff -C2 -d -r1.844 -r1.845 *** NEWS 17 Aug 2003 08:34:09 -0000 1.844 --- NEWS 18 Aug 2003 23:52:08 -0000 1.845 *************** *** 53,56 **** --- 53,62 ---- ----------- + - md5sum.py mistakenly opened input files in text mode by default, a + silent and dangerous change from previous releases. It once again + opens input files in binary mode by default. The -t and -b flags + remain for compatibility with the 2.3 release, but -b is the default + now. + - py-electric-colon now works when pending-delete/delete-selection mode is in effect From bwarsaw at users.sourceforge.net Mon Aug 18 21:49:37 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 18 23:49:40 2003 Subject: [Python-checkins] python/dist/src/Lib/email Utils.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv12887 Modified Files: Utils.py Log Message: decode_rfc2231(): We need to urllib.unquote() the value even if the charset and language fields are not present, e.g. as in: title*0="This%20is%20encoded" Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Utils.py 10 Mar 2003 19:20:18 -0000 1.24 --- Utils.py 19 Aug 2003 03:49:34 -0000 1.25 *************** *** 281,285 **** parts = s.split("'", 2) if len(parts) == 1: ! return None, None, s charset, language, s = parts return charset, language, urllib.unquote(s) --- 281,285 ---- parts = s.split("'", 2) if len(parts) == 1: ! return None, None, urllib.unquote(s) charset, language, s = parts return charset, language, urllib.unquote(s) From bwarsaw at users.sourceforge.net Mon Aug 18 21:53:05 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 18 23:53:08 2003 Subject: [Python-checkins] python/dist/src/Lib/email Message.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv13213 Modified Files: Message.py Log Message: get_param(): Update the docstring to explain how CHARSET and LANGUAGE can be None, and what to do in that situation. get_filename(), get_boundary(), get_content_charset(): Make sure these handle RFC 2231 headers without a CHARSET field. Backport candidate (as was the Utils.py 1.25 change) to both Python 2.3.1 and 2.2.4 -- will do momentarily. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Message.py 10 Jun 2003 16:31:55 -0000 1.32 --- Message.py 19 Aug 2003 03:53:02 -0000 1.33 *************** *** 572,582 **** value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty ! string. Your application should be prepared to deal with these, and ! can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) In any case, the parameter value (either the returned string, or the --- 572,585 ---- value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and ! LANGUAGE can be None, in which case you should consider VALUE to be ! encoded in the us-ascii charset. You can usually ignore LANGUAGE. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') In any case, the parameter value (either the returned string, or the *************** *** 709,713 **** # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0]) else: newvalue = _unquotevalue(filename.strip()) --- 712,716 ---- # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0] or 'us-ascii') else: newvalue = _unquotevalue(filename.strip()) *************** *** 726,730 **** if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! return unicode(boundary[2], boundary[0]).encode('us-ascii') return _unquotevalue(boundary.strip()) --- 729,734 ---- if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! charset = boundary[0] or 'us-ascii' ! return unicode(boundary[2], charset).encode('us-ascii') return _unquotevalue(boundary.strip()) *************** *** 793,797 **** if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! charset = unicode(charset[2], charset[0]).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() --- 797,802 ---- if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! pcharset = charset[0] or 'us-ascii' ! charset = unicode(charset[2], pcharset).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() From bwarsaw at users.sourceforge.net Mon Aug 18 21:54:27 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 18 23:54:30 2003 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py, 1.50, 1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory sc8-pr-cvs1:/tmp/cvs-serv13350 Modified Files: test_email.py Log Message: test_rfc2231_no_language_or_charset_in_filename(), test_rfc2231_no_language_or_charset_in_boundary(), test_rfc2231_no_language_or_charset_in_charset(): New tests for proper decoding of some RFC 2231 headers. Backport candidate (as was the Utils.py 1.25 change) to both Python 2.3.1 and 2.2.4 -- will do momentarily. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** test_email.py 8 May 2003 03:34:01 -0000 1.50 --- test_email.py 19 Aug 2003 03:54:24 -0000 1.51 *************** *** 2660,2663 **** --- 2660,2700 ---- (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm')) + def test_rfc2231_no_language_or_charset_in_filename(self): + m = '''\ + Content-Disposition: inline; + \tfilename*0="This%20is%20even%20more%20"; + \tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tfilename*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_boundary(self): + m = '''\ + Content-Type: multipart/alternative; + \tboundary*0="This%20is%20even%20more%20"; + \tboundary*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tboundary*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_boundary(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_charset(self): + # This is a nonsensical charset value, but tests the code anyway + m = '''\ + Content-Type: text/plain; + \tcharset*0="This%20is%20even%20more%20"; + \tcharset*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tcharset*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_content_charset(), + 'this is even more ***fun*** is it not.pdf') + From bwarsaw at users.sourceforge.net Mon Aug 18 21:59:11 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Mon Aug 18 23:59:16 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.845,1.846 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv13752 Modified Files: NEWS Log Message: Describe the fix to the email package. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.845 retrieving revision 1.846 diff -C2 -d -r1.845 -r1.846 *** NEWS 18 Aug 2003 23:52:08 -0000 1.845 --- NEWS 19 Aug 2003 03:59:09 -0000 1.846 *************** *** 31,34 **** --- 31,37 ---- ------- + - The email package handles some RFC 2231 parameters with missing + CHARSET fields better. + - sets.py now runs under Py2.2. In addition, the argument restrictions for most set methods (but not the operators) have been relaxed to From bwarsaw at users.sourceforge.net Mon Aug 18 22:05:27 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:05:30 2003 Subject: [Python-checkins] python/dist/src/Lib/email __init__.py,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv14801 Modified Files: __init__.py Log Message: Bump the version number for the standalone mimelib package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** __init__.py 29 May 2003 19:39:33 -0000 1.29 --- __init__.py 19 Aug 2003 04:05:25 -0000 1.30 *************** *** 5,9 **** """ ! __version__ = '2.5.3' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.5.4' __all__ = [ From bwarsaw at users.sourceforge.net Mon Aug 18 22:27:01 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:27:04 2003 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv17332 Modified Files: emailmessage.tex Log Message: Update get_param() description to reflect changes to the docstring. Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** emailmessage.tex 18 Apr 2003 23:03:53 -0000 1.11 --- emailmessage.tex 19 Aug 2003 04:26:59 -0000 1.12 *************** *** 355,367 **** value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may ! be the empty string. Your application should be prepared to deal with ! 3-tuple return values, which it can convert to a Unicode string like ! so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) \end{verbatim} --- 355,370 ---- value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}. Note that both \code{CHARSET} and ! \code{LANGUAGE} can be \code{None}, in which case you should consider ! \code{VALUE} to be encoded in the \code{us-ascii} charset. You can ! usually ignore \code{LANGUAGE}. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') \end{verbatim} From bwarsaw at users.sourceforge.net Mon Aug 18 22:50:34 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:50:38 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.16,1.831.4.17 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20100 Modified Files: Tag: release23-maint NEWS Log Message: Describe the fix to the email package. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.16 retrieving revision 1.831.4.17 diff -C2 -d -r1.831.4.16 -r1.831.4.17 *** NEWS 17 Aug 2003 22:08:58 -0000 1.831.4.16 --- NEWS 19 Aug 2003 04:50:31 -0000 1.831.4.17 *************** *** 28,31 **** --- 28,34 ---- ------- + - The email package handles some RFC 2231 parameters with missing + CHARSET fields better. + - sets.py now runs under Py2.2. In addition, the argument restrictions for most set methods (but not the operators) have been relaxed to From bwarsaw at users.sourceforge.net Mon Aug 18 22:51:27 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:51:29 2003 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex, 1.11, 1.11.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20184 Modified Files: Tag: release23-maint emailmessage.tex Log Message: Update get_param() description to reflect changes to the docstring. Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.11 retrieving revision 1.11.12.1 diff -C2 -d -r1.11 -r1.11.12.1 *** emailmessage.tex 18 Apr 2003 23:03:53 -0000 1.11 --- emailmessage.tex 19 Aug 2003 04:51:25 -0000 1.11.12.1 *************** *** 355,367 **** value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may ! be the empty string. Your application should be prepared to deal with ! 3-tuple return values, which it can convert to a Unicode string like ! so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) \end{verbatim} --- 355,370 ---- value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}. Note that both \code{CHARSET} and ! \code{LANGUAGE} can be \code{None}, in which case you should consider ! \code{VALUE} to be encoded in the \code{us-ascii} charset. You can ! usually ignore \code{LANGUAGE}. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') \end{verbatim} From bwarsaw at users.sourceforge.net Mon Aug 18 22:52:31 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:52:35 2003 Subject: [Python-checkins] python/dist/src/Lib/email Message.py, 1.32, 1.32.10.1 Utils.py, 1.24, 1.24.12.1 __init__.py, 1.29, 1.29.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv20308/Lib/email Modified Files: Tag: release23-maint Message.py Utils.py __init__.py Log Message: Backporting email 2.5.4 fixes from the trunk. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.32 retrieving revision 1.32.10.1 diff -C2 -d -r1.32 -r1.32.10.1 *** Message.py 10 Jun 2003 16:31:55 -0000 1.32 --- Message.py 19 Aug 2003 04:52:27 -0000 1.32.10.1 *************** *** 572,582 **** value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty ! string. Your application should be prepared to deal with these, and ! can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) In any case, the parameter value (either the returned string, or the --- 572,585 ---- value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and ! LANGUAGE can be None, in which case you should consider VALUE to be ! encoded in the us-ascii charset. You can usually ignore LANGUAGE. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') In any case, the parameter value (either the returned string, or the *************** *** 709,713 **** # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0]) else: newvalue = _unquotevalue(filename.strip()) --- 712,716 ---- # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0] or 'us-ascii') else: newvalue = _unquotevalue(filename.strip()) *************** *** 726,730 **** if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! return unicode(boundary[2], boundary[0]).encode('us-ascii') return _unquotevalue(boundary.strip()) --- 729,734 ---- if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! charset = boundary[0] or 'us-ascii' ! return unicode(boundary[2], charset).encode('us-ascii') return _unquotevalue(boundary.strip()) *************** *** 793,797 **** if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! charset = unicode(charset[2], charset[0]).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() --- 797,802 ---- if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! pcharset = charset[0] or 'us-ascii' ! charset = unicode(charset[2], pcharset).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.24 retrieving revision 1.24.12.1 diff -C2 -d -r1.24 -r1.24.12.1 *** Utils.py 10 Mar 2003 19:20:18 -0000 1.24 --- Utils.py 19 Aug 2003 04:52:29 -0000 1.24.12.1 *************** *** 281,285 **** parts = s.split("'", 2) if len(parts) == 1: ! return None, None, s charset, language, s = parts return charset, language, urllib.unquote(s) --- 281,285 ---- parts = s.split("'", 2) if len(parts) == 1: ! return None, None, urllib.unquote(s) charset, language, s = parts return charset, language, urllib.unquote(s) Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.29 retrieving revision 1.29.10.1 diff -C2 -d -r1.29 -r1.29.10.1 *** __init__.py 29 May 2003 19:39:33 -0000 1.29 --- __init__.py 19 Aug 2003 04:52:29 -0000 1.29.10.1 *************** *** 5,9 **** """ ! __version__ = '2.5.3' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.5.4' __all__ = [ From bwarsaw at users.sourceforge.net Mon Aug 18 22:52:32 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:52:42 2003 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py, 1.50, 1.50.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory sc8-pr-cvs1:/tmp/cvs-serv20308/Lib/email/test Modified Files: Tag: release23-maint test_email.py Log Message: Backporting email 2.5.4 fixes from the trunk. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.50 retrieving revision 1.50.10.1 diff -C2 -d -r1.50 -r1.50.10.1 *** test_email.py 8 May 2003 03:34:01 -0000 1.50 --- test_email.py 19 Aug 2003 04:52:29 -0000 1.50.10.1 *************** *** 2660,2663 **** --- 2660,2700 ---- (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm')) + def test_rfc2231_no_language_or_charset_in_filename(self): + m = '''\ + Content-Disposition: inline; + \tfilename*0="This%20is%20even%20more%20"; + \tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tfilename*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_boundary(self): + m = '''\ + Content-Type: multipart/alternative; + \tboundary*0="This%20is%20even%20more%20"; + \tboundary*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tboundary*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_boundary(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_charset(self): + # This is a nonsensical charset value, but tests the code anyway + m = '''\ + Content-Type: text/plain; + \tcharset*0="This%20is%20even%20more%20"; + \tcharset*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tcharset*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_content_charset(), + 'this is even more ***fun*** is it not.pdf') + From bwarsaw at users.sourceforge.net Mon Aug 18 22:55:08 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 00:55:11 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS, 1.337.2.4.2.91, 1.337.2.4.2.92 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv20594 Modified Files: Tag: release22-maint NEWS Log Message: Describe the fix to the email package. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.337.2.4.2.91 retrieving revision 1.337.2.4.2.92 diff -C2 -d -r1.337.2.4.2.91 -r1.337.2.4.2.92 *** NEWS 13 Jul 2003 13:55:55 -0000 1.337.2.4.2.91 --- NEWS 19 Aug 2003 04:55:06 -0000 1.337.2.4.2.92 *************** *** 1,3 **** --- 1,8 ---- What's New in Python 2.2.4? + Release date: XX-XXX-XXXX + =========================== + + - The email package handles some RFC 2231 parameters with missing + CHARSET fields better. - SF #746304: Builtin functions are now copy.[deep]copyable. From bwarsaw at users.sourceforge.net Mon Aug 18 22:56:49 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 02:09:17 2003 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email.py, 1.17.2.7, 1.17.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory sc8-pr-cvs1:/tmp/cvs-serv20788/Lib/email/test Modified Files: Tag: release22-maint test_email.py Log Message: Backporting email 2.5.4 fixes from the trunk. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email.py,v retrieving revision 1.17.2.7 retrieving revision 1.17.2.8 diff -C2 -d -r1.17.2.7 -r1.17.2.8 *** test_email.py 8 May 2003 04:00:05 -0000 1.17.2.7 --- test_email.py 19 Aug 2003 04:56:47 -0000 1.17.2.8 *************** *** 2651,2654 **** --- 2651,2691 ---- (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm')) + def test_rfc2231_no_language_or_charset_in_filename(self): + m = '''\ + Content-Disposition: inline; + \tfilename*0="This%20is%20even%20more%20"; + \tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tfilename*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_boundary(self): + m = '''\ + Content-Type: multipart/alternative; + \tboundary*0="This%20is%20even%20more%20"; + \tboundary*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tboundary*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_boundary(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_charset(self): + # This is a nonsensical charset value, but tests the code anyway + m = '''\ + Content-Type: text/plain; + \tcharset*0="This%20is%20even%20more%20"; + \tcharset*1="%2A%2A%2Afun%2A%2A%2A%20"; + \tcharset*2="is it not.pdf" + + ''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_content_charset(), + 'this is even more ***fun*** is it not.pdf') + From bwarsaw at users.sourceforge.net Mon Aug 18 22:56:49 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 02:09:24 2003 Subject: [Python-checkins] python/dist/src/Lib/email Message.py, 1.9.6.4, 1.9.6.5 Utils.py, 1.9.6.2, 1.9.6.3 __init__.py, 1.4.10.8, 1.4.10.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory sc8-pr-cvs1:/tmp/cvs-serv20788/Lib/email Modified Files: Tag: release22-maint Message.py Utils.py __init__.py Log Message: Backporting email 2.5.4 fixes from the trunk. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.9.6.4 retrieving revision 1.9.6.5 diff -C2 -d -r1.9.6.4 -r1.9.6.5 *** Message.py 8 May 2003 04:00:04 -0000 1.9.6.4 --- Message.py 19 Aug 2003 04:56:46 -0000 1.9.6.5 *************** *** 572,582 **** value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE), where LANGUAGE may be the empty ! string. Your application should be prepared to deal with these, and ! can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) In any case, the parameter value (either the returned string, or the --- 572,585 ---- value can either be a string, or a 3-tuple if the parameter was RFC 2231 encoded. When it's a 3-tuple, the elements of the value are of ! the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and ! LANGUAGE can be None, in which case you should consider VALUE to be ! encoded in the us-ascii charset. You can usually ignore LANGUAGE. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') In any case, the parameter value (either the returned string, or the *************** *** 709,713 **** # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0]) else: newvalue = _unquotevalue(filename.strip()) --- 712,716 ---- # It's an RFC 2231 encoded parameter newvalue = _unquotevalue(filename) ! return unicode(newvalue[2], newvalue[0] or 'us-ascii') else: newvalue = _unquotevalue(filename.strip()) *************** *** 726,730 **** if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! return unicode(boundary[2], boundary[0]).encode('us-ascii') return _unquotevalue(boundary.strip()) --- 729,734 ---- if isinstance(boundary, TupleType): # RFC 2231 encoded, so decode. It better end up as ascii ! charset = boundary[0] or 'us-ascii' ! return unicode(boundary[2], charset).encode('us-ascii') return _unquotevalue(boundary.strip()) *************** *** 793,797 **** if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! charset = unicode(charset[2], charset[0]).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() --- 797,802 ---- if isinstance(charset, TupleType): # RFC 2231 encoded, so decode it, and it better end up as ascii. ! pcharset = charset[0] or 'us-ascii' ! charset = unicode(charset[2], pcharset).encode('us-ascii') # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.9.6.2 retrieving revision 1.9.6.3 diff -C2 -d -r1.9.6.2 -r1.9.6.3 *** Utils.py 21 Mar 2003 21:09:31 -0000 1.9.6.2 --- Utils.py 19 Aug 2003 04:56:47 -0000 1.9.6.3 *************** *** 281,285 **** parts = s.split("'", 2) if len(parts) == 1: ! return None, None, s charset, language, s = parts return charset, language, urllib.unquote(s) --- 281,285 ---- parts = s.split("'", 2) if len(parts) == 1: ! return None, None, urllib.unquote(s) charset, language, s = parts return charset, language, urllib.unquote(s) Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/__init__.py,v retrieving revision 1.4.10.8 retrieving revision 1.4.10.9 diff -C2 -d -r1.4.10.8 -r1.4.10.9 *** __init__.py 29 May 2003 20:09:31 -0000 1.4.10.8 --- __init__.py 19 Aug 2003 04:56:47 -0000 1.4.10.9 *************** *** 5,9 **** """ ! __version__ = '2.5.3' __all__ = [ --- 5,9 ---- """ ! __version__ = '2.5.4' __all__ = [ From bwarsaw at users.sourceforge.net Mon Aug 18 22:56:49 2003 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Aug 19 02:09:30 2003 Subject: [Python-checkins] python/dist/src/Doc/lib emailmessage.tex, 1.4.8.3, 1.4.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20788/Doc/lib Modified Files: Tag: release22-maint emailmessage.tex Log Message: Backporting email 2.5.4 fixes from the trunk. Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.4.8.3 retrieving revision 1.4.8.4 diff -C2 -d -r1.4.8.3 -r1.4.8.4 *** emailmessage.tex 21 Mar 2003 21:24:27 -0000 1.4.8.3 --- emailmessage.tex 19 Aug 2003 04:56:46 -0000 1.4.8.4 *************** *** 341,353 **** value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}, where \code{LANGUAGE} may ! be the empty string. Your application should be prepared to deal with ! 3-tuple return values, which it can convert to a Unicode string like ! so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0]) \end{verbatim} --- 341,356 ---- value can either be a string, or a 3-tuple if the parameter was \rfc{2231} encoded. When it's a 3-tuple, the elements of the value are of ! the form \code{(CHARSET, LANGUAGE, VALUE)}. Note that both \code{CHARSET} and ! \code{LANGUAGE} can be \code{None}, in which case you should consider ! \code{VALUE} to be encoded in the \code{us-ascii} charset. You can ! usually ignore \code{LANGUAGE}. ! ! Your application should be prepared to deal with 3-tuple return ! values, and can convert the parameter to a Unicode string like so: \begin{verbatim} param = msg.get_param('foo') if isinstance(param, tuple): ! param = unicode(param[2], param[0] or 'us-ascii') \end{verbatim} From theller at users.sourceforge.net Wed Aug 20 12:27:39 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Aug 22 11:48:48 2003 Subject: [Python-checkins] python/dist/src/PCbuild bz2.dsp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv24200 Modified Files: bz2.dsp Log Message: Build the bzip2.lib as a custom pre-link step in MSVC. Index: bz2.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/bz2.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bz2.dsp 8 Jul 2003 20:53:38 -0000 1.2 --- bz2.dsp 20 Aug 2003 18:27:36 -0000 1.3 *************** *** 57,60 **** --- 57,64 ---- # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib + # Begin Special Build Tool + SOURCE="$(InputPath)" + PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc + # End Special Build Tool !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" *************** *** 85,88 **** --- 89,96 ---- # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none + # Begin Special Build Tool + SOURCE="$(InputPath)" + PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc + # End Special Build Tool !ENDIF From theller at users.sourceforge.net Wed Aug 20 12:22:51 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Aug 22 11:48:59 2003 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv23372 Modified Files: readme.txt Log Message: Build the bzip2.lib as a custom pre-link step in MSVC. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** readme.txt 27 Jun 2003 15:49:35 -0000 1.43 --- readme.txt 20 Aug 2003 18:22:48 -0000 1.44 *************** *** 149,165 **** Options -> Configuration -> Miscellaneous -> Other) for the duration. ! Don't bother trying to use libbz2.dsp with MSVC. After 10 minutes ! of fiddling, I couldn't get it to work. Perhaps it works with ! MSVC 5 (I used MSVC 6). It's better to run the by-hand makefile ! anyway, because it runs a helpful test step at the end. ! cd into dist\bzip2-1.0.2, and run ! nmake -f makefile.msc ! [Note that if you're running Win9X, you'll need to run vcvars32.bat ! before running nmake (this batch file is in your MSVC installation). ! TODO: make this work like zlib (in particular, MSVC runs the prelink ! step in an enviroment that already has the correct envars set up). ! ] ! The make step shouldn't yield any warnings or errors, and should end by displaying 6 blocks each terminated with FC: no differences encountered --- 149,160 ---- Options -> Configuration -> Miscellaneous -> Other) for the duration. ! A custom pre-link step in the bz2 project settings should manage to ! build bzip2-1.0.2\libbz2.lib by magic before bz2.pyd (or bz2_d.pyd) is ! linked in PCbuild\. ! However, the bz2 project is not smart enough to remove anything under ! bzip2-1.0.2\ when you do a clean, so if you want to rebuild bzip2.lib ! you need to clean up bzip2-1.0.2\ by hand. ! The build step shouldn't yield any warnings or errors, and should end by displaying 6 blocks each terminated with FC: no differences encountered From theller at users.sourceforge.net Wed Aug 20 11:27:44 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Aug 22 11:49:19 2003 Subject: [Python-checkins] python/dist/src/PCbuild python20.wse,1.133,1.134 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv13813 Modified Files: python20.wse Log Message: Opening the WISE script changes a few items: I have a different WISE version, and it's installed in a different directory. My sytem directory is somewhere else. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** python20.wse 29 Jul 2003 17:22:57 -0000 1.133 --- python20.wse 20 Aug 2003 17:27:42 -0000 1.134 *************** *** 1,5 **** Document Type: WSE item: Global ! Version=8.14 Title=Python 2.3 Flags=00010100 --- 1,5 ---- Document Type: WSE item: Global ! Version=9.0 Title=Python 2.3 Flags=00010100 *************** *** 19,22 **** --- 19,24 ---- Patch Threshold=85 Patch Memory=4000 + MIF PDF Version=1.0 + MIF SMS Version=2.0 EXE Filename=Python-2.3.exe Dialogs Version=8 *************** *** 29,33 **** Variable Name1=_WISE_ Variable Description1=WISE root directory ! Variable Default1=C:\PROGRAM FILES\WISE INSTALLMASTER 8.1 Variable Flags1=00001000 Variable Name2=_TCLDIR_ --- 31,35 ---- Variable Name1=_WISE_ Variable Description1=WISE root directory ! Variable Default1=C:\Programme\Wise Installation System Variable Flags1=00001000 Variable Name2=_TCLDIR_ *************** *** 47,50 **** --- 49,53 ---- Variable Values4=C:\WINNT\System32 Variable Values4=C:\Code\MSDLLs + Variable Values4=C:\Windows\System32 Variable Flags4=00000010 Variable Name5=_PYMAJOR_ *************** *** 65,68 **** --- 68,77 ---- Variable Values7=0 Variable Flags7=00001010 + Variable Name8=_ALIASNAME_ + Variable Flags8=00001000 + Variable Name9=_ALIASPATH_ + Variable Flags9=00001000 + Variable Name10=_ALIASTYPE_ + Variable Flags10=00001000 end item: Set Variable From rhettinger at users.sourceforge.net Fri Aug 22 10:27:05 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 23 08:56:10 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libdatetime.tex, 1.49, 1.49.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12319 Modified Files: Tag: release23-maint libdatetime.tex Log Message: Missing "if". Index: libdatetime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdatetime.tex,v retrieving revision 1.49 retrieving revision 1.49.8.1 diff -C2 -d -r1.49 -r1.49.8.1 *** libdatetime.tex 16 Jul 2003 21:14:35 -0000 1.49 --- libdatetime.tex 22 Aug 2003 16:27:03 -0000 1.49.8.1 *************** *** 868,872 **** dst)} The \member{tm_isdst} flag of the result is set according to ! the \method{dst()} method: \member{tzinfo} is \code{None} or \method{dst()} returns \code{None}, \member{tm_isdst} is set to \code{-1}; else if \method{dst()} returns --- 868,872 ---- dst)} The \member{tm_isdst} flag of the result is set according to ! the \method{dst()} method: if \member{tzinfo} is \code{None} or \method{dst()} returns \code{None}, \member{tm_isdst} is set to \code{-1}; else if \method{dst()} returns From rhettinger at users.sourceforge.net Fri Aug 22 21:39:30 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 21:13:20 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.25, 1.25.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv4981 Modified Files: Tag: release23-maint concrete.tex Log Message: Fix typo. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25 retrieving revision 1.25.10.1 diff -C2 -d -r1.25 -r1.25.10.1 *** concrete.tex 10 May 2003 07:08:50 -0000 1.25 --- concrete.tex 23 Aug 2003 03:39:28 -0000 1.25.10.1 *************** *** 2537,2541 **** \begin{cfuncdesc}{PyObject*}{PyCell_GET}{PyObject *cell} Return the contents of the cell \var{cell}, but without checking ! that \var{cell} is non-\NULL{} and a call object. \end{cfuncdesc} --- 2537,2541 ---- \begin{cfuncdesc}{PyObject*}{PyCell_GET}{PyObject *cell} Return the contents of the cell \var{cell}, but without checking ! that \var{cell} is non-\NULL{} and a cell object. \end{cfuncdesc} From gward at users.sourceforge.net Fri Aug 22 20:09:20 2003 From: gward at users.sourceforge.net (gward@users.sourceforge.net) Date: Sun Aug 24 21:17:19 2003 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory sc8-pr-cvs1:/tmp/cvs-serv27524 Modified Files: inst.tex Log Message: Fix a loooong-standing brainfart: I got the site-packages path for Python 1.5.2 wrong in the section on config files. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** inst.tex 2 Jul 2003 14:33:11 -0000 1.49 --- inst.tex 23 Aug 2003 02:09:18 -0000 1.50 *************** *** 811,815 **** and later on \UNIX, this is as shown. For Python 1.5.2, the Distutils will normally be installed to ! \file{\filevar{prefix}/lib/site-packages/python1.5/distutils}, so the system configuration file should be put there under Python 1.5.2. --- 811,815 ---- and later on \UNIX, this is as shown. For Python 1.5.2, the Distutils will normally be installed to ! \file{\filevar{prefix}/lib/python1.5/site-packages/distutils}, so the system configuration file should be put there under Python 1.5.2. From rhettinger at users.sourceforge.net Fri Aug 22 21:38:14 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 21:21:41 2003 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv4853 Modified Files: concrete.tex Log Message: Fix typo. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** concrete.tex 10 May 2003 07:08:50 -0000 1.25 --- concrete.tex 23 Aug 2003 03:38:11 -0000 1.26 *************** *** 2537,2541 **** \begin{cfuncdesc}{PyObject*}{PyCell_GET}{PyObject *cell} Return the contents of the cell \var{cell}, but without checking ! that \var{cell} is non-\NULL{} and a call object. \end{cfuncdesc} --- 2537,2541 ---- \begin{cfuncdesc}{PyObject*}{PyCell_GET}{PyObject *cell} Return the contents of the cell \var{cell}, but without checking ! that \var{cell} is non-\NULL{} and a cell object. \end{cfuncdesc} From rhettinger at users.sourceforge.net Fri Aug 22 21:47:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 21:25:41 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.3, 1.196.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv5919 Modified Files: Tag: release23-maint tut.tex Log Message: Fix typo. Thou shalt not count to two unless proceeding to the number three. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.3 retrieving revision 1.196.8.4 diff -C2 -d -r1.196.8.3 -r1.196.8.4 *** tut.tex 16 Aug 2003 06:31:21 -0000 1.196.8.3 --- tut.tex 23 Aug 2003 03:47:56 -0000 1.196.8.4 *************** *** 200,204 **** that file. ! A third way of starting the interpreter is \samp{\program{python} \programopt{-c} \var{command} [arg] ...}, which executes the statement(s) in \var{command}, analogous to the shell's --- 200,204 ---- that file. ! A second way of starting the interpreter is \samp{\program{python} \programopt{-c} \var{command} [arg] ...}, which executes the statement(s) in \var{command}, analogous to the shell's From rhettinger at users.sourceforge.net Fri Aug 22 21:49:10 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 21:26:56 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.200,1.201 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv6025 Modified Files: tut.tex Log Message: Fix typo. Thou shalt not count to two unless proceeding to the number three. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** tut.tex 16 Aug 2003 06:30:47 -0000 1.200 --- tut.tex 23 Aug 2003 03:49:08 -0000 1.201 *************** *** 200,204 **** that file. ! A third way of starting the interpreter is \samp{\program{python} \programopt{-c} \var{command} [arg] ...}, which executes the statement(s) in \var{command}, analogous to the shell's --- 200,204 ---- that file. ! A second way of starting the interpreter is \samp{\program{python} \programopt{-c} \var{command} [arg] ...}, which executes the statement(s) in \var{command}, analogous to the shell's From rhettinger at users.sourceforge.net Sun Aug 24 21:31:07 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 23:31:12 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libhtmlparser.tex, 1.3, 1.3.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv24215 Modified Files: Tag: release23-maint libhtmlparser.tex Log Message: SF bug #793702: Section 13.1 HTMLParser documentation error The -- is special to TeX and was printing as just -. Index: libhtmlparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhtmlparser.tex,v retrieving revision 1.3 retrieving revision 1.3.12.1 diff -C2 -d -r1.3 -r1.3.12.1 *** libhtmlparser.tex 17 Apr 2003 22:36:52 -0000 1.3 --- libhtmlparser.tex 25 Aug 2003 03:31:05 -0000 1.3.12.1 *************** *** 110,114 **** This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. It is --- 110,114 ---- This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. It is From rhettinger at users.sourceforge.net Sun Aug 24 21:31:30 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 24 23:41:34 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libhtmlparser.tex, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv24342 Modified Files: libhtmlparser.tex Log Message: SF bug #793702: Section 13.1 HTMLParser documentation error The -- is special to TeX and was printing as just -. Index: libhtmlparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhtmlparser.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libhtmlparser.tex 17 Apr 2003 22:36:52 -0000 1.3 --- libhtmlparser.tex 25 Aug 2003 03:31:28 -0000 1.4 *************** *** 110,114 **** This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. It is --- 110,114 ---- This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. It is From rhettinger at users.sourceforge.net Sun Aug 24 22:28:07 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:28:11 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcookie.tex, 1.10, 1.11 libfuncs.tex, 1.145, 1.146 liblocale.tex, 1.33, 1.34 libmailbox.tex, 1.26, 1.27 libmultifile.tex, 1.12, 1.13 libpdb.tex, 1.37, 1.38 libprofile.tex, 1.41, 1.42 librfc822.tex, 1.44, 1.45 libuserdict.tex, 1.23, 1.24 libzipfile.tex, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30182 Modified Files: libcookie.tex libfuncs.tex liblocale.tex libmailbox.tex libmultifile.tex libpdb.tex libprofile.tex librfc822.tex libuserdict.tex libzipfile.tex Log Message: Fix double word typos. Index: libcookie.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcookie.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libcookie.tex 31 Dec 2002 15:23:09 -0000 1.10 --- libcookie.tex 25 Aug 2003 04:28:03 -0000 1.11 *************** *** 13,17 **** data-type as cookie value. ! The module formerly strictly applied the parsing rules described in in the \rfc{2109} and \rfc{2068} specifications. It has since been discovered that MSIE 3.0x doesn't follow the character rules outlined in those --- 13,17 ---- data-type as cookie value. ! The module formerly strictly applied the parsing rules described in the \rfc{2109} and \rfc{2068} specifications. It has since been discovered that MSIE 3.0x doesn't follow the character rules outlined in those Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** libfuncs.tex 12 Aug 2003 00:01:15 -0000 1.145 --- libfuncs.tex 25 Aug 2003 04:28:04 -0000 1.146 *************** *** 423,427 **** buffered, any other positive value means use a buffer of (approximately) that size. A negative \var{bufsize} means to use ! the system default, which is usually line buffered for for tty devices and fully buffered for other files. If omitted, the system default is used.\footnote{ --- 423,427 ---- buffered, any other positive value means use a buffer of (approximately) that size. A negative \var{bufsize} means to use ! the system default, which is usually line buffered for tty devices and fully buffered for other files. If omitted, the system default is used.\footnote{ Index: liblocale.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblocale.tex,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** liblocale.tex 12 May 2003 03:23:51 -0000 1.33 --- liblocale.tex 25 Aug 2003 04:28:04 -0000 1.34 *************** *** 59,63 **** \begin{funcdesc}{localeconv}{} ! Returns the database of of the local conventions as a dictionary. This dictionary has the following strings as keys: --- 59,63 ---- \begin{funcdesc}{localeconv}{} ! Returns the database of the local conventions as a dictionary. This dictionary has the following strings as keys: Index: libmailbox.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailbox.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** libmailbox.tex 20 Jun 2003 22:04:03 -0000 1.26 --- libmailbox.tex 25 Aug 2003 04:28:04 -0000 1.27 *************** *** 73,77 **** Babyl format, each message has two sets of headers, the \emph{original} headers and the \emph{visible} headers. The original ! headers appear before a a line containing only \code{'*** EOOH ***'} (End-Of-Original-Headers) and the visible headers appear after the \code{EOOH} line. Babyl-compliant mail readers will show you only the --- 73,77 ---- Babyl format, each message has two sets of headers, the \emph{original} headers and the \emph{visible} headers. The original ! headers appear before a line containing only \code{'*** EOOH ***'} (End-Of-Original-Headers) and the visible headers appear after the \code{EOOH} line. Babyl-compliant mail readers will show you only the Index: libmultifile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmultifile.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libmultifile.tex 6 Aug 2002 21:26:01 -0000 1.12 --- libmultifile.tex 25 Aug 2003 04:28:04 -0000 1.13 *************** *** 18,22 **** Create a multi-file. You must instantiate this class with an input object argument for the \class{MultiFile} instance to get lines from, ! such as as a file object returned by \function{open()}. \class{MultiFile} only ever looks at the input object's --- 18,22 ---- Create a multi-file. You must instantiate this class with an input object argument for the \class{MultiFile} instance to get lines from, ! such as a file object returned by \function{open()}. \class{MultiFile} only ever looks at the input object's Index: libpdb.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpdb.tex,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** libpdb.tex 16 Jul 2003 17:58:38 -0000 1.37 --- libpdb.tex 25 Aug 2003 04:28:04 -0000 1.38 *************** *** 78,82 **** \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}} ! Evaluate the \var{expression} (given as a a string) under debugger control. When \function{runeval()} returns, it returns the value of the expression. Otherwise this function is similar to --- 78,82 ---- \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}} ! Evaluate the \var{expression} (given as a string) under debugger control. When \function{runeval()} returns, it returns the value of the expression. Otherwise this function is similar to Index: libprofile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libprofile.tex,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** libprofile.tex 14 Jul 2003 18:24:26 -0000 1.41 --- libprofile.tex 25 Aug 2003 04:28:04 -0000 1.42 *************** *** 534,538 **** 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 --- 534,538 ---- 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 the 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: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** librfc822.tex 16 Jul 2003 17:58:38 -0000 1.44 --- librfc822.tex 25 Aug 2003 04:28:04 -0000 1.45 *************** *** 47,51 **** doesn't work. For maximum portability, you should set the seekable argument to zero to prevent that initial \method{tell()} when passing ! in an unseekable object such as a a file object created from a socket object. --- 47,51 ---- doesn't work. For maximum portability, you should set the seekable argument to zero to prevent that initial \method{tell()} when passing ! in an unseekable object such as a file object created from a socket object. Index: libuserdict.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuserdict.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** libuserdict.tex 18 Nov 2002 04:34:10 -0000 1.23 --- libuserdict.tex 25 Aug 2003 04:28:04 -0000 1.24 *************** *** 30,34 **** \var{initialdata} is provided, \member{data} is initialized with its contents; note that a reference to \var{initialdata} will not be kept, ! allowing it be used used for other purposes. \end{classdesc} --- 30,34 ---- \var{initialdata} is provided, \member{data} is initialized with its contents; note that a reference to \var{initialdata} will not be kept, ! allowing it be used for other purposes. \end{classdesc} Index: libzipfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libzipfile.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libzipfile.tex 12 Dec 2002 12:23:32 -0000 1.15 --- libzipfile.tex 25 Aug 2003 04:28:05 -0000 1.16 *************** *** 211,215 **** \begin{memberdesc}[ZipInfo]{date_time} ! The time and date of the last modification to to the archive member. This is a tuple of six values: --- 211,215 ---- \begin{memberdesc}[ZipInfo]{date_time} ! The time and date of the last modification to the archive member. This is a tuple of six values: From rhettinger at users.sourceforge.net Sun Aug 24 22:34:48 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:34:51 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcookie.tex, 1.10, 1.10.16.1 libfuncs.tex, 1.143.8.1, 1.143.8.2 liblocale.tex, 1.33, 1.33.10.1 libmailbox.tex, 1.26, 1.26.10.1 libmultifile.tex, 1.12, 1.12.16.1 libpdb.tex, 1.37, 1.37.8.1 libprofile.tex, 1.41, 1.41.8.1 librfc822.tex, 1.44, 1.44.8.1 libuserdict.tex, 1.23, 1.23.16.1 libzipfile.tex, 1.15, 1.15.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30868 Modified Files: Tag: release23-maint libcookie.tex libfuncs.tex liblocale.tex libmailbox.tex libmultifile.tex libpdb.tex libprofile.tex librfc822.tex libuserdict.tex libzipfile.tex Log Message: Fix double word typos. Index: libcookie.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcookie.tex,v retrieving revision 1.10 retrieving revision 1.10.16.1 diff -C2 -d -r1.10 -r1.10.16.1 *** libcookie.tex 31 Dec 2002 15:23:09 -0000 1.10 --- libcookie.tex 25 Aug 2003 04:34:46 -0000 1.10.16.1 *************** *** 13,17 **** data-type as cookie value. ! The module formerly strictly applied the parsing rules described in in the \rfc{2109} and \rfc{2068} specifications. It has since been discovered that MSIE 3.0x doesn't follow the character rules outlined in those --- 13,17 ---- data-type as cookie value. ! The module formerly strictly applied the parsing rules described in the \rfc{2109} and \rfc{2068} specifications. It has since been discovered that MSIE 3.0x doesn't follow the character rules outlined in those Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.143.8.1 retrieving revision 1.143.8.2 diff -C2 -d -r1.143.8.1 -r1.143.8.2 *** libfuncs.tex 11 Aug 2003 23:43:04 -0000 1.143.8.1 --- libfuncs.tex 25 Aug 2003 04:34:46 -0000 1.143.8.2 *************** *** 423,427 **** buffered, any other positive value means use a buffer of (approximately) that size. A negative \var{bufsize} means to use ! the system default, which is usually line buffered for for tty devices and fully buffered for other files. If omitted, the system default is used.\footnote{ --- 423,427 ---- buffered, any other positive value means use a buffer of (approximately) that size. A negative \var{bufsize} means to use ! the system default, which is usually line buffered for tty devices and fully buffered for other files. If omitted, the system default is used.\footnote{ Index: liblocale.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblocale.tex,v retrieving revision 1.33 retrieving revision 1.33.10.1 diff -C2 -d -r1.33 -r1.33.10.1 *** liblocale.tex 12 May 2003 03:23:51 -0000 1.33 --- liblocale.tex 25 Aug 2003 04:34:46 -0000 1.33.10.1 *************** *** 59,63 **** \begin{funcdesc}{localeconv}{} ! Returns the database of of the local conventions as a dictionary. This dictionary has the following strings as keys: --- 59,63 ---- \begin{funcdesc}{localeconv}{} ! Returns the database of the local conventions as a dictionary. This dictionary has the following strings as keys: Index: libmailbox.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailbox.tex,v retrieving revision 1.26 retrieving revision 1.26.10.1 diff -C2 -d -r1.26 -r1.26.10.1 *** libmailbox.tex 20 Jun 2003 22:04:03 -0000 1.26 --- libmailbox.tex 25 Aug 2003 04:34:46 -0000 1.26.10.1 *************** *** 73,77 **** Babyl format, each message has two sets of headers, the \emph{original} headers and the \emph{visible} headers. The original ! headers appear before a a line containing only \code{'*** EOOH ***'} (End-Of-Original-Headers) and the visible headers appear after the \code{EOOH} line. Babyl-compliant mail readers will show you only the --- 73,77 ---- Babyl format, each message has two sets of headers, the \emph{original} headers and the \emph{visible} headers. The original ! headers appear before a line containing only \code{'*** EOOH ***'} (End-Of-Original-Headers) and the visible headers appear after the \code{EOOH} line. Babyl-compliant mail readers will show you only the Index: libmultifile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmultifile.tex,v retrieving revision 1.12 retrieving revision 1.12.16.1 diff -C2 -d -r1.12 -r1.12.16.1 *** libmultifile.tex 6 Aug 2002 21:26:01 -0000 1.12 --- libmultifile.tex 25 Aug 2003 04:34:46 -0000 1.12.16.1 *************** *** 18,22 **** Create a multi-file. You must instantiate this class with an input object argument for the \class{MultiFile} instance to get lines from, ! such as as a file object returned by \function{open()}. \class{MultiFile} only ever looks at the input object's --- 18,22 ---- Create a multi-file. You must instantiate this class with an input object argument for the \class{MultiFile} instance to get lines from, ! such as a file object returned by \function{open()}. \class{MultiFile} only ever looks at the input object's Index: libpdb.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpdb.tex,v retrieving revision 1.37 retrieving revision 1.37.8.1 diff -C2 -d -r1.37 -r1.37.8.1 *** libpdb.tex 16 Jul 2003 17:58:38 -0000 1.37 --- libpdb.tex 25 Aug 2003 04:34:46 -0000 1.37.8.1 *************** *** 78,82 **** \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}} ! Evaluate the \var{expression} (given as a a string) under debugger control. When \function{runeval()} returns, it returns the value of the expression. Otherwise this function is similar to --- 78,82 ---- \begin{funcdesc}{runeval}{expression\optional{, globals\optional{, locals}}} ! Evaluate the \var{expression} (given as a string) under debugger control. When \function{runeval()} returns, it returns the value of the expression. Otherwise this function is similar to Index: libprofile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libprofile.tex,v retrieving revision 1.41 retrieving revision 1.41.8.1 diff -C2 -d -r1.41 -r1.41.8.1 *** libprofile.tex 14 Jul 2003 18:24:26 -0000 1.41 --- libprofile.tex 25 Aug 2003 04:34:46 -0000 1.41.8.1 *************** *** 534,538 **** 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 --- 534,538 ---- 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 the 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: librfc822.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v retrieving revision 1.44 retrieving revision 1.44.8.1 diff -C2 -d -r1.44 -r1.44.8.1 *** librfc822.tex 16 Jul 2003 17:58:38 -0000 1.44 --- librfc822.tex 25 Aug 2003 04:34:46 -0000 1.44.8.1 *************** *** 47,51 **** doesn't work. For maximum portability, you should set the seekable argument to zero to prevent that initial \method{tell()} when passing ! in an unseekable object such as a a file object created from a socket object. --- 47,51 ---- doesn't work. For maximum portability, you should set the seekable argument to zero to prevent that initial \method{tell()} when passing ! in an unseekable object such as a file object created from a socket object. Index: libuserdict.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuserdict.tex,v retrieving revision 1.23 retrieving revision 1.23.16.1 diff -C2 -d -r1.23 -r1.23.16.1 *** libuserdict.tex 18 Nov 2002 04:34:10 -0000 1.23 --- libuserdict.tex 25 Aug 2003 04:34:46 -0000 1.23.16.1 *************** *** 30,34 **** \var{initialdata} is provided, \member{data} is initialized with its contents; note that a reference to \var{initialdata} will not be kept, ! allowing it be used used for other purposes. \end{classdesc} --- 30,34 ---- \var{initialdata} is provided, \member{data} is initialized with its contents; note that a reference to \var{initialdata} will not be kept, ! allowing it be used for other purposes. \end{classdesc} Index: libzipfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libzipfile.tex,v retrieving revision 1.15 retrieving revision 1.15.16.1 diff -C2 -d -r1.15 -r1.15.16.1 *** libzipfile.tex 12 Dec 2002 12:23:32 -0000 1.15 --- libzipfile.tex 25 Aug 2003 04:34:46 -0000 1.15.16.1 *************** *** 211,215 **** \begin{memberdesc}[ZipInfo]{date_time} ! The time and date of the last modification to to the archive member. This is a tuple of six values: --- 211,215 ---- \begin{memberdesc}[ZipInfo]{date_time} ! The time and date of the last modification to the archive member. This is a tuple of six values: From rhettinger at users.sourceforge.net Sun Aug 24 22:36:23 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:36:27 2003 Subject: [Python-checkins] python/dist/src/Tools/scripts texcheck.py, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv31078 Modified Files: texcheck.py Log Message: Added doubled word warnings. Index: texcheck.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/texcheck.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** texcheck.py 16 May 2003 03:06:39 -0000 1.6 --- texcheck.py 25 Aug 2003 04:36:21 -0000 1.7 *************** *** 99,102 **** --- 99,103 ---- delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])') braces = re.compile(r'({)|(})') + doubledwords = re.compile(r'(\b[A-za-z]+\b) \b\1\b') openers = [] # Stack of pending open delimiters *************** *** 176,179 **** --- 177,182 ---- print r'Style warning, avoid use of i.e or e.g. on line %d' % (lineno,) + for dw in doubledwords.findall(line): + print r'Doubled word warning. "%s" on line %d' % (dw, lineno) lastline = lineno From rhettinger at users.sourceforge.net Sun Aug 24 22:37:25 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:37:40 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.846,1.847 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv31154 Modified Files: NEWS Log Message: Added doubled word warnings. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.846 retrieving revision 1.847 diff -C2 -d -r1.846 -r1.847 *** NEWS 19 Aug 2003 03:59:09 -0000 1.846 --- NEWS 25 Aug 2003 04:37:23 -0000 1.847 *************** *** 56,59 **** --- 56,61 ---- ----------- + - texcheck.py now detects double word errors. + - md5sum.py mistakenly opened input files in text mode by default, a silent and dangerous change from previous releases. It once again From rhettinger at users.sourceforge.net Sun Aug 24 22:39:57 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:40:01 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex,1.114,1.115 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv31398 Modified Files: ref3.tex Log Message: Added doubled word warnings. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** ref3.tex 23 Jul 2003 15:18:03 -0000 1.114 --- ref3.tex 25 Aug 2003 04:39:55 -0000 1.115 *************** *** 1741,1745 **** methods are expected to do this as well. However, since they should already be doing that, negative indexes cannot be passed in; they must ! be be constrained to the bounds of the sequence before being passed to the \method{__*item__()} methods. Calling \code{max(0, i)} conveniently returns the proper value. --- 1741,1745 ---- methods are expected to do this as well. However, since they should already be doing that, negative indexes cannot be passed in; they must ! be constrained to the bounds of the sequence before being passed to the \method{__*item__()} methods. Calling \code{max(0, i)} conveniently returns the proper value. From rhettinger at users.sourceforge.net Sun Aug 24 22:41:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:41:21 2003 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex,1.114,1.114.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv32265 Modified Files: Tag: release23-maint ref3.tex Log Message: Fixed doubled word typos. Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.114 retrieving revision 1.114.4.1 diff -C2 -d -r1.114 -r1.114.4.1 *** ref3.tex 23 Jul 2003 15:18:03 -0000 1.114 --- ref3.tex 25 Aug 2003 04:41:15 -0000 1.114.4.1 *************** *** 1741,1745 **** methods are expected to do this as well. However, since they should already be doing that, negative indexes cannot be passed in; they must ! be be constrained to the bounds of the sequence before being passed to the \method{__*item__()} methods. Calling \code{max(0, i)} conveniently returns the proper value. --- 1741,1745 ---- methods are expected to do this as well. However, since they should already be doing that, negative indexes cannot be passed in; they must ! be constrained to the bounds of the sequence before being passed to the \method{__*item__()} methods. Calling \code{max(0, i)} conveniently returns the proper value. From rhettinger at users.sourceforge.net Sun Aug 24 22:43:55 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:44:25 2003 Subject: [Python-checkins] python/dist/src/Doc/api newtypes.tex,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv689 Modified Files: newtypes.tex Log Message: Fix doubled word typos. Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** newtypes.tex 7 Jul 2003 17:20:40 -0000 1.23 --- newtypes.tex 25 Aug 2003 04:43:53 -0000 1.24 *************** *** 23,27 **** initial reference. Returns the initialized object. If \var{type} indicates that the object participates in the cyclic garbage ! detector, it it added to the detector's set of observed objects. Other fields of the object are not affected. \end{cfuncdesc} --- 23,27 ---- initial reference. Returns the initialized object. If \var{type} indicates that the object participates in the cyclic garbage ! detector, it is added to the detector's set of observed objects. Other fields of the object are not affected. \end{cfuncdesc} From rhettinger at users.sourceforge.net Sun Aug 24 22:44:36 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 00:44:39 2003 Subject: [Python-checkins] python/dist/src/Doc/api newtypes.tex, 1.23, 1.23.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv791 Modified Files: Tag: release23-maint newtypes.tex Log Message: Fixed doubled word typos. Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v retrieving revision 1.23 retrieving revision 1.23.8.1 diff -C2 -d -r1.23 -r1.23.8.1 *** newtypes.tex 7 Jul 2003 17:20:40 -0000 1.23 --- newtypes.tex 25 Aug 2003 04:44:33 -0000 1.23.8.1 *************** *** 23,27 **** initial reference. Returns the initialized object. If \var{type} indicates that the object participates in the cyclic garbage ! detector, it it added to the detector's set of observed objects. Other fields of the object are not affected. \end{cfuncdesc} --- 23,27 ---- initial reference. Returns the initialized object. If \var{type} indicates that the object participates in the cyclic garbage ! detector, it is added to the detector's set of observed objects. Other fields of the object are not affected. \end{cfuncdesc} From rhettinger at users.sourceforge.net Sun Aug 24 23:04:24 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 01:04:28 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12.6.1, 1.12.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2938 Modified Files: Tag: release23-maint libitertools.tex Log Message: Make the derived tools amendable to cut and paste. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12.6.1 retrieving revision 1.12.6.2 diff -C2 -d -r1.12.6.1 -r1.12.6.2 *** libitertools.tex 8 Aug 2003 02:41:53 -0000 1.12.6.1 --- libitertools.tex 25 Aug 2003 05:04:22 -0000 1.12.6.2 *************** *** 326,383 **** \begin{verbatim} ! >>> def enumerate(iterable): ! ... return izip(count(), iterable) ! >>> def tabulate(function): ! ... "Return function(0), function(1), ..." ! ... return imap(function, count()) ! >>> def iteritems(mapping): ! ... return izip(mapping.iterkeys(), mapping.itervalues()) ! >>> def nth(iterable, n): ! ... "Returns the nth item" ! ... 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)) ! >>> def padnone(seq): ! ... "Returns the sequence elements and then returns None indefinitely" ! ... return chain(seq, repeat(None)) ! >>> def ncycles(seq, n): ! ... "Returns the sequence elements n times" ! ... return chain(*repeat(seq, n)) ! >>> def dotproduct(vec1, vec2): ! ... return sum(imap(operator.mul, vec1, vec2)) ! >>> 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 ! >>> def take(n, seq): ! ... return list(islice(seq, n)) \end{verbatim} --- 326,383 ---- \begin{verbatim} ! def enumerate(iterable): ! return izip(count(), iterable) ! def tabulate(function): ! "Return function(0), function(1), ..." ! return imap(function, count()) ! def iteritems(mapping): ! return izip(mapping.iterkeys(), mapping.itervalues()) ! def nth(iterable, n): ! "Returns the nth item" ! 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)) ! def padnone(seq): ! "Returns the sequence elements and then returns None indefinitely" ! return chain(seq, repeat(None)) ! def ncycles(seq, n): ! "Returns the sequence elements n times" ! return chain(*repeat(seq, n)) ! def dotproduct(vec1, vec2): ! return sum(imap(operator.mul, vec1, vec2)) ! 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 ! def take(n, seq): ! return list(islice(seq, n)) \end{verbatim} From rhettinger at users.sourceforge.net Sun Aug 24 23:06:11 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Aug 25 01:06:14 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3109 Modified Files: libitertools.tex Log Message: Make the derived tools amendable to cut and paste. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libitertools.tex 8 Aug 2003 05:10:41 -0000 1.14 --- libitertools.tex 25 Aug 2003 05:06:09 -0000 1.15 *************** *** 329,386 **** \begin{verbatim} ! >>> def enumerate(iterable): ! ... return izip(count(), iterable) ! >>> def tabulate(function): ! ... "Return function(0), function(1), ..." ! ... return imap(function, count()) ! >>> def iteritems(mapping): ! ... return izip(mapping.iterkeys(), mapping.itervalues()) ! >>> def nth(iterable, n): ! ... "Returns the nth item" ! ... 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)) ! >>> def padnone(seq): ! ... "Returns the sequence elements and then returns None indefinitely" ! ... return chain(seq, repeat(None)) ! >>> def ncycles(seq, n): ! ... "Returns the sequence elements n times" ! ... return chain(*repeat(seq, n)) ! >>> def dotproduct(vec1, vec2): ! ... return sum(imap(operator.mul, vec1, vec2)) ! >>> 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 ! >>> def take(n, seq): ! ... return list(islice(seq, n)) \end{verbatim} --- 329,386 ---- \begin{verbatim} ! def enumerate(iterable): ! return izip(count(), iterable) ! def tabulate(function): ! "Return function(0), function(1), ..." ! return imap(function, count()) ! def iteritems(mapping): ! return izip(mapping.iterkeys(), mapping.itervalues()) ! def nth(iterable, n): ! "Returns the nth item" ! 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)) ! def padnone(seq): ! "Returns the sequence elements and then returns None indefinitely" ! return chain(seq, repeat(None)) ! def ncycles(seq, n): ! "Returns the sequence elements n times" ! return chain(*repeat(seq, n)) ! def dotproduct(vec1, vec2): ! return sum(imap(operator.mul, vec1, vec2)) ! 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 ! def take(n, seq): ! return list(islice(seq, n)) \end{verbatim} From pedronis at users.sourceforge.net Mon Aug 25 06:33:32 2003 From: pedronis at users.sourceforge.net (pedronis@users.sourceforge.net) Date: Mon Aug 25 08:33:36 2003 Subject: [Python-checkins] python/nondist/sandbox/ast asdl_java.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/ast In directory sc8-pr-cvs1:/tmp/cvs-serv3252 Modified Files: asdl_java.py Log Message: minor tweaks. enable patch for using Jython parser outside of Jython: PyObject -> java.lang.Object Finer control over emitted java import statements, avoids spurious warnings e.g. in Eclipse. Index: asdl_java.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/ast/asdl_java.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** asdl_java.py 30 May 2002 16:59:56 -0000 1.6 --- asdl_java.py 25 Aug 2003 12:33:30 -0000 1.7 *************** *** 50,60 **** super(EmitVisitor, self).__init__() ! def open(self, name): ! self.file = open("%s.java" % name, "wb") print >> self.file, "// Autogenerated AST node" print >> self.file, 'package org.python.parser.ast;' ! print >> self.file, 'import org.python.parser.SimpleNode;' ! print >> self.file, 'import java.io.DataOutputStream;' ! print >> self.file, 'import java.io.IOException;' print >> self.file --- 50,62 ---- super(EmitVisitor, self).__init__() ! def open(self, name, refersToSimpleNode=1, useDataOutput=0): ! self.file = open("%s.java" % name, "w") print >> self.file, "// Autogenerated AST node" print >> self.file, 'package org.python.parser.ast;' ! if refersToSimpleNode: ! print >> self.file, 'import org.python.parser.SimpleNode;' ! if useDataOutput: ! print >> self.file, 'import java.io.DataOutputStream;' ! print >> self.file, 'import java.io.IOException;' print >> self.file *************** *** 134,138 **** def simple_sum(self, sum, name, depth): ! self.open("%sType" % name) self.emit("public interface %(name)sType {" % locals(), depth) for i in range(len(sum.types)): --- 136,140 ---- def simple_sum(self, sum, name, depth): ! self.open("%sType" % name, refersToSimpleNode=0) self.emit("public interface %(name)sType {" % locals(), depth) for i in range(len(sum.types)): *************** *** 160,164 **** def visitProduct(self, product, name, depth): ! self.open("%sType" % name) self.emit("public class %(name)sType extends SimpleNode {" % locals(), depth) for f in product.fields: --- 162,166 ---- def visitProduct(self, product, name, depth): ! self.open("%sType" % name, useDataOutput=1) self.emit("public class %(name)sType extends SimpleNode {" % locals(), depth) for f in product.fields: *************** *** 173,177 **** def visitConstructor(self, cons, name, depth): ! self.open(cons.name) enums = [] for f in cons.fields: --- 175,179 ---- def visitConstructor(self, cons, name, depth): ! self.open(cons.name, useDataOutput=1) enums = [] for f in cons.fields: *************** *** 277,281 **** 'identifier' : 'String', 'string' : 'String', ! 'object' : 'org.python.core.PyObject', } --- 279,283 ---- 'identifier' : 'String', 'string' : 'String', ! 'object' : 'Object', # was PyObject } *************** *** 300,304 **** for dfn in mod.dfns: self.visit(dfn) ! self.open("VisitorIF") self.emit('public interface VisitorIF {', 0) for ctor in self.ctors: --- 302,306 ---- for dfn in mod.dfns: self.visit(dfn) ! self.open("VisitorIF", refersToSimpleNode=0) self.emit('public interface VisitorIF {', 0) for ctor in self.ctors: From jhylton at users.sourceforge.net Mon Aug 25 19:17:17 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon Aug 25 21:17:20 2003 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.30,1.1.2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv9591 Modified Files: Tag: ast-branch ast.c Log Message: Add support for expressions like f(3)(2) Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.30 retrieving revision 1.1.2.31 diff -C2 -d -r1.1.2.30 -r1.1.2.31 *** ast.c 22 Jul 2003 19:32:39 -0000 1.1.2.30 --- ast.c 26 Aug 2003 01:17:15 -0000 1.1.2.31 *************** *** 814,818 **** return e; /* power: atom trailer* ('**' factor)* ! trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME */ if (TYPE(CHILD(n, NCH(n) - 1)) == factor) { expr_ty f = ast_for_expr(CHILD(n, NCH(n) - 1)); --- 814,821 ---- return e; /* power: atom trailer* ('**' factor)* ! trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME ! ! XXX What about atom trailer trailer ** factor? ! */ if (TYPE(CHILD(n, NCH(n) - 1)) == factor) { expr_ty f = ast_for_expr(CHILD(n, NCH(n) - 1)); *************** *** 820,830 **** } for (i = 1; i < NCH(n); i++) { ! expr_ty new; node *ch = CHILD(n, i); if (TYPE(CHILD(ch, 0)) == LPAR) { if (NCH(ch) == 2) ! return Call(e, NULL, NULL, NULL, NULL); else ! return ast_for_call(CHILD(ch, 1), e); } else if (TYPE(CHILD(ch, 0)) == LSQB) { --- 823,833 ---- } for (i = 1; i < NCH(n); i++) { ! expr_ty new = e; node *ch = CHILD(n, i); if (TYPE(CHILD(ch, 0)) == LPAR) { if (NCH(ch) == 2) ! new = Call(new, NULL, NULL, NULL, NULL); else ! new = ast_for_call(CHILD(ch, 1), new); } else if (TYPE(CHILD(ch, 0)) == LSQB) { From jhylton at users.sourceforge.net Mon Aug 25 19:21:15 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Mon Aug 25 21:21:19 2003 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.53, 1.1.2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv10183 Modified Files: Tag: ast-branch newcompile.c Log Message: Handle lineno offsets greater than 255. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.53 retrieving revision 1.1.2.54 diff -C2 -d -r1.1.2.53 -r1.1.2.54 *** newcompile.c 28 Apr 2003 16:35:40 -0000 1.1.2.53 --- newcompile.c 26 Aug 2003 01:21:13 -0000 1.1.2.54 *************** *** 2159,2164 **** return 1; - /* XXX Need logic for line number gaps greater than 255. */ - assert(d_lineno < 256); if (d_bytecode > 255) { int i, nbytes, ncodes = d_bytecode / 255; --- 2159,2162 ---- *************** *** 2181,2195 **** a->a_lnotab_off += ncodes * 2; } ! else { len = PyString_GET_SIZE(a->a_lnotab); if (a->a_lnotab_off + 2 >= len) { if (_PyString_Resize(&a->a_lnotab, len * 2) < 0) return 0; ! } lnotab = PyString_AS_STRING(a->a_lnotab) + a->a_lnotab_off; a->a_lnotab_off += 2; } - *lnotab++ = d_bytecode; - *lnotab++ = d_lineno; a->a_lineno = i->i_lineno; return 1; --- 2179,2218 ---- a->a_lnotab_off += ncodes * 2; } ! assert(d_bytecode < 255); ! if (d_lineno > 255) { ! int i, nbytes, ncodes = d_lineno / 255; ! nbytes = a->a_lnotab_off + 2 * ncodes; ! len = PyString_GET_SIZE(a->a_lnotab); ! if (nbytes >= len) { ! if (len * 2 < nbytes) ! len = nbytes; ! else ! len *= 2; ! if (_PyString_Resize(&a->a_lnotab, len) < 0) ! return 0; ! } ! lnotab = PyString_AS_STRING(a->a_lnotab) + a->a_lnotab_off; ! *lnotab++ = 255; ! *lnotab++ = d_bytecode; ! d_bytecode = 0; ! for (i = 1; i < ncodes; i++) { ! *lnotab++ = 255; ! *lnotab++ = 0; ! } ! d_lineno -= ncodes * 255; ! a->a_lnotab_off += ncodes * 2; ! } ! ! if (d_bytecode) { len = PyString_GET_SIZE(a->a_lnotab); if (a->a_lnotab_off + 2 >= len) { if (_PyString_Resize(&a->a_lnotab, len * 2) < 0) return 0; ! } lnotab = PyString_AS_STRING(a->a_lnotab) + a->a_lnotab_off; a->a_lnotab_off += 2; + *lnotab++ = d_bytecode; + *lnotab++ = d_lineno; } a->a_lineno = i->i_lineno; return 1; From jlt63 at users.sourceforge.net Tue Aug 26 05:59:29 2003 From: jlt63 at users.sourceforge.net (jlt63@users.sourceforge.net) Date: Tue Aug 26 08:00:24 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_largefile.py, 1.16, 1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv1893 Modified Files: test_largefile.py Log Message: test_largefile can leave its temp file open if one of many tests fail. On platforms (e.g., Cygwin) that are "particular" about open files, this will cause other regression tests that use the same temp file to fail: $ ./python.exe -E -tt Lib/test/regrtest.py -l test_largefile test_mmap test_mutants test_largefile test test_largefile failed -- got -1794967295L, but expected 2500000001L test_mmap test test_mmap crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test' test_mutants test test_mutants crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test' This patch solves the problem by adding missing "try/finally" blocks. Note that the "large" size of this patch is due to many white space changes -- otherwise, the patch is small. I tested this patch under Red Hat Linux 8.0 too. Index: test_largefile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_largefile.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_largefile.py 2 Dec 2002 10:42:30 -0000 1.16 --- test_largefile.py 26 Aug 2003 11:59:27 -0000 1.17 *************** *** 70,82 **** print 'create large file via seek (may be sparse file) ...' f = open(name, 'wb') ! f.write('z') ! f.seek(0) ! f.seek(size) ! f.write('a') ! f.flush() ! if test_support.verbose: ! print 'check file size with os.fstat' ! expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) ! f.close() if test_support.verbose: print 'check file size with os.stat' --- 70,84 ---- print 'create large file via seek (may be sparse file) ...' f = open(name, 'wb') ! try: ! f.write('z') ! f.seek(0) ! f.seek(size) ! f.write('a') ! f.flush() ! if test_support.verbose: ! print 'check file size with os.fstat' ! expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) ! finally: ! f.close() if test_support.verbose: print 'check file size with os.stat' *************** *** 86,131 **** print 'play around with seek() and read() with the built largefile' f = open(name, 'rb') ! expect(f.tell(), 0) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.seek(0) ! expect(f.tell(), 0) ! f.seek(0, 0) ! expect(f.tell(), 0) ! f.seek(42) ! expect(f.tell(), 42) ! f.seek(42, 0) ! expect(f.tell(), 42) ! f.seek(42, 1) ! expect(f.tell(), 84) ! f.seek(0, 1) ! expect(f.tell(), 84) ! f.seek(0, 2) # seek from the end ! expect(f.tell(), size + 1 + 0) ! f.seek(-10, 2) ! expect(f.tell(), size + 1 - 10) ! f.seek(-size-1, 2) ! expect(f.tell(), 0) ! f.seek(size) ! expect(f.tell(), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of the file above ! f.seek(-size-1, 1) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.close() if test_support.verbose: print 'play around with os.lseek() with the built largefile' f = open(name, 'rb') ! expect(os.lseek(f.fileno(), 0, 0), 0) ! expect(os.lseek(f.fileno(), 42, 0), 42) ! expect(os.lseek(f.fileno(), 42, 1), 84) ! expect(os.lseek(f.fileno(), 0, 1), 84) ! expect(os.lseek(f.fileno(), 0, 2), size+1+0) ! expect(os.lseek(f.fileno(), -10, 2), size+1-10) ! expect(os.lseek(f.fileno(), -size-1, 2), 0) ! expect(os.lseek(f.fileno(), size, 0), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of the file above ! f.close() if hasattr(f, 'truncate'): --- 88,137 ---- print 'play around with seek() and read() with the built largefile' f = open(name, 'rb') ! try: ! expect(f.tell(), 0) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.seek(0) ! expect(f.tell(), 0) ! f.seek(0, 0) ! expect(f.tell(), 0) ! f.seek(42) ! expect(f.tell(), 42) ! f.seek(42, 0) ! expect(f.tell(), 42) ! f.seek(42, 1) ! expect(f.tell(), 84) ! f.seek(0, 1) ! expect(f.tell(), 84) ! f.seek(0, 2) # seek from the end ! expect(f.tell(), size + 1 + 0) ! f.seek(-10, 2) ! expect(f.tell(), size + 1 - 10) ! f.seek(-size-1, 2) ! expect(f.tell(), 0) ! f.seek(size) ! expect(f.tell(), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of file above ! f.seek(-size-1, 1) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! finally: ! f.close() if test_support.verbose: print 'play around with os.lseek() with the built largefile' f = open(name, 'rb') ! try: ! expect(os.lseek(f.fileno(), 0, 0), 0) ! expect(os.lseek(f.fileno(), 42, 0), 42) ! expect(os.lseek(f.fileno(), 42, 1), 84) ! expect(os.lseek(f.fileno(), 0, 1), 84) ! expect(os.lseek(f.fileno(), 0, 2), size+1+0) ! expect(os.lseek(f.fileno(), -10, 2), size+1-10) ! expect(os.lseek(f.fileno(), -size-1, 2), 0) ! expect(os.lseek(f.fileno(), size, 0), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of file above ! finally: ! f.close() if hasattr(f, 'truncate'): *************** *** 133,162 **** print 'try truncate' f = open(name, 'r+b') ! f.seek(0, 2) ! expect(f.tell(), size+1) # else we've lost track of the true size ! # Cut it back via seek + truncate with no argument. ! newsize = size - 10 ! f.seek(newsize) ! f.truncate() ! expect(f.tell(), newsize) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # Ensure that truncate(smaller than true size) shrinks the file. ! newsize -= 1 ! f.seek(42) ! f.truncate(newsize) ! expect(f.tell(), 42) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # XXX truncate(larger than true size) is ill-defined across platforms ! # cut it waaaaay back ! f.seek(0) ! f.truncate(1) ! expect(f.tell(), 0) # else pointer moved ! expect(len(f.read()), 1) # else wasn't truncated ! f.close() os.unlink(name) --- 139,170 ---- print 'try truncate' f = open(name, 'r+b') ! try: ! f.seek(0, 2) ! expect(f.tell(), size+1) # else we've lost track of the true size ! # Cut it back via seek + truncate with no argument. ! newsize = size - 10 ! f.seek(newsize) ! f.truncate() ! expect(f.tell(), newsize) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # Ensure that truncate(smaller than true size) shrinks the file. ! newsize -= 1 ! f.seek(42) ! f.truncate(newsize) ! expect(f.tell(), 42) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # XXX truncate(larger than true size) is ill-defined across platforms ! # cut it waaaaay back ! f.seek(0) ! f.truncate(1) ! expect(f.tell(), 0) # else pointer moved ! expect(len(f.read()), 1) # else wasn't truncated ! finally: ! f.close() os.unlink(name) From jlt63 at users.sourceforge.net Tue Aug 26 05:59:43 2003 From: jlt63 at users.sourceforge.net (jlt63@users.sourceforge.net) Date: Tue Aug 26 08:00:35 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_largefile.py, 1.16, 1.16.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv2226 Modified Files: Tag: release23-maint test_largefile.py Log Message: test_largefile can leave its temp file open if one of many tests fail. On platforms (e.g., Cygwin) that are "particular" about open files, this will cause other regression tests that use the same temp file to fail: $ ./python.exe -E -tt Lib/test/regrtest.py -l test_largefile test_mmap test_mutants test_largefile test test_largefile failed -- got -1794967295L, but expected 2500000001L test_mmap test test_mmap crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test' test_mutants test test_mutants crashed -- exceptions.IOError: [Errno 13] Permission denied: '@test' This patch solves the problem by adding missing "try/finally" blocks. Note that the "large" size of this patch is due to many white space changes -- otherwise, the patch is small. I tested this patch under Red Hat Linux 8.0 too. Index: test_largefile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_largefile.py,v retrieving revision 1.16 retrieving revision 1.16.16.1 diff -C2 -d -r1.16 -r1.16.16.1 *** test_largefile.py 2 Dec 2002 10:42:30 -0000 1.16 --- test_largefile.py 26 Aug 2003 11:59:41 -0000 1.16.16.1 *************** *** 70,82 **** print 'create large file via seek (may be sparse file) ...' f = open(name, 'wb') ! f.write('z') ! f.seek(0) ! f.seek(size) ! f.write('a') ! f.flush() ! if test_support.verbose: ! print 'check file size with os.fstat' ! expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) ! f.close() if test_support.verbose: print 'check file size with os.stat' --- 70,84 ---- print 'create large file via seek (may be sparse file) ...' f = open(name, 'wb') ! try: ! f.write('z') ! f.seek(0) ! f.seek(size) ! f.write('a') ! f.flush() ! if test_support.verbose: ! print 'check file size with os.fstat' ! expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) ! finally: ! f.close() if test_support.verbose: print 'check file size with os.stat' *************** *** 86,131 **** print 'play around with seek() and read() with the built largefile' f = open(name, 'rb') ! expect(f.tell(), 0) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.seek(0) ! expect(f.tell(), 0) ! f.seek(0, 0) ! expect(f.tell(), 0) ! f.seek(42) ! expect(f.tell(), 42) ! f.seek(42, 0) ! expect(f.tell(), 42) ! f.seek(42, 1) ! expect(f.tell(), 84) ! f.seek(0, 1) ! expect(f.tell(), 84) ! f.seek(0, 2) # seek from the end ! expect(f.tell(), size + 1 + 0) ! f.seek(-10, 2) ! expect(f.tell(), size + 1 - 10) ! f.seek(-size-1, 2) ! expect(f.tell(), 0) ! f.seek(size) ! expect(f.tell(), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of the file above ! f.seek(-size-1, 1) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.close() if test_support.verbose: print 'play around with os.lseek() with the built largefile' f = open(name, 'rb') ! expect(os.lseek(f.fileno(), 0, 0), 0) ! expect(os.lseek(f.fileno(), 42, 0), 42) ! expect(os.lseek(f.fileno(), 42, 1), 84) ! expect(os.lseek(f.fileno(), 0, 1), 84) ! expect(os.lseek(f.fileno(), 0, 2), size+1+0) ! expect(os.lseek(f.fileno(), -10, 2), size+1-10) ! expect(os.lseek(f.fileno(), -size-1, 2), 0) ! expect(os.lseek(f.fileno(), size, 0), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of the file above ! f.close() if hasattr(f, 'truncate'): --- 88,137 ---- print 'play around with seek() and read() with the built largefile' f = open(name, 'rb') ! try: ! expect(f.tell(), 0) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! f.seek(0) ! expect(f.tell(), 0) ! f.seek(0, 0) ! expect(f.tell(), 0) ! f.seek(42) ! expect(f.tell(), 42) ! f.seek(42, 0) ! expect(f.tell(), 42) ! f.seek(42, 1) ! expect(f.tell(), 84) ! f.seek(0, 1) ! expect(f.tell(), 84) ! f.seek(0, 2) # seek from the end ! expect(f.tell(), size + 1 + 0) ! f.seek(-10, 2) ! expect(f.tell(), size + 1 - 10) ! f.seek(-size-1, 2) ! expect(f.tell(), 0) ! f.seek(size) ! expect(f.tell(), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of file above ! f.seek(-size-1, 1) ! expect(f.read(1), 'z') ! expect(f.tell(), 1) ! finally: ! f.close() if test_support.verbose: print 'play around with os.lseek() with the built largefile' f = open(name, 'rb') ! try: ! expect(os.lseek(f.fileno(), 0, 0), 0) ! expect(os.lseek(f.fileno(), 42, 0), 42) ! expect(os.lseek(f.fileno(), 42, 1), 84) ! expect(os.lseek(f.fileno(), 0, 1), 84) ! expect(os.lseek(f.fileno(), 0, 2), size+1+0) ! expect(os.lseek(f.fileno(), -10, 2), size+1-10) ! expect(os.lseek(f.fileno(), -size-1, 2), 0) ! expect(os.lseek(f.fileno(), size, 0), size) ! expect(f.read(1), 'a') # the 'a' that was written at the end of file above ! finally: ! f.close() if hasattr(f, 'truncate'): *************** *** 133,162 **** print 'try truncate' f = open(name, 'r+b') ! f.seek(0, 2) ! expect(f.tell(), size+1) # else we've lost track of the true size ! # Cut it back via seek + truncate with no argument. ! newsize = size - 10 ! f.seek(newsize) ! f.truncate() ! expect(f.tell(), newsize) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # Ensure that truncate(smaller than true size) shrinks the file. ! newsize -= 1 ! f.seek(42) ! f.truncate(newsize) ! expect(f.tell(), 42) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # XXX truncate(larger than true size) is ill-defined across platforms ! # cut it waaaaay back ! f.seek(0) ! f.truncate(1) ! expect(f.tell(), 0) # else pointer moved ! expect(len(f.read()), 1) # else wasn't truncated ! f.close() os.unlink(name) --- 139,170 ---- print 'try truncate' f = open(name, 'r+b') ! try: ! f.seek(0, 2) ! expect(f.tell(), size+1) # else we've lost track of the true size ! # Cut it back via seek + truncate with no argument. ! newsize = size - 10 ! f.seek(newsize) ! f.truncate() ! expect(f.tell(), newsize) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # Ensure that truncate(smaller than true size) shrinks the file. ! newsize -= 1 ! f.seek(42) ! f.truncate(newsize) ! expect(f.tell(), 42) # else pointer moved ! f.seek(0, 2) ! expect(f.tell(), newsize) # else wasn't truncated ! # XXX truncate(larger than true size) is ill-defined across platforms ! # cut it waaaaay back ! f.seek(0) ! f.truncate(1) ! expect(f.tell(), 0) # else pointer moved ! expect(len(f.read()), 1) # else wasn't truncated ! finally: ! f.close() os.unlink(name) From rhettinger at users.sourceforge.net Tue Aug 26 22:55:54 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 00:56:28 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.847,1.848 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv26091/Misc Modified Files: NEWS Log Message: SF bug #795506: Wrong handling of string format code for float values. Adding missing support for '%F'. Will backport to 2.3.1. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.847 retrieving revision 1.848 diff -C2 -d -r1.847 -r1.848 *** NEWS 25 Aug 2003 04:37:23 -0000 1.847 --- NEWS 27 Aug 2003 04:55:52 -0000 1.848 *************** *** 13,16 **** --- 13,19 ---- ----------------- + - The % formatting operator now supports '%F' which is equivalent to + '%f'. This has always been documented but never implemented. + - complex(obj) could leak a little memory if obj wasn't a string or number. From rhettinger at users.sourceforge.net Tue Aug 26 22:55:54 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 00:56:38 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.209, 2.210 unicodeobject.c, 2.194, 2.195 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv26091/Objects Modified Files: stringobject.c unicodeobject.c Log Message: SF bug #795506: Wrong handling of string format code for float values. Adding missing support for '%F'. Will backport to 2.3.1. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.209 retrieving revision 2.210 diff -C2 -d -r2.209 -r2.210 *** stringobject.c 18 Jun 2003 14:17:01 -0000 2.209 --- stringobject.c 27 Aug 2003 04:55:51 -0000 2.210 *************** *** 3922,3927 **** --- 3922,3930 ---- case 'E': case 'f': + case 'F': case 'g': case 'G': + if (c == 'F') + c = 'f'; pbuf = formatbuf; len = formatfloat(pbuf, sizeof(formatbuf), Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.194 retrieving revision 2.195 diff -C2 -d -r2.194 -r2.195 *** unicodeobject.c 15 Aug 2003 16:52:19 -0000 2.194 --- unicodeobject.c 27 Aug 2003 04:55:51 -0000 2.195 *************** *** 6541,6546 **** --- 6541,6549 ---- case 'E': case 'f': + case 'F': case 'g': case 'G': + if (c == 'F') + c = 'f'; pbuf = formatbuf; len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), From rhettinger at users.sourceforge.net Tue Aug 26 22:55:54 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 00:56:46 2003 Subject: [Python-checkins] python/dist/src/Lib/test string_tests.py, 1.32, 1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv26091/Lib/test Modified Files: string_tests.py Log Message: SF bug #795506: Wrong handling of string format code for float values. Adding missing support for '%F'. Will backport to 2.3.1. Index: string_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** string_tests.py 24 Apr 2003 16:02:50 -0000 1.32 --- string_tests.py 27 Aug 2003 04:55:52 -0000 1.33 *************** *** 551,554 **** --- 551,555 ---- self.checkequal(' 42', '%3ld', '__mod__', 42) self.checkequal('0042.00', '%07.2f', '__mod__', 42) + self.checkequal('0042.00', '%07.2F', '__mod__', 42) self.checkraises(TypeError, 'abc', '__mod__') From rhettinger at users.sourceforge.net Tue Aug 26 23:08:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 01:08:25 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.17,1.831.4.18 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv27943/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF bug #795506: Wrong handling of string format code for float values. Added missing support for '%F' as had been documented. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.17 retrieving revision 1.831.4.18 diff -C2 -d -r1.831.4.17 -r1.831.4.18 *** NEWS 19 Aug 2003 04:50:31 -0000 1.831.4.17 --- NEWS 27 Aug 2003 05:08:19 -0000 1.831.4.18 *************** *** 13,16 **** --- 13,19 ---- ----------------- + - Bug #795506: The % formatting operator did not support '%F' as + had been documented. + - Bug #775985: Only set stdout.encoding if a codec is available. From rhettinger at users.sourceforge.net Tue Aug 26 23:08:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 01:08:34 2003 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.209, 2.209.8.1 unicodeobject.c, 2.190.6.4, 2.190.6.5 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv27943/Objects Modified Files: Tag: release23-maint stringobject.c unicodeobject.c Log Message: SF bug #795506: Wrong handling of string format code for float values. Added missing support for '%F' as had been documented. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.209 retrieving revision 2.209.8.1 diff -C2 -d -r2.209 -r2.209.8.1 *** stringobject.c 18 Jun 2003 14:17:01 -0000 2.209 --- stringobject.c 27 Aug 2003 05:08:19 -0000 2.209.8.1 *************** *** 3922,3927 **** --- 3922,3930 ---- case 'E': case 'f': + case 'F': case 'g': case 'G': + if (c == 'F') + c = 'f'; pbuf = formatbuf; len = formatfloat(pbuf, sizeof(formatbuf), Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.4 retrieving revision 2.190.6.5 diff -C2 -d -r2.190.6.4 -r2.190.6.5 *** unicodeobject.c 15 Aug 2003 16:52:33 -0000 2.190.6.4 --- unicodeobject.c 27 Aug 2003 05:08:19 -0000 2.190.6.5 *************** *** 6541,6546 **** --- 6541,6549 ---- case 'E': case 'f': + case 'F': case 'g': case 'G': + if (c == 'F') + c = 'f'; pbuf = formatbuf; len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), From rhettinger at users.sourceforge.net Tue Aug 26 23:08:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Aug 27 01:08:44 2003 Subject: [Python-checkins] python/dist/src/Lib/test string_tests.py, 1.32, 1.32.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv27943/Lib/test Modified Files: Tag: release23-maint string_tests.py Log Message: SF bug #795506: Wrong handling of string format code for float values. Added missing support for '%F' as had been documented. Index: string_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v retrieving revision 1.32 retrieving revision 1.32.10.1 diff -C2 -d -r1.32 -r1.32.10.1 *** string_tests.py 24 Apr 2003 16:02:50 -0000 1.32 --- string_tests.py 27 Aug 2003 05:08:19 -0000 1.32.10.1 *************** *** 551,554 **** --- 551,555 ---- self.checkequal(' 42', '%3ld', '__mod__', 42) self.checkequal('0042.00', '%07.2f', '__mod__', 42) + self.checkequal('0042.00', '%07.2F', '__mod__', 42) self.checkraises(TypeError, 'abc', '__mod__') From theller at users.sourceforge.net Wed Aug 27 04:48:14 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Aug 27 06:48:18 2003 Subject: [Python-checkins] python/dist/src/Lib UserString.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv15177 Modified Files: UserString.py Log Message: Remove a typo. (Or is this some markup I don't understand? ;-) Index: UserString.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserString.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** UserString.py 10 Apr 2003 22:35:31 -0000 1.17 --- UserString.py 27 Aug 2003 10:48:12 -0000 1.18 *************** *** 133,137 **** people from inventing their own mutable string class derived from UserString and than forget thereby to remove (override) the ! __hash__ method inherited from ^UserString. This would lead to errors that would be very hard to track down. --- 133,137 ---- people from inventing their own mutable string class derived from UserString and than forget thereby to remove (override) the ! __hash__ method inherited from UserString. This would lead to errors that would be very hard to track down. From theller at users.sourceforge.net Wed Aug 27 04:49:36 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Aug 27 06:49:39 2003 Subject: [Python-checkins] python/dist/src/Lib UserString.py,1.17,1.17.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv15362 Modified Files: Tag: release23-maint UserString.py Log Message: Remove a typo. Index: UserString.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserString.py,v retrieving revision 1.17 retrieving revision 1.17.10.1 diff -C2 -d -r1.17 -r1.17.10.1 *** UserString.py 10 Apr 2003 22:35:31 -0000 1.17 --- UserString.py 27 Aug 2003 10:49:34 -0000 1.17.10.1 *************** *** 133,137 **** people from inventing their own mutable string class derived from UserString and than forget thereby to remove (override) the ! __hash__ method inherited from ^UserString. This would lead to errors that would be very hard to track down. --- 133,137 ---- people from inventing their own mutable string class derived from UserString and than forget thereby to remove (override) the ! __hash__ method inherited from UserString. This would lead to errors that would be very hard to track down. From fdrake at users.sourceforge.net Wed Aug 27 09:10:23 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Aug 27 11:10:54 2003 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib.tex, 1.40.8.5, 1.40.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv29699 Modified Files: Tag: release22-maint liburllib.tex Log Message: remove extra word occurance; reported to webmaster Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.40.8.5 retrieving revision 1.40.8.6 diff -C2 -d -r1.40.8.5 -r1.40.8.6 *** liburllib.tex 12 Jul 2003 07:35:35 -0000 1.40.8.5 --- liburllib.tex 27 Aug 2003 15:10:20 -0000 1.40.8.6 *************** *** 119,123 **** actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! that an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different --- 119,123 ---- actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different From fdrake at users.sourceforge.net Wed Aug 27 09:10:56 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Aug 27 11:11:43 2003 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib.tex, 1.50, 1.50.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv29792 Modified Files: Tag: release23-maint liburllib.tex Log Message: remove extra word occurance; reported to webmaster Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.50 retrieving revision 1.50.8.1 diff -C2 -d -r1.50 -r1.50.8.1 *** liburllib.tex 12 Jul 2003 07:33:31 -0000 1.50 --- liburllib.tex 27 Aug 2003 15:10:54 -0000 1.50.8.1 *************** *** 147,151 **** actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! that an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different --- 147,151 ---- actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different From fdrake at users.sourceforge.net Wed Aug 27 09:11:42 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Aug 27 11:11:55 2003 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib.tex,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv29902 Modified Files: liburllib.tex Log Message: remove extra word occurance; reported to webmaster Index: liburllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** liburllib.tex 12 Jul 2003 07:33:31 -0000 1.50 --- liburllib.tex 27 Aug 2003 15:11:40 -0000 1.51 *************** *** 147,151 **** actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! that an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different --- 147,151 ---- actions. To override this functionality, programmers can create a subclass of \class{URLopener} or \class{FancyURLopener}, then assign ! an instance of that class to the \code{urllib._urlopener} variable before calling the desired function. For example, applications may want to specify a different From theller at users.sourceforge.net Wed Aug 27 14:19:37 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Aug 27 16:19:41 2003 Subject: [Python-checkins] python/dist/src/Lib compileall.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv28168 Modified Files: compileall.py Log Message: Fix typo in docstring: The switch is '-x', not '-s'. Will backport to 2.3 myself. Index: compileall.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compileall.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** compileall.py 16 Jan 2003 11:02:43 -0000 1.14 --- compileall.py 27 Aug 2003 20:19:35 -0000 1.15 *************** *** 111,115 **** print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ ! "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" --- 111,115 ---- print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ ! "[-x regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" From theller at users.sourceforge.net Wed Aug 27 14:21:09 2003 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Wed Aug 27 16:21:36 2003 Subject: [Python-checkins] python/dist/src/Lib compileall.py,1.14,1.14.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv28517 Modified Files: Tag: release23-maint compileall.py Log Message: Fix typo in docstring: The switch is '-x', not '-s'. Index: compileall.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compileall.py,v retrieving revision 1.14 retrieving revision 1.14.12.1 diff -C2 -d -r1.14 -r1.14.12.1 *** compileall.py 16 Jan 2003 11:02:43 -0000 1.14 --- compileall.py 27 Aug 2003 20:21:06 -0000 1.14.12.1 *************** *** 111,115 **** print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ ! "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" --- 111,115 ---- print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ ! "[-x regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" From jhylton at users.sourceforge.net Wed Aug 27 20:09:28 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Aug 27 22:09:33 2003 Subject: [Python-checkins] python/dist/src/Lib/compiler symbols.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv31985 Modified Files: symbols.py Log Message: Fix SF bug [ 788011 ] compiler.compileFile fails on csv.py Bug fix candidate. Index: symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/symbols.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** symbols.py 31 Dec 2002 18:17:42 -0000 1.12 --- symbols.py 28 Aug 2003 02:09:26 -0000 1.13 *************** *** 221,225 **** self.handle_free_vars(scope, parent) ! def visitLambda(self, node, parent): for n in node.defaults: self.visit(n, parent) --- 221,230 ---- self.handle_free_vars(scope, parent) ! def visitLambda(self, node, parent, assign=0): ! # Lambda is an expression, so it could appear in an expression ! # context where assign is passed. The transformer should catch ! # any code that has a lambda on the left-hand side. ! assert not assign ! for n in node.defaults: self.visit(n, parent) From jhylton at users.sourceforge.net Thu Aug 28 08:42:16 2003 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Aug 28 10:42:20 2003 Subject: [Python-checkins] python/dist/src/Python compile.c,2.291,2.292 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv11600 Modified Files: compile.c Log Message: Fix for SF bug [ 784075 ] Fatal Python error: unknown scope Make sure the inner function is not compiled when there is a syntax error in the default arguments. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.291 retrieving revision 2.292 diff -C2 -d -r2.291 -r2.292 *** compile.c 15 Jul 2003 20:23:26 -0000 2.291 --- compile.c 28 Aug 2003 14:42:14 -0000 2.292 *************** *** 3667,3674 **** } static int com_argdefs(struct compiling *c, node *n) { ! int i, nch, nargs, ndefs; if (TYPE(n) == lambdef) { /* lambdef: 'lambda' [varargslist] ':' test */ --- 3667,3680 ---- } + /* Return the number of default values in the argument list. + + If a non-default argument follows a default argument, set an + exception and return -1. + */ + static int com_argdefs(struct compiling *c, node *n) { ! int i, nch, ndefs; if (TYPE(n) == lambdef) { /* lambdef: 'lambda' [varargslist] ':' test */ *************** *** 3687,3691 **** fpdef ['=' test] (',' fpdef ['=' test])* [','] */ nch = NCH(n); - nargs = 0; ndefs = 0; for (i = 0; i < nch; i++) { --- 3693,3696 ---- *************** *** 3694,3698 **** TYPE(CHILD(n, i)) == DOUBLESTAR) break; - nargs++; i++; if (i >= nch) --- 3699,3702 ---- *************** *** 3711,3717 **** else { /* Treat "(a=1, b)" as an error */ ! if (ndefs) com_error(c, PyExc_SyntaxError, "non-default argument follows default argument"); } if (t != COMMA) --- 3715,3723 ---- else { /* Treat "(a=1, b)" as an error */ ! if (ndefs) { com_error(c, PyExc_SyntaxError, "non-default argument follows default argument"); + return -1; + } } if (t != COMMA) *************** *** 3728,3731 **** --- 3734,3739 ---- REQ(n, funcdef); /* funcdef: 'def' NAME parameters ':' suite */ ndefs = com_argdefs(c, n); + if (ndefs < 0) + return; symtable_enter_scope(c->c_symtable, STR(CHILD(n, 1)), TYPE(n), n->n_lineno); From greg at users.sourceforge.net Thu Aug 28 15:50:32 2003 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Thu Aug 28 17:50:38 2003 Subject: [Python-checkins] python/dist/src/Lib/bsddb dbobj.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb In directory sc8-pr-cvs1:/tmp/cvs-serv353/bsddb Modified Files: dbobj.py Log Message: Support DBEnv.set_shm_key() to allow multi-threaded multi-process database environments to use shared memory on systems supporting it. Index: dbobj.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbobj.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dbobj.py 9 Jul 2003 04:45:59 -0000 1.7 --- dbobj.py 28 Aug 2003 21:50:30 -0000 1.8 *************** *** 40,43 **** --- 40,45 ---- def remove(self, *args, **kwargs): return apply(self._cobj.remove, args, kwargs) + def set_shm_key(self, *args, **kwargs): + return apply(self._cobj.set_shm_key, args, kwargs) def set_cachesize(self, *args, **kwargs): return apply(self._cobj.set_cachesize, args, kwargs) From greg at users.sourceforge.net Thu Aug 28 15:50:32 2003 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Thu Aug 28 17:50:47 2003 Subject: [Python-checkins] python/dist/src/Modules _bsddb.c,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv353/extsrc Modified Files: _bsddb.c Log Message: Support DBEnv.set_shm_key() to allow multi-threaded multi-process database environments to use shared memory on systems supporting it. Index: _bsddb.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** _bsddb.c 15 Jul 2003 19:12:54 -0000 1.17 --- _bsddb.c 28 Aug 2003 21:50:30 -0000 1.18 *************** *** 3278,3281 **** --- 3278,3296 ---- static PyObject* + DBEnv_set_shm_key(DBEnvObject* self, PyObject* args) + { + int err; + long shm_key = 0; + + if (!PyArg_ParseTuple(args, "l:set_shm_key", &shm_key)) + return NULL; + CHECK_ENV_NOT_CLOSED(self); + + err = self->db_env->set_shm_key(self->db_env, shm_key); + RETURN_IF_ERR(); + RETURN_NONE(); + } + + static PyObject* DBEnv_set_cachesize(DBEnvObject* self, PyObject* args) { *************** *** 4077,4080 **** --- 4092,4096 ---- {"set_timeout", (PyCFunction)DBEnv_set_timeout, METH_VARARGS|METH_KEYWORDS}, #endif + {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS}, {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS}, {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS}, From bcannon at users.sourceforge.net Thu Aug 28 20:28:56 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 28 22:29:20 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv12267/Lib Modified Files: _strptime.py Log Message: Make sure parentheses are escaped when used in the format string. Closes bug #796149 . Will be backported. Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** _strptime.py 11 Aug 2003 07:24:05 -0000 1.26 --- _strptime.py 29 Aug 2003 02:28:53 -0000 1.27 *************** *** 250,254 **** # The sub() call escapes all characters that might be misconstrued # as regex syntax. ! regex_chars = re_compile(r"([\\.^$*+?{}\[\]|])") format = regex_chars.sub(r"\\\1", format) whitespace_replacement = re_compile('\s+') --- 250,254 ---- # The sub() call escapes all characters that might be misconstrued # as regex syntax. ! regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])") format = regex_chars.sub(r"\\\1", format) whitespace_replacement = re_compile('\s+') From bcannon at users.sourceforge.net Thu Aug 28 20:28:56 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 28 22:29:34 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv12267/Lib/test Modified Files: test_strptime.py Log Message: Make sure parentheses are escaped when used in the format string. Closes bug #796149 . Will be backported. Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_strptime.py 11 Aug 2003 19:06:13 -0000 1.22 --- test_strptime.py 29 Aug 2003 02:28:54 -0000 1.23 *************** *** 334,337 **** --- 334,346 ---- " %s != %s" % (strp_output, defaults)) + def test_escaping(self): + # Make sure all characters that have regex significance are escaped. + # Parentheses are in a purposeful order; will cause an error of + # unbalanced parentheses when the regex is compiled if they are not + # escaped. + # Test instigated by bug #796149 . + need_escaping = ".^$*+?{}\[]|)(" + self.failUnless(_strptime.strptime(need_escaping, need_escaping)) + class Strptime12AMPMTests(unittest.TestCase): """Test a _strptime regression in '%I %p' at 12 noon (12 PM)""" From bcannon at users.sourceforge.net Thu Aug 28 20:34:25 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 28 23:39:52 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.18,1.831.4.19 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv13077/Misc Modified Files: Tag: release23-maint NEWS Log Message: _strptime.srptime() escaped parentheses in the format string properly. Closes bug #796149 . Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.18 retrieving revision 1.831.4.19 diff -C2 -d -r1.831.4.18 -r1.831.4.19 *** NEWS 27 Aug 2003 05:08:19 -0000 1.831.4.18 --- NEWS 29 Aug 2003 02:34:22 -0000 1.831.4.19 *************** *** 31,34 **** --- 31,37 ---- ------- + - Bug #796149: time.strptime() now handles having parentheses in the + format string properly. + - The email package handles some RFC 2231 parameters with missing CHARSET fields better. From bcannon at users.sourceforge.net Thu Aug 28 20:34:24 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 28 23:40:22 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_strptime.py, 1.19.4.3, 1.19.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv13077/Lib/test Modified Files: Tag: release23-maint test_strptime.py Log Message: _strptime.srptime() escaped parentheses in the format string properly. Closes bug #796149 . Index: test_strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_strptime.py,v retrieving revision 1.19.4.3 retrieving revision 1.19.4.4 diff -C2 -d -r1.19.4.3 -r1.19.4.4 *** test_strptime.py 11 Aug 2003 07:19:06 -0000 1.19.4.3 --- test_strptime.py 29 Aug 2003 02:34:22 -0000 1.19.4.4 *************** *** 384,387 **** --- 384,396 ---- " %s != %s" % (strp_output, defaults)) + def test_escaping(self): + # Make sure all characters that have regex significance are escaped. + # Parentheses are in a purposeful order; will cause an error of + # unbalanced parentheses when the regex is compiled if they are not + # escaped. + # Test instigated by bug #796149 . + need_escaping = ".^$*+?{}\[]|)(" + self.failUnless(_strptime.strptime(need_escaping, need_escaping)) + class Strptime12AMPMTests(unittest.TestCase): """Test a _strptime regression in '%I %p' at 12 noon (12 PM)""" From bcannon at users.sourceforge.net Thu Aug 28 20:34:24 2003 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Thu Aug 28 23:40:31 2003 Subject: [Python-checkins] python/dist/src/Lib _strptime.py, 1.23.4.3, 1.23.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv13077/Lib Modified Files: Tag: release23-maint _strptime.py Log Message: _strptime.srptime() escaped parentheses in the format string properly. Closes bug #796149 . Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.23.4.3 retrieving revision 1.23.4.4 diff -C2 -d -r1.23.4.3 -r1.23.4.4 *** _strptime.py 11 Aug 2003 07:19:05 -0000 1.23.4.3 --- _strptime.py 29 Aug 2003 02:34:22 -0000 1.23.4.4 *************** *** 382,386 **** # The sub() call escapes all characters that might be misconstrued # as regex syntax. ! regex_chars = re_compile(r"([\\.^$*+?{}\[\]|])") format = regex_chars.sub(r"\\\1", format) whitespace_replacement = re_compile('\s+') --- 382,386 ---- # The sub() call escapes all characters that might be misconstrued # as regex syntax. ! regex_chars = re_compile(r"([\\.^$*+?i\(\){}\[\]|])") format = regex_chars.sub(r"\\\1", format) whitespace_replacement = re_compile('\s+') From fdrake at users.sourceforge.net Thu Aug 28 22:09:28 2003 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Aug 29 00:10:17 2003 Subject: [Python-checkins] python/dist/src/Doc/html style.css,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory sc8-pr-cvs1:/tmp/cvs-serv24460 Modified Files: style.css Log Message: fix minor syntactic faux pas Index: style.css =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/style.css,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** style.css 16 Jul 2003 14:01:56 -0000 1.27 --- style.css 29 Aug 2003 04:09:26 -0000 1.28 *************** *** 50,54 **** h2 { font-size: 150%; } h3, h4 { font-size: 120%; } ! code, tt { font-family: lucida typewriter, lucidatypewriter, monospace; } var { font-family: times, serif; --- 50,54 ---- h2 { font-size: 150%; } h3, h4 { font-size: 120%; } ! code, tt { font-family: "lucida typewriter", lucidatypewriter, monospace; } var { font-family: times, serif; *************** *** 87,91 **** .verbatim pre { color: #00008b; ! font-family: lucida typewriter, lucidatypewriter, monospace; font-size: 90%; } --- 87,91 ---- .verbatim pre { color: #00008b; ! font-family: "lucida typewriter", lucidatypewriter, monospace; font-size: 90%; } From akuchling at users.sourceforge.net Fri Aug 29 11:49:29 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 13:50:32 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew22.tex, 1.62, 1.63 whatsnew23.tex, 1.160, 1.161 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv30107 Modified Files: whatsnew22.tex whatsnew23.tex Log Message: [Bug #780231] One of the changes described in the 2.3 "What's New" document actually occurred in 2.2. Move the description to whatsnew22.tex. [Bugfix candidate -- I'll backport to 2.3 (another 2.2 bugfix seems unlikely) Index: whatsnew22.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew22.tex,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** whatsnew22.tex 20 May 2003 18:12:21 -0000 1.62 --- whatsnew22.tex 29 Aug 2003 17:49:26 -0000 1.63 *************** *** 1227,1230 **** --- 1227,1257 ---- states for a given interpreter. (Contributed by David Beazley.) + \item The C-level interface to the garbage collector has been changed + to make it easier to write extension types that support garbage + collection and to debug misuses of the functions. + Various functions have slightly different semantics, so a bunch of + functions had to be renamed. Extensions that use the old API will + still compile but will \emph{not} participate in garbage collection, + so updating them for 2.2 should be considered fairly high priority. + + To upgrade an extension module to the new API, perform the following + steps: + + \begin{itemize} + + \item Rename \cfunction{Py_TPFLAGS_GC} to \cfunction{PyTPFLAGS_HAVE_GC}. + + \item Use \cfunction{PyObject_GC_New} or \cfunction{PyObject_GC_NewVar} to + allocate objects, and \cfunction{PyObject_GC_Del} to deallocate them. + + \item Rename \cfunction{PyObject_GC_Init} to \cfunction{PyObject_GC_Track} and + \cfunction{PyObject_GC_Fini} to \cfunction{PyObject_GC_UnTrack}. + + \item Remove \cfunction{PyGC_HEAD_SIZE} from object size calculations. + + \item Remove calls to \cfunction{PyObject_AS_GC} and \cfunction{PyObject_FROM_GC}. + + \end{itemize} + \item A new \samp{et} format sequence was added to \cfunction{PyArg_ParseTuple}; \samp{et} takes both a parameter and Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** whatsnew23.tex 30 Jul 2003 11:55:06 -0000 1.160 --- whatsnew23.tex 29 Aug 2003 17:49:26 -0000 1.161 *************** *** 2137,2167 **** \begin{itemize} - \item The C-level interface to the garbage collector has been changed - to make it easier to write extension types that support garbage - collection and to debug misuses of the functions. - Various functions have slightly different semantics, so a bunch of - functions had to be renamed. Extensions that use the old API will - still compile but will \emph{not} participate in garbage collection, - so updating them for 2.3 should be considered fairly high priority. - - To upgrade an extension module to the new API, perform the following - steps: - - \begin{itemize} - - \item Rename \cfunction{Py_TPFLAGS_GC} to \cfunction{PyTPFLAGS_HAVE_GC}. - - \item Use \cfunction{PyObject_GC_New} or \cfunction{PyObject_GC_NewVar} to - allocate objects, and \cfunction{PyObject_GC_Del} to deallocate them. - - \item Rename \cfunction{PyObject_GC_Init} to \cfunction{PyObject_GC_Track} and - \cfunction{PyObject_GC_Fini} to \cfunction{PyObject_GC_UnTrack}. - - \item Remove \cfunction{PyGC_HEAD_SIZE} from object size calculations. - - \item Remove calls to \cfunction{PyObject_AS_GC} and \cfunction{PyObject_FROM_GC}. - - \end{itemize} - \item The cycle detection implementation used by the garbage collection has proven to be stable, so it's now been made mandatory. You can no --- 2137,2140 ---- From akuchling at users.sourceforge.net Fri Aug 29 11:51:08 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 13:52:32 2003 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew22.tex, 1.62, 1.62.8.1 whatsnew23.tex, 1.159.2.1, 1.159.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv30721 Modified Files: Tag: release23-branch whatsnew22.tex whatsnew23.tex Log Message: [Backport of bug #780231] One of the changes described in the 2.3 "What's New" document actually occurred in 2.2. Move the description to whatsnew22.tex. Index: whatsnew22.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew22.tex,v retrieving revision 1.62 retrieving revision 1.62.8.1 diff -C2 -d -r1.62 -r1.62.8.1 *** whatsnew22.tex 20 May 2003 18:12:21 -0000 1.62 --- whatsnew22.tex 29 Aug 2003 17:51:06 -0000 1.62.8.1 *************** *** 1227,1230 **** --- 1227,1257 ---- states for a given interpreter. (Contributed by David Beazley.) + \item The C-level interface to the garbage collector has been changed + to make it easier to write extension types that support garbage + collection and to debug misuses of the functions. + Various functions have slightly different semantics, so a bunch of + functions had to be renamed. Extensions that use the old API will + still compile but will \emph{not} participate in garbage collection, + so updating them for 2.3 should be considered fairly high priority. + + To upgrade an extension module to the new API, perform the following + steps: + + \begin{itemize} + + \item Rename \cfunction{Py_TPFLAGS_GC} to \cfunction{PyTPFLAGS_HAVE_GC}. + + \item Use \cfunction{PyObject_GC_New} or \cfunction{PyObject_GC_NewVar} to + allocate objects, and \cfunction{PyObject_GC_Del} to deallocate them. + + \item Rename \cfunction{PyObject_GC_Init} to \cfunction{PyObject_GC_Track} and + \cfunction{PyObject_GC_Fini} to \cfunction{PyObject_GC_UnTrack}. + + \item Remove \cfunction{PyGC_HEAD_SIZE} from object size calculations. + + \item Remove calls to \cfunction{PyObject_AS_GC} and \cfunction{PyObject_FROM_GC}. + + \end{itemize} + \item A new \samp{et} format sequence was added to \cfunction{PyArg_ParseTuple}; \samp{et} takes both a parameter and Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.159.2.1 retrieving revision 1.159.2.2 diff -C2 -d -r1.159.2.1 -r1.159.2.2 *** whatsnew23.tex 30 Jul 2003 16:44:31 -0000 1.159.2.1 --- whatsnew23.tex 29 Aug 2003 17:51:06 -0000 1.159.2.2 *************** *** 2137,2167 **** \begin{itemize} - \item The C-level interface to the garbage collector has been changed - to make it easier to write extension types that support garbage - collection and to debug misuses of the functions. - Various functions have slightly different semantics, so a bunch of - functions had to be renamed. Extensions that use the old API will - still compile but will \emph{not} participate in garbage collection, - so updating them for 2.3 should be considered fairly high priority. - - To upgrade an extension module to the new API, perform the following - steps: - - \begin{itemize} - - \item Rename \cfunction{Py_TPFLAGS_GC} to \cfunction{PyTPFLAGS_HAVE_GC}. - - \item Use \cfunction{PyObject_GC_New} or \cfunction{PyObject_GC_NewVar} to - allocate objects, and \cfunction{PyObject_GC_Del} to deallocate them. - - \item Rename \cfunction{PyObject_GC_Init} to \cfunction{PyObject_GC_Track} and - \cfunction{PyObject_GC_Fini} to \cfunction{PyObject_GC_UnTrack}. - - \item Remove \cfunction{PyGC_HEAD_SIZE} from object size calculations. - - \item Remove calls to \cfunction{PyObject_AS_GC} and \cfunction{PyObject_FROM_GC}. - - \end{itemize} - \item The cycle detection implementation used by the garbage collection has proven to be stable, so it's now been made mandatory. You can no --- 2137,2140 ---- From akuchling at users.sourceforge.net Fri Aug 29 12:12:26 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:12:33 2003 Subject: [Python-checkins] python/dist/src/Lib urllib.py,1.158,1.159 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv3152 Modified Files: urllib.py Log Message: [Bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** urllib.py 16 May 2003 01:45:14 -0000 1.158 --- urllib.py 29 Aug 2003 18:12:23 -0000 1.159 *************** *** 370,374 **** else: h.putrequest('GET', selector) ! if auth: h.putheader('Authorization: Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) --- 370,374 ---- else: h.putrequest('GET', selector) ! if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) From akuchling at users.sourceforge.net Fri Aug 29 12:13:13 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:13:21 2003 Subject: [Python-checkins] python/dist/src/Lib urllib.py,1.158,1.158.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv3287 Modified Files: Tag: release23-branch urllib.py Log Message: [Backport of bug #776542] open_https() generates a bad Authorization header because it calls .putheader() wrongly. Reported by Steffen Ries. Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.158 retrieving revision 1.158.6.1 diff -C2 -d -r1.158 -r1.158.6.1 *** urllib.py 16 May 2003 01:45:14 -0000 1.158 --- urllib.py 29 Aug 2003 18:13:11 -0000 1.158.6.1 *************** *** 370,374 **** else: h.putrequest('GET', selector) ! if auth: h.putheader('Authorization: Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) --- 370,374 ---- else: h.putrequest('GET', selector) ! if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: h.putheader(*args) From akuchling at users.sourceforge.net Fri Aug 29 12:37:39 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:38:30 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_curses.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv8037 Modified Files: test_curses.py Log Message: Add simple unit test for ascii.unctrl() function Index: test_curses.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_curses.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_curses.py 13 Aug 2003 23:08:39 -0000 1.4 --- test_curses.py 29 Aug 2003 18:37:37 -0000 1.5 *************** *** 195,198 **** --- 195,207 ---- curses.mouseinterval(10) + def unit_tests(): + from curses import ascii + for ch, expected in [('a', 'a'), ('A', 'A'), + (';', ';'), (' ', ' '), + ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@')]: + if ascii.unctrl(ch) != expected: + print 'curses.unctrl fails on character', repr(ch) + + def main(stdscr): *************** *** 204,209 **** --- 213,220 ---- curses.resetty() + if __name__ == '__main__': curses.wrapper(main) + unit_tests() else: try: *************** *** 212,213 **** --- 223,226 ---- finally: curses.endwin() + + unit_tests() From akuchling at users.sourceforge.net Fri Aug 29 12:40:05 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:40:48 2003 Subject: [Python-checkins] python/dist/src/Lib/curses ascii.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/curses In directory sc8-pr-cvs1:/tmp/cvs-serv8407 Modified Files: ascii.py Log Message: [Bug #790356] unctrl() doesn't work for full printable charset. Fix by Dave Cinege. Index: ascii.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/curses/ascii.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ascii.py 29 Sep 2002 00:25:51 -0000 1.5 --- ascii.py 29 Aug 2003 18:40:03 -0000 1.6 *************** *** 88,91 **** --- 88,93 ---- def unctrl(c): + if isprint(c): + return chr(_ctoi(c)) bits = _ctoi(c) if bits == 0x7f: From akuchling at users.sourceforge.net Fri Aug 29 12:49:07 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:49:25 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_curses.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv9816 Modified Files: test_curses.py Log Message: Add tests for meta- bit set Index: test_curses.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_curses.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_curses.py 29 Aug 2003 18:37:37 -0000 1.5 --- test_curses.py 29 Aug 2003 18:49:05 -0000 1.6 *************** *** 199,203 **** for ch, expected in [('a', 'a'), ('A', 'A'), (';', ';'), (' ', ' '), ! ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@')]: if ascii.unctrl(ch) != expected: print 'curses.unctrl fails on character', repr(ch) --- 199,206 ---- for ch, expected in [('a', 'a'), ('A', 'A'), (';', ';'), (' ', ' '), ! ('\x7f', '^?'), ('\n', '^J'), ('\0', '^@'), ! # Meta-bit characters ! ('\x8a', '!^J'), ('\xc1', '!A'), ! ]: if ascii.unctrl(ch) != expected: print 'curses.unctrl fails on character', repr(ch) From akuchling at users.sourceforge.net Fri Aug 29 12:51:01 2003 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Aug 29 14:51:10 2003 Subject: [Python-checkins] python/dist/src/Lib/curses ascii.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/curses In directory sc8-pr-cvs1:/tmp/cvs-serv10135 Modified Files: ascii.py Log Message: Rework previous fix slightly; the &0x20 test seems useless, and the isprint() check mustn't prevent the meta-bit check at the end Index: ascii.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/curses/ascii.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ascii.py 29 Aug 2003 18:40:03 -0000 1.6 --- ascii.py 29 Aug 2003 18:50:59 -0000 1.7 *************** *** 88,98 **** def unctrl(c): - if isprint(c): - return chr(_ctoi(c)) bits = _ctoi(c) if bits == 0x7f: rep = "^?" ! elif bits & 0x20: ! rep = chr((bits & 0x7f) | 0x20) else: rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20) --- 88,96 ---- def unctrl(c): bits = _ctoi(c) if bits == 0x7f: rep = "^?" ! elif isprint(bits & 0x7f): ! rep = chr(bits & 0x7f) else: rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20) From jackjansen at users.sourceforge.net Fri Aug 29 16:46:27 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri Aug 29 18:46:31 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX Makefile.panther, NONE, 1.1.2.1 setup.panther.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX In directory sc8-pr-cvs1:/tmp/cvs-serv28730 Added Files: Tag: release23-maint Makefile.panther setup.panther.py Log Message: A makefile and setup script to create the bits that are part of MacPython but not of Apple's Panther distribution: the waste module, the IDE and BuildApplet applets. --- NEW FILE: Makefile.panther --- # This Makefile is to be used *only* on Panther. # It installs the things that are available in MacPython but that are # ommitted from Apple's installation of Python 2.3. # all: install_waste install_IDE install_PackageManager install_IDLE \ install_BuildApplet installextras install_PythonLauncher VERSION=2.3 DESTDIR= PYTHONAPPSDIR=/Applications/MacPython-$(VERSION) APPLE_prefix=/System/Library/Frameworks/Python.framework/Versions/$(VERSION) APPLE_PYTHON=/usr/bin/python$(VERSION) APPLE_LIBDEST=$(APPLE_prefix)/lib/python$(VERSION) APPLE_PYTHONW=$(APPLE_prefix)/Resources/Python.app/Contents/MacOS/Python APPLE_PYTHONLAUNCHER=$(APPLE_prefix)/Resources/PythonLauncher.app install_waste: $(APPLE_PYTHON) setup.panther.py install \ --prefix=$(APPLE_prefix) --root=/$(DESTDIR) install_IDE: $(MAKE) -f Makefile install_IDE \ BUILDPYTHON=$(APPLE_PYTHON) INSTALLED_PYTHONW=$(APPLE_PYTHONW) \ DESTDIR=$(DESTDIR) PYTHONAPPSDIR=$(PYTHONAPPSDIR) install_PackageManager: $(MAKE) -f Makefile install_PackageManager \ BUILDPYTHON=$(APPLE_PYTHON) INSTALLED_PYTHONW=$(APPLE_PYTHONW) \ DESTDIR=$(DESTDIR) PYTHONAPPSDIR=$(PYTHONAPPSDIR) install_IDLE: $(MAKE) -f Makefile install_IDLE \ BUILDPYTHON=$(APPLE_PYTHON) INSTALLED_PYTHONW=$(APPLE_PYTHONW) \ DESTDIR=$(DESTDIR) PYTHONAPPSDIR=$(PYTHONAPPSDIR) install_BuildApplet: $(MAKE) -f Makefile install_BuildApplet \ BUILDPYTHON=$(APPLE_PYTHON) INSTALLED_PYTHONW=$(APPLE_PYTHONW) \ DESTDIR=$(DESTDIR) PYTHONAPPSDIR=$(PYTHONAPPSDIR) installextras: $(MAKE) -f Makefile installextras \ BUILDPYTHON=$(APPLE_PYTHON) INSTALLED_PYTHONW=$(APPLE_PYTHONW) \ DESTDIR=$(DESTDIR) PYTHONAPPSDIR=$(PYTHONAPPSDIR) install_PythonLauncher: ln -fsn $(APPLE_PYTHONLAUNCHER) $(DESTDIR)$(PYTHONAPPSDIR)/PythonLauncher --- NEW FILE: setup.panther.py --- from distutils.core import Extension, setup from distutils import sysconfig import os SRCDIR=os.path.realpath(os.path.join(os.getcwd(), "../..")) def find_file(filename, std_dirs, paths): """Searches for the directory where a given file is located, and returns a possibly-empty list of additional directories, or None if the file couldn't be found at all. 'filename' is the name of a file, such as readline.h or libcrypto.a. 'std_dirs' is the list of standard system directories; if the file is found in one of them, no additional directives are needed. 'paths' is a list of additional locations to check; if the file is found in one of them, the resulting list will contain the directory. """ # Check the standard locations for dir in std_dirs: f = os.path.join(dir, filename) if os.path.exists(f): return [] # Check the additional directories for dir in paths: f = os.path.join(dir, filename) if os.path.exists(f): return [dir] # Not found anywhere return None def find_library_file(compiler, libname, std_dirs, paths): filename = compiler.library_filename(libname, lib_type='shared') result = find_file(filename, std_dirs, paths) if result is not None: return result filename = compiler.library_filename(libname, lib_type='static') result = find_file(filename, std_dirs, paths) return result def waste_Extension(): waste_incs = find_file("WASTE.h", [], ['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)]) if waste_incs != None: waste_libs = [os.path.join(os.path.split(waste_incs[0])[0], "Static Libraries")] srcdir = SRCDIR return [ Extension('waste', [os.path.join(srcdir, d) for d in 'Mac/Modules/waste/wastemodule.c', 'Mac/Wastemods/WEObjectHandlers.c', 'Mac/Wastemods/WETabHooks.c', 'Mac/Wastemods/WETabs.c' ], include_dirs = waste_incs + [ os.path.join(srcdir, 'Mac/Include'), os.path.join(srcdir, 'Mac/Wastemods') ], library_dirs = waste_libs, libraries = ['WASTE'], extra_link_args = ['-framework', 'Carbon'], ) ] return [] setup(name="MacPython for Jaguar extensions", version="2.3", ext_modules=waste_Extension() ) From rhettinger at users.sourceforge.net Fri Aug 29 17:10:00 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 19:10:04 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.17, 1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv32335/Lib/test Modified Files: test_itertools.py Log Message: SF bug #793826: using itertools.izip to mutate tuples Avoid Armin Rigo's dastardly exercise in re-entrancy. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_itertools.py 8 Aug 2003 05:10:41 -0000 1.17 --- test_itertools.py 29 Aug 2003 23:09:58 -0000 1.18 *************** *** 428,431 **** --- 428,461 ---- self.assertRaises(ZeroDivisionError, list, dropwhile(isOdd, E(s))) + class RegressionTests(unittest.TestCase): + + def test_sf_793826(self): + # Fix Armin Rigo's successful efforts to wreak havoc + + def mutatingtuple(tuple1, f, tuple2): + # this builds a tuple t which is a copy of tuple1, + # then calls f(t), then mutates t to be equal to tuple2 + # (needs len(tuple1) == len(tuple2)). + def g(value, first=[1]): + if first: + del first[:] + f(z.next()) + return value + items = list(tuple2) + items[1:1] = list(tuple1) + gen = imap(g, items) + z = izip(*[gen]*len(tuple1)) + z.next() + + def f(t): + global T + T = t + first[:] = list(T) + + first = [] + mutatingtuple((1,2,3), f, (4,5,6)) + second = list(T) + self.assertEqual(first, second) + libreftest = """ Doctest for examples in the library reference: libitertools.tex *************** *** 569,573 **** def test_main(verbose=None): ! test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC) test_support.run_unittest(*test_classes) --- 599,604 ---- def test_main(verbose=None): ! test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, ! RegressionTests) test_support.run_unittest(*test_classes) From rhettinger at users.sourceforge.net Fri Aug 29 17:10:00 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 19:10:13 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv32335/Modules Modified Files: itertoolsmodule.c Log Message: SF bug #793826: using itertools.izip to mutate tuples Avoid Armin Rigo's dastardly exercise in re-entrancy. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** itertoolsmodule.c 8 Aug 2003 05:10:41 -0000 1.19 --- itertoolsmodule.c 29 Aug 2003 23:09:58 -0000 1.20 *************** *** 1596,1609 **** return NULL; if (result->ob_refcnt == 1) { for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); assert(PyIter_Check(it)); item = (*it->ob_type->tp_iternext)(it); ! if (item == NULL) return NULL; Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } - Py_INCREF(result); } else { result = PyTuple_New(tuplesize); --- 1596,1611 ---- return NULL; if (result->ob_refcnt == 1) { + Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); assert(PyIter_Check(it)); item = (*it->ob_type->tp_iternext)(it); ! if (item == NULL) { ! Py_DECREF(result); return NULL; + } Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } } else { result = PyTuple_New(tuplesize); From rhettinger at users.sourceforge.net Fri Aug 29 17:13:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 19:13:21 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.18, 1.18.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv796/Modules Modified Files: Tag: release23-maint itertoolsmodule.c Log Message: SF bug #793826: using itertools.izip to mutate tuples Avoid Armin Rigo's dastardly exercise in re-entrancy. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.18 retrieving revision 1.18.6.1 diff -C2 -d -r1.18 -r1.18.6.1 *** itertoolsmodule.c 14 Jul 2003 07:07:12 -0000 1.18 --- itertoolsmodule.c 29 Aug 2003 23:13:16 -0000 1.18.6.1 *************** *** 1600,1613 **** if (result->ob_refcnt == 1) { for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); assert(PyIter_Check(it)); item = (*it->ob_type->tp_iternext)(it); ! if (item == NULL) return NULL; Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } - Py_INCREF(result); } else { result = PyTuple_New(tuplesize); --- 1600,1615 ---- if (result->ob_refcnt == 1) { + Py_INCREF(result); for (i=0 ; i < tuplesize ; i++) { it = PyTuple_GET_ITEM(lz->ittuple, i); assert(PyIter_Check(it)); item = (*it->ob_type->tp_iternext)(it); ! if (item == NULL) { ! Py_DECREF(result); return NULL; + } Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } } else { result = PyTuple_New(tuplesize); From rhettinger at users.sourceforge.net Fri Aug 29 17:13:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 19:13:33 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.15, 1.15.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv796/Lib/test Modified Files: Tag: release23-maint test_itertools.py Log Message: SF bug #793826: using itertools.izip to mutate tuples Avoid Armin Rigo's dastardly exercise in re-entrancy. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.15 retrieving revision 1.15.6.1 diff -C2 -d -r1.15 -r1.15.6.1 *** test_itertools.py 29 Jun 2003 20:36:23 -0000 1.15 --- test_itertools.py 29 Aug 2003 23:13:16 -0000 1.15.6.1 *************** *** 426,429 **** --- 426,459 ---- self.assertRaises(ZeroDivisionError, list, dropwhile(isOdd, E(s))) + class RegressionTests(unittest.TestCase): + + def test_sf_793826(self): + # Fix Armin Rigo's successful efforts to wreak havoc + + def mutatingtuple(tuple1, f, tuple2): + # this builds a tuple t which is a copy of tuple1, + # then calls f(t), then mutates t to be equal to tuple2 + # (needs len(tuple1) == len(tuple2)). + def g(value, first=[1]): + if first: + del first[:] + f(z.next()) + return value + items = list(tuple2) + items[1:1] = list(tuple1) + gen = imap(g, items) + z = izip(*[gen]*len(tuple1)) + z.next() + + def f(t): + global T + T = t + first[:] = list(T) + + first = [] + mutatingtuple((1,2,3), f, (4,5,6)) + second = list(T) + self.assertEqual(first, second) + libreftest = """ Doctest for examples in the library reference: libitertools.tex *************** *** 560,564 **** def test_main(verbose=None): ! test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC) test_support.run_unittest(*test_classes) --- 590,595 ---- def test_main(verbose=None): ! test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, ! RegressionTests) test_support.run_unittest(*test_classes) From rhettinger at users.sourceforge.net Fri Aug 29 18:10:09 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 20:10:12 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.20, 1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv8661 Modified Files: itertoolsmodule.c Log Message: For safety, replace a tuple entry before decreffing it. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** itertoolsmodule.c 29 Aug 2003 23:09:58 -0000 1.20 --- itertoolsmodule.c 30 Aug 2003 00:10:06 -0000 1.21 *************** *** 1592,1595 **** --- 1592,1596 ---- PyObject *it; PyObject *item; + PyObject *olditem; if (tuplesize == 0) *************** *** 1605,1610 **** return NULL; } ! Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } } else { --- 1606,1612 ---- return NULL; } ! olditem = PyTuple_GET_ITEM(result, i); PyTuple_SET_ITEM(result, i, item); + Py_DECREF(olditem); } } else { From rhettinger at users.sourceforge.net Fri Aug 29 18:11:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 20:11:22 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.18.6.1, 1.18.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv9146 Modified Files: Tag: release23-maint itertoolsmodule.c Log Message: For safety, replace a tuple entry before decreffing it. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.18.6.1 retrieving revision 1.18.6.2 diff -C2 -d -r1.18.6.1 -r1.18.6.2 *** itertoolsmodule.c 29 Aug 2003 23:13:16 -0000 1.18.6.1 --- itertoolsmodule.c 30 Aug 2003 00:11:16 -0000 1.18.6.2 *************** *** 1598,1601 **** --- 1598,1602 ---- PyObject *it; PyObject *item; + PyObject *olditem; if (result->ob_refcnt == 1) { *************** *** 1609,1614 **** return NULL; } ! Py_DECREF(PyTuple_GET_ITEM(result, i)); PyTuple_SET_ITEM(result, i, item); } } else { --- 1610,1616 ---- return NULL; } ! olditem = PyTuple_GET_ITEM(result, i); PyTuple_SET_ITEM(result, i, item); + Py_DECREF(olditem); } } else { From rhettinger at users.sourceforge.net Fri Aug 29 18:16:12 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 20:16:16 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.19,1.831.4.20 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv10855 Modified Files: Tag: release23-maint NEWS Log Message: SF bug #793826: using itertools.izip to mutate tuples Avoid Armin Rigo's dastardly exercise in re-entrancy. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.19 retrieving revision 1.831.4.20 diff -C2 -d -r1.831.4.19 -r1.831.4.20 *** NEWS 29 Aug 2003 02:34:22 -0000 1.831.4.19 --- NEWS 30 Aug 2003 00:16:08 -0000 1.831.4.20 *************** *** 21,24 **** --- 21,27 ---- ----------------- + - Bug #793826: re-ordered the reference counting code in + itertools.izip() to prevent re-entrancy anomalies. + - Bug #770485: cStringIO did not support the f.closed attribute. From rhettinger at users.sourceforge.net Fri Aug 29 19:24:21 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Aug 29 21:24:32 2003 Subject: [Python-checkins] python/dist/src/Lib random.py,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv19586 Modified Files: random.py Log Message: Eliminate unnecessary eval() in tests Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** random.py 9 Aug 2003 18:30:57 -0000 1.53 --- random.py 30 Aug 2003 01:24:19 -0000 1.54 *************** *** 688,695 **** ## -------------------- test program -------------------- ! def _test_generator(n, funccall): import time ! print n, 'times', funccall ! code = compile(funccall, funccall, 'eval') total = 0.0 sqsum = 0.0 --- 688,694 ---- ## -------------------- test program -------------------- ! def _test_generator(n, func, args): import time ! print n, 'times', func.__name__ total = 0.0 sqsum = 0.0 *************** *** 698,702 **** t0 = time.time() for i in range(n): ! x = eval(code) total += x sqsum = sqsum + x*x --- 697,701 ---- t0 = time.time() for i in range(n): ! x = func(*args) total += x sqsum = sqsum + x*x *************** *** 712,730 **** def _test(N=2000): ! _test_generator(N, 'random()') ! _test_generator(N, 'normalvariate(0.0, 1.0)') ! _test_generator(N, 'lognormvariate(0.0, 1.0)') ! _test_generator(N, 'vonmisesvariate(0.0, 1.0)') ! _test_generator(N, 'gammavariate(0.01, 1.0)') ! _test_generator(N, 'gammavariate(0.1, 1.0)') ! _test_generator(N, 'gammavariate(0.1, 2.0)') ! _test_generator(N, 'gammavariate(0.5, 1.0)') ! _test_generator(N, 'gammavariate(0.9, 1.0)') ! _test_generator(N, 'gammavariate(1.0, 1.0)') ! _test_generator(N, 'gammavariate(2.0, 1.0)') ! _test_generator(N, 'gammavariate(20.0, 1.0)') ! _test_generator(N, 'gammavariate(200.0, 1.0)') ! _test_generator(N, 'gauss(0.0, 1.0)') ! _test_generator(N, 'betavariate(3.0, 3.0)') # Create one instance, seeded from current time, and export its methods --- 711,729 ---- def _test(N=2000): ! _test_generator(N, random, ()) ! _test_generator(N, normalvariate, (0.0, 1.0)) ! _test_generator(N, lognormvariate, (0.0, 1.0)) ! _test_generator(N, vonmisesvariate, (0.0, 1.0)) ! _test_generator(N, gammavariate, (0.01, 1.0)) ! _test_generator(N, gammavariate, (0.1, 1.0)) ! _test_generator(N, gammavariate, (0.1, 2.0)) ! _test_generator(N, gammavariate, (0.5, 1.0)) ! _test_generator(N, gammavariate, (0.9, 1.0)) ! _test_generator(N, gammavariate, (1.0, 1.0)) ! _test_generator(N, gammavariate, (2.0, 1.0)) ! _test_generator(N, gammavariate, (20.0, 1.0)) ! _test_generator(N, gammavariate, (200.0, 1.0)) ! _test_generator(N, gauss, (0.0, 1.0)) ! _test_generator(N, betavariate, (3.0, 3.0)) # Create one instance, seeded from current time, and export its methods From rhettinger at users.sourceforge.net Sat Aug 30 08:43:57 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 10:44:02 2003 Subject: [Python-checkins] python/dist/src/Lib textwrap.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv20357 Modified Files: textwrap.py Log Message: SF bug 797650: Infinite loop in textwrap.py When the indents were set to longer than the width and long word breaking was enabled, an infinite loop would result because the inner loop did not assure that at least one character was stripped off on every pass. Index: textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** textwrap.py 15 Jun 2003 15:37:18 -0000 1.32 --- textwrap.py 30 Aug 2003 14:43:55 -0000 1.33 *************** *** 169,173 **** is too long to fit in any line. """ ! space_left = width - cur_len # If we're allowed to break long words, then do so: put as much --- 169,173 ---- is too long to fit in any line. """ ! space_left = max(width - cur_len, 1) # If we're allowed to break long words, then do so: put as much From rhettinger at users.sourceforge.net Sat Aug 30 08:43:57 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 10:44:13 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_textwrap.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv20357/test Modified Files: test_textwrap.py Log Message: SF bug 797650: Infinite loop in textwrap.py When the indents were set to longer than the width and long word breaking was enabled, an infinite loop would result because the inner loop did not assure that at least one character was stripped off on every pass. Index: test_textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** test_textwrap.py 8 May 2003 01:58:26 -0000 1.22 --- test_textwrap.py 30 Aug 2003 14:43:55 -0000 1.23 *************** *** 306,309 **** --- 306,319 ---- 'How *do* you spell that odd word, anyways?']) + # SF bug 797650. Prevent an infinite loop by making sure that at + # least one character gets split off on every pass. + self.check_wrap('-'*10+'hello', 10, + ['----------', + ' h', + ' e', + ' l', + ' l', + ' o'], + subsequent_indent = ' '*15) def test_nobreak_long(self): From rhettinger at users.sourceforge.net Sat Aug 30 08:52:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 10:52:41 2003 Subject: [Python-checkins] python/dist/src/Lib textwrap.py,1.32,1.32.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv22113/Lib Modified Files: Tag: release23-maint textwrap.py Log Message: SF bug 797650: Infinite loop in textwrap.py When the indents were set to longer than the width and long word breaking was enabled, an infinite loop would result because the inner loop did not assure that at least one character was stripped off on every pass. Index: textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v retrieving revision 1.32 retrieving revision 1.32.8.1 diff -C2 -d -r1.32 -r1.32.8.1 *** textwrap.py 15 Jun 2003 15:37:18 -0000 1.32 --- textwrap.py 30 Aug 2003 14:52:35 -0000 1.32.8.1 *************** *** 169,173 **** is too long to fit in any line. """ ! space_left = width - cur_len # If we're allowed to break long words, then do so: put as much --- 169,173 ---- is too long to fit in any line. """ ! space_left = max(width - cur_len, 1) # If we're allowed to break long words, then do so: put as much From rhettinger at users.sourceforge.net Sat Aug 30 08:52:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 10:52:52 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_textwrap.py, 1.22, 1.22.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv22113/Lib/test Modified Files: Tag: release23-maint test_textwrap.py Log Message: SF bug 797650: Infinite loop in textwrap.py When the indents were set to longer than the width and long word breaking was enabled, an infinite loop would result because the inner loop did not assure that at least one character was stripped off on every pass. Index: test_textwrap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_textwrap.py,v retrieving revision 1.22 retrieving revision 1.22.8.1 diff -C2 -d -r1.22 -r1.22.8.1 *** test_textwrap.py 8 May 2003 01:58:26 -0000 1.22 --- test_textwrap.py 30 Aug 2003 14:52:35 -0000 1.22.8.1 *************** *** 306,309 **** --- 306,319 ---- 'How *do* you spell that odd word, anyways?']) + # SF bug 797650. Prevent an infinite loop by making sure that at + # least one character gets split off on every pass. + self.check_wrap('-'*10+'hello', 10, + ['----------', + ' h', + ' e', + ' l', + ' l', + ' o'], + subsequent_indent = ' '*15) def test_nobreak_long(self): From rhettinger at users.sourceforge.net Sat Aug 30 08:52:37 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 10:53:00 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.20,1.831.4.21 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv22113/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF bug 797650: Infinite loop in textwrap.py When the indents were set to longer than the width and long word breaking was enabled, an infinite loop would result because the inner loop did not assure that at least one character was stripped off on every pass. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.20 retrieving revision 1.831.4.21 diff -C2 -d -r1.831.4.20 -r1.831.4.21 *** NEWS 30 Aug 2003 00:16:08 -0000 1.831.4.20 --- NEWS 30 Aug 2003 14:52:35 -0000 1.831.4.21 *************** *** 34,37 **** --- 34,40 ---- ------- + - Bug #797650: textwrap.py now avoids an infinite loop when one of the + indent arguments is set longer than the total width. + - Bug #796149: time.strptime() now handles having parentheses in the format string properly. From rhettinger at users.sourceforge.net Sat Aug 30 16:14:48 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:14:51 2003 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.18.6.2, 1.18.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv23105/Modules Modified Files: Tag: release23-maint itertoolsmodule.c Log Message: * Add news item for the previous bugfix * Backport itertoolsmodule.c 1.19 to re-sync Py2.3.1 with Py2.4. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.18.6.2 retrieving revision 1.18.6.3 diff -C2 -d -r1.18.6.2 -r1.18.6.3 *** itertoolsmodule.c 30 Aug 2003 00:11:16 -0000 1.18.6.2 --- itertoolsmodule.c 30 Aug 2003 22:14:46 -0000 1.18.6.3 *************** *** 1511,1520 **** int tuplesize = PySequence_Length(args); - if (tuplesize < 1) { - PyErr_SetString(PyExc_TypeError, - "izip() requires at least one sequence"); - return NULL; - } - /* args must be a tuple */ assert(PyTuple_Check(args)); --- 1511,1514 ---- *************** *** 1600,1603 **** --- 1594,1599 ---- PyObject *olditem; + if (tuplesize == 0) + return NULL; if (result->ob_refcnt == 1) { Py_INCREF(result); From rhettinger at users.sourceforge.net Sat Aug 30 16:14:48 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:15:03 2003 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.21,1.831.4.22 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv23105/Misc Modified Files: Tag: release23-maint NEWS Log Message: * Add news item for the previous bugfix * Backport itertoolsmodule.c 1.19 to re-sync Py2.3.1 with Py2.4. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.21 retrieving revision 1.831.4.22 diff -C2 -d -r1.831.4.21 -r1.831.4.22 *** NEWS 30 Aug 2003 14:52:35 -0000 1.831.4.21 --- NEWS 30 Aug 2003 22:14:45 -0000 1.831.4.22 *************** *** 22,26 **** - Bug #793826: re-ordered the reference counting code in ! itertools.izip() to prevent re-entrancy anomalies. - Bug #770485: cStringIO did not support the f.closed attribute. --- 22,28 ---- - Bug #793826: re-ordered the reference counting code in ! itertools.izip() to prevent re-entrancy anomalies. Also, ! if given zero arguments, it now returns an empty iterator ! rather than raising a type error. - Bug #770485: cStringIO did not support the f.closed attribute. From rhettinger at users.sourceforge.net Sat Aug 30 16:14:47 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:15:11 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.12.6.2, 1.12.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23105/Doc/lib Modified Files: Tag: release23-maint libitertools.tex Log Message: * Add news item for the previous bugfix * Backport itertoolsmodule.c 1.19 to re-sync Py2.3.1 with Py2.4. Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.12.6.2 retrieving revision 1.12.6.3 diff -C2 -d -r1.12.6.2 -r1.12.6.3 *** libitertools.tex 25 Aug 2003 05:04:22 -0000 1.12.6.2 --- libitertools.tex 30 Aug 2003 22:14:45 -0000 1.12.6.3 *************** *** 227,234 **** def izip(*iterables): iterables = map(iter, iterables) ! while True: result = [i.next() for i in iterables] yield tuple(result) \end{verbatim} \end{funcdesc} --- 227,237 ---- def izip(*iterables): iterables = map(iter, iterables) ! while iterables: result = [i.next() for i in iterables] yield tuple(result) \end{verbatim} + + \versionchanged[When no iterables are specified, returns a zero length + iterator instead of raising a TypeError exception]{2.3.1} \end{funcdesc} From rhettinger at users.sourceforge.net Sat Aug 30 16:17:02 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:17:06 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.15.6.1, 1.15.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv23521 Modified Files: Tag: release23-maint test_itertools.py Log Message: * Add news item for the previous bugfix * Backport itertoolsmodule.c 1.19 to re-sync Py2.3.1 with Py2.4. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.15.6.1 retrieving revision 1.15.6.2 diff -C2 -d -r1.15.6.1 -r1.15.6.2 *** test_itertools.py 29 Aug 2003 23:13:16 -0000 1.15.6.1 --- test_itertools.py 30 Aug 2003 22:16:59 -0000 1.15.6.2 *************** *** 88,92 **** self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3))) self.assertEqual(list(izip('abcdef')), zip('abcdef')) ! self.assertRaises(TypeError, izip) self.assertRaises(TypeError, izip, 3) self.assertRaises(TypeError, izip, range(3), 3) --- 88,92 ---- self.assertEqual(take(3,izip('abcdef', count())), zip('abcdef', range(3))) self.assertEqual(list(izip('abcdef')), zip('abcdef')) ! self.assertEqual(list(izip()), zip()) self.assertRaises(TypeError, izip, 3) self.assertRaises(TypeError, izip, range(3), 3) *************** *** 200,203 **** --- 200,205 ---- def test_StopIteration(self): + self.assertRaises(StopIteration, izip().next) + for f in (chain, cycle, izip): self.assertRaises(StopIteration, f([]).next) *************** *** 502,514 **** >>> def all(pred, seq): ... "Returns True if pred(x) is True for every element in the iterable" ! ... return not nth(ifilterfalse(pred, seq), 0) >>> def some(pred, seq): ... "Returns True if pred(x) is True for at least one element in the iterable" ! ... return bool(nth(ifilter(pred, seq), 0)) >>> def no(pred, seq): ... "Returns True if pred(x) is False for every element in the iterable" ! ... return not nth(ifilter(pred, seq), 0) >>> def padnone(seq): --- 504,520 ---- >>> 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)) >>> def padnone(seq): *************** *** 566,569 **** --- 572,578 ---- >>> no(lambda x: x%2==0, [1, 2, 5, 9]) False + + >>> quantify(lambda x: x%2==0, xrange(99)) + 50 >>> list(window('abc')) From rhettinger at users.sourceforge.net Sat Aug 30 16:54:57 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:55:02 2003 Subject: [Python-checkins] python/dist/src/Lib/test/output test_longexp, 1.3, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory sc8-pr-cvs1:/tmp/cvs-serv28037/output Removed Files: test_longexp Log Message: SF patch #736962: Port tests to unittest (Contributed by Walter Dörwald). * Convert three test modules to unittest format. * Expanded coverage in test_structseq.py. * Raymond added a new test in test_sets.py --- test_longexp DELETED --- From rhettinger at users.sourceforge.net Sat Aug 30 16:54:57 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 18:55:12 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_longexp.py, 1.8, 1.9 test_pep263.py, 1.2, 1.3 test_sets.py, 1.26, 1.27 test_structseq.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv28037 Modified Files: test_longexp.py test_pep263.py test_sets.py test_structseq.py Log Message: SF patch #736962: Port tests to unittest (Contributed by Walter Dörwald). * Convert three test modules to unittest format. * Expanded coverage in test_structseq.py. * Raymond added a new test in test_sets.py Index: test_longexp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_longexp.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_longexp.py 15 Jul 2002 12:03:19 -0000 1.8 --- test_longexp.py 30 Aug 2003 22:54:55 -0000 1.9 *************** *** 1,5 **** ! REPS = 65580 ! l = eval("[" + "2," * REPS + "]") ! print len(l) --- 1,14 ---- + import unittest + from test import test_support ! class LongExpText(unittest.TestCase): ! def test_longexp(self): ! REPS = 65580 ! l = eval("[" + "2," * REPS + "]") ! self.assertEqual(len(l), REPS) ! def test_main(): ! test_support.run_unittest(LongExpText) ! ! if __name__=="__main__": ! test_main() Index: test_pep263.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep263.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_pep263.py 9 Sep 2002 06:17:05 -0000 1.2 --- test_pep263.py 30 Aug 2003 22:54:55 -0000 1.3 *************** *** 1,3 **** ! #! -*- coding: koi8-r -*- ! assert u"ðÉÔÏÎ".encode("utf-8") == '\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' ! assert u"\ð".encode("utf-8") == '\\\xd0\x9f' --- 1,22 ---- ! #! -*- coding: koi8-r -*- ! ! import unittest ! from test import test_support ! ! class PEP263Test(unittest.TestCase): ! ! def test_pep263(self): ! self.assertEqual( ! u"ðÉÔÏÎ".encode("utf-8"), ! '\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' ! ) ! self.assertEqual( ! u"\ð".encode("utf-8"), ! '\\\xd0\x9f' ! ) ! ! def test_main(): ! test_support.run_unittest(PEP263Test) ! ! if __name__=="__main__": ! test_main() Index: test_sets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sets.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** test_sets.py 17 Aug 2003 08:34:09 -0000 1.26 --- test_sets.py 30 Aug 2003 22:54:55 -0000 1.27 *************** *** 597,600 **** --- 597,601 ---- else: self.assertRaises(TypeError, self.set.difference, self.other) + #------------------------------------------------------------------------------ *************** *** 648,651 **** --- 649,660 ---- self.otherIsIterable = True + #------------------------------------------------------------------------------ + + class TestOnlySetsofSets(TestOnlySetsInBinaryOps): + def setUp(self): + self.set = Set((1, 2, 3)) + self.other = [Set('ab'), ImmutableSet('cd')] + self.otherIsIterable = True + #============================================================================== *************** *** 802,805 **** --- 811,815 ---- TestOnlySetsString, TestOnlySetsGenerator, + TestOnlySetsofSets, TestCopyingEmpty, TestCopyingSingleton, Index: test_structseq.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_structseq.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_structseq.py 23 Jul 2002 19:04:04 -0000 1.4 --- test_structseq.py 30 Aug 2003 22:54:55 -0000 1.5 *************** *** 1,28 **** ! from test.test_support import vereq import time ! t = time.gmtime() ! astuple = tuple(t) ! vereq(len(t), len(astuple)) ! vereq(t, astuple) ! # Check that slicing works the same way; at one point, slicing t[i:j] with ! # 0 < i < j could produce NULLs in the result. ! for i in range(-len(t), len(t)): ! for j in range(-len(t), len(t)): ! vereq(t[i:j], astuple[i:j]) ! # Devious code could crash structseqs' contructors ! class C: ! def __getitem__(self, i): ! raise IndexError ! def __len__(self): ! return 9 ! try: ! repr(time.struct_time(C())) ! except: ! pass ! # XXX more needed --- 1,104 ---- ! import unittest ! from test import test_support import time ! class StructSeqTest(unittest.TestCase): ! def test_tuple(self): ! t = time.gmtime() ! astuple = tuple(t) ! self.assertEqual(len(t), len(astuple)) ! self.assertEqual(t, astuple) ! # Check that slicing works the same way; at one point, slicing t[i:j] with ! # 0 < i < j could produce NULLs in the result. ! for i in xrange(-len(t), len(t)): ! self.assertEqual(t[i:], astuple[i:]) ! for j in xrange(-len(t), len(t)): ! self.assertEqual(t[i:j], astuple[i:j]) ! for j in xrange(-len(t), len(t)): ! self.assertEqual(t[:j], astuple[:j]) ! self.assertRaises(IndexError, t.__getitem__, -len(t)-1) ! self.assertRaises(IndexError, t.__getitem__, len(t)) ! for i in xrange(-len(t), len(t)-1): ! self.assertEqual(t[i], astuple[i]) ! ! def test_repr(self): ! t = time.gmtime() ! repr(t) ! ! def test_concat(self): ! t1 = time.gmtime() ! t2 = t1 + tuple(t1) ! for i in xrange(len(t1)): ! self.assertEqual(t2[i], t2[i+len(t1)]) ! ! def test_repeat(self): ! t1 = time.gmtime() ! t2 = 3 * t1 ! for i in xrange(len(t1)): ! self.assertEqual(t2[i], t2[i+len(t1)]) ! self.assertEqual(t2[i], t2[i+2*len(t1)]) ! ! def test_contains(self): ! t1 = time.gmtime() ! for item in t1: ! self.assert_(item in t1) ! self.assert_(-42 not in t1) ! ! def test_hash(self): ! t1 = time.gmtime() ! self.assertEqual(hash(t1), hash(tuple(t1))) ! ! def test_cmp(self): ! t1 = time.gmtime() ! t2 = type(t1)(t1) ! self.assertEqual(t1, t2) ! self.assert_(not (t1 < t2)) ! self.assert_(t1 <= t2) ! self.assert_(not (t1 > t2)) ! self.assert_(t1 >= t2) ! self.assert_(not (t1 != t2)) ! ! def test_fields(self): ! t = time.gmtime() ! self.assertEqual(len(t), t.n_fields) ! self.assertEqual(t.n_fields, t.n_sequence_fields+t.n_unnamed_fields) ! ! def test_constructor(self): ! t = time.struct_time ! ! self.assertRaises(TypeError, t) ! self.assertRaises(TypeError, t, None) ! self.assertRaises(TypeError, t, "123") ! self.assertRaises(TypeError, t, "123", dict={}) ! self.assertRaises(TypeError, t, "123456789", dict=None) ! ! s = "123456789" ! self.assertEqual("".join(t(s)), s) ! ! def test_eviltuple(self): ! class Exc(Exception): ! pass ! ! # Devious code could crash structseqs' contructors ! class C: ! def __getitem__(self, i): ! raise Exc ! def __len__(self): ! return 9 ! ! self.assertRaises(Exc, time.struct_time, C()) ! ! def test_reduce(self): ! t = time.gmtime() ! x = t.__reduce__() ! ! def test_main(): ! test_support.run_unittest(StructSeqTest) ! ! if __name__ == "__main__": ! test_main() From rhettinger at users.sourceforge.net Sat Aug 30 17:21:34 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:21:37 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.201,1.202 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv936 Modified Files: tut.tex Log Message: SF patch #797868: Tutorial, sec. 5.1.4 could contain an extra example (Revised from the original patch contributed by Michal Pasternak.) Also, make a couple minor fixups elsewhere. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** tut.tex 23 Aug 2003 03:49:08 -0000 1.201 --- tut.tex 30 Aug 2003 23:21:32 -0000 1.202 *************** *** 123,127 **** single statement; \item ! statement grouping is done by indentation instead of begin/end brackets; \item --- 123,127 ---- single statement; \item ! statement grouping is done by indentation instead of beginning and ending brackets; \item *************** *** 518,522 **** Traceback (most recent call last): File "", line 1, in ? ! TypeError: can't convert complex to float; use e.g. abs(z) >>> a.real 3.0 --- 518,522 ---- Traceback (most recent call last): File "", line 1, in ? ! TypeError: can't convert complex to float; use abs(z) >>> a.real 3.0 *************** *** 1924,1927 **** --- 1924,1935 ---- >>> [vec1[i]*vec2[i] for i in range(len(vec1))] [8, 12, -54] + \end{verbatim} + + List comprehensions are much more flexible than \function{map()} and can be + applied to functions with more than one argument and to nested functions: + + \begin{verbatim} + >>> [str(round(355/113.0, i)) for i in range(1,6)] + ['3.1', '3.14', '3.142', '3.1416', '3.14159'] \end{verbatim} From rhettinger at users.sourceforge.net Sat Aug 30 17:24:39 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:24:42 2003 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.4, 1.196.8.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1:/tmp/cvs-serv2044 Modified Files: Tag: release23-maint tut.tex Log Message: SF patch #797868: Tutorial, sec. 5.1.4 could contain an extra example (Revised from the original patch contributed by Michal Pasternak.) Also, make a couple minor fixups elsewhere. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.4 retrieving revision 1.196.8.5 diff -C2 -d -r1.196.8.4 -r1.196.8.5 *** tut.tex 23 Aug 2003 03:47:56 -0000 1.196.8.4 --- tut.tex 30 Aug 2003 23:24:37 -0000 1.196.8.5 *************** *** 123,127 **** single statement; \item ! statement grouping is done by indentation instead of begin/end brackets; \item --- 123,127 ---- single statement; \item ! statement grouping is done by indentation instead of beginning and ending brackets; \item *************** *** 518,522 **** Traceback (most recent call last): File "", line 1, in ? ! TypeError: can't convert complex to float; use e.g. abs(z) >>> a.real 3.0 --- 518,522 ---- Traceback (most recent call last): File "", line 1, in ? ! TypeError: can't convert complex to float; use abs(z) >>> a.real 3.0 *************** *** 1929,1932 **** --- 1929,1940 ---- >>> [vec1[i]*vec2[i] for i in range(len(vec1))] [8, 12, -54] + \end{verbatim} + + List comprehensions are much more flexible than \function{map()} and can be + applied to functions with more than one argument and to nested functions: + + \begin{verbatim} + >>> [str(round(355/113.0, i)) for i in range(1,6)] + ['3.1', '3.14', '3.142', '3.1416', '3.14159'] \end{verbatim} From rhettinger at users.sourceforge.net Sat Aug 30 17:31:33 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:31:36 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.130, 1.131 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv2796 Modified Files: libstdtypes.tex Log Message: SF patch #797180: Bug 792656: slicing explained Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** libstdtypes.tex 8 Aug 2003 11:07:59 -0000 1.130 --- libstdtypes.tex 30 Aug 2003 23:31:31 -0000 1.131 *************** *** 531,536 **** \code{<=} \var{n} \code{<} \code{abs(i-j)}. If \var{i} or \var{j} is greater than \code{len(\var{s})}, use \code{len(\var{s})}. If ! \var{i} or \var{j} are ommitted then they become ``end'' values ! (which end depends on the sign of \var{k}). \end{description} --- 531,537 ---- \code{<=} \var{n} \code{<} \code{abs(i-j)}. If \var{i} or \var{j} is greater than \code{len(\var{s})}, use \code{len(\var{s})}. If ! \var{i} or \var{j} are omitted then they become ``end'' values ! (which end depends on the sign of \var{k}). Note, \var{k} cannot ! be zero. \end{description} From rhettinger at users.sourceforge.net Sat Aug 30 17:35:58 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:36:00 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129.8.1, 1.129.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3380 Modified Files: Tag: release23-maint libstdtypes.tex Log Message: SF patch #797180: Bug 792656: slicing explained Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129.8.1 retrieving revision 1.129.8.2 diff -C2 -d -r1.129.8.1 -r1.129.8.2 *** libstdtypes.tex 8 Aug 2003 11:05:59 -0000 1.129.8.1 --- libstdtypes.tex 30 Aug 2003 23:35:56 -0000 1.129.8.2 *************** *** 531,536 **** \code{<=} \var{n} \code{<} \code{abs(i-j)}. If \var{i} or \var{j} is greater than \code{len(\var{s})}, use \code{len(\var{s})}. If ! \var{i} or \var{j} are ommitted then they become ``end'' values ! (which end depends on the sign of \var{k}). \end{description} --- 531,537 ---- \code{<=} \var{n} \code{<} \code{abs(i-j)}. If \var{i} or \var{j} is greater than \code{len(\var{s})}, use \code{len(\var{s})}. If ! \var{i} or \var{j} are omitted then they become ``end'' values ! (which end depends on the sign of \var{k}). Note, \var{k} cannot ! be zero. \end{description} From rhettinger at users.sourceforge.net Sat Aug 30 17:39:18 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:39:21 2003 Subject: [Python-checkins] python/nondist/peps pep-0236.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv3728 Modified Files: pep-0236.txt Log Message: SF 795859: Fix typo. Index: pep-0236.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0236.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0236.txt 12 Jun 2003 13:54:00 -0000 1.11 --- pep-0236.txt 30 Aug 2003 23:39:16 -0000 1.12 *************** *** 319,323 **** A: By continuing to use 2.1, and not moving to 2.2 until you do change your code. The purpose of future_statement is to make life easier ! for people who keep keep current with the latest release in a timely fashion. We don't hate you if you don't, but your problems are much harder to solve, and somebody with those problems will need to --- 319,323 ---- A: By continuing to use 2.1, and not moving to 2.2 until you do change your code. The purpose of future_statement is to make life easier ! for people who keep current with the latest release in a timely fashion. We don't hate you if you don't, but your problems are much harder to solve, and somebody with those problems will need to From rhettinger at users.sourceforge.net Sat Aug 30 17:57:38 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:57:41 2003 Subject: [Python-checkins] python/nondist/peps pep-0289.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv6236 Modified Files: pep-0289.txt Log Message: Reference Tzot's patch Index: pep-0289.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0289.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0289.txt 8 Apr 2002 15:51:17 -0000 1.1 --- pep-0289.txt 30 Aug 2003 23:57:36 -0000 1.2 *************** *** 229,232 **** --- 229,234 ---- 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 From rhettinger at users.sourceforge.net Sat Aug 30 17:57:38 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:57:52 2003 Subject: [Python-checkins] python/dist/src/Objects complexobject.c, 2.68, 2.69 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv6235 Modified Files: complexobject.c Log Message: Remove 'e.g.' from error message Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.68 retrieving revision 2.69 diff -C2 -d -r2.68 -r2.69 *** complexobject.c 15 Aug 2003 01:16:37 -0000 2.68 --- complexobject.c 30 Aug 2003 23:57:36 -0000 2.69 *************** *** 611,615 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to int; use e.g. int(abs(z))"); return NULL; } --- 611,615 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to int; use int(abs(z))"); return NULL; } *************** *** 619,623 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to long; use e.g. long(abs(z))"); return NULL; } --- 619,623 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to long; use long(abs(z))"); return NULL; } *************** *** 627,631 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to float; use e.g. abs(z)"); return NULL; } --- 627,631 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to float; use abs(z)"); return NULL; } From rhettinger at users.sourceforge.net Sat Aug 30 17:58:22 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Aug 30 19:58:25 2003 Subject: [Python-checkins] python/dist/src/Objects complexobject.c, 2.67, 2.67.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv6371 Modified Files: Tag: release23-maint complexobject.c Log Message: Remove 'e.g.' from error message Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.67 retrieving revision 2.67.8.1 diff -C2 -d -r2.67 -r2.67.8.1 *** complexobject.c 17 Jun 2003 20:22:24 -0000 2.67 --- complexobject.c 30 Aug 2003 23:58:20 -0000 2.67.8.1 *************** *** 611,615 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to int; use e.g. int(abs(z))"); return NULL; } --- 611,615 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to int; use int(abs(z))"); return NULL; } *************** *** 619,623 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to long; use e.g. long(abs(z))"); return NULL; } --- 619,623 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to long; use long(abs(z))"); return NULL; } *************** *** 627,631 **** { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to float; use e.g. abs(z)"); return NULL; } --- 627,631 ---- { PyErr_SetString(PyExc_TypeError, ! "can't convert complex to float; use abs(z)"); return NULL; } From rhettinger at users.sourceforge.net Sat Aug 30 22:20:19 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 00:20:23 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libtimeit.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5112 Modified Files: libtimeit.tex Log Message: Fix long option markup. Index: libtimeit.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtimeit.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libtimeit.tex 10 May 2003 03:35:37 -0000 1.4 --- libtimeit.tex 31 Aug 2003 04:20:12 -0000 1.5 *************** *** 97,110 **** \begin{description} ! \item[-n N/--number=N] how many times to execute 'statement' ! \item[-r N/--repeat=N] how many times to repeat the timer (default 3) ! \item[-s S/--setup=S] statement to be executed once initially (default \code{'pass'}) ! \item[-t/--time] use \function{time.time()} (default on all platforms but Windows) ! \item[-c/--clock] use \function{time.clock()} (default on Windows) ! \item[-v/--verbose] print raw timing results; repeat for more digits precision ! \item[-h/--help] print a short usage message and exit \end{description} --- 97,110 ---- \begin{description} ! \item[-n N/\longprogramopt{number=N}] how many times to execute 'statement' ! \item[-r N/\longprogramopt{repeat=N}] how many times to repeat the timer (default 3) ! \item[-s S/\longprogramopt{setup=S}] statement to be executed once initially (default \code{'pass'}) ! \item[-t/\longprogramopt{time}] use \function{time.time()} (default on all platforms but Windows) ! \item[-c/\longprogramopt{clock}] use \function{time.clock()} (default on Windows) ! \item[-v/\longprogramopt{verbose}] print raw timing results; repeat for more digits precision ! \item[-h/\longprogramopt{help}] print a short usage message and exit \end{description} From rhettinger at users.sourceforge.net Sat Aug 30 22:21:44 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 00:21:47 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libtimeit.tex, 1.4, 1.4.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5248 Modified Files: Tag: release23-maint libtimeit.tex Log Message: SF bug 798006: Fix long option markup. Index: libtimeit.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtimeit.tex,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** libtimeit.tex 10 May 2003 03:35:37 -0000 1.4 --- libtimeit.tex 31 Aug 2003 04:21:42 -0000 1.4.10.1 *************** *** 97,110 **** \begin{description} ! \item[-n N/--number=N] how many times to execute 'statement' ! \item[-r N/--repeat=N] how many times to repeat the timer (default 3) ! \item[-s S/--setup=S] statement to be executed once initially (default \code{'pass'}) ! \item[-t/--time] use \function{time.time()} (default on all platforms but Windows) ! \item[-c/--clock] use \function{time.clock()} (default on Windows) ! \item[-v/--verbose] print raw timing results; repeat for more digits precision ! \item[-h/--help] print a short usage message and exit \end{description} --- 97,110 ---- \begin{description} ! \item[-n N/\longprogramopt{number=N}] how many times to execute 'statement' ! \item[-r N/\longprogramopt{repeat=N}] how many times to repeat the timer (default 3) ! \item[-s S/\longprogramopt{setup=S}] statement to be executed once initially (default \code{'pass'}) ! \item[-t/\longprogramopt{time}] use \function{time.time()} (default on all platforms but Windows) ! \item[-c/\longprogramopt{clock}] use \function{time.clock()} (default on Windows) ! \item[-v/\longprogramopt{verbose}] print raw timing results; repeat for more digits precision ! \item[-h/\longprogramopt{help}] print a short usage message and exit \end{description} From rhettinger at users.sourceforge.net Sat Aug 30 22:35:26 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 00:35:35 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_zlib.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6331 Modified Files: test_zlib.py Log Message: SF bug #785222: zlib monotonic test For smaller datasets, it is not always true the increasing the compression level always results in better compression. Removed the test which made this invalid assumption. Index: test_zlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zlib.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** test_zlib.py 1 May 2003 17:45:56 -0000 1.23 --- test_zlib.py 31 Aug 2003 04:35:24 -0000 1.24 *************** *** 97,111 **** self.assertEqual(zlib.decompress(x), data) - def test_monotonic(self): - # higher compression levels should not expand compressed size - data = hamlet_scene * 8 * 16 - last = length = len(zlib.compress(data, 0)) - self.failUnless(last > len(data), "compress level 0 always expands") - for level in range(10): - length = len(zlib.compress(data, level)) - self.failUnless(length <= last, - 'compress level %d more effective than %d!' % ( - level-1, level)) - last = length --- 97,100 ---- From rhettinger at users.sourceforge.net Sat Aug 30 22:37:27 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 00:37:31 2003 Subject: [Python-checkins] python/dist/src/Lib/test test_zlib.py, 1.23, 1.23.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv6632 Modified Files: Tag: release23-maint test_zlib.py Log Message: SF bug #785222: zlib monotonic test For smaller datasets, it is not always true the increasing the compression level always results in better compression. Removed the test which made this invalid assumption. Index: test_zlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_zlib.py,v retrieving revision 1.23 retrieving revision 1.23.8.1 diff -C2 -d -r1.23 -r1.23.8.1 *** test_zlib.py 1 May 2003 17:45:56 -0000 1.23 --- test_zlib.py 31 Aug 2003 04:37:25 -0000 1.23.8.1 *************** *** 97,111 **** self.assertEqual(zlib.decompress(x), data) - def test_monotonic(self): - # higher compression levels should not expand compressed size - data = hamlet_scene * 8 * 16 - last = length = len(zlib.compress(data, 0)) - self.failUnless(last > len(data), "compress level 0 always expands") - for level in range(10): - length = len(zlib.compress(data, level)) - self.failUnless(length <= last, - 'compress level %d more effective than %d!' % ( - level-1, level)) - last = length --- 97,100 ---- From rhettinger at users.sourceforge.net Sat Aug 30 23:09:54 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:09:57 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.127,1.128 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9655 Modified Files: libos.tex Log Message: SF patch #797157: Bug 794658: os.chmod docs, stat constants (Contributed by Christos Georgiou.) Reference the symbol definitions in the stat module. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** libos.tex 20 May 2003 16:21:51 -0000 1.127 --- libos.tex 31 Aug 2003 05:09:52 -0000 1.128 *************** *** 669,673 **** \begin{funcdesc}{chmod}{path, mode} Change the mode of \var{path} to the numeric \var{mode}. ! \var{mode} may take one of the following values: \begin{itemize} \item \code{S_ISUID} --- 669,674 ---- \begin{funcdesc}{chmod}{path, mode} Change the mode of \var{path} to the numeric \var{mode}. ! \var{mode} may take one of the following values ! (as defined in the \module{stat} module): \begin{itemize} \item \code{S_ISUID} From rhettinger at users.sourceforge.net Sat Aug 30 23:11:17 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:11:21 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex, 1.127, 1.127.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9867 Modified Files: Tag: release23-maint libos.tex Log Message: SF patch #797157: Bug 794658: os.chmod docs, stat constants (Contributed by Christos Georgiou.) Reference the symbol definitions in the stat module. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.127 retrieving revision 1.127.10.1 diff -C2 -d -r1.127 -r1.127.10.1 *** libos.tex 20 May 2003 16:21:51 -0000 1.127 --- libos.tex 31 Aug 2003 05:11:15 -0000 1.127.10.1 *************** *** 669,673 **** \begin{funcdesc}{chmod}{path, mode} Change the mode of \var{path} to the numeric \var{mode}. ! \var{mode} may take one of the following values: \begin{itemize} \item \code{S_ISUID} --- 669,674 ---- \begin{funcdesc}{chmod}{path, mode} Change the mode of \var{path} to the numeric \var{mode}. ! \var{mode} may take one of the following values ! (as defined in the \module{stat} module): \begin{itemize} \item \code{S_ISUID} From rhettinger at users.sourceforge.net Sat Aug 30 23:29:04 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:29:08 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex,1.102,1.103 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11614 Modified Files: libre.tex Log Message: SF bug #732120:An extended definition of "non-overlapping" would save time. Clarified the meaning of non-overlapping in patterns with zero length matches. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** libre.tex 12 Aug 2003 00:01:15 -0000 1.102 --- libre.tex 31 Aug 2003 05:29:02 -0000 1.103 *************** *** 548,552 **** return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the ! result. \versionadded{1.5.2} \end{funcdesc} --- 548,552 ---- return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the ! result unless they touch the beginning of another match. \versionadded{1.5.2} \end{funcdesc} *************** *** 555,559 **** Return an iterator over all non-overlapping matches for the RE \var{pattern} in \var{string}. For each match, the iterator returns ! a match object. Empty matches are included in the result. \versionadded{2.2} \end{funcdesc} --- 555,560 ---- Return an iterator over all non-overlapping matches for the RE \var{pattern} in \var{string}. For each match, the iterator returns ! a match object. Empty matches are included in the result unless they ! touch the beginning of another match. \versionadded{2.2} \end{funcdesc} From rhettinger at users.sourceforge.net Sat Aug 30 23:30:20 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:30:24 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libre.tex, 1.101.8.1, 1.101.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11884 Modified Files: Tag: release23-maint libre.tex Log Message: SF bug #732120:An extended definition of "non-overlapping" would save time. Clarified the meaning of non-overlapping in patterns with zero length matches. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.101.8.1 retrieving revision 1.101.8.2 diff -C2 -d -r1.101.8.1 -r1.101.8.2 *** libre.tex 11 Aug 2003 23:43:04 -0000 1.101.8.1 --- libre.tex 31 Aug 2003 05:30:18 -0000 1.101.8.2 *************** *** 548,552 **** return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the ! result. \versionadded{1.5.2} \end{funcdesc} --- 548,552 ---- return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the ! result unless they touch the beginning of another match. \versionadded{1.5.2} \end{funcdesc} *************** *** 555,559 **** Return an iterator over all non-overlapping matches for the RE \var{pattern} in \var{string}. For each match, the iterator returns ! a match object. Empty matches are included in the result. \versionadded{2.2} \end{funcdesc} --- 555,560 ---- Return an iterator over all non-overlapping matches for the RE \var{pattern} in \var{string}. For each match, the iterator returns ! a match object. Empty matches are included in the result unless they ! touch the beginning of another match. \versionadded{2.2} \end{funcdesc} From rhettinger at users.sourceforge.net Sat Aug 30 23:44:56 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:44:59 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13191 Modified Files: libcsv.tex Log Message: SF bug #797853: Small problems with the csv module's documentation Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libcsv.tex 2 Jul 2003 15:32:48 -0000 1.7 --- libcsv.tex 31 Aug 2003 05:44:54 -0000 1.8 *************** *** 46,50 **** ! \subsection{Module Contents} The \module{csv} module defines the following functions: --- 46,50 ---- ! \subsection{Module Contents \label{csv-contents}} The \module{csv} module defines the following functions: *************** *** 130,134 **** added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optiona \var{restval} parameter. All other parameters are interpreted as for \class{reader} objects. \end{classdesc} --- 130,134 ---- added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optional \var{restval} parameter. All other parameters are interpreted as for \class{reader} objects. \end{classdesc} *************** *** 219,223 **** instead of, the \var{dialect} parameter, the programmer can also specify individual formatting parameters, which have the same names as the ! attributes defined above for the \class{Dialect} class. Dialects support the following attributes: --- 219,223 ---- instead of, the \var{dialect} parameter, the programmer can also specify individual formatting parameters, which have the same names as the ! attributes defined below for the \class{Dialect} class. Dialects support the following attributes: *************** *** 252,257 **** \begin{memberdesc}[Dialect]{quoting} Controls when quotes should be generated by the writer. It can take on any ! of the \constant{QUOTE_*} constants defined below and defaults to ! \constant{QUOTE_MINIMAL}. \end{memberdesc} --- 252,257 ---- \begin{memberdesc}[Dialect]{quoting} Controls when quotes should be generated by the writer. It can take on any ! of the \constant{QUOTE_*} constants (see section~\ref{csv-contents}) ! and defaults to \constant{QUOTE_MINIMAL}. \end{memberdesc} *************** *** 265,269 **** Reader objects (\class{DictReader} instances and objects returned by ! the \function{reader()}function) have the following public methods: \begin{methoddesc}[csv reader]{next}{} --- 265,269 ---- Reader objects (\class{DictReader} instances and objects returned by ! the \function{reader()} function) have the following public methods: \begin{methoddesc}[csv reader]{next}{} From rhettinger at users.sourceforge.net Sat Aug 30 23:46:45 2003 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Aug 31 01:46:49 2003 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.7,1.7.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13419 Modified Files: Tag: release23-maint libcsv.tex Log Message: SF bug #797853: Small problems with the csv module's documentation Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.7 retrieving revision 1.7.8.1 diff -C2 -d -r1.7 -r1.7.8.1 *** libcsv.tex 2 Jul 2003 15:32:48 -0000 1.7 --- libcsv.tex 31 Aug 2003 05:46:43 -0000 1.7.8.1 *************** *** 46,50 **** ! \subsection{Module Contents} The \module{csv} module defines the following functions: --- 46,50 ---- ! \subsection{Module Contents \label{csv-contents}} The \module{csv} module defines the following functions: *************** *** 130,134 **** added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optiona \var{restval} parameter. All other parameters are interpreted as for \class{reader} objects. \end{classdesc} --- 130,134 ---- added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optional \var{restval} parameter. All other parameters are interpreted as for \class{reader} objects. \end{classdesc} *************** *** 219,223 **** instead of, the \var{dialect} parameter, the programmer can also specify individual formatting parameters, which have the same names as the ! attributes defined above for the \class{Dialect} class. Dialects support the following attributes: --- 219,223 ---- instead of, the \var{dialect} parameter, the programmer can also specify individual formatting parameters, which have the same names as the ! attributes defined below for the \class{Dialect} class. Dialects support the following attributes: *************** *** 252,257 **** \begin{memberdesc}[Dialect]{quoting} Controls when quotes should be generated by the writer. It can take on any ! of the \constant{QUOTE_*} constants defined below and defaults to ! \constant{QUOTE_MINIMAL}. \end{memberdesc} --- 252,257 ---- \begin{memberdesc}[Dialect]{quoting} Controls when quotes should be generated by the writer. It can take on any ! of the \constant{QUOTE_*} constants (see section~\ref{csv-contents}) ! and defaults to \constant{QUOTE_MINIMAL}. \end{memberdesc} *************** *** 265,269 **** Reader objects (\class{DictReader} instances and objects returned by ! the \function{reader()}function) have the following public methods: \begin{methoddesc}[csv reader]{next}{} --- 265,269 ---- Reader objects (\class{DictReader} instances and objects returned by ! the \function{reader()} function) have the following public methods: \begin{methoddesc}[csv reader]{next}{} From jackjansen at users.sourceforge.net Sun Aug 31 17:39:43 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Aug 31 19:39:48 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Dist/resources.panther - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Dist/resources.panther In directory sc8-pr-cvs1:/tmp/cvs-serv20875/resources.panther Log Message: Directory /cvsroot/python/python/dist/src/Mac/OSX/Dist/resources.panther added to the repository --> Using per-directory sticky tag `release23-maint' From jackjansen at users.sourceforge.net Sun Aug 31 17:40:53 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Aug 31 19:40:56 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Dist/resources.panther ReadMe.txt, NONE, 1.1.2.1 Welcome.rtf, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Dist/resources.panther In directory sc8-pr-cvs1:/tmp/cvs-serv21033/resources.panther Added Files: Tag: release23-maint ReadMe.txt Welcome.rtf Log Message: First stab at build script for distribution for Panther. Unfortunately at the moment it crashes the kernel:-) --- NEW FILE: ReadMe.txt --- This package will install MacPython 2.3 for Mac OS X 10.3. Installation requires approximately XXX MB of disk space, ignore the message that it will take zero bytes. You must install onto your current boot disk, even though the installer does not enforce this, otherwise things will not work. This installer does not contain a Python engine, as Apple already includes that in 10.3. It does contain a set of programs to allow easy access to it for Mac users (an integrated development environment, a Python extension package manager) and the waste module. The installer puts the applications in MacPython-2.3 in your Applications folder. The PythonIDE application has a Help command that gets you started quickly with MacPython and contains references to other documentation. More information on MacPython can be found at http://www.cwi.nl/~jack/macpython.html, more information on Python in general at http://www.python.org. --- NEW FILE: Welcome.rtf --- {\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;} {\colortbl;\red255\green255\blue255;} \paperw11904\paperh16835\margl1440\margr1440\vieww9920\viewh10660\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f0\fs24 \cf0 This package will install \f1\b MacPython 2.3 \f0\b0 for \f1\b Mac OS X 10.3 \f0\b0 . \ \ MacPython consists of the programs to allow easy access to Python for Mac users (an integrated development environment, a Python extension package manager), and uses the Python 2.3 interpreter core that comes pre-installed on 10.3.\ \ See the ReadMe file for more information.} From jackjansen at users.sourceforge.net Sun Aug 31 17:40:53 2003 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Aug 31 19:41:06 2003 Subject: [Python-checkins] python/dist/src/Mac/OSX/Dist build.panther, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX/Dist In directory sc8-pr-cvs1:/tmp/cvs-serv21033 Added Files: Tag: release23-maint build.panther Log Message: First stab at build script for distribution for Panther. Unfortunately at the moment it crashes the kernel:-) --- NEW FILE: build.panther --- #!/bin/sh -e #---------------------------------------------------------------------- # Build the MacPython 2.3 extensions for an installation to run # on the pre-installed 2.3 framework build on OSX 10.3 # TODO: Parameterize the versions, builddirs, etc... # Script configs PYVERSION=2.3 PYVER=2.3 BUILDNUM=1 DOCLEANUP=no PROGDIR="`dirname \"$0\"`" case x$PROGDIR in x|x.) PROGDIR=`pwd` ;; x/*) ;; *) echo "Please run with a full pathname" exit 1 ;; esac if [ ! -e /usr/bin/python ]; then echo "No /usr/bin/python; this script expects to be run on 10.3 only" exit 1 fi TMPDIR=/tmp/_py #TMPDIR=/projects/_py INSTALLROOT=$TMPDIR/install DMGDIR=$TMPDIR/dmg RESOURCEDIR=$PROGDIR/resources.panther DESTDIR=$TMPDIR/dist PYTHONSRC=$PROGDIR/../../.. PYTHONOSXDIR=$PYTHONSRC/Mac/OSX WASTEDIR=$PYTHONSRC/../waste rm -rf $DMGDIR if [ ! -e $TMPDIR ]; then mkdir $TMPDIR fi chgrp admin $TMPDIR mkdir -p $DMGDIR/root # Ask the user whether s/he has edited Welcome.txt read -p "Have you updated $RESOURCEDIR/Welcome.txt (Y/n)? " welcome if [ "$welcome" = "n" -o "$welcome" = "N" ]; then echo "Please do so and retry" exit fi # Make the installation directories mkdir -p $INSTALLROOT/Applications mkdir -p $INSTALLROOT/Library/Python/$PYVER # Make a temporary site-packages symlink mkdir -p $INSTALLROOT/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/ ln -s $INSTALLROOT/Library/Python/$PYVER $INSTALLROOT/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages pushd $PYTHONOSXDIR make -f Makefile.panther DIRMODE=775 EXEMODE=775 FILEMODE=664 DESTDIR=$INSTALLROOT # Remove the temporary symlink # rm -r $INSTALLROOT/System # Unfortunately all the ...MODE arguments above still don't do the trick. # Cop out, and recursively set everything group-writeable. chmod -R ug+w $INSTALLROOT popd # Make the Installer package: # Finally, build the package... rm -rf MacPython-Panther.pkg python $PYTHONSRC/Mac/scripts/buildpkg.py \ --Title=MacPython-Panther \ --Version=$PYVERSION-$BUILDNUM \ --Description="MacPython $PYVERSION tools and additions for Mac OS X 10.3" \ --NeedsAuthorization="YES" \ --Relocatable="NO" \ --InstallOnly="YES" \ --UseUserMask="NO" \ $INSTALLROOT \ $RESOURCEDIR # --RootVolumeOnly="YES" \ # ...and then make a disk image containing the package. mv MacPython-Panther.pkg $DMGDIR/root cp $RESOURCEDIR/ReadMe.txt $DMGDIR/root/ReadMe.txt $PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-Panther-$PYVERSION-$BUILDNUM echo Moving $DMGDIR/MacPython-Panther-$PYVERSION-$BUILDNUM to $DESTDIR if [ ! -e $DESTDIR ]; then mkdir $DESTDIR fi mv $DMGDIR/MacPython-Panther-$PYVERSION-$BUILDNUM.dmg $DESTDIR # Cleanup build/install dirs if [ $DOCLEANUP = yes ]; then echo "Cleaning up..." rm -rf $INSTALLROOT rm -rf $DMGDIR else echo "Cleanup is disabled. You should remove these dirs when done:" echo " $INSTALLROOT" echo " $DMGDIR" fi echo "Your installer can be found in $DESTDIR"