Merged revisions 67898,67904-67907,67912,67918,67920-67921,67923-67924,67927,67930,67932,67943 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67898 | benjamin.peterson | 2008-12-21 15:00:53 -0600 (Sun, 21 Dec 2008) | 1 line
compute DISTVERSION with patchlevel.py
........
r67904 | benjamin.peterson | 2008-12-22 14:44:58 -0600 (Mon, 22 Dec 2008) | 1 line
less attitude
........
r67905 | benjamin.peterson | 2008-12-22 14:51:15 -0600 (Mon, 22 Dec 2008) | 1 line
fix #4720: the format to PyArg_ParseTupleAndKeywords can now start with '|'
........
r67906 | benjamin.peterson | 2008-12-22 14:52:53 -0600 (Mon, 22 Dec 2008) | 1 line
add NEWS note
........
r67907 | benjamin.peterson | 2008-12-22 16:12:19 -0600 (Mon, 22 Dec 2008) | 1 line
silence compiler warning
........
r67912 | georg.brandl | 2008-12-23 06:37:21 -0600 (Tue, 23 Dec 2008) | 2 lines
Fix missing "svn" command.
........
r67918 | georg.brandl | 2008-12-23 09:44:25 -0600 (Tue, 23 Dec 2008) | 2 lines
Markup fix.
........
r67920 | benjamin.peterson | 2008-12-23 14:09:28 -0600 (Tue, 23 Dec 2008) | 1 line
use a global variable, so the compiler doesn't optimize the assignment out
........
r67921 | benjamin.peterson | 2008-12-23 14:12:33 -0600 (Tue, 23 Dec 2008) | 1 line
make global static
........
r67923 | benjamin.peterson | 2008-12-24 09:10:27 -0600 (Wed, 24 Dec 2008) | 1 line
#4736 BufferRWPair.closed shouldn't try to call another property as a function
........
r67924 | benjamin.peterson | 2008-12-24 10:10:05 -0600 (Wed, 24 Dec 2008) | 1 line
pretend exceptions don't exist a while longer
........
r67927 | benjamin.peterson | 2008-12-26 17:26:30 -0600 (Fri, 26 Dec 2008) | 1 line
python version is included in file name now
........
r67930 | hirokazu.yamamoto | 2008-12-26 22:19:48 -0600 (Fri, 26 Dec 2008) | 2 lines
Issue #4740: Use HIGHEST_PROTOCOL in pickle test.
(There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2)
........
r67932 | alexandre.vassalotti | 2008-12-27 00:36:10 -0600 (Sat, 27 Dec 2008) | 5 lines
Remove unnecessary casts related to unicode_decode_call_errorhandler.
Make the _PyUnicode_Resize macro a static function.
These changes are needed to avoid breaking strict aliasing rules.
........
r67943 | alexandre.vassalotti | 2008-12-27 04:02:59 -0600 (Sat, 27 Dec 2008) | 2 lines
Fix bogus unicode tests in pickletester.
........
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index bf25245..bd0a3a4 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -480,8 +480,8 @@
if have_unicode:
def test_unicode(self):
- endcases = [u'', u'<\\u>', u'<\\\\u1234>', u'<\n>',
- u'<\\>', u'<\\\\U00012345>']
+ endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>',
+ u'<\\>', u'<\\\U00012345>']
for proto in protocols:
for u in endcases:
p = self.dumps(u, proto)
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 2efbc7d..2c4c2fd 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -7,7 +7,7 @@
from test import test_support
from weakref import proxy
import array, cStringIO
-from cPickle import loads, dumps
+from cPickle import loads, dumps, HIGHEST_PROTOCOL
class ArraySubclass(array.array):
pass
@@ -97,7 +97,7 @@
self.assertEqual(a, b)
def test_pickle(self):
- for protocol in (0, 1, 2):
+ for protocol in range(HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode, self.example)
b = loads(dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
@@ -112,7 +112,7 @@
self.assertEqual(type(a), type(b))
def test_pickle_for_empty_array(self):
- for protocol in (0, 1, 2):
+ for protocol in range(HIGHEST_PROTOCOL + 1):
a = array.array(self.typecode)
b = loads(dumps(a, protocol))
self.assertNotEqual(id(a), id(b))
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 0b751d8..0f0d098 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -373,7 +373,7 @@
def test_pickle(self):
d = deque(xrange(200))
- for i in (0, 1, 2):
+ for i in range(pickle.HIGHEST_PROTOCOL + 1):
s = pickle.dumps(d, i)
e = pickle.loads(s)
self.assertNotEqual(id(d), id(e))
@@ -382,7 +382,7 @@
## def test_pickle_recursive(self):
## d = deque('abc')
## d.append(d)
-## for i in (0, 1, 2):
+## for i in range(pickle.HIGHEST_PROTOCOL + 1):
## e = pickle.loads(pickle.dumps(d, i))
## self.assertNotEqual(id(d), id(e))
## self.assertEqual(id(e), id(e[-1]))
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 8a7da60..967018e 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -554,8 +554,9 @@
r = MockRawIO(())
w = MockRawIO()
pair = io.BufferedRWPair(r, w)
+ self.assertFalse(pair.closed)
- # XXX need implementation
+ # XXX More Tests
class BufferedRandomTest(unittest.TestCase):
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 499406f..d38a675 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -221,7 +221,7 @@
self.failIf(set('cbs').issuperset('a'))
def test_pickling(self):
- for i in (0, 1, 2):
+ for i in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(self.s, i)
dup = pickle.loads(p)
self.assertEqual(self.s, dup, "%s != %s" % (self.s, dup))