[Python-checkins] r66800 - in python/branches/release26-maint: Doc/library/functions.rst Doc/whatsnew/2.2.rst Doc/whatsnew/2.6.rst Lib/lib2to3 Lib/lib2to3/fixes/fix_getcwdu.py Lib/lib2to3/fixes/fix_import.py Lib/lib2to3/pytree.py Lib/lib2to3/tests/data/README Lib/lib2to3/tests/data/infinite_recursion.py Lib/lib2to3/tests/test_fixers.py Lib/test/test_datetime.py Lib/test/test_docxmlrpc.py Mac/BuildScript/build-installer.py Modules/_codecsmodule.c Modules/cjkcodecs/multibytecodec.c Objects/floatobject.c Objects/listobject.c Objects/setobject.c Objects/stringobject.c Objects/tupleobject.c Objects/unicodeobject.c setup.py

benjamin.peterson python-checkins at python.org
Sat Oct 4 23:33:09 CEST 2008


Author: benjamin.peterson
Date: Sat Oct  4 23:33:08 2008
New Revision: 66800

Log:
Merged revisions 66766-66767,66771-66772,66774,66776,66783-66787,66790,66793,66797 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

................
  r66766 | benjamin.peterson | 2008-10-03 06:52:06 -0500 (Fri, 03 Oct 2008) | 1 line
  
  update the mac installer script
................
  r66767 | andrew.kuchling | 2008-10-03 07:26:42 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Docstring typo.
................
  r66771 | hirokazu.yamamoto | 2008-10-03 11:18:42 -0500 (Fri, 03 Oct 2008) | 2 lines
  
  Fixed following error when DocXMLRPCServer failed.
    UnboundLocalError: local variable 'serv' referenced before assignment
................
  r66772 | andrew.kuchling | 2008-10-03 11:29:19 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Mention exception in docstring
................
  r66774 | andrew.kuchling | 2008-10-03 11:42:52 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Typo fix
................
  r66776 | hirokazu.yamamoto | 2008-10-03 12:34:49 -0500 (Fri, 03 Oct 2008) | 2 lines
  
  Issue #1706863: Fixed "'NoneType' object has no attribute 'rfind'" error when sqlite libfile not found.
................
  r66783 | andrew.kuchling | 2008-10-03 20:02:29 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Use correct capitalization of NaN
................
  r66784 | andrew.kuchling | 2008-10-03 20:03:42 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Docstring change: Specify exception raised
................
  r66785 | andrew.kuchling | 2008-10-03 20:04:24 -0500 (Fri, 03 Oct 2008) | 1 line
  
  Docstring changes: Specify exceptions raised
................
  r66786 | andrew.kuchling | 2008-10-03 20:05:56 -0500 (Fri, 03 Oct 2008) | 3 lines
  
  Docstring change for *partition: use same tense as other docstrings.
  Hyphenate left- and right-justified.
  Fix 'registerd' typo
................
  r66787 | andrew.kuchling | 2008-10-03 22:08:56 -0500 (Fri, 03 Oct 2008) | 1 line
  
  two corrections
................
  r66790 | andrew.kuchling | 2008-10-04 11:52:01 -0500 (Sat, 04 Oct 2008) | 1 line
  
  Set svn:keywords
................
  r66793 | georg.brandl | 2008-10-04 13:26:01 -0500 (Sat, 04 Oct 2008) | 2 lines
  
  #4041: don't refer to removed and outdated modules.
................
  r66797 | benjamin.peterson | 2008-10-04 15:55:50 -0500 (Sat, 04 Oct 2008) | 19 lines
  
  Merged revisions 66707,66775,66782 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
  
  ........
    r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line
    
    fix #4001: fix_imports didn't check for __init__.py before converting to relative imports
  ........
    r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines
    
    Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails.
    
    Fixes http://bugs.python.org/issue2532. Thanks to Nick Edds.
  ........
    r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line
    
    add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023
  ........
