Skip to content

Commit

Permalink
Merged revisions 79307,79408,79430,79533,79542,79579-79580,79585-7958…
Browse files Browse the repository at this point in the history
…7,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

  python#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 python#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 python#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

  python#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

  python#8012: clarification in generator glossary entry.
........
  r79607 | andrew.kuchling | 2010-04-02 12:48:23 -0500 (Fri, 02 Apr 2010) | 1 line

  python#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

  python#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

  python#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

  python#8360: skipTest was added in 2.7.
........
  r79924 | georg.brandl | 2010-04-10 06:16:59 -0500 (Sat, 10 Apr 2010) | 1 line

  python#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
........
  • Loading branch information
benjaminp committed Apr 11, 2010
1 parent 40b0c9a commit 08bf91c
Show file tree
Hide file tree
Showing 24 changed files with 279 additions and 231 deletions.
9 changes: 9 additions & 0 deletions Doc/c-api/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,22 @@ Importing Modules
such modules have no way to know that the module object is an unknown (and
probably damaged with respect to the module author's intents) state.

The module's :attr:`__file__` attribute will be set to the code object's
:cmember:`co_filename`.

This function will reload the module if it was already imported. See
:cfunc:`PyImport_ReloadModule` for the intended way to reload a module.

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


.. cfunction:: PyObject* PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname)

Like :cfunc:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
the module object is set to *pathname* if it is non-``NULL``.


.. cfunction:: long PyImport_GetMagicNumber()

Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and
Expand Down
12 changes: 12 additions & 0 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ PyImport_ExecCodeModule:PyObject*::+1:
PyImport_ExecCodeModule:char*:name::
PyImport_ExecCodeModule:PyObject*:co:0:

PyImport_ExecCodeModuleEx:PyObject*::+1:
PyImport_ExecCodeModuleEx:char*:name::
PyImport_ExecCodeModuleEx:PyObject*:co:0:
PyImport_ExecCodeModuleEx:char*:pathname::

PyImport_GetMagicNumber:long:::

PyImport_GetModuleDict:PyObject*::0:
Expand All @@ -518,6 +523,13 @@ PyImport_ImportModuleEx:PyObject*:globals:0:???
PyImport_ImportModuleEx:PyObject*:locals:0:???
PyImport_ImportModuleEx:PyObject*:fromlist:0:???

PyImport_ImportModuleLevel:PyObject*::+1:
PyImport_ImportModuleLevel:char*:name::
PyImport_ImportModuleLevel:PyObject*:globals:0:???
PyImport_ImportModuleLevel:PyObject*:locals:0:???
PyImport_ImportModuleLevel:PyObject*:fromlist:0:???
PyImport_ImportModuleLevel:int:level::

PyImport_ReloadModule:PyObject*::+1:
PyImport_ReloadModule:PyObject*:m:0:

Expand Down
13 changes: 0 additions & 13 deletions Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1944,19 +1944,6 @@ This is described in more detail in :pep:`301`.

.. % todo
:mod:`distutils.command.check` --- Check the meta-data of a package
===================================================================

.. module:: distutils.command.check
:synopsis: Check the metadata of a package


The ``check`` command performs some tests on the meta-data of a package.
For example, it verifies that all required meta-data are provided as
the arguments passed to the :func:`setup` function.

.. % todo
Creating a new Distutils command
================================
Expand Down
97 changes: 0 additions & 97 deletions Doc/distutils/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,103 +233,6 @@ With exactly the same source tree layout, this extension can be put in the
ext_modules=[Extension('foopkg.foo', ['foo.c'])],
)

Checking a package
==================

The ``check`` command allows you to verify if your package meta-data
meet the minimum requirements to build a distribution.

To run it, just call it using your :file:`setup.py` script. If something is
missing, ``check`` will display a warning.

Let's take an example with a simple script::

from distutils.core import setup

setup(name='foobar')

Running the ``check`` command will display some warnings::

$ python setup.py check
running check
warning: check: missing required meta-data: version, url
warning: check: missing meta-data: either (author and author_email) or
(maintainer and maintainer_email) must be supplied


