Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 679db4a

Browse files
committed
Merged revisions 59985-60000,60002,60005-60007,60009-60042 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r59987 | raymond.hettinger | 2008-01-15 21:52:42 +0100 (Tue, 15 Jan 2008) | 1 line Refactor if/elif chain for clarity and speed. Remove dependency on subclasses having to implement _empty and _full. ........ r59988 | raymond.hettinger | 2008-01-15 22:22:47 +0100 (Tue, 15 Jan 2008) | 1 line Fix-up half-written paragraph in the docs ........ r59989 | amaury.forgeotdarc | 2008-01-15 22:25:11 +0100 (Tue, 15 Jan 2008) | 3 lines test_doctest fails since r59984. Not sure if these are the correct values, but save_stdout has to be set before its usage... ........ r59992 | andrew.kuchling | 2008-01-16 01:32:03 +0100 (Wed, 16 Jan 2008) | 1 line Docstring typos ........ r59993 | andrew.kuchling | 2008-01-16 04:17:25 +0100 (Wed, 16 Jan 2008) | 1 line Add PEP 3141 section ........ r59998 | andrew.kuchling | 2008-01-16 14:01:51 +0100 (Wed, 16 Jan 2008) | 1 line Markup fix ........ r59999 | georg.brandl | 2008-01-16 17:56:29 +0100 (Wed, 16 Jan 2008) | 2 lines Fix MSDN library URL. (#1854) ........ r60006 | georg.brandl | 2008-01-16 21:27:56 +0100 (Wed, 16 Jan 2008) | 3 lines Add Python-specific content to Doc dir. Update configuration file to work with the newest Sphinx. ........ r60007 | georg.brandl | 2008-01-16 21:29:00 +0100 (Wed, 16 Jan 2008) | 2 lines Doc build should work with 2.4 now. ........ r60009 | raymond.hettinger | 2008-01-17 00:38:16 +0100 (Thu, 17 Jan 2008) | 1 line Minor wordsmithing. ........ r60010 | raymond.hettinger | 2008-01-17 00:40:45 +0100 (Thu, 17 Jan 2008) | 1 line Add queues will alternative fetch orders (priority based and stack based). ........ r60011 | raymond.hettinger | 2008-01-17 00:49:35 +0100 (Thu, 17 Jan 2008) | 1 line Add news entry. ........ r60013 | raymond.hettinger | 2008-01-17 04:02:14 +0100 (Thu, 17 Jan 2008) | 1 line Make starmap() match its pure python definition and accept any itertable input (not just tuples). ........ r60015 | gregory.p.smith | 2008-01-17 08:43:20 +0100 (Thu, 17 Jan 2008) | 3 lines Comply with RFC 3207. Fixes issue 829951 - http://bugs.python.org/issue829951 ........ r60018 | gregory.p.smith | 2008-01-17 09:03:17 +0100 (Thu, 17 Jan 2008) | 2 lines entry for r60015 ........ r60019 | raymond.hettinger | 2008-01-17 09:07:05 +0100 (Thu, 17 Jan 2008) | 1 line Note versionadded. ........ r60020 | gregory.p.smith | 2008-01-17 09:35:49 +0100 (Thu, 17 Jan 2008) | 8 lines Fixes (accepts patch) issue1339 - http://bugs.python.org/issue1339 - Factor out the duplication of EHLO/HELO in login() and sendmail() to a new function, ehlo_or_helo_if_needed(). - Use ehlo_or_helo_if_needed() in starttls() - Check for the starttls exception in starttls() in the same way as login() checks for the auth extension. Contributed by Bill Fenner. ........ r60021 | andrew.kuchling | 2008-01-17 13:00:15 +0100 (Thu, 17 Jan 2008) | 1 line Revise 3141 section a bit; add some Windows items ........ r60022 | brett.cannon | 2008-01-17 19:45:10 +0100 (Thu, 17 Jan 2008) | 2 lines Fix a function pointer declaration to silence the compiler. ........ r60024 | raymond.hettinger | 2008-01-17 20:31:38 +0100 (Thu, 17 Jan 2008) | 1 line Issue #1861: Add read-only attribute listing upcoming events in the order they will be run. ........ r60025 | andrew.kuchling | 2008-01-17 20:49:24 +0100 (Thu, 17 Jan 2008) | 1 line Correction from Jordan Lewis: halfdelay() uses tenths of a second, not milliseconds ........ r60026 | raymond.hettinger | 2008-01-17 23:27:49 +0100 (Thu, 17 Jan 2008) | 1 line Add advice on choosing between scheduler and threading.Timer(). ........ r60028 | christian.heimes | 2008-01-18 00:01:44 +0100 (Fri, 18 Jan 2008) | 2 lines Updated new property syntax. An elaborate example for subclassing and the getter was missing. Added comment about VS 2008 and PGO builds. ........ r60029 | raymond.hettinger | 2008-01-18 00:32:01 +0100 (Fri, 18 Jan 2008) | 1 line Fix-up Timer() example. ........ r60030 | raymond.hettinger | 2008-01-18 00:56:56 +0100 (Fri, 18 Jan 2008) | 1 line Fix markup ........ r60031 | raymond.hettinger | 2008-01-18 01:10:42 +0100 (Fri, 18 Jan 2008) | 1 line clearcache() needs to remove the dict as well as clear it. ........ r60033 | andrew.kuchling | 2008-01-18 03:26:16 +0100 (Fri, 18 Jan 2008) | 1 line Bump verson ........ r60034 | andrew.kuchling | 2008-01-18 03:42:52 +0100 (Fri, 18 Jan 2008) | 1 line Typo fix ........ r60035 | christian.heimes | 2008-01-18 08:30:20 +0100 (Fri, 18 Jan 2008) | 3 lines Coverity issue CID #197 var_decl: Declared variable "stm" without initializer ninit_use_in_call: Using uninitialized value "stm" (field "stm".tm_zone uninitialized) in call to function "mktime" ........ r60036 | christian.heimes | 2008-01-18 08:45:30 +0100 (Fri, 18 Jan 2008) | 11 lines Coverity issue CID #167 Event alloc_fn: Called allocation function "metacompile" [model] Event var_assign: Assigned variable "gr" to storage returned from "metacompile" gr = metacompile(n); Event pass_arg: Variable "gr" not freed or pointed-to in function "maketables" [model] g = maketables(gr); translatelabels(g); addfirstsets(g); Event leaked_storage: Returned without freeing storage "gr" return g; ........ r60038 | christian.heimes | 2008-01-18 09:04:57 +0100 (Fri, 18 Jan 2008) | 3 lines Coverity issue CID #182 size_error: Allocating 1 bytes to pointer "children", which needs at least 4 bytes ........ r60041 | christian.heimes | 2008-01-18 09:47:59 +0100 (Fri, 18 Jan 2008) | 4 lines Coverity issue CID #169 local_ptr_assign_local: Assigning address of stack variable "namebuf" to pointer "filename" out_of_scope: Variable "namebuf" goes out of scope use_invalid: Used "filename" pointing to out-of-scope variable "namebuf" ........ r60042 | christian.heimes | 2008-01-18 09:53:45 +0100 (Fri, 18 Jan 2008) | 2 lines Coverity CID #168 leaked_storage: Returned without freeing storage "fp" ........
1 parent ff72122 commit 679db4a

29 files changed

Lines changed: 538 additions & 79 deletions

Doc/conf.py

Lines changed: 75 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22
#
33
# Python documentation build configuration file
44
#
5+
# This file is execfile()d with the current directory set to its containing dir.
6+
#
57
# The contents of this file are pickled, so don't put values in the namespace
68
# that aren't pickleable (module imports are okay, they're removed automatically).
79

810
# General configuration
911
# ---------------------
1012

13+
# General substitutions.
14+
project = 'Python'
15+
copyright = '1990-2007, Python Software Foundation'
16+
1117
# The default replacements for |version| and |release|.
12-
# If 'auto', Sphinx looks for the Include/patchlevel.h file in the current Python
18+
# If '<auto>', Sphinx looks for the Include/patchlevel.h file in the current Python
1319
# source tree and replaces the values accordingly.
1420
#
1521
# The short X.Y version.
1622
# version = '2.6'
17-
version = 'auto'
23+
version = '<auto>'
1824
# The full version, including alpha/beta/rc tags.
1925
# release = '2.6a0'
20-
release = 'auto'
26+
release = '<auto>'
2127

2228
# There are two options for replacing |today|: either, you set today to some
2329
# non-false value, then it is used:
@@ -39,6 +45,9 @@
3945
'library/xml.etree.rst',
4046
]
4147