................


Added:
   python/branches/release26-maint/Lib/lib2to3/fixes/fix_getcwdu.py
      - copied unchanged from r66797, /python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py
   python/branches/release26-maint/Lib/lib2to3/tests/data/README
      - copied unchanged from r66797, /python/trunk/Lib/lib2to3/tests/data/README
   python/branches/release26-maint/Lib/lib2to3/tests/data/infinite_recursion.py
      - copied unchanged from r66797, /python/trunk/Lib/lib2to3/tests/data/infinite_recursion.py
Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Doc/library/functions.rst
   python/branches/release26-maint/Doc/whatsnew/2.2.rst
   python/branches/release26-maint/Doc/whatsnew/2.6.rst   (contents, props changed)
   python/branches/release26-maint/Lib/lib2to3/   (props changed)
   python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py
   python/branches/release26-maint/Lib/lib2to3/pytree.py
   python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py
   python/branches/release26-maint/Lib/test/test_datetime.py
   python/branches/release26-maint/Lib/test/test_docxmlrpc.py
   python/branches/release26-maint/Mac/BuildScript/build-installer.py
   python/branches/release26-maint/Modules/_codecsmodule.c
   python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c
   python/branches/release26-maint/Objects/floatobject.c
   python/branches/release26-maint/Objects/listobject.c
   python/branches/release26-maint/Objects/setobject.c
   python/branches/release26-maint/Objects/stringobject.c
   python/branches/release26-maint/Objects/tupleobject.c
   python/branches/release26-maint/Objects/unicodeobject.c
   python/branches/release26-maint/setup.py

Modified: python/branches/release26-maint/Doc/library/functions.rst
==============================================================================
--- python/branches/release26-maint/Doc/library/functions.rst	(original)
+++ python/branches/release26-maint/Doc/library/functions.rst	Sat Oct  4 23:33:08 2008
@@ -24,10 +24,8 @@
    The function is invoked by the :keyword:`import` statement.  It mainly exists
    so that you can replace it with another function that has a compatible
    interface, in order to change the semantics of the :keyword:`import` statement.
-   For examples of why and how you would do this, see the standard library modules
-   :mod:`ihooks` and :mod:`rexec`.  See also the built-in module :mod:`imp`, which
-   defines some useful operations out of which you can build your own
-   :func:`__import__` function.
+   See the built-in module :mod:`imp`, which defines some useful operations out
+   of which you can build your own :func:`__import__` function.
 
    For example, the statement ``import spam`` results in the following call:
    ``__import__('spam', globals(), locals(), [], -1)``; the statement

Modified: python/branches/release26-maint/Doc/whatsnew/2.2.rst
==============================================================================
--- python/branches/release26-maint/Doc/whatsnew/2.2.rst	(original)
+++ python/branches/release26-maint/Doc/whatsnew/2.2.rst	Sat Oct  4 23:33:08 2008
@@ -714,7 +714,7 @@
 presented with two integer arguments: it returns an integer result that's
 truncated down when there would be a fractional part.  For example, ``3/2`` is
 1, not 1.5, and ``(-1)/2`` is -1, not -0.5.  This means that the results of
-divison can vary unexpectedly depending on the type of the two operands and
+division can vary unexpectedly depending on the type of the two operands and
 because Python is dynamically typed, it can be difficult to determine the
 possible types of the operands.
 

Modified: python/branches/release26-maint/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/release26-maint/Doc/whatsnew/2.6.rst	(original)
+++ python/branches/release26-maint/Doc/whatsnew/2.6.rst	Sat Oct  4 23:33:08 2008
@@ -8,7 +8,7 @@
 :Release: |release|
 :Date: |today|
 
-.. $Id: whatsnew26.tex 55746 2007-06-02 18:33:53Z neal.norwitz $
+.. $Id$
    Rules for maintenance:
 
    * Anyone can add text to this document.  Do not spend very much time
