]> granicus.if.org Git - python/commitdiff
Merged revisions 68162,68166,68171,68176,68195-68196,68210,68232 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 22:47:39 +0000 (22:47 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 3 Jan 2009 22:47:39 +0000 (22:47 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68162 | ronald.oussoren | 2009-01-02 16:06:00 +0100 (Fri, 02 Jan 2009) | 3 lines

  Fix for issue 4472 is incompatible with Cygwin, this patch
  should fix that.
........
  r68166 | benjamin.peterson | 2009-01-02 19:26:23 +0100 (Fri, 02 Jan 2009) | 1 line

  document PyMemberDef
........
  r68171 | georg.brandl | 2009-01-02 21:25:14 +0100 (Fri, 02 Jan 2009) | 3 lines

  #4811: fix markup glitches (mostly remains of the conversion),
  found by Gabriel Genellina.
........
  r68176 | andrew.kuchling | 2009-01-02 22:00:35 +0100 (Fri, 02 Jan 2009) | 1 line

  Add various items
........
  r68195 | georg.brandl | 2009-01-03 14:45:15 +0100 (Sat, 03 Jan 2009) | 2 lines

  Remove useless string literal.
........
  r68196 | georg.brandl | 2009-01-03 15:29:53 +0100 (Sat, 03 Jan 2009) | 2 lines

  Fix indentation.
........
  r68210 | georg.brandl | 2009-01-03 20:10:12 +0100 (Sat, 03 Jan 2009) | 2 lines

  Set eol-style correctly for mp_distributing.py.
........
  r68232 | georg.brandl | 2009-01-03 22:52:16 +0100 (Sat, 03 Jan 2009) | 2 lines

  Grammar fix.
........

23 files changed:
Doc/ACKS.txt
Doc/c-api/arg.rst
Doc/c-api/structures.rst
Doc/distutils/apiref.rst
Doc/howto/functional.rst
Doc/howto/urllib2.rst
Doc/install/index.rst
Doc/library/email.mime.rst
Doc/library/gzip.rst
Doc/library/http.cookiejar.rst
Doc/library/json.rst
Doc/library/multiprocessing.rst
Doc/library/numbers.rst
Doc/library/parser.rst
Doc/library/smtplib.rst
Doc/library/urllib.parse.rst
Doc/tutorial/inputoutput.rst
Doc/using/cmdline.rst
Doc/whatsnew/2.4.rst
Doc/whatsnew/2.5.rst
Doc/whatsnew/2.7.rst
Makefile.pre.in
Parser/asdl.py

index 4537c654788b2f766a423cfb8f5fb07d45a7e5d8..775798ba7d2ed0e92bdda1928b931612c4728afa 100644 (file)
@@ -60,6 +60,7 @@ docs@python.org), and we'll be glad to correct the problem.
    * Peter Funk
    * Lele Gaifax
    * Matthew Gallagher
+   * Gabriel Genellina
    * Ben Gertzfield
    * Nadim Ghaznavi
    * Jonathan Giddy
index 1b2ab8f843c66dfb6e4538e90dd458becaafab49..96068d988af204dfd33588375d4412fbf1261730 100644 (file)
@@ -53,8 +53,9 @@ variable(s) whose address should be passed.
    string may contain embedded null bytes.  Unicode objects pass back a pointer
    to the default encoded string version of the object if such a conversion is
    possible.  All other read-buffer compatible objects pass back a reference to
-   the raw internal data representation.  Since this format doesn't allow writable buffer compatible objects like byte
-   arrays, ``s*`` is to be preferred.
+   the raw internal data representation.  Since this format doesn't allow
+   writable buffer compatible objects like byte arrays, ``s*`` is to be
+   preferred.
 
    The type of the length argument (int or :ctype:`Py_ssize_t`) is controlled by
    defining the macro :cmacro:`PY_SSIZE_T_CLEAN` before including
index 04fe8f44d5f95d4f047243dccc28bb957a8bc3ee..fdbd806cb9ddc623c16a16bf1f6fc7da63919cb2 100644 (file)
@@ -198,3 +198,64 @@ definition with the same method name.
    object and will co-exist with the slot.  This is helpful because calls to
    PyCFunctions are optimized more than wrapper object calls.
 
+
+.. ctype:: PyMemberDef
+
+   Structure which describes an attribute of a type which corresponds to a C
+   struct member.  Its fields are:
+
+   +------------------+-------------+-------------------------------+
+   | Field            | C Type      | Meaning                       |
+   +==================+=============+===============================+
+   | :attr:`name`     | char \*     | name of the member            |
+   +------------------+-------------+-------------------------------+
+   | :attr:`type`     | int         | the type of the member in the |
+   |                  |             | C struct                      |
+   +------------------+-------------+-------------------------------+
+   | :attr:`offset`   | Py_ssize_t  | the offset in bytes that the  |
+   |                  |             | member is located on the      |
+   |                  |             | type's object struct          |
+   +------------------+-------------+-------------------------------+
+   | :attr:`flags`    | int         | flag bits indicating if the   |
+   |                  |             | field should be read-only or  |
+   |                  |             | writable                      |
+   +------------------+-------------+-------------------------------+
+   | :attr:`doc`      | char \*     | points to the contents of the |
+   |                  |             | docstring                     |
+   +------------------+-------------+-------------------------------+
+
+   :attr:`type` can be one of many ``T_`` macros corresponding to various C
+   types.  When the member is accessed in Python, it will be converted to the
+   equivalent Python type.
+
+   =============== ==================
+   Macro name      C type
+   =============== ==================
+   T_SHORT         short
+   T_INT           int
+   T_LONG          long
+   T_FLOAT         float
+   T_DOUBLE        double
+   T_STRING        char \*
+   T_OBJECT        PyObject \*
+   T_OBJECT_EX     PyObject \*
+   T_CHAR          char
+   T_BYTE          char
+   T_UNBYTE        unsigned char
+   T_UINT          unsigned int
+   T_USHORT        unsigned short
+   T_ULONG         unsigned long
+   T_BOOL          char
+   T_LONGLONG      long long
+   T_ULONGLONG     unsigned long long
+   T_PYSSIZET      Py_ssize_t
+   =============== ==================
+
+   :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX` differ in that
+   :cmacro:`T_OBJECT` returns ``None`` if the member is *NULL* and
+   :cmacro:`T_OBJECT_EX` raises an :exc:`AttributeError`.
+
+   :attr:`flags` can be 0 for write and read access or :cmacro:`READONLY` for
+   read-only access.  Using :cmacro:`T_STRING` for :attr:`type` implies
+   :cmacro:`READONLY`.  Only :cmacro:`T_OBJECT` and :cmacro:`T_OBJECT_EX`
+   members can be deleted.  (They are set to *NULL*).
index 868099ba5fdc2359017e134bd2a81512acb111fb..612993414d3342eab95aca75bfbf76253c129dc8 100644 (file)
@@ -188,9 +188,10 @@ the full reference.
    |                        | for C/C++ header files (in     |                           |
    |                        | Unix form for portability)     |                           |
    +------------------------+--------------------------------+---------------------------+
-   | *define_macros*        | list of macros to define; each | (string,string)  tuple or |
-   |                        | macro is defined using a       | (name,``None``)           |
-   |                        | 2-tuple, where 'value' is      |                           |
+   | *define_macros*        | list of macros to define; each | (string, string) tuple or |
+   |                        | macro is defined using a       | (name, ``None``)          |
+   |                        | 2-tuple ``(name, value)``,     |                           |
+   |                        | where *value* is               |                           |
    |                        | either the string to define it |                           |
    |                        | to or ``None`` to define it    |                           |
    |                        | without a particular value     |                           |
index cfa831ebb406c1555f75cc1c45d4fe24f8714f89..9aa0aed8f9e82946d93e430c72180d32997c6c6f 100644 (file)
@@ -586,7 +586,7 @@ And here's an example of changing the counter:
     9
     >>> next(it)
     Traceback (most recent call last):
-      File ``t.py'', line 15, in ?
+      File "t.py", line 15, in ?
         it.next()
     StopIteration
 
index b71b30079660991b2eb8d08012164592c74fad6b..e57f9e53e3ef2f67b28a8cb8d5baa2d8b4d03604 100644 (file)
@@ -475,7 +475,7 @@ than the URL you pass to .add_password() will also match. ::
     password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
 
     # Add the username and password.
-    # If we knew the realm, we could use it instead of ``None``.
+    # If we knew the realm, we could use it instead of None.
     top_level_url = "http://example.com/foo/"
     password_mgr.add_password(None, top_level_url, username, password)
 
index 3b47f7250f9559bfff73d164ec8cf1f06269272d..42f41a7e8316de0e385f9600405ab9c188644d44 100644 (file)
@@ -584,7 +584,7 @@ value of ``sys.path``.   ::
    $ python
    Python 2.2 (#11, Oct  3 2002, 13:31:27)
    [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
-   Type ``help'', ``copyright'', ``credits'' or ``license'' for more information.
+   Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.path
    ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2',
index 83f4228dda773aae42c733df9697b08666df51bd..95407b0a1a337a2e3dc686e61d7e7eecb4869862 100644 (file)
@@ -55,14 +55,14 @@ Here are the classes:
 
 .. currentmodule:: email.mime.multipart
 
-.. class:: MIMEMultipart([subtype[, boundary[, _subparts[, _params]]]])
+.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]])
 
    Module: :mod:`email.mime.multipart`
 
    A subclass of :class:`MIMEBase`, this is an intermediate base class for MIME
    messages that are :mimetype:`multipart`.  Optional *_subtype* defaults to
    :mimetype:`mixed`, but can be used to specify the subtype of the message.  A
-   :mailheader:`Content-Type` header of :mimetype:`multipart/`*_subtype* will be
+   :mailheader:`Content-Type` header of :mimetype:`multipart/_subtype` will be
    added to the message object.  A :mailheader:`MIME-Version` header will also be
    added.
 
index 86be3cdd94d368ce5e489b3baf923d0a1aa9e9d3..c6f9ef82bd3182d2242a43a947b310b1c26cafac 100644 (file)
@@ -7,7 +7,7 @@
 This module provides a simple interface to compress and decompress files just
 like the GNU programs :program:`gzip` and :program:`gunzip` would.
 
-The data compression is provided by the :mod:``zlib`` module.
+The data compression is provided by the :mod:`zlib` module.
 
 The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled
 after Python's File Object. The :class:`GzipFile` class reads and writes
index 79c89c7f1c720293ae782dbf1605a240bdb25700..7141d5beb1081cc0e39a0457f5f9dd478c3e8d72 100644 (file)
@@ -704,7 +704,7 @@ accessed using the following methods:
 The :class:`Cookie` class also defines the following method:
 
 
-.. method:: Cookie.is_expired([now=:const:`None`])
+.. method:: Cookie.is_expired([now=None])
 
    True if cookie has passed the time at which the server requested it should
    expire.  If *now* is given (in seconds since the epoch), return whether the
index 69d4c1024867df196eecc6ce86cc4f3e4bde3a42..22925f53c8faa2d4dcbcea9f3a5dfd9fac32613f 100644 (file)
@@ -151,7 +151,7 @@ Basic Usage
    *default(obj)* is a function that should return a serializable version of
    *obj* or raise :exc:`TypeError`.  The default simply raises :exc:`TypeError`.
 
-   To use a custom :class:`JSONEncoder`` subclass (e.g. one that overrides the
+   To use a custom :class:`JSONEncoder` subclass (e.g. one that overrides the
    :meth:`default` method to serialize additional types), specify it with the
    *cls* kwarg.
 
index e5dd1ed1d73c76a3eaf367d349fce653319e8574..6334d32b6e63f260dae95a65eada62a041fd4a29 100644 (file)
@@ -107,12 +107,12 @@ processes:
       def f(q):
           q.put([42, None, 'hello'])
 
-       if __name__ == '__main__':
-           q = Queue()
-           p = Process(target=f, args=(q,))
-           p.start()
-           print(q.get())    # prints "[42, None, 'hello']"
-           p.join()
+      if __name__ == '__main__':
+          q = Queue()
+          p = Process(target=f, args=(q,))
+          p.start()
+          print(q.get())    # prints "[42, None, 'hello']"
+          p.join()
 
    Queues are thread and process safe.
 
@@ -1136,18 +1136,18 @@ their parent process exits.  The manager classes are defined in the
 
       Returns a :class:`Server` object which represents the actual server under
       the control of the Manager. The :class:`Server` object supports the
-      :meth:`serve_forever` method::
+      :meth:`serve_forever` method:
 
-       >>> from multiprocessing.managers import BaseManager
-       >>> m = BaseManager(address=('', 50000), authkey='abc'))
-       >>> server = m.get_server()
-       >>> s.serve_forever()
+      >>> from multiprocessing.managers import BaseManager
+      >>> m = BaseManager(address=('', 50000), authkey='abc'))
+      >>> server = m.get_server()
+      >>> s.serve_forever()
 
