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

Skip to content

Commit 08bf91c

Browse files
committed
Merged revisions 79307,79408,79430,79533,79542,79579-79580,79585-79587,79607-79608,79622,79717,79820,79822,79828,79862,79875,79923-79924,79941-79943,79945,79947,79951-79952 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r79307 | florent.xicluna | 2010-03-22 17:45:50 -0500 (Mon, 22 Mar 2010) | 2 lines #7667: Fix doctest failures with non-ASCII paths. ........ r79408 | victor.stinner | 2010-03-24 20:18:38 -0500 (Wed, 24 Mar 2010) | 2 lines Fix a gcc warning introduced by r79397. ........ r79430 | brian.curtin | 2010-03-25 18:48:54 -0500 (Thu, 25 Mar 2010) | 2 lines Fix #6538. Markup RegexObject and MatchObject as classes. Patch by Ryan Arana. ........ r79533 | barry.warsaw | 2010-03-31 16:07:16 -0500 (Wed, 31 Mar 2010) | 6 lines - Issue #8233: When run as a script, py_compile.py optionally takes a single argument `-` which tells it to read files to compile from stdin. Each line is read on demand and the named file is compiled immediately. (Original patch by Piotr O?\197?\188arowski). ........ r79542 | r.david.murray | 2010-03-31 20:28:39 -0500 (Wed, 31 Mar 2010) | 3 lines A couple small grammar fixes in test.rst, and rewrite the check_warnings docs to be clearer. ........ r79579 | georg.brandl | 2010-04-02 03:34:41 -0500 (Fri, 02 Apr 2010) | 1 line Add 2.6.5. ........ r79580 | georg.brandl | 2010-04-02 03:39:09 -0500 (Fri, 02 Apr 2010) | 1 line #2768: add a note on how to get a file descriptor. ........ r79585 | georg.brandl | 2010-04-02 04:03:18 -0500 (Fri, 02 Apr 2010) | 1 line Remove col-spanning cells in logging docs. ........ r79586 | georg.brandl | 2010-04-02 04:07:42 -0500 (Fri, 02 Apr 2010) | 1 line Document PyImport_ExecCodeModuleEx(). ........ r79587 | georg.brandl | 2010-04-02 04:11:49 -0500 (Fri, 02 Apr 2010) | 1 line #8012: clarification in generator glossary entry. ........ r79607 | andrew.kuchling | 2010-04-02 12:48:23 -0500 (Fri, 02 Apr 2010) | 1 line #6647: document that catch_warnings is not thread-safe ........ r79608 | andrew.kuchling | 2010-04-02 12:54:26 -0500 (Fri, 02 Apr 2010) | 1 line #6647: add note to two examples ........ r79622 | tarek.ziade | 2010-04-02 16:34:19 -0500 (Fri, 02 Apr 2010) | 1 line removed documentation on code that was reverted and pushed into distutils2 ........ r79717 | antoine.pitrou | 2010-04-03 16:22:38 -0500 (Sat, 03 Apr 2010) | 4 lines Fix wording / typography, and a slightly misleading statement (memoryviews don't support complex structures right now) ........ r79820 | benjamin.peterson | 2010-04-05 22:34:09 -0500 (Mon, 05 Apr 2010) | 1 line ready _sre types ........ r79822 | georg.brandl | 2010-04-06 03:18:15 -0500 (Tue, 06 Apr 2010) | 1 line #8320: document return value of recv_into(). ........ r79828 | georg.brandl | 2010-04-06 09:33:44 -0500 (Tue, 06 Apr 2010) | 1 line Add JP. ........ r79862 | georg.brandl | 2010-04-06 15:27:59 -0500 (Tue, 06 Apr 2010) | 1 line Fix syntax. ........ r79875 | mark.dickinson | 2010-04-06 17:18:23 -0500 (Tue, 06 Apr 2010) | 1 line More NaN consistency doc fixes. ........ r79923 | georg.brandl | 2010-04-10 06:15:24 -0500 (Sat, 10 Apr 2010) | 1 line #8360: skipTest was added in 2.7. ........ r79924 | georg.brandl | 2010-04-10 06:16:59 -0500 (Sat, 10 Apr 2010) | 1 line #8346: update version. ........ r79941 | andrew.kuchling | 2010-04-10 20:39:36 -0500 (Sat, 10 Apr 2010) | 1 line Two grammar fixes ........ r79942 | andrew.kuchling | 2010-04-10 20:40:06 -0500 (Sat, 10 Apr 2010) | 1 line Punctuation fix ........ r79943 | andrew.kuchling | 2010-04-10 20:40:30 -0500 (Sat, 10 Apr 2010) | 1 line Add various items ........ r79945 | andrew.kuchling | 2010-04-10 20:40:49 -0500 (Sat, 10 Apr 2010) | 1 line name correct ........ r79947 | andrew.kuchling | 2010-04-10 20:44:13 -0500 (Sat, 10 Apr 2010) | 1 line Remove distutils section ........ r79951 | andrew.kuchling | 2010-04-11 07:48:08 -0500 (Sun, 11 Apr 2010) | 1 line Two typo fixes ........ r79952 | andrew.kuchling | 2010-04-11 07:49:37 -0500 (Sun, 11 Apr 2010) | 1 line Add two items ........
1 parent 40b0c9a commit 08bf91c

24 files changed

Lines changed: 279 additions & 231 deletions

Doc/c-api/import.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,22 @@ Importing Modules
115115
such modules have no way to know that the module object is an unknown (and
116116
probably damaged with respect to the module author's intents) state.
117117

118+
The module's :attr:`__file__` attribute will be set to the code object's
119+
:cmember:`co_filename`.
120+
118121
This function will reload the module if it was already imported. See
119122
:cfunc:`PyImport_ReloadModule` for the intended way to reload a module.
120123

121124
If *name* points to a dotted name of the form ``package.module``, any package
122125
structures not already created will still not be created.
123126

124127

128+
.. cfunction:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)
129+
130+
Like :cfunc:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
131+
the module object is set to *pathname* if it is non-``NULL``.
132+
133+
125134
.. cfunction:: long PyImport_GetMagicNumber()
126135

127136
Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and

Doc/data/refcounts.dat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ PyImport_ExecCodeModule:PyObject*::+1:
499499
PyImport_ExecCodeModule:char*:name::
500500
PyImport_ExecCodeModule:PyObject*:co:0:
501501

502+
PyImport_ExecCodeModuleEx:PyObject*::+1:
503+
PyImport_ExecCodeModuleEx:char*:name::
504+
PyImport_ExecCodeModuleEx:PyObject*:co:0:
505+
PyImport_ExecCodeModuleEx:char*:pathname::
506+
502507
PyImport_GetMagicNumber:long:::
503508

504509
PyImport_GetModuleDict:PyObject*::0:
@@ -518,6 +523,13 @@ PyImport_ImportModuleEx:PyObject*:globals:0:???
518523
PyImport_ImportModuleEx:PyObject*:locals:0:???
519524
PyImport_ImportModuleEx:PyObject*:fromlist:0:???
520525

526+
PyImport_ImportModuleLevel:PyObject*::+1:
527+
PyImport_ImportModuleLevel:char*:name::
528+
PyImport_ImportModuleLevel:PyObject*:globals:0:???
529+
PyImport_ImportModuleLevel:PyObject*:locals:0:???
530+
PyImport_ImportModuleLevel:PyObject*:fromlist:0:???
531+
PyImport_ImportModuleLevel:int:level::
532+
521533
PyImport_ReloadModule:PyObject*::+1:
522534
PyImport_ReloadModule:PyObject*:m:0:
523535

Doc/distutils/apiref.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,19 +1944,6 @@ This is described in more detail in :pep:`301`.
19441944

19451945
.. % todo
19461946
1947-
:mod:`distutils.command.check` --- Check the meta-data of a package
1948-
===================================================================
1949-
1950-
.. module:: distutils.command.check
1951-
:synopsis: Check the metadata of a package
1952-
1953-
1954-
The ``check`` command performs some tests on the meta-data of a package.
1955-
For example, it verifies that all required meta-data are provided as
1956-
the arguments passed to the :func:`setup` function.
1957-
1958-
.. % todo
1959-
19601947
19611948
Creating a new Distutils command
19621949
================================

Doc/distutils/examples.rst

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -233,103 +233,6 @@ With exactly the same source tree layout, this extension can be put in the
233233
ext_modules=[Extension('foopkg.foo', ['foo.c'])],
234234
)
235235

236-
Checking a package
237-
==================
238-
239-
The ``check`` command allows you to verify if your package meta-data
240-
meet the minimum requirements to build a distribution.
241-
242-
To run it, just call it using your :file:`setup.py` script. If something is
243-
missing, ``check`` will display a warning.
244-
245-
Let's take an example with a simple script::
246-
247-
from distutils.core import setup
248-
249-
setup(name='foobar')
250-
251-
Running the ``check`` command will display some warnings::
252-
253-
$ python setup.py check
254-
running check
255-
warning: check: missing required meta-data: version, url
256-
warning: check: missing meta-data: either (author and author_email) or
257-
(maintainer and maintainer_email) must be supplied
258-
259-
260-
If you use the reStructuredText syntax in the ``long_description`` field and
261-
`docutils <http://docutils.sourceforge.net/>`_ is installed you can check if
262-
the syntax is fine with the ``check`` command, using the ``restructuredtext``
263-
option.
264-
265-
For example, if the :file:`setup.py` script is changed like this::
266-
267-
from distutils.core import setup
268-
269-
desc = """\
270-
My description
271-
=============
272-
273-
This is the description of the ``foobar`` package.
274-
"""
275-
276-
setup(name='foobar', version='1', author='tarek',
277-
author_email='[email protected]',
278-
url='http://example.com', long_description=desc)
279-
280-
Where the long description is broken, ``check`` will be able to detect it
281-
by using the :mod:`docutils` parser::
282-
283-
$ pythontrunk setup.py check --restructuredtext
284-
running check
285-
warning: check: Title underline too short. (line 2)
286-
warning: check: Could not finish the parsing.
287-
288-
289-
.. _reading-metadata:
290-
291-
Reading the metadata
292-
====================
293-
294-
The :func:`distutils.core.setup` function provides a command-line interface
295-
that allows you to query the metadata fields of a project through the
296-
:file:`setup.py` script of a given project::
297-
298-
$ python setup.py --name
299-
distribute
300-
301-
This call reads the ``name`` metadata by running the
302-
:func:`distutils.core.setup` function. Although, when a source or binary
303-
distribution is created with Distutils, the metadata fields are written
304-
in a static file called :file:`PKG-INFO`. When a Distutils-based project is
305-
installed in Python, the :file:`PKG-INFO` file is copied alongside the modules
306-
and packages of the distribution under :file:`NAME-VERSION-pyX.X.egg-info`,
307-
where ``NAME`` is the name of the project, ``VERSION`` its version as defined
308-
in the Metadata, and ``pyX.X`` the major and minor version of Python like
309-
``2.7`` or ``3.2``.
310-
311-
You can read back this static file, by using the
312-
:class:`distutils.dist.DistributionMetadata` class and its
313-
:func:`read_pkg_file` method::
314-
315-
>>> from distutils.dist import DistributionMetadata
316-
>>> metadata = DistributionMetadata()
317-
>>> metadata.read_pkg_file(open('distribute-0.6.8-py2.7.egg-info'))
318-
>>> metadata.name
319-
'distribute'
320-
>>> metadata.version
321-
'0.6.8'
322-
>>> metadata.description
323-
'Easily download, build, install, upgrade, and uninstall Python packages'
324-
325-
Notice that the class can also be instanciated with a metadata file path to
326-
loads its values::
327-
328-
>>> pkg_info_path = 'distribute-0.6.8-py2.7.egg-info'
329-
>>> DistributionMetadata(pkg_info_path).name
330-
'distribute'
331-
332-
333236
.. % \section{Multiple extension modules}
334237
.. % \label{multiple-ext}
335238

Doc/glossary.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ Glossary
212212
performs garbage collection via reference counting and a cyclic garbage
213213
collector that is able to detect and break reference cycles.
214214

215+
.. index:: single: generator
216+
215217
generator
216218
A function which returns an iterator. It looks like a normal function
217219
except that values are returned to the caller using a :keyword:`yield`
@@ -225,7 +227,7 @@ Glossary
225227
.. index:: single: generator expression
226228

227229
generator expression
228-
An expression that returns a generator. It looks like a normal expression
230+
An expression that returns an iterator. It looks like a normal expression
229231
followed by a :keyword:`for` expression defining a loop variable, range,
230232
and an optional :keyword:`if` expression. The combined expression
231233
generates values for an enclosing function::

Doc/library/functools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
4040
.. function:: total_ordering(cls)
4141

4242
Given a class defining one or more rich comparison ordering methods, this
43-
class decorator supplies the rest. This simplies the effort involved
43+
class decorator supplies the rest. This simplifies the effort involved
4444
in specifying all of the possible rich comparison operations:
4545

4646
The class must define one of :meth:`__lt__`, :meth:`__le__`,

Doc/library/logging.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,84 @@ supports sending logging messages to a remote or local Unix syslog.
20122012
or integers - if strings are passed, internal mapping dictionaries are
20132013
used to convert them to integers.
20142014