48+
# Relative filename of the reference count data file.
49+
refcount_file = 'data/refcounts.dat'
50+
4251
# If true, '()' will be appended to :func: etc. cross-reference text.
4352
add_function_parentheses = True
4453

@@ -50,9 +59,6 @@
5059
# Options for HTML output
5160
# -----------------------
5261

53-
# The base URL for download links.
54-
html_download_base_url = 'http://docs.python.org/ftp/python/doc/'
55-
5662
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
5763
# using the given strftime format.
5864
html_last_updated_fmt = '%b %d, %Y'
@@ -61,12 +67,71 @@
6167
# typographically correct entities.
6268
html_use_smartypants = True
6369

70+
# Content template for the index page, filename relative to this file.
71+
html_index = 'tools/sphinxext/indexcontent.html'
72+
73+
# Custom sidebar templates, filenames relative to this file.
74+
html_sidebars = {
75+
'index': 'tools/sphinxext/indexsidebar.html',
76+
}
77+
78+
# Additional templates that should be rendered to pages.
79+
html_additional_pages = {
80+
'download': 'tools/sphinxext/download.html',
81+
}
82+
83+
# Output file base name for HTML help builder.
84+
htmlhelp_basename = 'pydoc'
85+
6486

6587
# Options for LaTeX output
6688
# ------------------------
6789

