Kaydet (Commit) 734e2680 authored tarafından Georg Brandl's avatar Georg Brandl

Merged revisions…

Merged revisions 65437,65469,65476,65480,65502,65528,65539,65543,65558,65561-65562,65565,65591,65601,65608,65610,65639 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65437 | georg.brandl | 2008-08-03 22:28:55 +0000 (Sun, 03 Aug 2008) | 2 lines

  Note the removal of several committers.
........
  r65469 | gregory.p.smith | 2008-08-04 01:03:50 +0000 (Mon, 04 Aug 2008) | 3 lines

  issue1606: Add warnings to the subprocess documentation about common pitfalls
  of using pipes that cause deadlocks.
........
  r65476 | georg.brandl | 2008-08-04 06:29:36 +0000 (Mon, 04 Aug 2008) | 2 lines

  Fix markup.
........
  r65480 | georg.brandl | 2008-08-04 07:31:50 +0000 (Mon, 04 Aug 2008) | 3 lines

  Clarify the meaning of the select() parameters and sync
  names with docstring.
........
  r65502 | gregory.p.smith | 2008-08-04 18:34:07 +0000 (Mon, 04 Aug 2008) | 2 lines

  more cleanup ups of the recently added warnings in the subprocess docs.
........
  r65528 | brett.cannon | 2008-08-04 21:52:25 +0000 (Mon, 04 Aug 2008) | 4 lines

  Add a note about all the modules/packages changed to silence -3 warnings. More
  changes are needed once some decisions are made, but this is the work up to this
  point.
........
  r65539 | andrew.kuchling | 2008-08-05 01:38:08 +0000 (Tue, 05 Aug 2008) | 6 lines

  #3367 from Kristjan Valur Jonsson:
  If a PyTokenizer_FromString() is called with an empty string, the
  tokenizer's line_start member never gets initialized.  Later, it is
  compared with the token pointer 'a' in parsetok.c:193 and that behavior
  can result in undefined behavior.
........
  r65543 | andrew.kuchling | 2008-08-05 02:05:23 +0000 (Tue, 05 Aug 2008) | 1 line

  #3367: revert rev. 65539: this change causes test_parser to fail
........
  r65558 | georg.brandl | 2008-08-06 17:20:41 +0000 (Wed, 06 Aug 2008) | 2 lines

  Fix longstringitem definition. #3505.
........
  r65561 | mark.dickinson | 2008-08-06 20:12:30 +0000 (Wed, 06 Aug 2008) | 2 lines

  Docstring typo
........
  r65562 | mark.dickinson | 2008-08-06 21:36:57 +0000 (Wed, 06 Aug 2008) | 2 lines

  Remove duplicate import
........
  r65565 | andrew.kuchling | 2008-08-07 01:47:34 +0000 (Thu, 07 Aug 2008) | 1 line

  Add some items
........
  r65591 | georg.brandl | 2008-08-08 06:42:20 +0000 (Fri, 08 Aug 2008) | 2 lines

  #3519: callee is an expression too.
........
  r65601 | georg.brandl | 2008-08-08 15:34:34 +0000 (Fri, 08 Aug 2008) | 2 lines

  Remove mention of backquotes in the tutorial.
........
  r65608 | guido.van.rossum | 2008-08-09 14:55:34 +0000 (Sat, 09 Aug 2008) | 2 lines

  Add news item about _sre.compile() re-bytecode validator.
........
  r65610 | antoine.pitrou | 2008-08-09 17:27:23 +0000 (Sat, 09 Aug 2008) | 3 lines

  move NEWS entry to the appropriate section (oops!)
........
  r65639 | georg.brandl | 2008-08-11 10:27:31 +0000 (Mon, 11 Aug 2008) | 2 lines

  #3540: fix exception name.