-       :class:`Server` additionally have an :attr:`address` attribute.
+      :class:`Server` additionally have an :attr:`address` attribute.
 
    .. method:: connect()
 
-      Connect a local manager object to a remote manager process::
+      Connect a local manager object to a remote manager process:
 
       >>> from multiprocessing.managers import BaseManager
       >>> m = BaseManager(address='127.0.0.1', authkey='abc))
@@ -1293,7 +1293,7 @@ Customized managers
 >>>>>>>>>>>>>>>>>>>
 
 To create one's own manager, one creates a subclass of :class:`BaseManager` and
-use the :meth:`~BaseManager.resgister` classmethod to register new types or
+use the :meth:`~BaseManager.register` classmethod to register new types or
 callables with the manager class.  For example::
 
    from multiprocessing.managers import BaseManager
@@ -1809,7 +1809,7 @@ Address Formats
 
 * An ``'AF_PIPE'`` address is a string of the form
    :samp:`r'\\\\.\\pipe\\{PipeName}'`.  To use :func:`Client` to connect to a named
-   pipe on a remote computer called ServerName* one should use an address of the
+   pipe on a remote computer called *ServerName* one should use an address of the
    form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead.
 
 Note that any string beginning with two backslashes is assumed by default to be
index e2d08bbcc01e18dfff49828744ff14c8b8c1cd3d..ae14c905181406acc1515d9e69e6381787c4b387 100644 (file)
@@ -49,14 +49,14 @@ The numeric tower
    :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``,
    ``%``, ``<``, ``<=``, ``>``, and ``>=``.
 
-   Real also provides defaults for :func:`complex`, :attr:`Complex.real`,
-   :attr:`Complex.imag`, and :meth:`Complex.conjugate`.
+   Real also provides defaults for :func:`complex`, :attr:`~Complex.real`,
+   :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`.
 
 
 .. class:: Rational
 
    Subtypes :class:`Real` and adds
-   :attr:`Rational.numerator` and :attr:`Rational.denominator` properties, which
+   :attr:`~Rational.numerator` and :attr:`~Rational.denominator` properties, which
    should be in lowest terms. With these, it provides a default for
    :func:`float`.
 
@@ -72,8 +72,8 @@ The numeric tower
 .. class:: Integral
 
    Subtypes :class:`Rational` and adds a conversion to :class:`int`.
-   Provides defaults for :func:`float`, :attr:`Rational.numerator`, and
-   :attr:`Rational.denominator`, and bit-string operations: ``<<``,
+   Provides defaults for :func:`float`, :attr:`~Rational.numerator`, and
+   :attr:`~Rational.denominator`, and bit-string operations: ``<<``,
    ``>>``, ``&``, ``^``, ``|``, ``~``.
 
 
@@ -169,7 +169,7 @@ Complex``. I'll consider ``a + b``:
        knowledge of ``A``, so it can handle those instances before
        delegating to :class:`Complex`.
 
-If ``A<:Complex`` and ``B<:Real`` without sharing any other knowledge,
+If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge,
 then the appropriate shared operation is the one involving the built
 in :class:`complex`, and both :meth:`__radd__` s land there, so ``a+b
 == b+a``.
index f5cd87789b0db1c22cacf8d4a0999750dbfc494a..5aad93815b6514021bf5cd1bf51866fad3c07224 100644 (file)
@@ -635,7 +635,7 @@ on the same line as the definition of the code block, as in ::
 while the long form uses an indented block and allows nested definitions::
 
    def make_power(exp):
-       "Make a function that raises an argument to the exponent `exp'."
+       "Make a function that raises an argument to the exponent `exp`."
        def raiser(x, y=exp):
            return x ** y
        return raiser
index 21065b2bb6fcbeb6421ed200bcbf15a7f66ac512..53631207bad80494961dbeb616c8c722ebe165b4 100644 (file)
@@ -200,7 +200,7 @@ An :class:`SMTP` instance has the following methods:
    previous ``EHLO`` or ``HELO`` command this session.  It tries ESMTP ``EHLO``
    first.
 
-   :exc:SMTPHeloError
+   :exc:`SMTPHeloError`
      The server didn't reply properly to the ``HELO`` greeting.
 
 .. method:: SMTP.has_extn(name)
index d013601e4837e61f09d26e1612a149bed0f1480a..28fa66fdd8190e2c352f6980eef4cd6e2f8c5474 100644 (file)
@@ -365,7 +365,7 @@ described in those functions, as well as provide an additional method:
       'http://www.Python.org/doc/'
 
 
-The following classes provide the implementations of the parse results::
+The following classes provide the implementations of the parse results:
 
 .. class:: BaseResult
 
index 1fd779f7c741bc3f42e7d43a01cac0b9181aa5fb..9b903233a50e804046dc1abac8ce1ae68779c7d1 100644 (file)
@@ -151,7 +151,7 @@ Positional and keyword arguments can be arbitrarily combined::
                                                           other='Georg'))
    The story of Bill, Manfred, and Georg.
 