68-
# The paper size ("letter" or "a4").
69-
latex_paper_size = "a4"
90+
# The paper size ('letter' or 'a4').
91+
latex_paper_size = 'a4'
92+
93+
# The font size ('10pt', '11pt' or '12pt').
94+
latex_font_size = '10pt'
95+
96+
# Grouping the document tree into LaTeX files. List of tuples
97+
# (source start file, target name, title, author, document class [howto/manual]).
98+
_stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
99+
latex_documents = [
100+
('c-api/index.rst', 'c-api.tex',
101+
'The Python/C API', _stdauthor, 'manual'),
102+
('distutils/index.rst', 'distutils.tex',
103+
'Distributing Python Modules', _stdauthor, 'manual'),
104+
('documenting/index.rst', 'documenting.tex',
105+
'Documenting Python', 'Georg Brandl', 'manual'),
106+
('extending/index.rst', 'extending.tex',
107+
'Extending and Embedding Python', _stdauthor, 'manual'),
108+
('install/index.rst', 'install.tex',
109+
'Installing Python Modules', _stdauthor, 'manual'),
110+
('library/index.rst', 'library.tex',
111+
'The Python Library Reference', _stdauthor, 'manual'),
112+
('reference/index.rst', 'reference.tex',
113+
'The Python Language Reference', _stdauthor, 'manual'),
114+
('tutorial/index.rst', 'tutorial.tex',
115+
'Python Tutorial', _stdauthor, 'manual'),
116+
('using/index.rst', 'using.tex',
117+
'Using Python', _stdauthor, 'manual'),
118+
('whatsnew/' + version + '.rst', 'whatsnew.tex',
119+
'What\'s New in Python', 'A. M. Kuchling', 'howto'),
120+
]
121+
# Collect all HOWTOs individually
122+
import os
123+
latex_documents.extend(('howto/' + fn, 'howto-' + fn[:-4] + '.tex',
124+
'HOWTO', _stdauthor, 'howto')
125+
for fn in os.listdir('howto')
126+
if fn.endswith('.rst') and fn != 'index.rst')
127+
128+
# Additional stuff for the LaTeX preamble.
129+
latex_preamble = r'''
130+
\authoraddress{
131+
\strong{Python Software Foundation}\\
132+
Email: \email{[email protected]}
133+
}
134+
'''
70135

71-
# The font size ("10pt", "11pt" or "12pt").
72-
latex_font_size = "10pt"
136+
# Documents to append as an appendix to all manuals.
137+
latex_appendices = ['glossary.rst', 'about.rst', 'license.rst', 'copyright.rst']

Doc/howto/curses.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**********************************
44

55
:Author: A.M. Kuchling, Eric S. Raymond
6-
:Release: 2.02
6+
:Release: 2.03
77

88