@@ -2753,7 +2753,7 @@
 returns the resulting value.  A literal expression is a Python
 expression containing only strings, numbers, dictionaries,
 etc. but no statements or function calls.  If you need to
-evaluate an expression but accept the security risk of using an
+evaluate an expression but cannot accept the security risk of using an
 :func:`eval` call, :func:`literal_eval` will handle it safely::
 
     >>> literal = '("a", "b", {2:4, 3:8, 1:2})'
@@ -3039,7 +3039,7 @@
   ``numfree``, and a macro ``Py<typename>_MAXFREELIST`` is
   always defined.
 
-* A new Makefile target, "make check", prepares the Python source tree
+* A new Makefile target, "make patchcheck", prepares the Python source tree
   for making a patch: it fixes trailing whitespace in all modified
   ``.py`` files, checks whether the documentation has been changed,
   and reports whether the :file:`Misc/ACKS` and :file:`Misc/NEWS` files
@@ -3267,6 +3267,6 @@
 
 The author would like to thank the following people for offering
 suggestions, corrections and assistance with various drafts of this
-article: Georg Brandl, Steve Brown, Nick Coghlan, Jim Jewett, Kent
-Johnson, Chris Lambacher, Antoine Pitrou.
+article: Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, 
+Jim Jewett, Kent Johnson, Chris Lambacher, Antoine Pitrou, Brian Warner.
 

Modified: python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py
==============================================================================
--- python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py	(original)
+++ python/branches/release26-maint/Lib/lib2to3/fixes/fix_import.py	Sat Oct  4 23:33:08 2008
@@ -54,6 +54,10 @@
     imp_name = imp_name.split('.', 1)[0].strip()
     base_path = dirname(file_path)
     base_path = join(base_path, imp_name)
+    # If there is no __init__.py next to the file its not in a package
+    # so can't be a relative import.
+    if not exists(join(dirname(base_path), '__init__.py')):
+        return False
     for ext in ['.py', pathsep, '.pyc', '.so', '.sl', '.pyd']:
         if exists(base_path + ext):
             return True

Modified: python/branches/release26-maint/Lib/lib2to3/pytree.py
==============================================================================
--- python/branches/release26-maint/Lib/lib2to3/pytree.py	(original)
+++ python/branches/release26-maint/Lib/lib2to3/pytree.py	Sat Oct  4 23:33:08 2008
@@ -655,10 +655,47 @@
         elif self.name == "bare_name":
             yield self._bare_name_matches(nodes)
         else:
-            for count, r in self._recursive_matches(nodes, 0):
-                if self.name:
-                    r[self.name] = nodes[:count]
-                yield count, r
+            try:
+                for count, r in self._recursive_matches(nodes, 0):
+                    if self.name:
+                        r[self.name] = nodes[:count]
+                    yield count, r
+            except RuntimeError:
+                # We fall back to the iterative pattern matching scheme if the recursive
+                # scheme hits the recursion limit.
+                for count, r in self._iterative_matches(nodes):
+                    if self.name:
+                        r[self.name] = nodes[:count]
+                    yield count, r
+
+    def _iterative_matches(self, nodes):
+        """Helper to iteratively yield the matches."""
+        nodelen = len(nodes)
+        if 0 >= self.min:
+            yield 0, {}
+
+        results = []
+        # generate matches that use just one alt from self.content
+        for alt in self.content:
+            for c, r in generate_matches(alt, nodes):
+                yield c, r
+                results.append((c, r))
+
+        # for each match, iterate down the nodes
+        while results:
+            new_results = []
+            for c0, r0 in results:
+                # stop if the entire set of nodes has been matched
+                if c0 < nodelen and c0 <= self.max:
+                    for alt in self.content:
+                        for c1, r1 in generate_matches(alt, nodes[c0:]):
+                            if c1 > 0:
+                                r = {}
+                                r.update(r0)
+                                r.update(r1)
+                                yield c0 + c1, r
+                                new_results.append((c0 + c1, r))
+            results = new_results
 
     def _bare_name_matches(self, nodes):
         """Special optimized matcher for bare_name."""

