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

Skip to content

Commit 5c6d787

Browse files
committed
Merged revisions 69129-69131,69139-69140,69143,69154-69159,69169,69288-69289,69293,69297-69301,69348 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r69129 | benjamin.peterson | 2009-01-30 19:42:55 -0600 (Fri, 30 Jan 2009) | 1 line check the errno in bad fd cases ........ r69130 | andrew.kuchling | 2009-01-30 20:50:09 -0600 (Fri, 30 Jan 2009) | 1 line Add a section ........ r69131 | andrew.kuchling | 2009-01-30 21:26:02 -0600 (Fri, 30 Jan 2009) | 1 line Text edits and markup fixes ........ r69139 | mark.dickinson | 2009-01-31 10:44:04 -0600 (Sat, 31 Jan 2009) | 2 lines Add an extra test for long <-> float hash equivalence. ........ r69140 | benjamin.peterson | 2009-01-31 10:52:03 -0600 (Sat, 31 Jan 2009) | 1 line PyErr_BadInternalCall() raises a SystemError, not TypeError #5112 ........ r69143 | benjamin.peterson | 2009-01-31 15:00:10 -0600 (Sat, 31 Jan 2009) | 1 line I believe the intention here was to avoid a global lookup ........ r69154 | benjamin.peterson | 2009-01-31 16:33:02 -0600 (Sat, 31 Jan 2009) | 1 line fix indentation in comment ........ r69155 | david.goodger | 2009-01-31 16:53:46 -0600 (Sat, 31 Jan 2009) | 1 line markup fix ........ r69156 | gregory.p.smith | 2009-01-31 16:57:30 -0600 (Sat, 31 Jan 2009) | 4 lines - Issue #5104: The socket module now raises OverflowError when 16-bit port and protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport(). ........ r69157 | benjamin.peterson | 2009-01-31 17:43:25 -0600 (Sat, 31 Jan 2009) | 1 line add explanatory comment ........ r69158 | benjamin.peterson | 2009-01-31 17:54:38 -0600 (Sat, 31 Jan 2009) | 1 line more flags which only work for function blocks ........ r69159 | gregory.p.smith | 2009-01-31 18:16:01 -0600 (Sat, 31 Jan 2009) | 2 lines Update doc wording as suggested in issue4903. ........ r69169 | guilherme.polo | 2009-01-31 20:56:16 -0600 (Sat, 31 Jan 2009) | 3 lines Restore Tkinter.Tk._loadtk so this test doesn't fail for problems related to ttk. ........ r69288 | georg.brandl | 2009-02-05 04:30:57 -0600 (Thu, 05 Feb 2009) | 1 line #5153: fix typo in example. ........ r69289 | georg.brandl | 2009-02-05 04:37:07 -0600 (Thu, 05 Feb 2009) | 1 line #5144: document that PySys_SetArgv prepends the script directory (or the empty string) to sys.path. ........ r69293 | georg.brandl | 2009-02-05 04:59:28 -0600 (Thu, 05 Feb 2009) | 1 line #5059: fix example. ........ r69297 | georg.brandl | 2009-02-05 05:32:18 -0600 (Thu, 05 Feb 2009) | 1 line #5015: document PythonHome API functions. ........ r69298 | georg.brandl | 2009-02-05 05:33:21 -0600 (Thu, 05 Feb 2009) | 1 line #4827: fix callback example. ........ r69299 | georg.brandl | 2009-02-05 05:35:28 -0600 (Thu, 05 Feb 2009) | 1 line #4820: use correct module for ctypes.util. ........ r69300 | georg.brandl | 2009-02-05 05:38:23 -0600 (Thu, 05 Feb 2009) | 1 line #4563: disable alpha and roman lists, fixes wrong formatting of contributor list. ........ r69301 | georg.brandl | 2009-02-05 05:40:35 -0600 (Thu, 05 Feb 2009) | 1 line #5031: fix Thread.daemon property docs. ........ r69348 | benjamin.peterson | 2009-02-05 19:47:31 -0600 (Thu, 05 Feb 2009) | 1 line fix download link ........
1 parent 407c757 commit 5c6d787

17 files changed

Lines changed: 149 additions & 38 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,10 @@ in various ways. There is a separate error indicator for each thread.
280280

281281
.. cfunction:: void PyErr_BadInternalCall()
282282

283-
This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where
284-
*message* indicates that an internal operation (e.g. a Python/C API function)
285-
was invoked with an illegal argument. It is mostly for internal use.
283+
This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``,
284+
where *message* indicates that an internal operation (e.g. a Python/C API
285+
function) was invoked with an illegal argument. It is mostly for internal
286+
use.
286287

287288

288289
.. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel)

Doc/c-api/init.rst

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,18 +350,36 @@ Initialization, Finalization, and Threads
350350
single: Py_FatalError()
351351
single: argv (in module sys)
352352

353-
Set ``sys.argv`` based on *argc* and *argv*. These parameters are similar to
354-
those passed to the program's :cfunc:`main` function with the difference that
355-
the first entry should refer to the script file to be executed rather than the
356-
executable hosting the Python interpreter. If there isn't a script that will be
357-
run, the first entry in *argv* can be an empty string. If this function fails
358-
to initialize ``sys.argv``, a fatal condition is signalled using
359-
:cfunc:`Py_FatalError`.
353+
Set :data:`sys.argv` based on *argc* and *argv*. These parameters are
354+
similar to those passed to the program's :cfunc:`main` function with the
355+
difference that the first entry should refer to the script file to be
356+
executed rather than the executable hosting the Python interpreter. If there
357+
isn't a script that will be run, the first entry in *argv* can be an empty
358+
string. If this function fails to initialize :data:`sys.argv`, a fatal
359+
condition is signalled using :cfunc:`Py_FatalError`.
360+
361+
This function also prepends the executed script's path to :data:`sys.path`.
362+
If no script is executed (in the case of calling ``python -c`` or just the
363+
interactive interpreter), the empty string is used instead.
360364