-An optional ``':``` and format specifier can follow the field name. This also
+An optional ``':'`` and format specifier can follow the field name. This also
 greater control over how the value is formatted.  The following example
 truncates the Pi to three places after the decimal.
 
index bfebd9d9116265a4cee3aa4b08fba6390d44480a..3481d5ba6f0a4bbd39a5c9e2dad41e0642f38f20 100644 (file)
@@ -343,7 +343,7 @@ These environment variables influence Python's behavior.
    compiled form). Extension modules cannot be imported from zipfiles.
 
    The default search path is installation dependent, but generally begins with
-   :file:`{prefix}/lib/python{version}`` (see :envvar:`PYTHONHOME` above).  It
+   :file:`{prefix}/lib/python{version}` (see :envvar:`PYTHONHOME` above).  It
    is *always* appended to :envvar:`PYTHONPATH`.
 
    An additional directory will be inserted in the search path in front of
index 67478c26ee4a18d635dbee164b9e32715dba8ec0..9e438ac7615037d282262b2d366ffb1a65146078 100644 (file)
@@ -1428,7 +1428,7 @@ Running the above function's tests with :const:`doctest.REPORT_UDIFF` specified,
 you get the following output::
 
    **********************************************************************
-   File ``t.py'', line 15, in g
+   File "t.py", line 15, in g
    Failed example:
        g(4)
    Differences (unified diff with -expected +actual):
index 16350ac2bf83a734fff8a39b9e986becaaebce88..e1e2887614a4408ec516dfde2483fa604bd1f4a9 100644 (file)
@@ -485,7 +485,7 @@ And here's an example of changing the counter::
    9
    >>> print it.next()
    Traceback (most recent call last):
-     File ``t.py'', line 15, in ?
+     File "t.py", line 15, in ?
        print it.next()
    StopIteration
 
index 61084c8812e3ab900d0ea7f82466972fa4ceaa22..da1762053821b498b86953e0b47e62e15e0967a9 100644 (file)
@@ -103,7 +103,23 @@ changes, sorted alphabetically by module name. Consult the
 :file:`Misc/NEWS` file in the source tree for a more complete list of
 changes, or look through the Subversion logs for all the details.
 
-* To be written.
+* A new function in the :mod:`subprocess` module,
+  :func:`check_output`, runs a command with a specified set of arguments
+  and returns the command's output as a string if the command runs without
+  error, or raises a :exc:`CalledProcessError` exception otherwise.
+
+  ::
+
+    >>> subprocess.check_output(['df', '-h', '.'])
+    'Filesystem     Size   Used  Avail Capacity  Mounted on\n
+    /dev/disk0s2    52G    49G   3.0G    94%    /\n'
+
+    >>> subprocess.check_output(['df', '-h', '/bogus'])
+      ...
+    subprocess.CalledProcessError: Command '['df', '-h', '/bogus']' returned non-zero exit status 1
+
+  (Contributed by Gregory P. Smith.)
+
 
 .. ======================================================================
 .. whole new modules get described in subsections here
@@ -116,13 +132,22 @@ Build and C API Changes
 
 Changes to Python's build process and to the C API include:
 
-* To be written.
+* If you use the :file:`.gdbinit` file provided with Python,
+  the "pyo" macro in the 2.7 version will now work when the thread being
+  debugged doesn't hold the GIL; the macro will now acquire it before printing.
+  (Contributed by haypo XXX; :issue:`3632`.)
 
 .. ======================================================================
 
 Port-Specific Changes: Windows
 -----------------------------------
 
+* The :mod:`msvcrt` module now contains some constants from
+  the :file:`crtassem.h` header file:
+  :data:`CRT_ASSEMBLY_VERSION`,
+  :data:`VC_ASSEMBLY_PUBLICKEYTOKEN`,
+  and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`.
+  (Added by Martin von Loewis (XXX check); :issue:`4365`.)
 
 .. ======================================================================
 
index 6f89a2124f761131fdf77a95638a11620c9c8515..7cd0b4d976a857de0cad53dc11cfd17e9f93f98a 100644 (file)
@@ -777,8 +777,8 @@ altbininstall:      $(BUILDPYTHON)
        done
        $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
        if test -f $(LDLIBRARY); then \
-               if test "$(SO)" = .dll; then \
-                       $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(BINDIR); \
+               if test -n "$(DLLLIBRARY)" ; then \
+                       $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
                else \
                        $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
                        if test $(LDLIBRARY) != $(INSTSONAME); then \
index 3583d846fa8f8b1ed11b672ee2afdc86d028dba4..418ac5717d2a8fd2609c32b3eebbf4592623f5aa 100644 (file)
@@ -176,7 +176,7 @@ class ASDLParser(spark.GenericParser, object):
         return Product(fields)
 
     def p_sum_0(self, constructor):
-        " sum ::= constructor """
+        " sum ::= constructor "
         return [constructor[0]]
 
     def p_sum_1(self, info):