If you use the reStructuredText syntax in the ``long_description`` field and
`docutils <http://docutils.sourceforge.net/>`_ is installed you can check if
the syntax is fine with the ``check`` command, using the ``restructuredtext``
option.

For example, if the :file:`setup.py` script is changed like this::

from distutils.core import setup

desc = """\
My description
=============

This is the description of the ``foobar`` package.
"""

setup(name='foobar', version='1', author='tarek',
author_email='[email protected]',
url='http://example.com', long_description=desc)

Where the long description is broken, ``check`` will be able to detect it
by using the :mod:`docutils` parser::

$ pythontrunk setup.py check --restructuredtext
running check
warning: check: Title underline too short. (line 2)
warning: check: Could not finish the parsing.


.. _reading-metadata:

Reading the metadata
====================

The :func:`distutils.core.setup` function provides a command-line interface
that allows you to query the metadata fields of a project through the
:file:`setup.py` script of a given project::

$ python setup.py --name
distribute

This call reads the ``name`` metadata by running the
:func:`distutils.core.setup` function. Although, when a source or binary
distribution is created with Distutils, the metadata fields are written
in a static file called :file:`PKG-INFO`. When a Distutils-based project is
installed in Python, the :file:`PKG-INFO` file is copied alongside the modules
and packages of the distribution under :file:`NAME-VERSION-pyX.X.egg-info`,
where ``NAME`` is the name of the project, ``VERSION`` its version as defined
in the Metadata, and ``pyX.X`` the major and minor version of Python like
``2.7`` or ``3.2``.

You can read back this static file, by using the
:class:`distutils.dist.DistributionMetadata` class and its
:func:`read_pkg_file` method::

>>> from distutils.dist import DistributionMetadata
>>> metadata = DistributionMetadata()
>>> metadata.read_pkg_file(open('distribute-0.6.8-py2.7.egg-info'))
>>> metadata.name
'distribute'
>>> metadata.version
'0.6.8'
>>> metadata.description
'Easily download, build, install, upgrade, and uninstall Python packages'

Notice that the class can also be instanciated with a metadata file path to
loads its values::

>>> pkg_info_path = 'distribute-0.6.8-py2.7.egg-info'
>>> DistributionMetadata(pkg_info_path).name
'distribute'


.. % \section{Multiple extension modules}
.. % \label{multiple-ext}
Expand Down
4 changes: 3 additions & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ Glossary
performs garbage collection via reference counting and a cyclic garbage
collector that is able to detect and break reference cycles.

.. index:: single: generator

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

generator expression
An expression that returns a generator. It looks like a normal expression
An expression that returns an iterator. It looks like a normal expression
followed by a :keyword:`for` expression defining a loop variable, range,
and an optional :keyword:`if` expression. The combined expression
generates values for an enclosing function::
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
.. function:: total_ordering(cls)

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

The class must define one of :meth:`__lt__`, :meth:`__le__`,
Expand Down
78 changes: 78 additions & 0 deletions Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,84 @@ supports sending logging messages to a remote or local Unix syslog.
or integers - if strings are passed, internal mapping dictionaries are
used to convert them to integers.

**Priorities**

+--------------------------+---------------+
| Name (string) | Symbolic value|
+==========================+===============+
| ``alert`` | LOG_ALERT |
+--------------------------+---------------+
| ``crit`` or ``critical`` | LOG_CRIT |
+--------------------------+---------------+
| ``debug`` | LOG_DEBUG |
+--------------------------+---------------+
| ``emerg`` or ``panic`` | LOG_EMERG |
+--------------------------+---------------+
| ``err`` or ``error`` | LOG_ERR |
+--------------------------+---------------+
| ``info`` | LOG_INFO |
+--------------------------+---------------+
| ``notice`` | LOG_NOTICE |
+--------------------------+---------------+
| ``warn`` or ``warning`` | LOG_WARNING |
+--------------------------+---------------+

**Facilities**

