Merged revisions 74277,74321,74323,74326,74355,74465,74467,74488,74492,74513,74531,74549,74553,74625,74632,74643-74644,74647,74652,74666,74671,74727,74739 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74277 | sean.reifschneider | 2009-08-01 18:54:55 -0500 (Sat, 01 Aug 2009) | 3 lines

  - Issue #6624: yArg_ParseTuple with "s" format when parsing argument with
    NUL: Bogus TypeError detail string.
........
  r74321 | guilherme.polo | 2009-08-05 11:51:41 -0500 (Wed, 05 Aug 2009) | 1 line

  Easier reference to find (at least while svn continues being used).
........
  r74323 | guilherme.polo | 2009-08-05 18:48:26 -0500 (Wed, 05 Aug 2009) | 1 line

  Typo.
........
  r74326 | jesse.noller | 2009-08-05 21:05:56 -0500 (Wed, 05 Aug 2009) | 1 line

  Fix issue 4660: spurious task_done errors in multiprocessing, remove doc note for from_address
........
  r74355 | gregory.p.smith | 2009-08-12 12:02:37 -0500 (Wed, 12 Aug 2009) | 2 lines

  comment typo fix
........
  r74465 | vinay.sajip | 2009-08-15 18:23:12 -0500 (Sat, 15 Aug 2009) | 1 line

  Added section on logging to one file from multiple processes.
........
  r74467 | vinay.sajip | 2009-08-15 18:34:47 -0500 (Sat, 15 Aug 2009) | 1 line

  Refined section on logging to one file from multiple processes.
........
  r74488 | vinay.sajip | 2009-08-17 08:14:37 -0500 (Mon, 17 Aug 2009) | 1 line

  Further refined section on logging to one file from multiple processes.
........
  r74492 | r.david.murray | 2009-08-17 14:26:49 -0500 (Mon, 17 Aug 2009) | 2 lines

  Issue 6685: 'toupper' -> 'upper' in cgi doc example explanation.
........
  r74513 | skip.montanaro | 2009-08-18 09:37:52 -0500 (Tue, 18 Aug 2009) | 1 line

  missing module ref (issue6723)
........
  r74531 | vinay.sajip | 2009-08-20 17:04:32 -0500 (Thu, 20 Aug 2009) | 1 line

  Added section on exceptions raised during logging.
........
  r74549 | benjamin.peterson | 2009-08-24 12:42:36 -0500 (Mon, 24 Aug 2009) | 1 line

  fix pdf building by teaching latex the right encoding package
........
  r74553 | r.david.murray | 2009-08-26 20:04:59 -0500 (Wed, 26 Aug 2009) | 2 lines

  Remove leftover text from end of sentence.
........
  r74625 | benjamin.peterson | 2009-09-01 17:27:57 -0500 (Tue, 01 Sep 2009) | 1 line

  remove the check that classmethod's argument is a callable
........
  r74632 | georg.brandl | 2009-09-03 02:27:26 -0500 (Thu, 03 Sep 2009) | 1 line

  #6828: fix wrongly highlighted blocks.
........
  r74643 | georg.brandl | 2009-09-04 01:59:20 -0500 (Fri, 04 Sep 2009) | 2 lines

  Issue #2666: Handle BROWSER environment variable properly for unknown browser names in the webbrowser module.
........
  r74644 | georg.brandl | 2009-09-04 02:55:14 -0500 (Fri, 04 Sep 2009) | 1 line

  #5047: remove Monterey support from configure.
........
  r74647 | georg.brandl | 2009-09-04 03:17:04 -0500 (Fri, 04 Sep 2009) | 2 lines

  Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as documented.
........
  r74652 | georg.brandl | 2009-09-04 06:25:37 -0500 (Fri, 04 Sep 2009) | 1 line

  #6756: add some info about the "acct" parameter.
........
  r74666 | georg.brandl | 2009-09-05 04:04:09 -0500 (Sat, 05 Sep 2009) | 1 line

  #6841: remove duplicated word.
........
  r74671 | georg.brandl | 2009-09-05 11:47:17 -0500 (Sat, 05 Sep 2009) | 1 line

  #6843: add link from filterwarnings to where the meaning of the arguments is covered.
........
  r74727 | benjamin.peterson | 2009-09-08 18:04:22 -0500 (Tue, 08 Sep 2009) | 1 line

  #6865 fix ref counting in initialization of pwd module
........
  r74739 | georg.brandl | 2009-09-11 02:55:20 -0500 (Fri, 11 Sep 2009) | 1 line

  Move function back to its section.
........
This commit is contained in:
Benjamin Peterson 2009-09-11 22:24:02 +00:00
parent 244f354559
commit 8719ad5dde
23 changed files with 6074 additions and 5364 deletions

View File

@ -151,6 +151,9 @@ latex_preamble = r'''
# Documents to append as an appendix to all manuals.
latex_appendices = ['glossary', 'about', 'license', 'copyright']
# Get LaTeX to handle Unicode correctly
latex_elements = {'inputenc': r'\usepackage[utf8x]{inputenc}'}
# Options for the coverage checker
# --------------------------------

View File

@ -429,13 +429,6 @@ built-in functions in the installation script.
also the configuration. For details refer to Microsoft's documentation of the
:cfunc:`SHGetSpecialFolderPath` function.
Vista User Access Control (UAC)
===============================
Starting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`
option. The default is 'none' (meaning no UAC handling is done), and other
valid values are 'auto' (meaning prompt for UAC elevation if Python was
installed for all users) and 'force' (meaning always prompt for elevation)
.. function:: create_shortcut(target, description, filename[, arguments[, workdir[, iconpath[, iconindex]]]])
@ -447,3 +440,12 @@ installed for all users) and 'force' (meaning always prompt for elevation)
and *iconindex* is the index of the icon in the file *iconpath*. Again, for
details consult the Microsoft documentation for the :class:`IShellLink`
interface.
Vista User Access Control (UAC)
===============================
Starting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`
option. The default is 'none' (meaning no UAC handling is done), and other
valid values are 'auto' (meaning prompt for UAC elevation if Python was
installed for all users) and 'force' (meaning always prompt for elevation).

View File

@ -208,7 +208,7 @@ The problem with the code is that you should never expect that a client will
provide valid input to your scripts. For example, if a curious user appends
another ``user=foo`` pair to the query string, then the script would crash,
because in this situation the ``getvalue("user")`` method call returns a list
instead of a string. Calling the :meth:`toupper` method on a list is not valid
instead of a string. Calling the :meth:`~str.upper` method on a list is not valid
(since lists do not have a method of this name) and results in an
:exc:`AttributeError` exception.

View File

@ -66,7 +66,7 @@ should not be used in programs.
Objects that when printed, print a message like "Use quit() or Ctrl-D
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
specified exit code, and when .
specified exit code.
.. data:: copyright
license

View File

@ -140,7 +140,8 @@ followed by ``lines`` for the text version or ``binary`` for the binary version.
``'anonymous@'``. This function should be called only once for each instance,
after a connection has been established; it should not be called at all if a
host and user were given when the instance was created. Most FTP commands are
only allowed after the client has logged in.
only allowed after the client has logged in. The *acct* parameter supplies
"accounting information"; few systems implement this.
.. method:: FTP.abort()

View File

@ -1362,6 +1362,7 @@ Note that at present, the :mod:`multiprocessing` module does not provide
working lock functionality on all platforms (see
http://bugs.python.org/issue3770).
.. _network-logging:
Sending and receiving logging events across a network

View File

@ -1151,11 +1151,6 @@ their parent process exits. The manager classes are defined in the
Run the server in the current process.
.. method:: from_address(address, authkey)
A class method which creates a manager object referring to a pre-existing
server process which is using the given address and authentication key.
.. method:: get_server()
Returns a :class:`Server` object which represents the actual server under

View File

@ -1938,7 +1938,7 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
:meth:`update` accepts either another dictionary object or an iterable of
key/value pairs (as a tuple or other iterable of length two). If keyword
arguments are specified, the dictionary is then is updated with those
arguments are specified, the dictionary is then updated with those
key/value pairs: ``d.update(red=1, blue=2)``.
.. method:: values()

View File

@ -1,4 +1,3 @@
:mod:`warnings` --- Warning control
===================================
@ -131,16 +130,16 @@ the disposition of the match. Each entry is a tuple of the form (*action*,
+---------------+----------------------------------------------+
* *message* is a string containing a regular expression that the warning message
must match (the match is compiled to always be case-insensitive)
must match (the match is compiled to always be case-insensitive).
* *category* is a class (a subclass of :exc:`Warning`) of which the warning
category must be a subclass in order to match
category must be a subclass in order to match.
* *module* is a string containing a regular expression that the module name must
match (the match is compiled to be case-sensitive)
match (the match is compiled to be case-sensitive).
* *lineno* is an integer that the line number where the warning occurred must
match, or ``0`` to match all line numbers
match, or ``0`` to match all line numbers.
Since the :exc:`Warning` class is derived from the built-in :exc:`Exception`
class, to turn a warning into an error we simply raise ``category(message)``.
@ -286,17 +285,19 @@ Available Functions
.. function:: formatwarning(message, category, filename, lineno[, line])
Format a warning the standard way. This returns a string which may contain
embedded newlines and ends in a newline. *line* is
a line of source code to be included in the warning message; if *line* is not supplied,
:func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
embedded newlines and ends in a newline. *line* is a line of source code to
be included in the warning message; if *line* is not supplied,
:func:`formatwarning` will try to read the line specified by *filename* and
*lineno*.
.. function:: filterwarnings(action[, message[, category[, module[, lineno[, append]]]]])
Insert an entry into the list of warnings filters. The entry is inserted at the
front by default; if *append* is true, it is inserted at the end. This checks
the types of the arguments, compiles the message and module regular expressions,
and inserts them as a tuple in the list of warnings filters. Entries closer to
Insert an entry into the list of :ref:`warnings filter specifications
<warning-filter>`. The entry is inserted at the front by default; if
*append* is true, it is inserted at the end. This checks the types of the
arguments, compiles the *message* and *module* regular expressions, and
inserts them as a tuple in the list of warnings filters. Entries closer to
the front of the list override entries later in the list, if both match a
particular warning. Omitted arguments default to a value that matches
everything.
@ -304,10 +305,11 @@ Available Functions
.. function:: simplefilter(action[, category[, lineno[, append]]])
Insert a simple entry into the list of warnings filters. The meaning of the
function parameters is as for :func:`filterwarnings`, but regular expressions
are not needed as the filter inserted always matches any message in any module
as long as the category and line number match.
Insert a simple entry into the list of :ref:`warnings filter specifications
<warning-filter>`. The meaning of the function parameters is as for
:func:`filterwarnings`, but regular expressions are not needed as the filter
inserted always matches any message in any module as long as the category and
line number match.
.. function:: resetwarnings()

View File

@ -150,7 +150,6 @@ convert a complex number to a real number. Use ``abs(z)`` to get its magnitude
4.0
>>> abs(a) # sqrt(a.real**2 + a.imag**2)
5.0
>>>
In interactive mode, the last printed expression is assigned to the variable
``_``. This means that when you are using Python as a desk calculator, it is
@ -164,7 +163,6 @@ somewhat easier to continue calculations, for example::
113.0625
>>> round(_, 2)
113.06
>>>
This variable should be treated as read-only by the user. Don't explicitly
assign a value to it --- you would create an independent local variable with the
@ -212,12 +210,32 @@ next line is a logical continuation of the line::
Note that newlines still need to be embedded in the string using ``\n``; the
newline following the trailing backslash is discarded. This example would print
the following::
the following:
.. code-block:: text
This is a rather long string containing
several lines of text just as you would do in C.
Note that whitespace at the beginning of the line is significant.
Or, strings can be surrounded in a pair of matching triple-quotes: ``"""`` or
``'''``. End of lines do not need to be escaped when using triple-quotes, but
they will be included in the string. ::
print """
Usage: thingy [OPTIONS]
-h Display this usage message
-H hostname Hostname to connect to
"""
produces the following output:
.. code-block:: text
Usage: thingy [OPTIONS]
-h Display this usage message
-H hostname Hostname to connect to
If we make the string literal a "raw" string, ``\n`` sequences are not converted
to newlines, but the backslash at the end of the line, and the newline character
in the source, are both included in the string as data. Thus, the example::
@ -227,7 +245,9 @@ in the source, are both included in the string as data. Thus, the example::
print(hello)
would print::
would print:
.. code-block:: text
This is a rather long string containing\n\
several lines of text much as you would do in C.

View File

@ -514,7 +514,9 @@ class BaseCookie(dict):
if type(rawdata) == type(""):
self.__ParseString(rawdata)
else:
self.update(rawdata)
# self.update() wouldn't call our custom __setitem__
for k, v in rawdata.items():
self[k] = v
return
def __ParseString(self, str, patt=_CookiePattern):

View File

@ -9,7 +9,7 @@ def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so, assume that Python was built with Aqua Tcl/Tk rather than
X11 Tck/Tk.
X11 Tcl/Tk.
"""
return (sys.platform == 'darwin' and '.app' in sys.executable)

View File

@ -595,4 +595,4 @@ class MethodProxy(object):
# XXX KBK 09Sep03 We need a proper unit test for this module. Previously
# existing test code was removed at Rev 1.27.
# existing test code was removed at Rev 1.27 (r34098).

View File

@ -282,9 +282,22 @@ class JoinableQueue(Queue):
Queue.__setstate__(self, state[:-2])
self._cond, self._unfinished_tasks = state[-2:]
def put(self, item, block=True, timeout=None):
Queue.put(self, item, block, timeout)
def put(self, obj, block=True, timeout=None):
assert not self._closed
if not self._sem.acquire(block, timeout):
raise Full
self._notempty.acquire()
self._cond.acquire()
try:
if self._thread is None:
self._start_thread()
self._buffer.append(obj)
self._unfinished_tasks.release()
self._notempty.notify()
finally:
self._cond.release()
self._notempty.release()
def task_done(self):
self._cond.acquire()

View File

@ -1268,13 +1268,9 @@ order (MRO) for bases """
self.assertEqual(super(D,D).goo(), (D,))
self.assertEqual(super(D,d).goo(), (D,))
# Verify that argument is checked for callability (SF bug 753451)
try:
classmethod(1).__get__(1)
except TypeError:
pass
else:
self.fail("classmethod should check for callability")
# Verify that a non-callable will raise
meth = classmethod(1).__get__(1)
self.assertRaises(TypeError, meth)
# Verify that classmethod() doesn't allow keyword args
try:

View File

@ -626,7 +626,9 @@ if "BROWSER" in os.environ:
# and prepend to _tryorder
for cmdline in _userchoices:
if cmdline != '':
_synthesize(cmdline, -1)
cmd = _synthesize(cmdline, -1)
if cmd[1] is None:
register(cmdline, None, GenericBrowser(cmdline), -1)
cmdline = None # to make del work if _userchoices was empty
del cmdline
del _userchoices

View File

@ -489,6 +489,7 @@ Craig McPheeters
Lambert Meertens
Bill van Melle
Lucas Prado Melo
Brian Merrell
Luke Mewburn
Mike Meyer
Steven Miale

View File

@ -853,7 +853,7 @@ PyErr_CheckSignals(void)
#endif
/*
* The is_stripped variable is meant to speed up the calls to
* The is_tripped variable is meant to speed up the calls to
* PyErr_CheckSignals (both directly or via pending calls) when no
* signal has arrived. This variable is set to 1 when a signal arrives
* and it is set to 0 here, when we know some signals arrived. This way

View File

@ -43,10 +43,6 @@ PyObject *
PyMethod_New(PyObject *func, PyObject *self)
{
register PyMethodObject *im;
if (!PyCallable_Check(func)) {
PyErr_BadInternalCall();
return NULL;
}
if (self == NULL) {
PyErr_BadInternalCall();
return NULL;

View File

@ -765,12 +765,6 @@ cm_init(PyObject *self, PyObject *args, PyObject *kwds)
return -1;
if (!_PyArg_NoKeywords("classmethod", kwds))
return -1;
if (!PyCallable_Check(callable)) {
PyErr_Format(PyExc_TypeError, "'%s' object is not callable",
callable->ob_type->tp_name);
return -1;
}
Py_INCREF(callable);
cm->cm_callable = callable;
return 0;

10892
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -233,7 +233,7 @@ AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
ac_sys_release=`uname -v`
else
@ -415,9 +415,6 @@ AC_ARG_WITH(gcc,
case $ac_sys_system in
AIX*) CC=cc_r
without_gcc=;;
Monterey*)
RANLIB=:
without_gcc=;;
*) without_gcc=no;;
esac])
AC_MSG_RESULT($without_gcc)
@ -539,10 +536,6 @@ hp*|HP*)
case $CC in
cc|*/cc) CC="$CC -Ae";;
esac;;
Monterey*)
case $CC in
cc) CC="$CC -Wl,-Bexport";;
esac;;
SunOS*)
# Some functions have a prototype only with that define, e.g. confstr
AC_DEFINE(__EXTENSIONS__, 1, [Defined on Solaris to see additional function prototypes.])
@ -603,8 +596,6 @@ then
exp_extra="."
fi
LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";;
Monterey64*)
LINKCC="$LINKCC -L/usr/lib/ia64l64";;
QNX*)
# qcc must be used because the other compilers do not
# support -N.
@ -854,15 +845,6 @@ then
OPT="-O"
;;
esac
# The current (beta) Monterey compiler dies with optimizations
# XXX what is Monterey? Does it still die w/ -O? Can we get rid of this?
case $ac_sys_system in
Monterey*)
OPT=""
;;
esac
fi
AC_SUBST(BASECFLAGS)
@ -1718,7 +1700,6 @@ then
else LDSHARED='$(CC) -G'
fi;;
SCO_SV*) LDSHARED='$(CC) -Wl,-G,-Bexport';;
Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
atheos*) LDSHARED="gcc -shared";;
*) LDSHARED="ld";;
@ -1755,7 +1736,6 @@ then
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
Monterey*) CCSHARED="-G";;
IRIX*/6*) case $CC in
*gcc*) CCSHARED="-shared";;
*) CCSHARED="";;

View File

@ -5,6 +5,9 @@
#define Py_PYCONFIG_H
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
support for AIX C++ shared extension modules. */
#undef AIX_GENUINE_CPLUSPLUS
@ -1010,6 +1013,28 @@
/* Define if you want to use computed gotos in ceval.c. */
#undef USE_COMPUTED_GOTOS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Define if a va_list is an array of some kind */
#undef VA_LIST_IS_ARRAY
@ -1047,20 +1072,21 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Define if arithmetic is subject to x87-style double rounding issue */
#undef X87_DOUBLE_ROUNDING
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Define on OpenBSD to activate all library features */
#undef _BSD_SOURCE
@ -1079,15 +1105,25 @@
/* This must be defined on some systems to enable large file support. */
#undef _LARGEFILE_SOURCE
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define on NetBSD to activate all library features */
#undef _NETBSD_SOURCE
/* Define _OSF_SOURCE to get the makedev macro. */
#undef _OSF_SOURCE
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to activate features from IEEE Stds 1003.1-2001 */
#undef _POSIX_C_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define if you have POSIX threads, and your system does not define that. */
#undef _POSIX_THREADS
@ -1095,12 +1131,12 @@
#undef _REENTRANT
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T