Modified: python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py
==============================================================================
--- python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py	(original)
+++ python/branches/release26-maint/Lib/lib2to3/tests/test_fixers.py	Sat Oct  4 23:33:08 2008
@@ -9,10 +9,10 @@
     import support
 
 # Python imports
+import os
 import unittest
 from itertools import chain
 from operator import itemgetter
-from os.path import dirname, pathsep
 
 # Local imports
 from .. import pygram
@@ -3274,14 +3274,19 @@
         # Need to replace fix_import's exists method
         # so we can check that it's doing the right thing
         self.files_checked = []
+        self.present_files = set()
         self.always_exists = True
         def fake_exists(name):
             self.files_checked.append(name)
-            return self.always_exists
+            return self.always_exists or (name in self.present_files)
 
         from ..fixes import fix_import
         fix_import.exists = fake_exists
 
+    def tearDown(self):
+        from lib2to3.fixes import fix_import
+        fix_import.exists = os.path.exists
+
     def check_both(self, b, a):
         self.always_exists = True
         FixerTestCase.check(self, b, a)
@@ -3291,10 +3296,12 @@
     def test_files_checked(self):
         def p(path):
             # Takes a unix path and returns a path with correct separators
-            return pathsep.join(path.split("/"))
+            return os.path.pathsep.join(path.split("/"))
 
         self.always_exists = False
-        expected_extensions = ('.py', pathsep, '.pyc', '.so', '.sl', '.pyd')
+        self.present_files = set(['__init__.py'])
+        expected_extensions = ('.py', os.path.pathsep, '.pyc', '.so',
+                               '.sl', '.pyd')
         names_to_test = (p("/spam/eggs.py"), "ni.py", p("../../shrubbery.py"))
 
         for name in names_to_test:
@@ -3302,11 +3309,32 @@
             self.filename = name
             self.unchanged("import jam")
 
-            if dirname(name): name = dirname(name) + '/jam'
-            else:             name = 'jam'
+            if os.path.dirname(name):
+                name = os.path.dirname(name) + '/jam'
+            else:
+                name = 'jam'
             expected_checks = set(name + ext for ext in expected_extensions)
+            expected_checks.add("__init__.py")
+
+            self.assertEqual(set(self.files_checked), expected_checks)
 
-            self.failUnlessEqual(set(self.files_checked), expected_checks)
+    def test_not_in_package(self):
+        s = "import bar"
+        self.always_exists = False
+        self.present_files = set(["bar.py"])
+        self.unchanged(s)
+
+    def test_in_package(self):
+        b = "import bar"
+        a = "from . import bar"
+        self.always_exists = False
+        self.present_files = set(["__init__.py", "bar.py"])
+        self.check(b, a)
+
+    def test_comments_and_indent(self):
+        b = "import bar # Foo"
+        a = "from . import bar # Foo"
+        self.check(b, a)
 
     def test_from(self):
         b = "from foo import bar, baz"
@@ -3577,6 +3605,67 @@
         self.check(b, a)
 
 