........
üst eaf8f7a4
...@@ -1478,7 +1478,7 @@ The following exception classes are defined in the :mod:`mailbox` module: ...@@ -1478,7 +1478,7 @@ The following exception classes are defined in the :mod:`mailbox` module:
parameter set to ``False``), or when opening a folder that does not exist. parameter set to ``False``), or when opening a folder that does not exist.
.. exception:: NotEmptyErrorError() .. exception:: NotEmptyError()
Raised when a mailbox is not empty but is expected to be, such as when deleting Raised when a mailbox is not empty but is expected to be, such as when deleting
a folder that contains messages. a folder that contains messages.
......
...@@ -52,19 +52,24 @@ The module defines the following: ...@@ -52,19 +52,24 @@ The module defines the following:
:ref:`kevent-objects` below for the methods supported by kqueue objects. :ref:`kevent-objects` below for the methods supported by kqueue objects.
.. function:: select(iwtd, owtd, ewtd[, timeout]) .. function:: select(rlist, wlist, xlist[, timeout])
This is a straightforward interface to the Unix :cfunc:`select` system call. This is a straightforward interface to the Unix :cfunc:`select` system call.
The first three arguments are sequences of 'waitable objects': either The first three arguments are sequences of 'waitable objects': either
integers representing file descriptors or objects with a parameterless method integers representing file descriptors or objects with a parameterless method
named :meth:`fileno` returning such an integer. The three sequences of named :meth:`fileno` returning such an integer:
waitable objects are for input, output and 'exceptional conditions',
respectively. Empty sequences are allowed, but acceptance of three empty * *rlist*: wait until ready for reading
sequences is platform-dependent. (It is known to work on Unix but not on * *wlist*: wait until ready for writing
Windows.) The optional *timeout* argument specifies a time-out as a floating * *xlist*: wait for an "exceptional condition" (see the manual page for what
point number in seconds. When the *timeout* argument is omitted the function your system considers such a condition)
blocks until at least one file descriptor is ready. A time-out value of zero
specifies a poll and never blocks. Empty sequences are allowed, but acceptance of three empty sequences is
platform-dependent. (It is known to work on Unix but not on Windows.) The
optional *timeout* argument specifies a time-out as a floating point number
in seconds. When the *timeout* argument is omitted the function blocks until
at least one file descriptor is ready. A time-out value of zero specifies a
poll and never blocks.
The return value is a triple of lists of objects that are ready: subsets of the The return value is a triple of lists of objects that are ready: subsets of the
first three arguments. When the time-out is reached without a file descriptor first three arguments. When the time-out is reached without a file descriptor
...@@ -84,9 +89,10 @@ The module defines the following: ...@@ -84,9 +89,10 @@ The module defines the following:
.. index:: single: WinSock .. index:: single: WinSock
File objects on Windows are not acceptable, but sockets are. On Windows, the File objects on Windows are not acceptable, but sockets are. On Windows,
underlying :cfunc:`select` function is provided by the WinSock library, and does the underlying :cfunc:`select` function is provided by the WinSock
not handle file descriptors that don't originate from WinSock. library, and does not handle file descriptors that don't originate from
WinSock.
.. _epoll-objects: .. _epoll-objects:
......
...@@ -215,6 +215,12 @@ Instances of the :class:`Popen` class have the following methods: ...@@ -215,6 +215,12 @@ Instances of the :class:`Popen` class have the following methods:
Wait for child process to terminate. Set and return :attr:`returncode` Wait for child process to terminate. Set and return :attr:`returncode`
attribute. attribute.
.. warning::
This will deadlock if the child process generates enough output to a
stdout or stderr pipe such that it blocks waiting for the OS pipe buffer
to accept more data. Use :meth:`communicate` to avoid that.
.. method:: Popen.communicate(input=None) .. method:: Popen.communicate(input=None)
...@@ -261,6 +267,14 @@ Instances of the :class:`Popen` class have the following methods: ...@@ -261,6 +267,14 @@ Instances of the :class:`Popen` class have the following methods:
The following attributes are also available: The following attributes are also available:
.. warning::
Use :meth:`communicate` rather than :meth:`.stdin.write`,
:meth:`.stdout.read` or :meth:`.stderr.read` to avoid deadlocks due
to any of the other OS pipe buffers filling up and blocking the child
process.
.. attribute:: Popen.stdin .. attribute:: Popen.stdin
If the *stdin* argument is ``PIPE``, this attribute is a file object that If the *stdin* argument is ``PIPE``, this attribute is a file object that
......
...@@ -1212,7 +1212,7 @@ their suffixes:: ...@@ -1212,7 +1212,7 @@ their suffixes::
(expr1, expr2, expr3, expr4) (expr1, expr2, expr3, expr4)
{expr1: expr2, expr3: expr4} {expr1: expr2, expr3: expr4}
expr1 + expr2 * (expr3 - expr4) expr1 + expr2 * (expr3 - expr4)
func(expr1, expr2, *expr3, **expr4) expr1(expr2, expr3, *expr4, **expr5)
expr3, expr4 = expr1, expr2 expr3, expr4 = expr1, expr2
......
...@@ -785,7 +785,7 @@ documentation for a :ref:`complete list <formatstrings>`; here's a sample:: ...@@ -785,7 +785,7 @@ documentation for a :ref:`complete list <formatstrings>`; here's a sample::
'%' - Percentage. Multiplies the number by 100 and displays '%' - Percentage. Multiplies the number by 100 and displays
in fixed ('f') format, followed by a percent sign. in fixed ('f') format, followed by a percent sign.
Classes and types can define a __format__ method to control how they're Classes and types can define a :meth:`__format__` method to control how they're
formatted. It receives a single argument, the format specifier:: formatted. It receives a single argument, the format specifier::
def __format__(self, format_spec): def __format__(self, format_spec):
...@@ -1515,10 +1515,22 @@ Here are all of the changes that Python 2.6 makes to the core Python language. ...@@ -1515,10 +1515,22 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
:func:`isnan`, return true if their floating-point argument is :func:`isnan`, return true if their floating-point argument is
infinite or Not A Number. (:issue:`1640`) infinite or Not A Number. (:issue:`1640`)
The float type has a new instance method :meth:`float.hex` and a Conversion functions were added to convert floating-point numbers
corresponding new class method :meth:`float.fromhex` to convert into hexadecimal strings. (:issue:`3008`) These functions lets you
floating-point numbers to and from hexadecimal strings, convert floats to and from a string representation without
respectively. (:issue:`3008`) introducing rounding errors from the conversion between decimal and
binary. Floats have a :meth:`hex` method that returns a string
representation, and the ``float.fromhex()`` method converts a string
back into a number::
>>> a = 3.75
>>> a.hex()
'0x1.e000000000000p+1'
>>> float.fromhex('0x1.e000000000000p+1')
3.75
>>> b=1./3
>>> b.hex()
'0x1.5555555555555p-2'
* The :mod:`math` module has a number of new functions, and the existing * The :mod:`math` module has a number of new functions, and the existing
functions have been improved to give more consistent behaviour functions have been improved to give more consistent behaviour
...@@ -1633,6 +1645,12 @@ Optimizations ...@@ -1633,6 +1645,12 @@ Optimizations
(Original optimization implemented by Armin Rigo, updated for (Original optimization implemented by Armin Rigo, updated for
Python 2.6 by Kevin Jacobs; :issue:`1700288`.) Python 2.6 by Kevin Jacobs; :issue:`1700288`.)
* Function calls that use keyword arguments
are significantly faster thanks to a patch that does a quick pointer
comparison, usually saving the time of a full string comparison.
(Contributed by Raymond Hettinger, after an initial implementation by
Antoine Pitrou; :issue:`1819`.)
* All of the functions in the :mod:`struct` module have been rewritten in * All of the functions in the :mod:`struct` module have been rewritten in
C, thanks to work at the Need For Speed sprint. C, thanks to work at the Need For Speed sprint.
(Contributed by Raymond Hettinger.) (Contributed by Raymond Hettinger.)
......
...@@ -209,7 +209,7 @@ else: ...@@ -209,7 +209,7 @@ else:
class SocketListener(object): class SocketListener(object):
''' '''
Represtation of a socket which is bound to an address and listening Representation of a socket which is bound to an address and listening
''' '''
def __init__(self, address, family, backlog=1): def __init__(self, address, family, backlog=1):
self._socket = socket.socket(getattr(socket, family)) self._socket = socket.socket(getattr(socket, family))
......
...@@ -22,7 +22,6 @@ import multiprocessing.dummy ...@@ -22,7 +22,6 @@ import multiprocessing.dummy
import multiprocessing.connection import multiprocessing.connection
import multiprocessing.managers import multiprocessing.managers
import multiprocessing.heap import multiprocessing.heap
import multiprocessing.managers
import multiprocessing.pool import multiprocessing.pool
import _multiprocessing import _multiprocessing
......
...@@ -20,7 +20,7 @@ Permissions History ...@@ -20,7 +20,7 @@ Permissions History
- Antoine Pitrou was given SVN access on July 16 2008, by recommendation - Antoine Pitrou was given SVN access on July 16 2008, by recommendation
from GvR, for general contributions to Python. from GvR, for general contributions to Python.
- Jesse Noller was given SVN access on 16 June 2008 by Georg Brandl, - Jesse Noller was given SVN access on 16 June 2008 by GFB,
for work on the multiprocessing module. for work on the multiprocessing module.
- Gregor Lingl was given SVN access on 10 June 2008 by MvL, - Gregor Lingl was given SVN access on 10 June 2008 by MvL,
...@@ -45,13 +45,13 @@ Permissions History ...@@ -45,13 +45,13 @@ Permissions History
for work on branches (ast/optimizer related). for work on branches (ast/optimizer related).
- Jeroen Ruigrok van der Werven was given SVN access on 12 April 2008 - Jeroen Ruigrok van der Werven was given SVN access on 12 April 2008
by Georg Brandl, for documentation work. by GFB, for documentation work.
- Josiah Carlson was given SVN access on 26 March 2008 by Georg Brandl, - Josiah Carlson was given SVN access on 26 March 2008 by GFB,
for work on asyncore/asynchat. for work on asyncore/asynchat.
- Benjamin Peterson was given SVN access on 25 March 2008 by Georg - Benjamin Peterson was given SVN access on 25 March 2008 by GFB,
Brandl, for bug triage work. for bug triage work.
- Jerry Seutter was given SVN access on 20 March 2008 by BAC, for - Jerry Seutter was given SVN access on 20 March 2008 by BAC, for
general contributions to Python. general contributions to Python.
...@@ -196,6 +196,12 @@ Permissions History ...@@ -196,6 +196,12 @@ Permissions History
Permissions Dropped on Request Permissions Dropped on Request
------------------------------ ------------------------------
- Roy Smith, Matt Fleming and Richard Emslie sent drop requests.
4 Aug 2008 GFB
- Per note from Andrew Kuchling, the permissions for Gregory K Johnson
and the Summer Of Code project are no longer needed. 4 Aug 2008 GFB
- Per note from Andrew Kuchling, the permissions for Gregory K Johnson - Per note from Andrew Kuchling, the permissions for Gregory K Johnson
and the Summer Of Code project are no longer needed. AMK will make and the Summer Of Code project are no longer needed. AMK will make
any future checkins directly. 16 Oct 2005 RDH any future checkins directly. 16 Oct 2005 RDH
...@@ -235,3 +241,4 @@ RDH: Raymond Hettinger ...@@ -235,3 +241,4 @@ RDH: Raymond Hettinger
TGP: Tim Peters TGP: Tim Peters
DJG: David Goodger DJG: David Goodger
MvL: Martin v. Loewis MvL: Martin v. Loewis
GFB: Georg Brandl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment