Skip to content

Commit fa0d703

Browse files
committed
Merged revisions 72506,72525-72526,72551,72558,72616,72654-72655,72689,72745,72750,72802,72812,72822,72824,72826-72827,72833,72876,72890,72923,72946,73026,73042,73045,73047,73065,73068-73069 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72506 | vinay.sajip | 2009-05-09 07:07:17 -0500 (Sat, 09 May 2009) | 1 line Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. ........ r72525 | benjamin.peterson | 2009-05-09 20:38:02 -0500 (Sat, 09 May 2009) | 1 line close file explicitly ........ r72526 | benjamin.peterson | 2009-05-09 21:29:00 -0500 (Sat, 09 May 2009) | 1 line make sure files are closed using the with statement ........ r72551 | benjamin.peterson | 2009-05-10 09:16:47 -0500 (Sun, 10 May 2009) | 1 line use isinstance ........ r72558 | benjamin.peterson | 2009-05-10 18:52:09 -0500 (Sun, 10 May 2009) | 1 line sys.setdefaultencoding() strikes me as a bad example ........ r72616 | benjamin.peterson | 2009-05-13 19:33:10 -0500 (Wed, 13 May 2009) | 1 line importlib.import_module is better these days ........ r72654 | benjamin.peterson | 2009-05-14 17:37:49 -0500 (Thu, 14 May 2009) | 1 line prevent refleaks from threads ........ r72655 | benjamin.peterson | 2009-05-14 17:40:34 -0500 (Thu, 14 May 2009) | 1 line a useful decorator for cleaning up threads ........ r72689 | benjamin.peterson | 2009-05-16 13:44:34 -0500 (Sat, 16 May 2009) | 1 line use skipTest() ........ r72745 | benjamin.peterson | 2009-05-17 09:16:29 -0500 (Sun, 17 May 2009) | 1 line ignore .rst files in sphinx its self ........ r72750 | benjamin.peterson | 2009-05-17 11:59:27 -0500 (Sun, 17 May 2009) | 1 line chop off slash ........ r72802 | georg.brandl | 2009-05-20 13:35:27 -0500 (Wed, 20 May 2009) | 1 line #6051: refer to email examples for better way to construct email messages. ........ r72812 | michael.foord | 2009-05-21 17:57:02 -0500 (Thu, 21 May 2009) | 1 line Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072. ........ r72822 | georg.brandl | 2009-05-22 04:33:25 -0500 (Fri, 22 May 2009) | 1 line #6084: fix example. ........ r72824 | georg.brandl | 2009-05-22 04:43:17 -0500 (Fri, 22 May 2009) | 1 line Fix references to file-related functions and methods (os.* vs file.*). ........ r72826 | georg.brandl | 2009-05-22 04:49:42 -0500 (Fri, 22 May 2009) | 1 line Fix confusing wording. ........ r72827 | georg.brandl | 2009-05-22 04:50:30 -0500 (Fri, 22 May 2009) | 1 line s/use/call/ ........ r72833 | georg.brandl | 2009-05-22 12:00:17 -0500 (Fri, 22 May 2009) | 1 line #6078: _warnings is a builtin module and has no standard init_warnings function. ........ r72876 | benjamin.peterson | 2009-05-23 15:59:09 -0500 (Sat, 23 May 2009) | 1 line remove mention of old ctypes version ........ r72890 | gregory.p.smith | 2009-05-24 13:00:13 -0500 (Sun, 24 May 2009) | 2 lines add a versionadded tag for set_tunnel ........ r72923 | michael.foord | 2009-05-25 15:36:56 -0500 (Mon, 25 May 2009) | 1 line Make assertSequenceEqual error messages less cryptic, particularly for nested sequences. ........ r72946 | ronald.oussoren | 2009-05-26 13:44:48 -0500 (Tue, 26 May 2009) | 2 lines Fixes issue 6110 ........ r73026 | r.david.murray | 2009-05-29 14:30:27 -0500 (Fri, 29 May 2009) | 3 lines Issue 6141: document that the first item of args is still the command name even when executable is specified. ........ r73042 | benjamin.peterson | 2009-05-29 22:10:52 -0500 (Fri, 29 May 2009) | 1 line no fdatasync on macos ........ r73045 | georg.brandl | 2009-05-30 02:26:04 -0500 (Sat, 30 May 2009) | 1 line #6146: fix markup bug. ........ r73047 | georg.brandl | 2009-05-30 05:33:23 -0500 (Sat, 30 May 2009) | 1 line Fix some more small markup problems. ........ r73065 | antoine.pitrou | 2009-05-30 16:39:25 -0500 (Sat, 30 May 2009) | 3 lines The test for #5330 wasn't correct. ........ r73068 | antoine.pitrou | 2009-05-30 16:45:40 -0500 (Sat, 30 May 2009) | 3 lines Update ACKS ........ r73069 | benjamin.peterson | 2009-05-30 19:42:42 -0500 (Sat, 30 May 2009) | 1 line fix signature ........
1 parent f11be75 commit fa0d703