99
.. topic:: Abstract
@@ -367,8 +367,8 @@ It's possible to change this behavior with the method :meth:`nodelay`. After
367367
``nodelay(1)``, :meth:`getch` for the window becomes non-blocking and returns
368368
``curses.ERR`` (a value of -1) when no input is ready. There's also a
369369
:func:`halfdelay` function, which can be used to (in effect) set a timer on each
370-
:meth:`getch`; if no input becomes available within the number of milliseconds
371-
specified as the argument to :func:`halfdelay`, curses raises an exception.
370+
:meth:`getch`; if no input becomes available within a specified
371+
delay (measured in tenths of a second), curses raises an exception.
372372

373373
The :meth:`getch` method returns an integer; if it's between 0 and 255, it
374374
represents the ASCII code of the key pressed. Values greater than 255 are

Doc/library/collections.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ faster versions that bypass error-checking::
566566
def _replace(self, _map=map, **kwds):
567567
return self._make(_map(kwds.get, ('x', 'y'), self))
568568

569+
The subclasses shown above set ``__slots__`` to an empty tuple. This keeps
570+
keep memory requirements low by preventing the creation of instance dictionaries.
571+
569572

570573
Subclassing is not useful for adding new, stored fields. Instead, simply
571574
create a new named tuple type from the :attr:`_fields` attribute::

Doc/library/itertools.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,19 @@ loops that truncate the stream.
319319

320320
.. function:: starmap(function, iterable)
321321

322-
Make an iterator that computes the function using arguments tuples obtained from
322+
Make an iterator that computes the function using arguments obtained from
323323
the iterable. Used instead of :func:`imap` when argument parameters are already
324324
grouped in tuples from a single iterable (the data has been "pre-zipped"). The
325325
difference between :func:`imap` and :func:`starmap` parallels the distinction
326326
between ``function(a,b)`` and ``function(*c)``. Equivalent to::
327327

328328
def starmap(function, iterable):
329-
iterable = iter(iterable)
330-
while True:
331-
yield function(*next(iterable))
329+
for args in iterable:
330+
yield function(*args)
331+
332+
.. versionchanged:: 2.6
333+
Previously, :func:`starmap` required the function arguments to be tuples.
334+
Now, any iterable is allowed.
332335

333336

334337
.. function:: takewhile(predicate, iterable)

Doc/library/msilib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Database Objects
146146

147147
.. seealso::
148148

149-
`MSIOpenView <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msiopenview.asp>`_
149+
`MSIDatabaseOpenView <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabaseopenview.asp>`_
150150
`MSIDatabaseCommit <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msidatabasecommit.asp>`_
151151
`MSIGetSummaryInformation <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msigetsummaryinformation.asp>`_
152152

Doc/library/queue.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ The :mod:`Queue` module defines the following classes and exceptions:
2929
block once this size has been reached, until queue items are consumed. If
3030
*maxsize* is less than or equal to zero, the queue size is infinite.
3131

32+
3233
.. class:: LifoQueue(maxsize)
3334

3435
Constructor for a LIFO queue. *maxsize* is an integer that sets the upperbound
3536
limit on the number of items that can be placed in the queue. Insertion will
3637
block once this size has been reached, until queue items are consumed. If
3738
*maxsize* is less than or equal to zero, the queue size is infinite.
3839

40+
.. versionadded:: 2.6
41+
42+
3943
.. class:: PriorityQueue(maxsize)
4044

4145
Constructor for a priority queue. *maxsize* is an integer that sets the upperbound
@@ -47,6 +51,9 @@ The :mod:`Queue` module defines the following classes and exceptions:
4751
one returned by ``sorted(list(entries))[0]``). A typical pattern for entries
4852
is a tuple in the form: ``(priority_number, data)``.
4953

54+
.. versionadded:: 2.6
55+
56+
5057
.. exception:: Empty
5158

5259
Exception raised when non-blocking :meth:`get` (or :meth:`get_nowait`) is called

Doc/library/sched.rst

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,39 @@ Example::
4141
From print_time 930343700.273
4242
930343700.276
4343

