diff options
author | Georg Brandl <georg@python.org> | 2008-01-19 20:08:23 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-19 20:08:23 (GMT) |
commit | fceab5a385f121029bfa7e855f7fd1aca1eb8c3f (patch) | |
tree | 91d552ec2d068287efc8b8f3769cd6865c3c0620 /Doc | |
parent | 2336bddd5dba559db950e8b5fa73257fc62d1fc3 (diff) | |
download | cpython-fceab5a385f121029bfa7e855f7fd1aca1eb8c3f.zip cpython-fceab5a385f121029bfa7e855f7fd1aca1eb8c3f.tar.gz cpython-fceab5a385f121029bfa7e855f7fd1aca1eb8c3f.tar.bz2 |
Merged revisions 60080-60089,60091-60093 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60080 | andrew.kuchling | 2008-01-19 17:26:13 +0100 (Sat, 19 Jan 2008) | 2 lines
Patch #742598 from Michael Pomraning: add .timeout attribute to SocketServer that will call
.handle_timeout() method when no requests are received within the timeout period.
........
r60081 | andrew.kuchling | 2008-01-19 17:34:09 +0100 (Sat, 19 Jan 2008) | 1 line
Add item
........
r60082 | christian.heimes | 2008-01-19 17:39:27 +0100 (Sat, 19 Jan 2008) | 2 lines
Disabled test_xmlrpc:test_404. It's causing lots of false alarms.
I also disabled a test in test_ssl which requires network access to svn.python.org. This fixes a bug Skip has reported a while ago.
........
r60083 | georg.brandl | 2008-01-19 18:38:53 +0100 (Sat, 19 Jan 2008) | 2 lines
Clarify thread.join() docs. #1873.
........
r60084 | georg.brandl | 2008-01-19 19:02:46 +0100 (Sat, 19 Jan 2008) | 2 lines
#1782: don't leak in error case in PyModule_AddXxxConstant. Patch by Hrvoje Nik?\197?\161i?\196?\135.
........
r60085 | andrew.kuchling | 2008-01-19 19:08:52 +0100 (Sat, 19 Jan 2008) | 1 line
Sort two names into position
........
r60086 | andrew.kuchling | 2008-01-19 19:18:41 +0100 (Sat, 19 Jan 2008) | 2 lines
Patch #976880: add mmap .rfind() method, and 'end' paramter to .find().
Contributed by John Lenton.
........
r60087 | facundo.batista | 2008-01-19 19:38:19 +0100 (Sat, 19 Jan 2008) | 5 lines
Fix #1693149. Now you can pass several modules separated by
coma to trace.py in the same --ignore-module option.
Thanks Raghuram Devarakonda.
........
r60088 | facundo.batista | 2008-01-19 19:45:46 +0100 (Sat, 19 Jan 2008) | 3 lines
Comment in NEWS regarding the change in trace.py.
........
r60089 | skip.montanaro | 2008-01-19 19:47:24 +0100 (Sat, 19 Jan 2008) | 2 lines
missing from r60088 checkin.
........
r60091 | andrew.kuchling | 2008-01-19 20:14:05 +0100 (Sat, 19 Jan 2008) | 1 line
Add item
........
r60092 | georg.brandl | 2008-01-19 20:27:05 +0100 (Sat, 19 Jan 2008) | 4 lines
Fix #1679: "0x" was taken as a valid integer literal.
Fixes the tokenizer, tokenize.py and int() to reject this.
Patches by Malte Helmert.
........
r60093 | georg.brandl | 2008-01-19 20:48:19 +0100 (Sat, 19 Jan 2008) | 3 lines
Fix #1146: TextWrap vs words 1-character shorter than the width.
Patch by Quentin Gallet-Gilles.
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/mmap.rst | 17 | ||||
-rw-r--r-- | Doc/library/socketserver.rst | 16 | ||||
-rw-r--r-- | Doc/library/threading.rst | 13 | ||||
-rw-r--r-- | Doc/library/trace.rst | 8 | ||||
-rw-r--r-- | Doc/whatsnew/2.6.rst | 14 |
5 files changed, 54 insertions, 14 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index 9e552fd..37391d0 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -137,11 +137,12 @@ Memory-mapped file objects support the following methods: an exception being raised. -.. method:: mmap.find(string[, start]) +.. method:: mmap.find(string[, start[, end]]) - Returns the lowest index in the object where the substring *string* is found. - Returns ``-1`` on failure. *start* is the index at which the search begins, and - defaults to zero. + Returns the lowest index in the object where the substring *string* is found, + such that *string* is contained in the range [*start*, *end*]. Optional + arguments *start* and *end* are interpreted as in slice notation. + Returns ``-1`` on failure. .. method:: mmap.flush([offset, size]) @@ -186,6 +187,14 @@ Memory-mapped file objects support the following methods: :exc:`TypeError` exception. +.. method:: mmap.rfind(string[, start[, end]]) + + Returns the highest index in the object where the substring *string* is + found, such that *string* is contained in the range [*start*, + *end*]. Optional arguments *start* and *end* are interpreted as in slice + notation. Returns ``-1`` on failure. + + .. method:: mmap.seek(pos[, whence]) Set the file's current position. *whence* argument is optional and defaults to diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst index c900ea7..2c85c86 100644 --- a/Doc/library/socketserver.rst +++ b/Doc/library/socketserver.rst @@ -44,7 +44,7 @@ to behave autonomously; the default is :const:`False`, meaning that Python will not exit until all threads created by :class:`ThreadingMixIn` have exited. Server classes have the same external methods and attributes, no matter what -network protocol they use: +network protocol they use. Server Creation Notes @@ -193,6 +193,13 @@ The server classes support the following class variables: The type of socket used by the server; :const:`socket.SOCK_STREAM` and :const:`socket.SOCK_DGRAM` are two possible values. +.. data:: timeout + + Timeout duration, measured in seconds, or :const:`None` if no timeout is desired. + If no incoming requests are received within the timeout period, + the :meth:`handle_timeout` method is called and then the server resumes waiting for + requests. + There are various server methods that can be overridden by subclasses of base server classes like :class:`TCPServer`; these methods aren't useful to external users of the server object. @@ -220,6 +227,13 @@ users of the server object. method raises an exception. The default action is to print the traceback to standard output and continue handling further requests. +.. function:: handle_timeout() + + This function is called when the :attr:`timeout` attribute has been set to a + value other than :const:`None` and the timeout period has passed with no + requests being received. The default action for forking servers is + to collect the status of any child processes that have exited, while + in threading servers this method does nothing. .. function:: process_request(request, client_address) diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index c015372..6f3e95b 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -615,18 +615,19 @@ impossible to detect the termination of alien threads. When the *timeout* argument is present and not ``None``, it should be a floating point number specifying a timeout for the operation in seconds (or fractions - thereof). As :meth:`join` always returns ``None``, you must call - :meth:`isAlive` to decide whether a timeout happened. + thereof). As :meth:`join` always returns ``None``, you must call :meth:`isAlive` + after :meth:`join` to decide whether a timeout happened -- if the thread is + still alive, the :meth:`join` call timed out. When the *timeout* argument is not present or ``None``, the operation will block until the thread terminates. A thread can be :meth:`join`\ ed many times. - :meth:`join` may throw a :exc:`RuntimeError`, if an attempt is made to join the - current thread as that would cause a deadlock. It is also an error to - :meth:`join` a thread before it has been started and attempts to do so raises - same exception. + :meth:`join` raises a :exc:`RuntimeError` if an attempt is made to join + the current thread as that would cause a deadlock. It is also an error to + :meth:`join` a thread before it has been started and attempts to do so + raises the same exception. .. method:: Thread.getName() diff --git a/Doc/library/trace.rst b/Doc/library/trace.rst index 91cf1a4..9d0c0c4 100644 --- a/Doc/library/trace.rst +++ b/Doc/library/trace.rst @@ -64,12 +64,14 @@ The following command-line arguments are supported: stdout for each file processed. :option:`--ignore-module` - Ignore the named module and its submodules (if it is a package). May be given + Accepts comma separated list of module names. Ignore each of the named + module and its submodules (if it is a package). May be given multiple times. :option:`--ignore-dir` - Ignore all modules and packages in the named directory and subdirectories. May - be given multiple times. + Ignore all modules and packages in the named directory and subdirectories + (multiple directories can be joined by os.pathsep). May be given multiple + times. .. _trace-api: diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 46922a4..e386b36 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -960,6 +960,13 @@ complete list of changes, or look through the CVS logs for all the details. .. Patch #1490190 +* :class:`mmap` objects now have a :meth:`rfind` method that finds + a substring, beginning at the end of the string and searching + backwards. The :meth:`find` method + also gained a *end* parameter containing the index at which to stop + the forward search. + (Contributed by John Lenton.) + * The :mod:`new` module has been removed from Python 3.0. Importing it therefore triggers a warning message when Python is running in 3.0-warning @@ -1102,6 +1109,13 @@ complete list of changes, or look through the CVS logs for all the details. (Contributed by Alberto Bertogli.) .. Patch #1646 + +* The base classes in the :mod:`SocketServer` module now support + calling a :meth:`handle_timeout` method after a span of inactivity + specified by the server's :attr:`timeout` attribute. (Contributed + by Michael Pomraning.) + + .. Patch #742598 * A new variable in the :mod:`sys` module, :attr:`float_info`, is an object |