23 files changed

Lines changed: 132 additions & 101 deletions

Doc/c-api/buffer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Buffer related functions
137137
Return 1 if *obj* supports the buffer interface otherwise 0.
138138

139139

140-
.. cfunction:: int PyObject_GetBuffer(PyObject *obj, PyObject *view, int flags)
140+
.. cfunction:: int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
141141

142142
Export *obj* into a :ctype:`Py_buffer`, *view*. These arguments must
143143
never be *NULL*. The *flags* argument is a bit field indicating what

Doc/c-api/sequence.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Sequence Protocol
5050

5151
.. cfunction:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i)
5252

53-
Return the *i*th element of *o*, or *NULL* on failure. This is the equivalent of
53+
Return the *i*\ th element of *o*, or *NULL* on failure. This is the equivalent of
5454
the Python expression ``o[i]``.
5555

5656

@@ -62,14 +62,14 @@ Sequence Protocol
6262

6363
.. cfunction:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v)
6464

65-
Assign object *v* to the *i*th element of *o*. Returns ``-1`` on failure. This
65+
Assign object *v* to the *i*\ th element of *o*. Returns ``-1`` on failure. This
6666
is the equivalent of the Python statement ``o[i] = v``. This function *does
6767
not* steal a reference to *v*.
6868

6969

7070
.. cfunction:: int PySequence_DelItem(PyObject *o, Py_ssize_t i)
7171

72-
Delete the *i*th element of object *o*. Returns ``-1`` on failure. This is the
72+
Delete the *i*\ th element of object *o*. Returns ``-1`` on failure. This is the
7373
equivalent of the Python statement ``del o[i]``.
7474

7575

@@ -131,7 +131,7 @@ Sequence Protocol
131131

132132
.. cfunction:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i)
133133

134-
Return the *i*th element of *o*, assuming that *o* was returned by
134+
Return the *i*\ th element of *o*, assuming that *o* was returned by
135135
:cfunc:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds.
136136

137137

@@ -147,7 +147,7 @@ Sequence Protocol
147147

148148
.. cfunction:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i)
149149

150-
Return the *i*th element of *o* or *NULL* on failure. Macro form of
150+
Return the *i*\ th element of *o* or *NULL* on failure. Macro form of
151151
:cfunc:`PySequence_GetItem` but without checking that
152152
:cfunc:`PySequence_Check(o)` is true and without adjustment for negative
153153
indices.

Doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
'library/xml.etree',
4747
]
4848

49+
# Ignore .rst in Sphinx its self.
50+
exclude_trees = ['tools/sphinx']
51+
4952
# Relative filename of the reference count data file.
5053
refcount_file = 'data/refcounts.dat'
5154

Doc/library/ctypes.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,7 @@ constructs a new Python object each time!
12071207
Variable-sized data types
12081208
^^^^^^^^^^^^^^^^^^^^^^^^^
12091209

1210-
``ctypes`` provides some support for variable-sized arrays and structures (this
1211-
was added in version 0.9.9.7).
1210+
``ctypes`` provides some support for variable-sized arrays and structures.
12121211

12131212
The ``resize`` function can be used to resize the memory buffer of an existing
12141213
ctypes object. The function takes the object as first argument, and the

Doc/library/email-examples.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _email-examples:
2+
13
:mod:`email`: Examples
24
----------------------
35

Doc/library/exceptions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ The following exceptions are only used as base classes for other exceptions.
7373

7474
.. exception:: LookupError
7575

76-
The base class for the exceptions that are raised when a key or index used on a
77-
mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This can be
78-
raised directly by :func:`sys.setdefaultencoding`.
76+
The base class for the exceptions that are raised when a key or index used on
77+
a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This
78+
can be raised directly by :func:`codecs.lookup`.
7979

8080

8181
.. exception:: EnvironmentError

Doc/library/functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ are always available. They are listed here in alphabetical order.
12091209
>>> list(zipped)
12101210
[(1, 4), (2, 5), (3, 6)]
12111211
>>> x2, y2 = zip(*zip(x, y))
1212-
>>> x == x2, y == y2
1212+
>>> x == list(x2) and y == list(y2)
12131213
True
12141214

12151215

@@ -1272,7 +1272,7 @@ are always available. They are listed here in alphabetical order.
12721272
names.
12731273

12741274
If you simply want to import a module (potentially within a package) by name,
1275-
you can get it from :data:`sys.modules`::
1275+
you can call :func:`__import__` and then look it up in :data:`sys.modules`::
12761276

12771277
>>> import sys
12781278
>>> name = 'foo.bar.baz'