361365
.. XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
362366
check w/ Guido.
363367
364368
369+
.. cfunction:: void Py_SetPythonHome(char *home)
370+
371+
Set the default "home" directory, that is, the location of the standard
372+
Python libraries. The libraries are searched in
373+
:file:`{home}/lib/python{version}` and :file:`{home}/lib/python{version}`.
374+
375+
376+
.. cfunction:: char* Py_GetPythonHome()
377+
378+
Return the default "home", that is, the value set by a previous call to
379+
:cfunc:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME`
380+
environment variable if it is set.
381+
382+
365383
.. _threads:
366384

367385
Thread State and the Global Interpreter Lock

Doc/library/ctypes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,7 @@ library to load.
12721272

12731273

12741274
.. data:: find_library(name)
1275+
:module: ctypes.util
12751276
:noindex:
12761277

12771278
Try to find a library and return a pathname. *name* is the library name without

Doc/library/optparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ Here's an example of a callback option that takes no arguments, and simply
15061506
records that the option was seen::
15071507

15081508
def record_foo_seen(option, opt_str, value, parser):
1509-
parser.saw_foo = True
1509+
parser.values.saw_foo = True
15101510

15111511
parser.add_option("--foo", action="callback", callback=record_foo_seen)
15121512

@@ -1646,7 +1646,7 @@ arguments::
16461646
value.append(arg)
16471647

16481648
del parser.rargs[:len(value)]
1649-
setattr(parser.values, option.dest, value))
1649+
setattr(parser.values, option.dest, value)
16501650

16511651
[...]
16521652
parser.add_option("-c", "--callback", dest="vararg_attr",

Doc/library/threading.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ changed through the :attr:`name` attribute.
198198
A thread can be flagged as a "daemon thread". The significance of this flag is
199199
that the entire Python program exits when only daemon threads are left. The
200200
initial value is inherited from the creating thread. The flag can be set
201-
through the :attr:`daemon` attribute.
201+
through the :attr:`daemon` property.
202202

203203
There is a "main thread" object; this corresponds to the initial thread of
204204
control in the Python program. It is not a daemon thread.
@@ -312,10 +312,11 @@ impossible to detect the termination of alien threads.
312312

313313
.. attribute:: Thread.daemon
314314

315-
The thread's daemon flag. This must be set before :meth:`start` is called,
316-
otherwise :exc:`RuntimeError` is raised.
317-
318-
The initial value is inherited from the creating thread.
315+
A boolean value indicating whether this thread is a daemon thread (True) or
316+
not (False). This must be set before :meth:`start` is called, otherwise
317+
:exc:`RuntimeError` is raised. Its initial value is inherited from the
318+
creating thread; the main thread is not a daemon thread and therefore all
319+
threads created in the main thread default to :attr:`daemon` = ``False``.
319320

320321
The entire Python program exits when no alive non-daemon threads are left.
321322

Doc/tools/sphinxext/download.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h1>Download Python {{ release }} Documentation</h1>
3131
<td><a href="{{ dlbase }}/python-{{ release }}-docs-html.tar.bz2">Download</a> (ca. 4 MB)</td>
3232
</tr>
3333
<tr><td>Plain Text</td>
34-
<td><a href="{{ dlbase }}/python-{{ release }}-text.zip">Download</a> (ca. 2 MB)</td>
34+
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.zip">Download</a> (ca. 2 MB)</td>
3535
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.tar.bz2">Download</a> (ca. 1.5 MB)</td>
3636
</tr>
3737
</table>

Doc/tools/sphinxext/pyspecific.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313

1414
from docutils import nodes, utils
1515

16+
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
17+
from docutils.parsers.rst.states import Body
18+
Body.enum.converters['loweralpha'] = \
19+
Body.enum.converters['upperalpha'] = \
20+
Body.enum.converters['lowerroman'] = \
21+
Body.enum.converters['upperroman'] = lambda x: None
22+
23+
1624
def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
1725
issue = utils.unescape(text)
1826
text = 'issue ' + issue

Doc/tutorial/floatingpoint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Why is that? 1/10 is not exactly representable as a binary fraction. Almost all
200200
machines today (November 2000) use IEEE-754 floating point arithmetic, and
201201
almost all platforms map Python floats to IEEE-754 "double precision". 754
202202
doubles contain 53 bits of precision, so on input the computer strives to
203-
convert 0.1 to the closest fraction it can of the form *J*/2\*\**N* where *J* is
203+
convert 0.1 to the closest fraction it can of the form *J*/2**\ *N* where *J* is
204204
an integer containing exactly 53 bits. Rewriting ::
205205

206206
1 / 10 ~= J / (2**N)

Doc/whatsnew/2.7.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,23 @@ changes, or look through the Subversion logs for all the details.
197197
.. ======================================================================
198198
.. whole new modules get described in subsections here
199199
200+
ttk: Themed Widgets for Tk
201+
--------------------------
202+
203+
Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk
204+
widgets but have a more customizable appearance and can therefore more
205+
closely resemble the native platform's widgets. This widget
206+
set was originally called Tile, but was renamed to Ttk (for "themed Tk")
207+
on being added to Tcl/Tck release 8.5.
208+
209+
XXX write a brief discussion and an example here.
210+
211+
The :mod:`ttk` module was written by Guilherme Polo and added in
212+
:issue:`2983`. An alternate version called ``Tile.py``, written by
213+
Martin Franklin and maintained by Kevin Walzer, was proposed for
214+
inclusion in :issue:`2618`, but the authors argued that Guilherme
215+
Polo's work was more comprehensive.
216+
200217
.. ======================================================================
201218
202219

Lib/heapq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def nlargest(n, iterable):
195195
heapify(result)
196196
_heappushpop = heappushpop
197197
for elem in it:
198-
heappushpop(result, elem)
198+
_heappushpop(result, elem)
199199
result.sort(reverse=True)
200200
return result
201201

0 commit comments

Comments
 (0)