+class Test_getcwdu(FixerTestCase):
+
+    fixer = 'getcwdu'
+
+    def test_basic(self):
+        b = """os.getcwdu"""
+        a = """os.getcwd"""
+        self.check(b, a)
+
+        b = """os.getcwdu()"""
+        a = """os.getcwd()"""
+        self.check(b, a)
+
+        b = """meth = os.getcwdu"""
+        a = """meth = os.getcwd"""
+        self.check(b, a)
+
+        b = """os.getcwdu(args)"""
+        a = """os.getcwd(args)"""
+        self.check(b, a)
+
+    def test_comment(self):
+        b = """os.getcwdu() # Foo"""
+        a = """os.getcwd() # Foo"""
+        self.check(b, a)
+
+    def test_unchanged(self):
+        s = """os.getcwd()"""
+        self.unchanged(s)
+
+        s = """getcwdu()"""
+        self.unchanged(s)
+
+        s = """os.getcwdb()"""
+        self.unchanged(s)
+
+    def test_indentation(self):
+        b = """
+            if 1:
+                os.getcwdu()
+            """
+        a = """
+            if 1:
+                os.getcwd()
+            """
+        self.check(b, a)
+
+    def test_multilation(self):
+        b = """os .getcwdu()"""
+        a = """os .getcwd()"""
+        self.check(b, a)
+
+        b = """os.  getcwdu"""
+        a = """os.  getcwd"""
+        self.check(b, a)
+
+        b = """os.getcwdu (  )"""
+        a = """os.getcwd (  )"""
+        self.check(b, a)
+
+
 if __name__ == "__main__":
     import __main__
     support.run_all_tests(__main__)

Modified: python/branches/release26-maint/Lib/test/test_datetime.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_datetime.py	(original)
+++ python/branches/release26-maint/Lib/test/test_datetime.py	Sat Oct  4 23:33:08 2008
@@ -253,7 +253,7 @@
         self.assertRaises(TypeError, lambda: a // x)
         self.assertRaises(TypeError, lambda: x // a)
 
-        # Divison of int by timedelta doesn't make sense.
+        # Division of int by timedelta doesn't make sense.
         # Division by zero doesn't make sense.
         for zero in 0, 0L:
             self.assertRaises(TypeError, lambda: zero // a)

Modified: python/branches/release26-maint/Lib/test/test_docxmlrpc.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_docxmlrpc.py	(original)
+++ python/branches/release26-maint/Lib/test/test_docxmlrpc.py	Sat Oct  4 23:33:08 2008
@@ -9,9 +9,9 @@
 PORT = None
 
 def server(evt, numrequests):
-    try:
-        serv = DocXMLRPCServer(("localhost", 0), logRequests=False)
+    serv = DocXMLRPCServer(("localhost", 0), logRequests=False)
 
+    try:
         global PORT
         PORT = serv.socket.getsockname()[1]
 

Modified: python/branches/release26-maint/Mac/BuildScript/build-installer.py
==============================================================================
--- python/branches/release26-maint/Mac/BuildScript/build-installer.py	(original)
+++ python/branches/release26-maint/Mac/BuildScript/build-installer.py	Sat Oct  4 23:33:08 2008
@@ -129,8 +129,8 @@
     ),
 
     dict(
-        name="SQLite 3.3.5",
-        url="http://www.sqlite.org/sqlite-3.3.5.tar.gz",
+        name="SQLite 3.6.3",
+        url="http://www.sqlite.org/sqlite-3.6.3.tar.gz",
         checksum='93f742986e8bc2dfa34792e16df017a6feccf3a2',
         configure_pre=[
             '--enable-threadsafe',
@@ -170,8 +170,8 @@
             ),
     ),
     dict(
-        name="Sleepycat DB 4.4",
-        url="http://downloads.sleepycat.com/db-4.4.20.tar.gz",
+        name="Sleepycat DB 4.7.25",
+        url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
         #name="Sleepycat DB 4.3.29",
         #url="http://downloads.sleepycat.com/db-4.3.29.tar.gz",
         buildDir="build_unix",
@@ -585,21 +585,23 @@
     version = getVersion()
     docdir = os.path.join(rootDir, 'pydocs')
 
+    novername = 'python-docs-html.tar.bz2'
     name = 'html-%s.tar.bz2'%(getFullVersion(),)
     sourceArchive = os.path.join(DEPSRC, name)
     if os.path.exists(sourceArchive):
         print "Using local copy of %s"%(name,)
 
     else:
-        print "Downloading %s"%(name,)
+        print "Downloading %s"%(novername,)
         downloadURL('http://www.python.org/ftp/python/doc/%s/%s'%(
-            getFullVersion(), name), sourceArchive)
+            getFullVersion(), novername), sourceArchive)
         print "Archive for %s stored as %s"%(name, sourceArchive)
 
     extractArchive(os.path.dirname(docdir), sourceArchive)
+
     os.rename(
             os.path.join(
-                os.path.dirname(docdir), 'Python-Docs-%s'%(getFullVersion(),)),
+                os.path.dirname(docdir), 'python-docs-html'),
             docdir)
 
 