44+
In multi-threaded environments, the :class:`scheduler` class has limitations
45+
with respect to thread-safety, inability to insert a new task before
46+
the one currently pending in a running scheduler, and holding up the main
47+
thread until the event queue is empty. Instead, the preferred approach
48+
is to use the :class:`threading.Timer` class instead.
49+
50+
Example::
51+
52+
>>> import time
53+
>>> from threading import Timer
54+
>>> def print_time():
55+
... print "From print_time", time.time()
56+
...
57+
>>> def print_some_times():
58+
... print time.time()
59+
... Timer(5, print_time, ()).start()
60+
... Timer(10, print_time, ()).start()
61+
... time.sleep(11) # sleep while time-delay events execute
62+
... print time.time()
63+
...
64+
>>> print_some_times()
65+
930343690.257
66+
From print_time 930343695.274
67+
From print_time 930343700.273
68+
930343701.301
69+
4470

4571
.. _scheduler-objects:
4672

4773
Scheduler Objects
4874
-----------------
4975

50-
:class:`scheduler` instances have the following methods:
76+
:class:`scheduler` instances have the following methods and attributes:
5177

5278

5379
.. method:: scheduler.enterabs(time, priority, action, argument)
@@ -98,3 +124,10 @@ Scheduler Objects
98124
the calling code is responsible for canceling events which are no longer
99125
pertinent.
100126

127+
.. attribute:: scheduler.queue
128+
129+
Read-only attribute returning a list of upcoming events in the order they
130+
will be run. Each event is shown as a :term:`named tuple` with the
131+
following fields: time, priority, action, argument.
132+
133+
.. versionadded:: 2.6

Doc/library/smtplib.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ An :class:`SMTP` instance has the following methods:
184184
necessary to call this method explicitly. It will be implicitly called by
185185
:meth:`sendmail` when necessary.
186186

187+
.. method:: SMTP.ehlo_or_helo_if_needed()
188+
189+
This method call :meth:`ehlo` and or :meth:`helo` if there has been no
190+
previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO``
191+
first.
192+
193+
:exc:SMTPHeloError
194+
The server didn't reply properly to the ``HELO`` greeting.
195+
196+
.. versionadded:: 2.6
187197

188198
.. method:: SMTP.has_extn(name)
189199

@@ -230,6 +240,22 @@ An :class:`SMTP` instance has the following methods:
230240
If *keyfile* and *certfile* are provided, these are passed to the :mod:`socket`
231241
module's :func:`ssl` function.
232242

243+
If there has been no previous ``EHLO`` or ``HELO`` command this session,
244+
this method tries ESMTP ``EHLO`` first.
245+
246+
.. versionchanged:: 2.6
247+
248+
:exc:`SMTPHeloError`
249+
The server didn't reply properly to the ``HELO`` greeting.
250+
251+
:exc:`SMTPException`
252+
The server does not support the STARTTLS extension.
253+
254+
.. versionchanged:: 2.6
255+
256+
:exc:`RuntimeError`
257+
SSL/TLS support is not available to your python interpreter.
258+
233259

234260
.. method:: SMTP.sendmail(from_addr, to_addrs, msg[, mail_options, rcpt_options])
235261

Doc/library/socket.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ correspond to Unix system calls applicable to sockets.
562562

563563
:platform: Windows
564564

565-
The `meth:ioctl` method is a limited interface to the WSAIoctl system
565+
The :meth:`ioctl` method is a limited interface to the WSAIoctl system
566566
interface. Please refer to the MSDN documentation for more information.
567567

568568

Doc/tools/sphinx-build.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111

1212
if __name__ == '__main__':
1313

14-
if not (2, 5, 1) <= sys.version_info[:3] < (3, 0, 0):
15-
sys.stderr.write("""\
16-
Error: Sphinx needs to be executed with Python 2.5.1 or newer (not 3.0 though).
17-
If you run this from the Makefile, you can set the PYTHON variable to the path
18-
of an alternative interpreter executable, e.g., ``make html PYTHON=python2.5``.)
19-
""")
14+
if sys.version_info[:3] < (2, 4, 0):
15+
print("""\
16+
Error: Sphinx needs to be executed with Python 2.4 or newer (not 3.0 though).
17+
(If you run this from the Makefile, you can set the PYTHON variable
18+
to the path of an alternative interpreter executable, e.g.,
19+
``make html PYTHON=python2.5``).
20+
""", file=sys.stderr)
2021
sys.exit(1)
2122

2223
from sphinx import main

0 commit comments

Comments
 (0)