Doc/library/http.client.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ HTTPConnection Objects
384384
Set the debugging level (the amount of debugging output printed). The default
385385
debug level is ``0``, meaning no debugging output is printed.
386386

387+
.. versionadded:: 2.7
388+
387389

388390
.. method:: HTTPConnection.connect()
389391

Doc/library/os.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ by file descriptors.
386386
.. note::
387387

388388
This function is intended for low-level I/O and must be applied to a file
389-
descriptor as returned by :func:`open` or :func:`pipe`. To close a "file
389+
descriptor as returned by :func:`os.open` or :func:`pipe`. To close a "file
390390
object" returned by the built-in function :func:`open` or by :func:`popen` or
391-
:func:`fdopen`, use its :meth:`close` method.
391+
:func:`fdopen`, use its :meth:`~file.close` method.
392392

393393

394394
.. function:: closerange(fd_low, fd_high)
@@ -439,6 +439,9 @@ by file descriptors.
439439
Force write of file with filedescriptor *fd* to disk. Does not force update of
440440
metadata. Availability: Unix.
441441

442+
.. note::
443+
This function is not available on MacOS.
444+
442445

443446
.. function:: fpathconf(fd, name)
444447

@@ -514,8 +517,8 @@ by file descriptors.
514517
.. note::
515518

516519
This function is intended for low-level I/O. For normal usage, use the built-in
517-
function :func:`open`, which returns a "file object" with :meth:`read` and
518-
:meth:`write` methods (and many more). To wrap a file descriptor in a "file
520+
function :func:`open`, which returns a "file object" with :meth:`~file.read` and
521+
:meth:`~file.write` methods (and many more). To wrap a file descriptor in a "file
519522
object", use :func:`fdopen`.
520523

521524

@@ -544,22 +547,22 @@ by file descriptors.
544547
.. note::
545548

546549
This function is intended for low-level I/O and must be applied to a file
547-
descriptor as returned by :func:`open` or :func:`pipe`. To read a "file object"
550+
descriptor as returned by :func:`os.open` or :func:`pipe`. To read a "file object"
548551
returned by the built-in function :func:`open` or by :func:`popen` or
549-
:func:`fdopen`, or :data:`sys.stdin`, use its :meth:`read` or :meth:`readline`
550-
methods.
552+
:func:`fdopen`, or :data:`sys.stdin`, use its :meth:`~file.read` or
553+
:meth:`~file.readline` methods.
551554

552555

553556
.. function:: tcgetpgrp(fd)
554557

555558
Return the process group associated with the terminal given by *fd* (an open
556-
file descriptor as returned by :func:`open`). Availability: Unix.
559+
file descriptor as returned by :func:`os.open`). Availability: Unix.
557560

558561

559562
.. function:: tcsetpgrp(fd, pg)
560563

561564
Set the process group associated with the terminal given by *fd* (an open file
562-
descriptor as returned by :func:`open`) to *pg*. Availability: Unix.
565+
descriptor as returned by :func:`os.open`) to *pg*. Availability: Unix.
563566

564567

565568
.. function:: ttyname(fd)
@@ -577,13 +580,13 @@ by file descriptors.
577580
.. note::
578581

579582
This function is intended for low-level I/O and must be applied to a file
580-
descriptor as returned by :func:`open` or :func:`pipe`. To write a "file
583+
descriptor as returned by :func:`os.open` or :func:`pipe`. To write a "file
581584
object" returned by the built-in function :func:`open` or by :func:`popen` or
582-
:func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write`
583-
method.
585+
:func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its
586+
:meth:`~file.write` method.
584587

585588
The following constants are options for the *flags* parameter to the
586-
:func:`open` function. They can be combined using the bitwise OR operator
589+
:func:`~os.open` function. They can be combined using the bitwise OR operator
587590
``|``. Some of them are not available on all platforms. For descriptions of
588591
their availability and use, consult the :manpage:`open(2)` manual page on Unix
589592
or `the MSDN <http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>` on Windows.
@@ -660,7 +663,7 @@ Files and Directories
660663
.. note::
661664

662665
Using :func:`access` to check if a user is authorized to e.g. open a file before
663-
actually doing so using :func:`open` creates a security hole, because the user
666+
actually doing so using :func:`open` creates a security hole, because the user
664667
might exploit the short time interval between checking and opening the file to
665668
manipulate it.
666669

Doc/library/rlcompleter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Completer objects have the following method:
5252

5353
.. method:: Completer.complete(text, state)
5454

55-
Return the *state*th completion for *text*.
55+
Return the *state*\ th completion for *text*.
5656

5757
If called for *text* that doesn't include a period character (``'.'``), it will
5858
complete from names currently defined in :mod:`__main__`, :mod:`builtins` and

0 commit comments

Comments
 (0)