@@ -1028,11 +1030,11 @@
     buildPython()
     buildPythonDocs()
     fn = os.path.join(WORKDIR, "_root", "Applications",
-                "MacPython %s"%(getVersion(),), "Update Shell Profile.command")
+                "Python %s"%(getVersion(),), "Update Shell Profile.command")
     patchFile("scripts/postflight.patch-profile",  fn)
     os.chmod(fn, 0755)
 
-    folder = os.path.join(WORKDIR, "_root", "Applications", "MacPython %s"%(
+    folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(
         getVersion(),))
     os.chmod(folder, 0755)
     setIcon(folder, "../Icons/Python Folder.icns")

Modified: python/branches/release26-maint/Modules/_codecsmodule.c
==============================================================================
--- python/branches/release26-maint/Modules/_codecsmodule.c	(original)
+++ python/branches/release26-maint/Modules/_codecsmodule.c	Sat Oct  4 23:33:08 2008
@@ -115,7 +115,7 @@
 to the default encoding. errors may be given to set a different error\n\
 handling scheme. Default is 'strict' meaning that encoding errors raise\n\
 a ValueError. Other possible values are 'ignore' and 'replace'\n\
-as well as any other name registerd with codecs.register_error that is\n\
+as well as any other name registered with codecs.register_error that is\n\
 able to handle ValueErrors.");
 
 static PyObject *

Modified: python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c
==============================================================================
--- python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c	(original)
+++ python/branches/release26-maint/Modules/cjkcodecs/multibytecodec.c	Sat Oct  4 23:33:08 2008
@@ -36,7 +36,7 @@
 Decodes `string' using I, an MultibyteCodec instance. errors may be given\n\
 to set a different error handling scheme. Default is 'strict' meaning\n\
 that encoding errors raise a UnicodeDecodeError. Other possible values\n\
-are 'ignore' and 'replace' as well as any other name registerd with\n\
+are 'ignore' and 'replace' as well as any other name registered with\n\
 codecs.register_error that is able to handle UnicodeDecodeErrors.");
 
 static char *codeckwarglist[] = {"input", "errors", NULL};

Modified: python/branches/release26-maint/Objects/floatobject.c
==============================================================================
--- python/branches/release26-maint/Objects/floatobject.c	(original)
+++ python/branches/release26-maint/Objects/floatobject.c	Sat Oct  4 23:33:08 2008
@@ -1548,7 +1548,7 @@
 #ifdef Py_NAN
 	if (Py_IS_NAN(self)) {
 	  PyErr_SetString(PyExc_ValueError,
-			  "Cannot pass nan to float.as_integer_ratio.");
+			  "Cannot pass NaN to float.as_integer_ratio.");
 	  return NULL;
 	}
 #endif
@@ -1607,7 +1607,7 @@
 "\n"
 "Returns a pair of integers, whose ratio is exactly equal to the original\n"
 "float and with a positive denominator.\n"
-"Raises OverflowError on infinities and a ValueError on nans.\n"
+"Raises OverflowError on infinities and a ValueError on NaNs.\n"
 "\n"
 ">>> (10.0).as_integer_ratio()\n"
 "(10, 1)\n"

Modified: python/branches/release26-maint/Objects/listobject.c
==============================================================================
--- python/branches/release26-maint/Objects/listobject.c	(original)
+++ python/branches/release26-maint/Objects/listobject.c	Sat Oct  4 23:33:08 2008
@@ -2459,11 +2459,14 @@
 PyDoc_STRVAR(insert_doc,
 "L.insert(index, object) -- insert object before index");
 PyDoc_STRVAR(pop_doc,
-"L.pop([index]) -> item -- remove and return item at index (default last)");
+"L.pop([index]) -> item -- remove and return item at index (default last).\n"
+"Raises IndexError if list is empty or index is out of range.");
 PyDoc_STRVAR(remove_doc,
-"L.remove(value) -- remove first occurrence of value");
+"L.remove(value) -- remove first occurrence of value.\n"
+"Raises ValueError if the value is not present.");
 PyDoc_STRVAR(index_doc,
-"L.index(value, [start, [stop]]) -> integer -- return first index of value");
+"L.index(value, [start, [stop]]) -> integer -- return first index of value.\n"
+"Raises ValueError if the value is not present.");
 PyDoc_STRVAR(count_doc,
 "L.count(value) -> integer -- return number of occurrences of value");
 PyDoc_STRVAR(reverse_doc,

Modified: python/branches/release26-maint/Objects/setobject.c
==============================================================================
--- python/branches/release26-maint/Objects/setobject.c	(original)
+++ python/branches/release26-maint/Objects/setobject.c	Sat Oct  4 23:33:08 2008
@@ -754,7 +754,8 @@
 	return key;
 }
 
-PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.");
+PyDoc_STRVAR(pop_doc, "Remove and return an arbitrary set element.\n\
+Raises KeyError if the set is empty.");
 
 static int
 set_traverse(PySetObject *so, visitproc visit, void *arg)

Modified: python/branches/release26-maint/Objects/stringobject.c
==============================================================================
--- python/branches/release26-maint/Objects/stringobject.c	(original)
+++ python/branches/release26-maint/Objects/stringobject.c	Sat Oct  4 23:33:08 2008
@@ -1591,9 +1591,9 @@
 PyDoc_STRVAR(partition__doc__,
 "S.partition(sep) -> (head, sep, tail)\n\
 \n\
-Searches for the separator sep in S, and returns the part before it,\n\
+Search for the separator sep in S, and return the part before it,\n\
 the separator itself, and the part after it.  If the separator is not\n\
-found, returns S and two empty strings.");
+found, return S and two empty strings.");
 
 static PyObject *
 string_partition(PyStringObject *self, PyObject *sep_obj)
@@ -1622,9 +1622,9 @@
 PyDoc_STRVAR(rpartition__doc__,
 "S.rpartition(sep) -> (tail, sep, head)\n\
 \n\
-Searches for the separator sep in S, starting at the end of S, and returns\n\
+Search for the separator sep in S, starting at the end of S, and return\n\
 the part before it, the separator itself, and the part after it.  If the\n\
-separator is not found, returns two empty strings and S.");
+separator is not found, return two empty strings and S.");
 
 static PyObject *
 string_rpartition(PyStringObject *self, PyObject *sep_obj)
@@ -3357,7 +3357,7 @@
 to the default encoding. errors may be given to set a different error\n\
 handling scheme. Default is 'strict' meaning that encoding errors raise\n\
 a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'\n\
-as well as any other name registerd with codecs.register_error that is\n\
+as well as any other name registered with codecs.register_error that is\n\
 able to handle UnicodeDecodeErrors.");
 
 static PyObject *
@@ -3506,7 +3506,7 @@
 PyDoc_STRVAR(ljust__doc__,
 "S.ljust(width[, fillchar]) -> string\n"
 "\n"
-"Return S left justified in a string of length width. Padding is\n"
+"Return S left-justified in a string of length width. Padding is\n"
 "done using the specified fill character (default is a space).");
 
 static PyObject *
@@ -3530,7 +3530,7 @@
 PyDoc_STRVAR(rjust__doc__,
 "S.rjust(width[, fillchar]) -> string\n"
 "\n"
-"Return S right justified in a string of length width. Padding is\n"
+"Return S right-justified in a string of length width. Padding is\n"
 "done using the specified fill character (default is a space)");
 
 static PyObject *

Modified: python/branches/release26-maint/Objects/tupleobject.c
==============================================================================
--- python/branches/release26-maint/Objects/tupleobject.c	(original)
+++ python/branches/release26-maint/Objects/tupleobject.c	Sat Oct  4 23:33:08 2008
@@ -719,7 +719,9 @@
 }
 
 PyDoc_STRVAR(index_doc,
-"T.index(value, [start, [stop]]) -> integer -- return first index of value");
+"T.index(value, [start, [stop]]) -> integer -- return first index of value.\n"
+"Raises ValueError if the value is not present."
+);
 PyDoc_STRVAR(count_doc,
 "T.count(value) -> integer -- return number of occurrences of value");
 PyDoc_STRVAR(sizeof_doc,

Modified: python/branches/release26-maint/Objects/unicodeobject.c
==============================================================================
--- python/branches/release26-maint/Objects/unicodeobject.c	(original)
+++ python/branches/release26-maint/Objects/unicodeobject.c	Sat Oct  4 23:33:08 2008
@@ -7070,7 +7070,7 @@
 PyDoc_STRVAR(ljust__doc__,
 "S.ljust(width[, fillchar]) -> int\n\
 \n\
-Return S left justified in a Unicode string of length width. Padding is\n\
+Return S left-justified in a Unicode string of length width. Padding is\n\
 done using the specified fill character (default is a space).");
 
 static PyObject *
@@ -7456,7 +7456,7 @@
 PyDoc_STRVAR(rjust__doc__,
 "S.rjust(width[, fillchar]) -> unicode\n\
 \n\
-Return S right justified in a Unicode string of length width. Padding is\n\
+Return S right-justified in a Unicode string of length width. Padding is\n\
 done using the specified fill character (default is a space).");
 
 static PyObject *
@@ -7606,9 +7606,9 @@
 PyDoc_STRVAR(partition__doc__,
 "S.partition(sep) -> (head, sep, tail)\n\
 \n\
-Searches for the separator sep in S, and returns the part before it,\n\
+Search for the separator sep in S, and return the part before it,\n\
 the separator itself, and the part after it.  If the separator is not\n\
-found, returns S and two empty strings.");
+found, return S and two empty strings.");
 
 static PyObject*
 unicode_partition(PyUnicodeObject *self, PyObject *separator)
@@ -7619,9 +7619,9 @@
 PyDoc_STRVAR(rpartition__doc__,
 "S.rpartition(sep) -> (tail, sep, head)\n\
 \n\
-Searches for the separator sep in S, starting at the end of S, and returns\n\
+Search for the separator sep in S, starting at the end of S, and return\n\
 the part before it, the separator itself, and the part after it.  If the\n\
-separator is not found, returns two empty strings and S.");
+separator is not found, return two empty strings and S.");
 
 static PyObject*
 unicode_rpartition(PyUnicodeObject *self, PyObject *separator)

Modified: python/branches/release26-maint/setup.py
==============================================================================
--- python/branches/release26-maint/setup.py	(original)
+++ python/branches/release26-maint/setup.py	Sat Oct  4 23:33:08 2008
@@ -934,7 +934,8 @@
             ]
             sqlite_libfile = self.compiler.find_library_file(
                                 sqlite_dirs_to_check + lib_dirs, 'sqlite3')
-            sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]
+            if sqlite_libfile:
+                sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]
 
         if sqlite_incdir and sqlite_libdir:
             sqlite_srcs = ['_sqlite/cache.c',


More information about the Python-checkins mailing list