+---------------+---------------+
| Name (string) | Symbolic value|
+===============+===============+
| ``auth`` | LOG_AUTH |
+---------------+---------------+
| ``authpriv`` | LOG_AUTHPRIV |
+---------------+---------------+
| ``cron`` | LOG_CRON |
+---------------+---------------+
| ``daemon`` | LOG_DAEMON |
+---------------+---------------+
| ``ftp`` | LOG_FTP |
+---------------+---------------+
| ``kern`` | LOG_KERN |
+---------------+---------------+
| ``lpr`` | LOG_LPR |
+---------------+---------------+
| ``mail`` | LOG_MAIL |
+---------------+---------------+
| ``news`` | LOG_NEWS |
+---------------+---------------+
| ``syslog`` | LOG_SYSLOG |
+---------------+---------------+
| ``user`` | LOG_USER |
+---------------+---------------+
| ``uucp`` | LOG_UUCP |
+---------------+---------------+
| ``local0`` | LOG_LOCAL0 |
+---------------+---------------+
| ``local1`` | LOG_LOCAL1 |
+---------------+---------------+
| ``local2`` | LOG_LOCAL2 |
+---------------+---------------+
| ``local3`` | LOG_LOCAL3 |
+---------------+---------------+
| ``local4`` | LOG_LOCAL4 |
+---------------+---------------+
| ``local5`` | LOG_LOCAL5 |
+---------------+---------------+
| ``local6`` | LOG_LOCAL6 |
+---------------+---------------+
| ``local7`` | LOG_LOCAL7 |
+---------------+---------------+

.. method:: mapPriority(levelname)

Maps a logging level name to a syslog priority name.
You may need to override this if you are using custom levels, or
if the default algorithm is not suitable for your needs. The
default algorithm maps ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` and
``CRITICAL`` to the equivalent syslog names, and all other level
names to "warning".

.. _nt-eventlog-handler:

NTEventLogHandler
^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ Constants
:exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or ``log(0.0)``
(where C99 Annex F recommends signaling invalid operation or divide-by-zero),
and :exc:`OverflowError` for results that overflow (for example,
``exp(1000.0)``). A *NaN* will not be returned from any of the functions
above unless one or more of the input arguments was a *NaN*; in that case,
most functions will return a *NaN*, but (again following C99 Annex F) there
``exp(1000.0)``). A NaN will not be returned from any of the functions
above unless one or more of the input arguments was a NaN; in that case,
most functions will return a NaN, but (again following C99 Annex F) there
are some exceptions to this rule, for example ``pow(float('nan'), 0.0)`` or
``hypot(float('nan'), float('inf'))``.

Expand Down
4 changes: 4 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ process will then be assigned 3, 4, 5, and so forth. The name "file descriptor"
is slightly deceptive; on Unix platforms, sockets and pipes are also referenced
by file descriptors.

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

.. function:: close(fd)

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ correspond to Unix system calls applicable to sockets.

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


.. method:: socket.send(bytes[, flags])
Expand Down
10 changes: 5 additions & 5 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2143,12 +2143,12 @@ An example of dictionary view usage::

.. _typememoryview:

memoryview Types
================
memoryview type
===============

:class:`memoryview`\s allow Python code to access the internal data of an object
that supports the buffer protocol without copying. Memory can be interpreted as
simple bytes or complex data structures.
:class:`memoryview` objects allow Python code to access the internal data
of an object that supports the buffer protocol without copying. Memory
is generally interpreted as simple bytes.

.. class:: memoryview(obj)

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ object, see :ref:`tarinfo-objects` for details.
A :class:`TarFile` object can be used as a context manager in a :keyword:`with`
statement. It will automatically be closed when the block is completed. Please
note that in the event of an exception an archive opened for writing will not
be finalized, only the internally used file object will be closed. See the
be finalized; only the internally used file object will be closed. See the
:ref:`tar-examples` section for a use case.

.. versionadded:: 3.2
Expand Down
Loading

0 comments on commit 08bf91c

Please sign in to comment.