Merged revisions 68133-68134,68141-68142,68145-68146,68148-68149,68159-68162,68166,68171-68174,68179,68195-68196,68210,68214-68215,68217-68222 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line
fill in actual issue number in tests
........
r68134 | hirokazu.yamamoto | 2009-01-01 16:45:39 +0100 (Thu, 01 Jan 2009) | 2 lines
Issue #4797: IOError.filename was not set when _fileio.FileIO failed to open
file with `str' filename on Windows.
........
r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line
fix highlighting
........
r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines
welcome to 2009, Python!
........
r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines
#4801 _collections module fails to build on cygwin.
_PyObject_GC_TRACK is the macro version of PyObject_GC_Track,
and according to documentation it should not be used for extension modules.
........
r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines
Fix for issue4472: "configure --enable-shared doesn't work on OSX"
........
r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines
Forgot to add a NEWS item in my previous checkin
........
r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines
Fix for issue4780
........
r68159 | ronald.oussoren | 2009-01-02 15:48:17 +0100 (Fri, 02 Jan 2009) | 2 lines
Fix for issue 1627952
........
r68160 | ronald.oussoren | 2009-01-02 15:52:09 +0100 (Fri, 02 Jan 2009) | 2 lines
Fix for issue r1737832
........
r68161 | ronald.oussoren | 2009-01-02 16:00:05 +0100 (Fri, 02 Jan 2009) | 3 lines
Fix for issue 1149804
........
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.
........
r68172 | martin.v.loewis | 2009-01-02 21:32:55 +0100 (Fri, 02 Jan 2009) | 2 lines
Issue #4075: Use OutputDebugStringW in Py_FatalError.
........
r68173 | martin.v.loewis | 2009-01-02 21:40:14 +0100 (Fri, 02 Jan 2009) | 2 lines
Issue #4051: Prevent conflict of UNICODE macros in cPickle.
........
r68174 | benjamin.peterson | 2009-01-02 21:47:27 +0100 (Fri, 02 Jan 2009) | 1 line
fix compilation on non-Windows platforms
........
r68179 | raymond.hettinger | 2009-01-02 22:26:45 +0100 (Fri, 02 Jan 2009) | 1 line
Issue #4615. Document how to use itertools for de-duping.
........
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.
........
r68214 | georg.brandl | 2009-01-03 20:44:48 +0100 (Sat, 03 Jan 2009) | 2 lines
Make indentation consistent.
........
r68215 | georg.brandl | 2009-01-03 21:15:14 +0100 (Sat, 03 Jan 2009) | 2 lines
Fix role name.
........
r68217 | georg.brandl | 2009-01-03 21:30:15 +0100 (Sat, 03 Jan 2009) | 2 lines
Add rstlint, a little tool to find subtle markup problems and inconsistencies in the Doc sources.
........
r68218 | georg.brandl | 2009-01-03 21:38:59 +0100 (Sat, 03 Jan 2009) | 2 lines
Recognize usage of the default role.
........
r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines
Fix uses of the default role.
........
r68220 | georg.brandl | 2009-01-03 21:55:06 +0100 (Sat, 03 Jan 2009) | 2 lines
Remove trailing whitespace.
........
r68221 | georg.brandl | 2009-01-03 22:04:55 +0100 (Sat, 03 Jan 2009) | 2 lines
Remove tabs from the documentation.
........
r68222 | georg.brandl | 2009-01-03 22:11:58 +0100 (Sat, 03 Jan 2009) | 2 lines
Disable the line length checker by default.
........
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 144a365..9d14d1c 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -46,12 +46,12 @@
:ctype:`Py_ssize_t` rather than an int.
``s*`` (string, Unicode, or any buffer compatible object) [Py_buffer \*]
- Similar to ``s#``, this code fills a Py_buffer structure provided by the caller.
- The buffer gets locked, so that the caller can subsequently use the buffer even
- inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling
- ``PyBuffer_Release`` with the structure after it has processed the data.
+ Similar to ``s#``, this code fills a Py_buffer structure provided by the caller.
+ The buffer gets locked, so that the caller can subsequently use the buffer even
+ inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is responsible for calling
+ ``PyBuffer_Release`` with the structure after it has processed the data.
- .. versionadded:: 2.6
+ .. versionadded:: 2.6
``z`` (string or ``None``) [const char \*]
Like ``s``, but the Python object may also be ``None``, in which case the C
@@ -63,7 +63,7 @@
``z*`` (string or ``None`` or any buffer compatible object) [Py_buffer*]
This is to ``s*`` as ``z`` is to ``s``.
- .. versionadded:: 2.6
+ .. versionadded:: 2.6
``u`` (Unicode object) [Py_UNICODE \*]
Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of
@@ -261,6 +261,7 @@
``w*`` (read-write byte-oriented buffer) [Py_buffer \*]
This is to ``w`` what ``s*`` is to ``s``.
+
.. versionadded:: 2.6
``(items)`` (tuple) [*matching-items*]
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index bf367d8..6b80ad6 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -30,7 +30,7 @@
.. index:: single: PyBufferProcs
-More information on the buffer interface is provided in the section
+More information on the buffer interface is provided in the section
:ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`.
A "buffer object" is defined in the :file:`bufferobject.h` header (included by
diff --git a/Doc/c-api/conversion.rst b/Doc/c-api/conversion.rst
index 5a747ef..0c81bc0 100644
--- a/Doc/c-api/conversion.rst
+++ b/Doc/c-api/conversion.rst
@@ -77,7 +77,7 @@
.. versionadded:: 2.4
-
+
.. cfunction:: double PyOS_ascii_atof(const char *nptr)
Convert a string to a :ctype:`double` in a locale-independent way.
@@ -86,7 +86,7 @@
See the Unix man page :manpage:`atof(2)` for details.
-
+
.. cfunction:: char * PyOS_stricmp(char *s1, char *s2)
Case insensitive comparison of strings. The function works almost
diff --git a/Doc/c-api/file.rst b/Doc/c-api/file.rst
index aa753e5..5d74355 100644
--- a/Doc/c-api/file.rst
+++ b/Doc/c-api/file.rst
@@ -63,8 +63,8 @@
Return the file object associated with *p* as a :ctype:`FILE\*`.
If the caller will ever use the returned :ctype:`FILE\*` object while
- the GIL is released it must also call the `PyFile_IncUseCount` and
- `PyFile_DecUseCount` functions described below as appropriate.
+ the GIL is released it must also call the :cfunc:`PyFile_IncUseCount` and
+ :cfunc:`PyFile_DecUseCount` functions described below as appropriate.
.. cfunction:: void PyFile_IncUseCount(PyFileObject \*p)
@@ -72,13 +72,13 @@
Increments the PyFileObject's internal use count to indicate
that the underlying :ctype:`FILE\*` is being used.
This prevents Python from calling f_close() on it from another thread.
- Callers of this must call `PyFile_DecUseCount` when they are
+ Callers of this must call :cfunc:`PyFile_DecUseCount` when they are
finished with the :ctype:`FILE\*`. Otherwise the file object will
never be closed by Python.
The GIL must be held while calling this function.
- The suggested use is to call this after `PyFile_AsFile` just before
+ The suggested use is to call this after :cfunc:`PyFile_AsFile` just before
you release the GIL.
.. versionadded:: 2.6
@@ -88,7 +88,7 @@
Decrements the PyFileObject's internal unlocked_count member to
indicate that the caller is done with its own use of the :ctype:`FILE\*`.
- This may only be called to undo a prior call to `PyFile_IncUseCount`.
+ This may only be called to undo a prior call to :cfunc:`PyFile_IncUseCount`.
The GIL must be held while calling this function.
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 17fb82e..a4a202a 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -902,7 +902,7 @@
Return a tuple of function call counts. There are constants defined for the
positions within the tuple:
-
+
+-------------------------------+-------+
| Name | Value |
+===============================+=======+
@@ -928,7 +928,7 @@
+-------------------------------+-------+
| :const:`PCALL_POP` | 10 |
+-------------------------------+-------+
-
+
:const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created.
:const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used.
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index 57015db..4b21fd4 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -126,7 +126,7 @@
Return a C :ctype:`long` representation of the contents of *pylong*. If
*pylong* is greater than :const:`LONG_MAX`, an :exc:`OverflowError` is raised
- and ``-1`` will be returned.
+ and ``-1`` will be returned.
.. cfunction:: Py_ssize_t PyLong_AsSsize_t(PyObject *pylong)
diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index 9d16ef5..abac599 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -106,7 +106,7 @@
.. cfunction:: int PyModule_AddIntMacro(PyObject *module, macro)
- Add an int constant to *module*. The name and the value are taken from
+ Add an int constant to *module*. The name and the value are taken from
*macro*. For example ``PyModule_AddConstant(module, AF_INET)`` adds the int
constant *AF_INET* with the value of *AF_INET* to *module*.
Return ``-1`` on error, ``0`` on success.
diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst
index 8a96ce3..822c593 100644
--- a/Doc/c-api/reflection.rst
+++ b/Doc/c-api/reflection.rst
@@ -15,7 +15,7 @@
Return a dictionary of the local variables in the current execution frame,
or *NULL* if no frame is currently executing.
-
+
.. cfunction:: PyObject* PyEval_GetGlobals()
diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst
index e16c2e3..7f5e77a 100644
--- a/Doc/c-api/sequence.rst
+++ b/Doc/c-api/sequence.rst
@@ -143,9 +143,9 @@
Return the underlying array of PyObject pointers. Assumes that *o* was returned
by :cfunc:`PySequence_Fast` and *o* is not *NULL*.
-
+
Note, if a list gets resized, the reallocation may relocate the items array.
- So, only use the underlying array pointer in contexts where the sequence
+ So, only use the underlying array pointer in contexts where the sequence
cannot change.
.. versionadded:: 2.4
diff --git a/Doc/c-api/set.rst b/Doc/c-api/set.rst
index c6b097d..a60ccd6 100644
--- a/Doc/c-api/set.rst
+++ b/Doc/c-api/set.rst
@@ -101,7 +101,7 @@
.. versionchanged:: 2.6
Now guaranteed to return a brand-new :class:`frozenset`. Formerly,
- frozensets of zero-length were a singleton. This got in the way of
+ frozensets of zero-length were a singleton. This got in the way of
building-up new frozensets with :meth:`PySet_Add`.
The following functions and macros are available for instances of :class:`set`
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 725f554..f8635e5 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -205,6 +205,69 @@
.. versionadded:: 2.4
+.. ctype:: PyMemberDef
+
+ Structure which describes an attribute of a type which corresponds to a C
+ struct member. It's 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` can be
+ deleted. (They are set to *NULL*).
+
+
+
.. cfunction:: PyObject* Py_FindMethod(PyMethodDef table[], PyObject *ob, char *name)
Return a bound method object for an extension type implemented in C. This can