]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 67398,67423-67424,67432,67440-67441,67444-67445,67454,67457,67463...
authorGeorg Brandl <georg@python.org>
Fri, 5 Dec 2008 09:00:55 +0000 (09:00 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 5 Dec 2008 09:00:55 +0000 (09:00 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67398 | benjamin.peterson | 2008-11-26 18:39:17 +0100 (Wed, 26 Nov 2008) | 1 line

  fix typo in sqlite3 docs
........
  r67423 | jesse.noller | 2008-11-28 19:59:35 +0100 (Fri, 28 Nov 2008) | 2 lines

  issue4238: bsd support for cpu_count
........
  r67424 | christian.heimes | 2008-11-28 20:33:33 +0100 (Fri, 28 Nov 2008) | 1 line

  Retain copyright of processing examples. This was requested by a Debian maintainer during packaging of the multiprocessing package for 2.4/2.5
........
  r67432 | benjamin.peterson | 2008-11-29 00:18:46 +0100 (Sat, 29 Nov 2008) | 1 line

  SVN format 9 is the same it seems
........
  r67440 | jeremy.hylton | 2008-11-29 00:42:59 +0100 (Sat, 29 Nov 2008) | 4 lines

  Move definition int sval into branch of ifdef where it is used.

  Otherwise, you get a warning about an undefined variable.
........
  r67441 | jeremy.hylton | 2008-11-29 01:09:16 +0100 (Sat, 29 Nov 2008) | 2 lines

  Reflow long lines.
........
  r67444 | amaury.forgeotdarc | 2008-11-29 03:03:32 +0100 (Sat, 29 Nov 2008) | 2 lines

  Fix a small typo in docstring
........
  r67445 | benjamin.peterson | 2008-11-30 04:07:33 +0100 (Sun, 30 Nov 2008) | 1 line

  StringIO.close() stops you from using the buffer, too
........
  r67454 | benjamin.peterson | 2008-11-30 15:43:23 +0100 (Sun, 30 Nov 2008) | 1 line

  note the version that works
........
  r67457 | christian.heimes | 2008-11-30 22:16:28 +0100 (Sun, 30 Nov 2008) | 1 line

  w# requires Py_ssize_t
........
  r67463 | skip.montanaro | 2008-12-01 02:55:22 +0100 (Mon, 01 Dec 2008) | 1 line

  typo in comment
........

15 files changed:
Doc/includes/mp_benchmarks.py
Doc/includes/mp_distributing.py
Doc/includes/mp_newtype.py
Doc/includes/mp_pool.py
Doc/includes/mp_synchronize.py
Doc/includes/mp_webserver.py
Doc/includes/mp_workers.py
Doc/library/sqlite3.rst
Doc/library/stringio.rst
Lib/multiprocessing/__init__.py
Lib/test/test_httplib.py
Modules/_multiprocessing/semaphore.c
Objects/unicodeobject.c
Tools/scripts/svneol.py
configure.in

index 425d6dee9b5b322c88a533be672fca6baee0b7f6..16be77edcef42d23aa7c0be62dbdf37071a0262c 100644 (file)
@@ -1,6 +1,9 @@
 #
 # Simple benchmarks for the multiprocessing package
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 import time, sys, multiprocessing, threading, Queue, gc
 
index 3e9ffd65ea2aa7d186b01709c815758ab883ed39..5ec718bf47d74d4d46dc8a175d7c6258ffb0a3cd 100644 (file)
@@ -3,6 +3,9 @@
 #\r
 # Depends on `multiprocessing` package -- tested with `processing-0.60`\r
 #\r
+# Copyright (c) 2006-2008, R Oudkerk\r
+# All rights reserved.\r
+#\r
 \r
 __all__ = ['Cluster', 'Host', 'get_logger', 'current_process']\r
 \r
index b9edc9e55258347406472f4d57a9bcd80d3628e9..1858696aa0abbde64f635ef51a069405bf6616e8 100644 (file)
@@ -2,6 +2,9 @@
 # This module shows how to use arbitrary callables with a subclass of
 # `BaseManager`.
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 from multiprocessing import freeze_support
 from multiprocessing.managers import BaseManager, BaseProxy
index e7aaaacaf30667286a51596eea693da0af4768a1..9e89cbc607ff31af1f509da71f4b05504d9cd818 100644 (file)
@@ -1,6 +1,9 @@
 #
 # A test of `multiprocessing.Pool` class
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 import multiprocessing
 import time
index ddcd338273c7961a61cc0173377f0ea141758851..2f43ad8d95712675debe8ac7712974bb1ed81b56 100644 (file)
@@ -1,6 +1,9 @@
 #
 # A test file for the `multiprocessing` package
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 import time, sys, random
 from Queue import Empty
index 4943f5d4775259e93d0b58993d3528c1febbcbd1..96d14c54434e4757c3ce1940bfb79cd0afdbb609 100644 (file)
@@ -8,6 +8,9 @@
 # Not sure if we should synchronize access to `socket.accept()` method by
 # using a process-shared lock -- does not seem to be necessary.
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 import os
 import sys
index 07e4cdd2e0cd83048e2009f7e20b0d00115c7142..e64a156ec907f3a0dfe24b3ac5d3fd1153d91928 100644 (file)
@@ -7,6 +7,9 @@
 # in the original order then consider using `Pool.map()` or
 # `Pool.imap()` (which will save on the amount of code needed anyway).
 #
+# Copyright (c) 2006-2008, R Oudkerk
+# All rights reserved.
+#
 
 import time
 import random
index 6235f9ed3e6d0f60f91d01a57d6e453141477712..19b80abbe584fd6afc31cd747bb1cbe11316b1cf 100644 (file)
@@ -223,8 +223,8 @@ Connection Objects
 
 .. attribute:: Connection.isolation_level
 
-   Get or set the current isolation level. :const:`None` for autocommit mode or one of
-   "DEFERRED", "IMMEDIATE" or "EXLUSIVE". See section
+   Get or set the current isolation level. :const:`None` for autocommit mode or
+   one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section
    :ref:`sqlite3-controlling-transactions` for a more detailed explanation.
 
 
index 4736fc3a7c733986d3b76b9cf62f4b6bedfd489d..19e15473fdf17edb848b49745fb3a08c1b05bbc7 100644 (file)
@@ -37,7 +37,8 @@ The following methods of :class:`StringIO` objects require special mention:
 
 .. method:: StringIO.close()
 
-   Free the memory buffer.
+   Free the memory buffer.  Attempting to do further operations with a closed
+   :class:`StringIO` object will raise a :exc:`ValueError`.
 
 Example usage::
 
index f96505630ae5487a4a326bd8907adb0d75f2edeb..10be01a6ba623c33dd4c22f1ea82bec3c29cf3c9 100644 (file)
@@ -113,7 +113,7 @@ def cpu_count():
             num = int(os.environ['NUMBER_OF_PROCESSORS'])
         except (ValueError, KeyError):
             num = 0
-    elif sys.platform == 'darwin':
+    elif 'bsd' in sys.platform or sys.platform == 'darwin':
         try:
             num = int(os.popen('sysctl -n hw.ncpu').read())
         except ValueError:
index e2560b61d59eb760f390202b99c392885e1b24bd..c8c0648e51352d900fc86dc26b22edd2816ea54e 100644 (file)
@@ -107,19 +107,23 @@ class BasicTest(TestCase):
         for hp in ("www.python.org:abc", "www.python.org:"):
             self.assertRaises(httplib.InvalidURL, httplib.HTTP, hp)
 
-        for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b", 8000),
+        for hp, h, p in (("[fe80::207:e9ff:fe9b]:8000", "fe80::207:e9ff:fe9b",
+                          8000),
                          ("www.python.org:80", "www.python.org", 80),
                          ("www.python.org", "www.python.org", 80),
                          ("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)):
             http = httplib.HTTP(hp)
             c = http._conn
-            if h != c.host: self.fail("Host incorrectly parsed: %s != %s" % (h, c.host))
-            if p != c.port: self.fail("Port incorrectly parsed: %s != %s" % (p, c.host))
+            if h != c.host:
+                self.fail("Host incorrectly parsed: %s != %s" % (h, c.host))
+            if p != c.port:
+                self.fail("Port incorrectly parsed: %s != %s" % (p, c.host))
 
     def test_response_headers(self):
         # test response with multiple message headers with the same field name.
         text = ('HTTP/1.1 200 OK\r\n'
-                'Set-Cookie: Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"\r\n'
+                'Set-Cookie: Customer="WILE_E_COYOTE";'
+                ' Version="1"; Path="/acme"\r\n'
                 'Set-Cookie: Part_Number="Rocket_Launcher_0001"; Version="1";'
                 ' Path="/acme"\r\n'
                 '\r\n'
@@ -187,7 +191,8 @@ class BasicTest(TestCase):
                 resp.close()
 
     def test_negative_content_length(self):
-        sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
+        sock = FakeSocket('HTTP/1.1 200 OK\r\n'
+                          'Content-Length: -1\r\n\r\nHello\r\n')
         resp = httplib.HTTPResponse(sock, method="GET")
         resp.begin()
         self.assertEquals(resp.read(), 'Hello\r\n')
index a7ffd1ea7a628950707b3509078d6528786dc312..a5ba71e30ca8f701d138094a93b44b21f7624107 100644 (file)
@@ -512,7 +512,6 @@ semlock_getvalue(SemLockObject *self)
 static PyObject *
 semlock_iszero(SemLockObject *self)
 {
-       int sval;
 #if HAVE_BROKEN_SEM_GETVALUE
        if (sem_trywait(self->handle) < 0) {
                if (errno == EAGAIN)
@@ -524,6 +523,7 @@ semlock_iszero(SemLockObject *self)
                Py_RETURN_FALSE;
        }
 #else
+       int sval;
        if (SEM_GETVALUE(self->handle, &sval) < 0)
                return mp_SetError(NULL, MP_STANDARD_ERROR);
        return PyBool_FromLong((long)sval == 0);
index 17424256a22bd13681791115a1918805a2c387df..ba148430f1bbd9321bb8b8978a210dc7500e32a9 100644 (file)
@@ -7680,7 +7680,7 @@ unicode_rsplit(PyUnicodeObject *self, PyObject *args)
 }
 
 PyDoc_STRVAR(splitlines__doc__,
-"S.splitlines([keepends]]) -> list of strings\n\
+"S.splitlines([keepends]) -> list of strings\n\
 \n\
 Return a list of the lines in S, breaking at line boundaries.\n\
 Line breaks are not included in the resulting list unless keepends\n\
index 9e57bb4c0f82c0666fc9aafb5aefd09e77e65f21..9357c7ed8d2ef4c720c707a1e740bb7b6f0c9f4b 100644 (file)
@@ -39,9 +39,9 @@ def propfiles(root, fn):
         format = int(open(os.path.join(root, ".svn", "format")).read().strip())
     except IOError:
         return []
-    if format == 8:
-        # In version 8, committed props are stored in prop-base,
-        # local modifications in props
+    if format in (8, 9):
+        # In version 8 and 9, committed props are stored in prop-base, local
+        # modifications in props
         return [os.path.join(root, ".svn", "prop-base", fn+".svn-base"),
                 os.path.join(root, ".svn", "props", fn+".svn-work")]
     raise ValueError, "Unknown repository format"
index 97a7d41b6fb36e82a330c3cc788dcd97d31491e3..cf70489a3d569199092901a3ff144660ce53e8f8 100644 (file)
@@ -1,7 +1,7 @@
 dnl ***********************************************
 dnl * Please run autoreconf to test your changes! *
 dnl ***********************************************
-dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.63).
+dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61).
 
 # Set VERSION so we only need to edit in one place (i.e., here)
 m4_define(PYTHON_VERSION, 2.6)
@@ -1844,7 +1844,7 @@ AC_MSG_RESULT($SHLIBS)
 AC_CHECK_LIB(dl, dlopen)       # Dynamic linking for SunOS/Solaris and SYSV
 AC_CHECK_LIB(dld, shl_load)    # Dynamic linking for HP-UX
 
-# only check for sem_ini if thread support is requested
+# only check for sem_init if thread support is requested
 if test "$with_threads" = "yes" -o -z "$with_threads"; then
     AC_SEARCH_LIBS(sem_init, pthread rt posix4) # 'Real Time' functions on Solaris
                                                # posix4 on Solaris 2.6