2015+
**Priorities**
2016+
2017+
+--------------------------+---------------+
2018+
| Name (string) | Symbolic value|
2019+
+==========================+===============+
2020+
| ``alert`` | LOG_ALERT |
2021+
+--------------------------+---------------+
2022+
| ``crit`` or ``critical`` | LOG_CRIT |
2023+
+--------------------------+---------------+
2024+
| ``debug`` | LOG_DEBUG |
2025+
+--------------------------+---------------+
2026+
| ``emerg`` or ``panic`` | LOG_EMERG |
2027+
+--------------------------+---------------+
2028+
| ``err`` or ``error`` | LOG_ERR |
2029+
+--------------------------+---------------+
2030+
| ``info`` | LOG_INFO |
2031+
+--------------------------+---------------+
2032+
| ``notice`` | LOG_NOTICE |
2033+
+--------------------------+---------------+
2034+
| ``warn`` or ``warning`` | LOG_WARNING |
2035+
+--------------------------+---------------+
2036+
2037+
**Facilities**
2038+
2039+
+---------------+---------------+
2040+
| Name (string) | Symbolic value|
2041+
+===============+===============+
2042+
| ``auth`` | LOG_AUTH |
2043+
+---------------+---------------+
2044+
| ``authpriv`` | LOG_AUTHPRIV |
2045+
+---------------+---------------+
2046+
| ``cron`` | LOG_CRON |
2047+
+---------------+---------------+
2048+
| ``daemon`` | LOG_DAEMON |
2049+
+---------------+---------------+
2050+
| ``ftp`` | LOG_FTP |
2051+
+---------------+---------------+
2052+
| ``kern`` | LOG_KERN |
2053+
+---------------+---------------+
2054+
| ``lpr`` | LOG_LPR |
2055+
+---------------+---------------+
2056+
| ``mail`` | LOG_MAIL |
2057+
+---------------+---------------+
2058+
| ``news`` | LOG_NEWS |
2059+
+---------------+---------------+
2060+
| ``syslog`` | LOG_SYSLOG |
2061+
+---------------+---------------+
2062+
| ``user`` | LOG_USER |
2063+
+---------------+---------------+
2064+
| ``uucp`` | LOG_UUCP |
2065+
+---------------+---------------+
2066+
| ``local0`` | LOG_LOCAL0 |
2067+
+---------------+---------------+
2068+
| ``local1`` | LOG_LOCAL1 |
2069+
+---------------+---------------+
2070+
| ``local2`` | LOG_LOCAL2 |
2071+
+---------------+---------------+
2072+
| ``local3`` | LOG_LOCAL3 |
2073+
+---------------+---------------+
2074+
| ``local4`` | LOG_LOCAL4 |
2075+
+---------------+---------------+
2076+
| ``local5`` | LOG_LOCAL5 |
2077+
+---------------+---------------+
2078+
| ``local6`` | LOG_LOCAL6 |
2079+
+---------------+---------------+
2080+
| ``local7`` | LOG_LOCAL7 |
2081+
+---------------+---------------+
2082+
2083+
.. method:: mapPriority(levelname)
2084+
2085+
Maps a logging level name to a syslog priority name.
2086+
You may need to override this if you are using custom levels, or
2087+
if the default algorithm is not suitable for your needs. The
2088+
default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
2089+
``CRITICAL`` to the equivalent syslog names, and all other level
2090+
names to "warning".
2091+
2092+
.. _nt-eventlog-handler:
20152093

20162094
NTEventLogHandler
20172095
^^^^^^^^^^^^^^^^^

Doc/library/math.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ Constants
345345
:exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or ``log(0.0)``
346346
(where C99 Annex F recommends signaling invalid operation or divide-by-zero),
347347
and :exc:`OverflowError` for results that overflow (for example,
348-
``exp(1000.0)``). A *NaN* will not be returned from any of the functions
349-
above unless one or more of the input arguments was a *NaN*; in that case,
350-
most functions will return a *NaN*, but (again following C99 Annex F) there
348+
``exp(1000.0)``). A NaN will not be returned from any of the functions
349+
above unless one or more of the input arguments was a NaN; in that case,
350+
most functions will return a NaN, but (again following C99 Annex F) there
351351
are some exceptions to this rule, for example ``pow(float('nan'), 0.0)`` or
352352
``hypot(float('nan'), float('inf'))``.
353353

Doc/library/os.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ process will then be assigned 3, 4, 5, and so forth. The name "file descriptor"
437437
is slightly deceptive; on Unix platforms, sockets and pipes are also referenced
438438
by file descriptors.
439439

440+
The :meth:`~file.fileno` method can be used to obtain the file descriptor
441+
associated with a file object when required. Note that using the file
442+
descriptor directly will bypass the file object methods, ignoring aspects such
443+
as internal buffering of data.
440444

441445
.. function:: close(fd)
442446

Doc/library/socket.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ correspond to Unix system calls applicable to sockets.
622622

623623
Receive up to *nbytes* bytes from the socket, storing the data into a buffer
624624
rather than creating a new bytestring. If *nbytes* is not specified (or 0),
625-
receive up to the size available in the given buffer. See the Unix manual page
626-
:manpage:`recv(2)` for the meaning of the optional argument *flags*; it defaults
627-
to zero.
625+
receive up to the size available in the given buffer. Returns the number of
626+
bytes received. See the Unix manual page :manpage:`recv(2)` for the meaning
627+
of the optional argument *flags*; it defaults to zero.
628628

629629

630630
.. method:: socket.send(bytes[, flags])

0 commit comments

Comments
 (0)