Merged revisions 67154,67157-67159,67162-67163,67166,67175-67176,67189,67224-67225,67243 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67154 | hirokazu.yamamoto | 2008-11-08 04:46:17 +0100 (Sat, 08 Nov 2008) | 1 line
Issue #4071: ntpath.abspath returned an empty string for long unicode path.
........
r67157 | georg.brandl | 2008-11-08 12:47:44 +0100 (Sat, 08 Nov 2008) | 2 lines
Don't use "HOWTO" as the title for all howto .tex files.
........
r67158 | georg.brandl | 2008-11-08 12:48:20 +0100 (Sat, 08 Nov 2008) | 2 lines
Update "Documenting" a bit. Concentrate on Python-specifics.
........
r67159 | georg.brandl | 2008-11-08 13:52:25 +0100 (Sat, 08 Nov 2008) | 2 lines
Fix warning.
........
r67162 | benjamin.peterson | 2008-11-08 17:55:33 +0100 (Sat, 08 Nov 2008) | 1 line
a few compile() and ast doc improvements
........
r67163 | benjamin.peterson | 2008-11-08 18:04:18 +0100 (Sat, 08 Nov 2008) | 1 line
move context clue to versionchanged tag
........
r67166 | benjamin.peterson | 2008-11-08 18:07:06 +0100 (Sat, 08 Nov 2008) | 1 line
clarify what was added
........
r67175 | benjamin.peterson | 2008-11-09 02:44:32 +0100 (Sun, 09 Nov 2008) | 1 line
update link
........
r67176 | benjamin.peterson | 2008-11-09 02:52:32 +0100 (Sun, 09 Nov 2008) | 1 line
fix comment
........
r67189 | benjamin.peterson | 2008-11-11 22:56:06 +0100 (Tue, 11 Nov 2008) | 1 line
use correct name
........
r67224 | georg.brandl | 2008-11-15 09:10:04 +0100 (Sat, 15 Nov 2008) | 2 lines
#4324: fix getlocale() argument.
........
r67225 | brett.cannon | 2008-11-15 23:33:25 +0100 (Sat, 15 Nov 2008) | 1 line
Clarify the docs for the 'strict' argument to httplib.HTTPConnection.
........
r67243 | benjamin.peterson | 2008-11-17 22:39:05 +0100 (Mon, 17 Nov 2008) | 1 line
a few fixes on the download page
........
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 2192d11..e1a8ac0 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -21,13 +21,12 @@
Python release; this module helps to find out programmatically what the current
grammar looks like.
-An abstract syntax tree can be generated by passing :data:`_ast.PyCF_ONLY_AST`
-as a flag to the :func:`compile` builtin function, or using the :func:`parse`
+An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as
+a flag to the :func:`compile` builtin function, or using the :func:`parse`
helper provided in this module. The result will be a tree of objects whose
-classes all inherit from :class:`ast.AST`.
+classes all inherit from :class:`ast.AST`. An abstract syntax tree can be
+compiled into a Python code object using the built-in :func:`compile` function.
-A modified abstract syntax tree can be compiled into a Python code object using
-the built-in :func:`compile` function.
Node classes
------------
@@ -126,7 +125,7 @@
.. function:: parse(expr, filename='<unknown>', mode='exec')
Parse an expression into an AST node. Equivalent to ``compile(expr,
- filename, mode, PyCF_ONLY_AST)``.
+ filename, mode, ast.PyCF_ONLY_AST)``.
.. function:: literal_eval(node_or_string)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 78d2ad1..daa2704 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -199,15 +199,8 @@
Compile the *source* into a code or AST object. Code objects can be executed
by an :keyword:`exec` statement or evaluated by a call to :func:`eval`.
- *source* can either be a string or an AST object. Refer to the :mod:`_ast`
- module documentation for information on how to compile into and from AST
- objects.
-
- When compiling a string with multi-line statements, two caveats apply: line
- endings must be represented by a single newline character (``'\n'``), and the
- input must be terminated by at least one newline character. If line endings
- are represented by ``'\r\n'``, use the string :meth:`replace` method to
- change them into ``'\n'``.
+ *source* can either be a string or an AST object. Refer to the :mod:`ast`
+ module documentation for information on how to work with AST objects.
The *filename* argument should give the file from which the code was read;
pass some recognizable value if it wasn't read from a file (``'<string>'`` is
@@ -219,15 +212,15 @@
interactive statement (in the latter case, expression statements that
evaluate to something else than ``None`` will be printed).
- The optional arguments *flags* and *dont_inherit* (which are new in Python 2.2)
- control which future statements (see :pep:`236`) affect the compilation of
- *source*. If neither is present (or both are zero) the code is compiled with
- those future statements that are in effect in the code that is calling compile.
- If the *flags* argument is given and *dont_inherit* is not (or is zero) then the
+ The optional arguments *flags* and *dont_inherit* control which future
+ statements (see :pep:`236`) affect the compilation of *source*. If neither
+ is present (or both are zero) the code is compiled with those future
+ statements that are in effect in the code that is calling compile. If the
+ *flags* argument is given and *dont_inherit* is not (or is zero) then the
future statements specified by the *flags* argument are used in addition to
those that would be used anyway. If *dont_inherit* is a non-zero integer then
- the *flags* argument is it -- the future statements in effect around the call to
- compile are ignored.
+ the *flags* argument is it -- the future statements in effect around the call
+ to compile are ignored.
Future statements are specified by bits which can be bitwise ORed together to
specify multiple statements. The bitfield required to specify a given feature
@@ -237,7 +230,18 @@
This function raises :exc:`SyntaxError` if the compiled source is invalid,
and :exc:`TypeError` if the source contains null bytes.
- .. versionadded:: 2.6
+ .. note::
+
+ When compiling a string with multi-line statements, line endings must be
+ represented by a single newline character (``'\n'``), and the input must
+ be terminated by at least one newline character. If line endings are
+ represented by ``'\r\n'``, use :meth:`str.replace` to change them into
+ ``'\n'``.
+
+ .. versionchanged:: 2.3
+ The *flags* and *dont_inherit* arguments were added.
+
+ .. versionchanged:: 2.6
Support for compiling AST objects.
diff --git a/Doc/library/httplib.rst b/Doc/library/httplib.rst
index 4c87d17..874fd54 100644
--- a/Doc/library/httplib.rst
+++ b/Doc/library/httplib.rst
@@ -40,7 +40,8 @@
server. It should be instantiated passing it a host and optional port
number. If no port number is passed, the port is extracted from the host
string if it has the form ``host:port``, else the default HTTP port (80) is
- used. When True, the optional parameter *strict* causes ``BadStatusLine`` to
+ used. When True, the optional parameter *strict* (which defaults to a false
+ value) causes ``BadStatusLine`` to
be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1
status line. If the optional *timeout* parameter is given, blocking
operations (like connection attempts) will timeout after that many seconds
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 6d427b7..3dfefa2 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -492,7 +492,7 @@
Example::
>>> import locale
- >>> loc = locale.getlocale(locale.LC_ALL) # get current locale
+ >>> loc = locale.getlocale() # get current locale
>>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
>>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
>>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 16bb8f9..7a13183 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1870,7 +1870,7 @@
Below is an example session with logging turned on::
>>> import multiprocessing, logging
- >>> logger = multiprocessing.getLogger()
+ >>> logger = multiprocessing.get_logger()
>>> logger.setLevel(logging.INFO)
>>> logger.warning('doomed')
[WARNING/MainProcess] doomed