Merged revisions 68521,68527,68534-68536,68540,68547,68552,68563,68570,68572,68575,68579-68580,68584 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68521 | hirokazu.yamamoto | 2009-01-11 04:28:13 +0100 (So, 11 Jan 2009) | 1 line

  Fixed version number in build_ssl.bat.
........
  r68527 | martin.v.loewis | 2009-01-11 10:43:55 +0100 (So, 11 Jan 2009) | 2 lines

  Issue #4895: Use _strdup on Windows CE.
........
  r68534 | gregory.p.smith | 2009-01-11 18:53:33 +0100 (So, 11 Jan 2009) | 2 lines

  correct email address
........
  r68535 | gregory.p.smith | 2009-01-11 18:57:54 +0100 (So, 11 Jan 2009) | 9 lines

  Update the documentation for binascii and zlib crc32/adler32 functions
  to better describe the signed vs unsigned return value behavior on
  different platforms and versions of python.  Mention the workaround to
  make them all return the same thing by using & 0xffffffff.

  Fixes issue4903.

  Also needs to be merged into release26-maint, release30-maint, & py3k.
........
  r68536 | benjamin.peterson | 2009-01-11 20:48:15 +0100 (So, 11 Jan 2009) | 1 line

  add email addresses
........
  r68540 | martin.v.loewis | 2009-01-12 08:57:11 +0100 (Mo, 12 Jan 2009) | 2 lines

  Issue #4915: Port sysmodule to Windows CE.
........
  r68547 | kristjan.jonsson | 2009-01-12 19:09:27 +0100 (Mo, 12 Jan 2009) | 1 line

  Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module.
........
  r68552 | vinay.sajip | 2009-01-12 21:36:18 +0100 (Mo, 12 Jan 2009) | 1 line

  Minor changes/corrections in markup.
........
  r68563 | benjamin.peterson | 2009-01-13 02:49:10 +0100 (Di, 13 Jan 2009) | 1 line

  small logic correction
........
  r68570 | raymond.hettinger | 2009-01-13 10:08:32 +0100 (Di, 13 Jan 2009) | 5 lines

  Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard().

  Needs to be backported to 2.6 and forward ported to 3.0 and 3.1.
........
  r68572 | andrew.kuchling | 2009-01-13 14:40:54 +0100 (Di, 13 Jan 2009) | 1 line

  Note that first coord. is left alone
........
  r68575 | thomas.heller | 2009-01-13 18:32:28 +0100 (Di, 13 Jan 2009) | 1 line

  Fix refcount leak in error cases.  Bug found by coverity.
........
  r68579 | benjamin.peterson | 2009-01-13 22:42:23 +0100 (Di, 13 Jan 2009) | 1 line

  make bytearrayobject.o depend on the stringlib #4936
........
  r68580 | benjamin.peterson | 2009-01-13 22:43:11 +0100 (Di, 13 Jan 2009) | 1 line

  add bytearrayobject.h to PYTHON_HEADERS
........
  r68584 | benjamin.peterson | 2009-01-13 23:22:41 +0100 (Di, 13 Jan 2009) | 1 line

  de-spacify
........
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index a5fee08..38b44a5 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -249,12 +249,12 @@
 
     @abstractmethod
     def add(self, value):
-        """Return True if it was added, False if already there."""
+        """Add an element."""
         raise NotImplementedError
 
     @abstractmethod
     def discard(self, value):
-        """Return True if it was deleted, False if not there."""
+        """Remove an element.  Do not raise an exception if absent."""
         raise NotImplementedError
 
     def remove(self, value):
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index ff00d8b..89fa5c8 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -856,6 +856,14 @@
         # A naive object replaces %z and %Z w/ empty strings.
         self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
 
+        #make sure that invalid format specifiers are handled correctly
+        self.assertRaises(ValueError, t.strftime, "%e")
+        self.assertRaises(ValueError, t.strftime, "%")
+        self.assertRaises(ValueError, t.strftime, "%#")
+
+        #check that this standard extension works
+        t.strftime("%f")
+
 
     def test_format(self):
         dt = self.theclass(2007, 9, 10)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 583df2b..c89a23f 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -533,6 +533,55 @@
     def test_chmod(self):
         self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
 
+class TestInvalidFD(unittest.TestCase):
+    singles = ["fchdir", "fdopen", "close", "dup", "fdatasync", "fstat",
+               "fstatvfs", "fsync", "tcgetpgrp", "ttyname"]
+    def get_single(f):
+        def helper(self):
+            if  getattr(os, f, None):
+                self.assertRaises(OSError, getattr(os, f), 10)
+        return helper
+    for f in singles:
+        locals()["test_"+f] = get_single(f)
+
+    def test_isatty(self):
+        self.assertEqual(os.isatty(10), False)
+
+    def test_closerange(self):
+        self.assertEqual(os.closerange(10, 20), None)
+
+    def test_dup2(self):
+        self.assertRaises(OSError, os.dup2, 10, 20)
+
+    def test_fchmod(self):
+        if hasattr(os, "fchmod"):
+            self.assertRaises(OSError, os.fchmod, 10, 0)
+
+    def test_fchown(self):
+        if hasattr(os, "fchown"):
+            self.assertRaises(OSError, os.fchmod, 10, -1, -1)
+
+    def test_fpathconf(self):
+        if hasattr(os, "fpathconf"):
+            self.assertRaises(OSError, os.fpathconf, 10, "foo")
+
+    def test_ftruncate(self):
+        if hasattr(os, "ftruncate"):
+            self.assertRaises(OSError, os.ftruncate, 10, 0)
+
+    def test_lseek(self):
+        self.assertRaises(OSError, os.lseek, 10, 0, 0)
+
+    def test_read(self):
+        self.assertRaises(OSError, os.read, 10, 1)
+
+    def test_tcsetpgrpt(self):
+        if hasattr(os, "tcsetpgrp"):
+            self.assertRaises(OSError, os.tcsetpgrp, 10, 0)
+
+    def test_write(self):
+        self.assertRaises(OSError, os.write, 10, " ")
+
 if sys.platform != 'win32':
     class Win32ErrorTests(unittest.TestCase):
         pass
@@ -547,7 +596,8 @@
         MakedirTests,
         DevNullTests,
         URandomTests,
-        Win32ErrorTests
+        Win32ErrorTests,
+        TestInvalidFD
     )
 
 if __name__ == "__main__":