Merged revisions 73930-73932,73937-73939,73945,73951,73954,73962-73963,73970 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73930 | amaury.forgeotdarc | 2009-07-10 12:47:42 -0400 (Fri, 10 Jul 2009) | 2 lines #6447: typo in subprocess docstring ........ r73931 | ezio.melotti | 2009-07-10 16:25:56 -0400 (Fri, 10 Jul 2009) | 1 line more cleanups and if zlib -> skipUnless(zlib) ........ r73932 | kristjan.jonsson | 2009-07-11 04:44:43 -0400 (Sat, 11 Jul 2009) | 3 lines http://bugs.python.org/issue6460 Need to be careful with thread switching when testing the xmlrpc server. The server thread may not have updated stats when the client thread tests them. ........ r73937 | georg.brandl | 2009-07-11 06:12:36 -0400 (Sat, 11 Jul 2009) | 1 line Fix style. ........ r73938 | georg.brandl | 2009-07-11 06:14:54 -0400 (Sat, 11 Jul 2009) | 1 line #6446: fix import_spam() function to use correct error and reference handling. ........ r73939 | georg.brandl | 2009-07-11 06:18:10 -0400 (Sat, 11 Jul 2009) | 1 line #6448: clarify docs for find_module(). ........ r73945 | georg.brandl | 2009-07-11 06:51:31 -0400 (Sat, 11 Jul 2009) | 1 line #6456: clarify the meaning of constants used as arguments to nl_langinfo(). ........ r73951 | georg.brandl | 2009-07-11 10:23:38 -0400 (Sat, 11 Jul 2009) | 2 lines array.array is actually a class. ........ r73954 | tarek.ziade | 2009-07-11 13:21:00 -0400 (Sat, 11 Jul 2009) | 1 line reverted changes for #6459 (doesn't apply on 2.x) ........ r73962 | benjamin.peterson | 2009-07-11 18:15:13 -0400 (Sat, 11 Jul 2009) | 1 line put downloaded test support files in Lib/test/data instead of the cwd ........ r73963 | benjamin.peterson | 2009-07-11 18:25:24 -0400 (Sat, 11 Jul 2009) | 1 line ignore things in Lib/test/data/ ........ r73970 | hirokazu.yamamoto | 2009-07-11 22:04:47 -0400 (Sat, 11 Jul 2009) | 1 line Fixed distutils test. ........
This commit is contained in:
parent
ea3714e689
commit
711ed4aedf
18
.bzrignore
18
.bzrignore
|
@ -14,24 +14,7 @@ platform
|
|||
pyconfig.h
|
||||
libpython*.a
|
||||
python.exe
|
||||
CP936.TXT
|
||||
SHIFT_JISX0213.TXT
|
||||
JOHAB.TXT
|
||||
EUC-JP.TXT
|
||||
NormalizationTest-3.2.0.txt
|
||||
NormalizationTest.txt
|
||||
BIG5.TXT
|
||||
BIG5HKSCS-2004.TXT
|
||||
CP949.TXT
|
||||
EUC-CN.TXT
|
||||
BIG5HKSCS.TXT
|
||||
SHIFTJIS.TXT
|
||||
EUC-KR.TXT
|
||||
EUC-JISX0213.TXT
|
||||
CP932.TXT
|
||||
CP950.TXT
|
||||
reflog.txt
|
||||
gb-18030-2000.xml
|
||||
tags
|
||||
TAGS
|
||||
.gdb_history
|
||||
|
@ -45,5 +28,6 @@ Modules/Setup.config
|
|||
Modules/Setup.local
|
||||
Modules/config.c
|
||||
Parser/pgen
|
||||
Lib/test/data/*
|
||||
Lib/lib2to3/Grammar*.pickle
|
||||
Lib/lib2to3/PatternGrammar*.pickle
|
||||
|
|
18
.hgignore
18
.hgignore
|
@ -1,24 +1,8 @@
|
|||
.gdb_history
|
||||
.purify
|
||||
.svn
|
||||
BIG5.TXT
|
||||
BIG5HKSCS-2004.TXT
|
||||
BIG5HKSCS.TXT
|
||||
CP932.TXT
|
||||
CP936.TXT
|
||||
CP949.TXT
|
||||
CP950.TXT
|
||||
EUC-CN.TXT
|
||||
EUC-JISX0213.TXT
|
||||
EUC-JP.TXT
|
||||
EUC-KR.TXT
|
||||
JOHAB.TXT
|
||||
Makefile
|
||||
Makefile.pre
|
||||
NormalizationTest-3.2.0.txt
|
||||
NormalizationTest.txt
|
||||
SHIFTJIS.TXT
|
||||
SHIFT_JISX0213.TXT
|
||||
TAGS
|
||||
autom4te.cache
|
||||
build
|
||||
|
@ -28,7 +12,6 @@ config.log
|
|||
config.status
|
||||
config.status.lineno
|
||||
db_home
|
||||
gb-18030-2000.xml
|
||||
platform
|
||||
pyconfig.h
|
||||
python
|
||||
|
@ -59,6 +42,7 @@ libpython*.a
|
|||
*.rej
|
||||
*~
|
||||
Lib/lib2to3/*.pickle
|
||||
Lib/test/data/*
|
||||
PCbuild/*.exe
|
||||
PCbuild/*.dll
|
||||
PCbuild/*.pdb
|
||||
|
|
|
@ -25,6 +25,8 @@ Importing Modules
|
|||
imported module, or *NULL* with an exception set on failure. A failing
|
||||
import of a module doesn't leave the module in :data:`sys.modules`.
|
||||
|
||||
This function always uses absolute imports.
|
||||
|
||||
|
||||
.. cfunction:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
|
||||
|
||||
|
@ -75,6 +77,8 @@ Importing Modules
|
|||
current globals. This means that the import is done using whatever import
|
||||
hooks are installed in the current environment.
|
||||
|
||||
This function always uses absolute imports.
|
||||
|
||||
|
||||
.. cfunction:: PyObject* PyImport_ReloadModule(PyObject *m)
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@ through the :attr:`itemsize` attribute.
|
|||
The module defines the following type:
|
||||
|
||||
|
||||
.. function:: array(typecode[, initializer])
|
||||
.. class:: array(typecode[, initializer])
|
||||
|
||||
Return a new array whose items are restricted by *typecode*, and initialized
|
||||
A new array whose items are restricted by *typecode*, and initialized
|
||||
from the optional *initializer* value, which must be a list, object
|
||||
supporting the buffer interface, or iterable over elements of the
|
||||
appropriate type.
|
||||
|
@ -67,7 +67,7 @@ The module defines the following type:
|
|||
|
||||
.. data:: ArrayType
|
||||
|
||||
Obsolete alias for :func:`array`.
|
||||
Obsolete alias for :class:`array`.
|
||||
|
||||
.. data:: typecodes
|
||||
|
||||
|
@ -81,7 +81,6 @@ and may be used wherever buffer objects are supported.
|
|||
|
||||
The following data items and methods are also supported:
|
||||
|
||||
|
||||
.. attribute:: array.typecode
|
||||
|
||||
The typecode character used to create the array.
|
||||
|
|
|
@ -33,16 +33,17 @@ This module provides an interface to the mechanisms used to implement the
|
|||
|
||||
.. function:: find_module(name[, path])
|
||||
|
||||
Try to find the module *name* on the search path *path*. If *path* is a list
|
||||
of directory names, each directory is searched for files with any of the
|
||||
suffixes returned by :func:`get_suffixes` above. Invalid names in the list
|
||||
are silently ignored (but all list items must be strings). If *path* is
|
||||
omitted or ``None``, the list of directory names given by ``sys.path`` is
|
||||
searched, but first it searches a few special places: it tries to find a
|
||||
built-in module with the given name (:const:`C_BUILTIN`), then a frozen
|
||||
module (:const:`PY_FROZEN`), and on some systems some other places are looked
|
||||
in as well (on Windows, it looks in the registry which may point to a
|
||||
specific file).
|
||||
Try to find the module *name*. If *path* is omitted or ``None``, the list of
|
||||
directory names given by ``sys.path`` is searched, but first a few special
|
||||
places are searched: the function tries to find a built-in module with the
|
||||
given name (:const:`C_BUILTIN`), then a frozen module (:const:`PY_FROZEN`),
|
||||
and on some systems some other places are looked in as well (on Windows, it
|
||||
looks in the registry which may point to a specific file).
|
||||
|
||||
Otherwise, *path* must be a list of directory names; each directory is
|
||||
searched for files with any of the suffixes returned by :func:`get_suffixes`
|
||||
above. Invalid names in the list are silently ignored (but all list items
|
||||
must be strings).
|
||||
|
||||
If search is successful, the return value is a 3-element tuple ``(file,
|
||||
pathname, description)``:
|
||||
|
|
|
@ -144,13 +144,127 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
|
||||
.. function:: nl_langinfo(option)
|
||||
|
||||
Return some locale-specific information as a string. This function is not
|
||||
available on all systems, and the set of possible options might also vary across
|
||||
platforms. The possible argument values are numbers, for which symbolic
|
||||
constants are available in the locale module.
|
||||
Return some locale-specific information as a string. This function is not
|
||||
available on all systems, and the set of possible options might also vary
|
||||
across platforms. The possible argument values are numbers, for which
|
||||
symbolic constants are available in the locale module.
|
||||
|
||||
The :func:`nl_langinfo` function accepts one of the following keys. Most
|
||||
descriptions are taken from the corresponding description in the GNU C
|
||||
library.
|
||||
|
||||
.. data:: CODESET
|
||||
|
||||
Get a string with the name of the character encoding used in the
|
||||
selected locale.
|
||||
|
||||
.. data:: D_T_FMT
|
||||
|
||||
Get a string that can be used as a format string for :func:`strftime` to
|
||||
represent time and date in a locale-specific way.
|
||||
|
||||
.. data:: D_FMT
|
||||
|
||||
Get a string that can be used as a format string for :func:`strftime` to
|
||||
represent a date in a locale-specific way.
|
||||
|
||||
.. data:: T_FMT
|
||||
|
||||
Get a string that can be used as a format string for :func:`strftime` to
|
||||
represent a time in a locale-specific way.
|
||||
|
||||
.. data:: T_FMT_AMPM
|
||||
|
||||
Get a format string for :func:`strftime` to represent time in the am/pm
|
||||
format.
|
||||
|
||||
.. data:: DAY_1 ... DAY_7
|
||||
|
||||
Get the name of the n-th day of the week.
|
||||
|
||||
.. note::
|
||||
|
||||
This follows the US convention of :const:`DAY_1` being Sunday, not the
|
||||
international convention (ISO 8601) that Monday is the first day of the
|
||||
week.
|
||||
|
||||
.. data:: ABDAY_1 ... ABDAY_7
|
||||
|
||||
Get the abbreviated name of the n-th day of the week.
|
||||
|
||||
.. data:: MON_1 ... MON_12
|
||||
|
||||
Get the name of the n-th month.
|
||||
|
||||
.. data:: ABMON_1 ... ABMON_12
|
||||
|
||||
Get the abbreviated name of the n-th month.
|
||||
|
||||
.. data:: RADIXCHAR
|
||||
|
||||
Get the radix character (decimal dot, decimal comma, etc.)
|
||||
|
||||
.. data:: THOUSEP
|
||||
|
||||
Get the separator character for thousands (groups of three digits).
|
||||
|
||||
.. data:: YESEXPR
|
||||
|
||||
Get a regular expression that can be used with the regex function to
|
||||
recognize a positive response to a yes/no question.
|
||||
|
||||
.. note::
|
||||
|
||||
The expression is in the syntax suitable for the :cfunc:`regex` function
|
||||
from the C library, which might differ from the syntax used in :mod:`re`.
|
||||
|
||||
.. data:: NOEXPR
|
||||
|
||||
Get a regular expression that can be used with the regex(3) function to
|
||||
recognize a negative response to a yes/no question.
|
||||
|
||||
.. data:: CRNCYSTR
|
||||
|
||||
Get the currency symbol, preceded by "-" if the symbol should appear before
|
||||
the value, "+" if the symbol should appear after the value, or "." if the
|
||||
symbol should replace the radix character.
|
||||
|
||||
.. data:: ERA
|
||||
|
||||
Get a string that represents the era used in the current locale.
|
||||
|
||||
Most locales do not define this value. An example of a locale which does
|
||||
define this value is the Japanese one. In Japan, the traditional
|
||||
representation of dates includes the name of the era corresponding to the
|
||||
then-emperor's reign.
|
||||
|
||||
Normally it should not be necessary to use this value directly. Specifying
|
||||
the ``E`` modifier in their format strings causes the :func:`strftime`
|
||||
function to use this information. The format of the returned string is not
|
||||
specified, and therefore you should not assume knowledge of it on different
|
||||
systems.
|
||||
|
||||
.. data:: ERA_YEAR
|
||||
|
||||
Get the year in the relevant era of the locale.
|
||||
|
||||
.. data:: ERA_D_T_FMT
|
||||
|
||||
Get a format string for :func:`strftime` to represent dates and times in a
|
||||
locale-specific era-based way.
|
||||
|
||||
.. data:: ERA_D_FMT
|
||||
|
||||
Get a format string for :func:`strftime` to represent time in a
|
||||
locale-specific era-based way.
|
||||
|
||||
.. data:: ALT_DIGITS
|
||||
|
||||
Get a representation of up to 100 values used to represent the values
|
||||
0 to 99.
|
||||
|
||||
|
||||
.. function:: getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'))
|
||||
.. function:: getdefaultlocale([envvars])
|
||||
|
||||
Tries to determine the default locale settings and returns them as a tuple of
|
||||
the form ``(language code, encoding)``.
|
||||
|
@ -338,140 +452,13 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
This is a symbolic constant used for different values returned by
|
||||
:func:`localeconv`.
|
||||
|
||||
The :func:`nl_langinfo` function accepts one of the following keys. Most
|
||||
descriptions are taken from the corresponding description in the GNU C library.
|
||||
|
||||
|
||||
.. data:: CODESET
|
||||
|
||||
Return a string with the name of the character encoding used in the selected
|
||||
locale.
|
||||
|
||||
|
||||
.. data:: D_T_FMT
|
||||
|
||||
Return a string that can be used as a format string for strftime(3) to represent
|
||||
time and date in a locale-specific way.
|
||||
|
||||
|
||||
.. data:: D_FMT
|
||||
|
||||
Return a string that can be used as a format string for strftime(3) to represent
|
||||
a date in a locale-specific way.
|
||||
|
||||
|
||||
.. data:: T_FMT
|
||||
|
||||
Return a string that can be used as a format string for strftime(3) to represent
|
||||
a time in a locale-specific way.
|
||||
|
||||
|
||||
.. data:: T_FMT_AMPM
|
||||
|
||||
The return value can be used as a format string for 'strftime' to represent time
|
||||
in the am/pm format.
|
||||
|
||||
|
||||
.. data:: DAY_1 ... DAY_7
|
||||
|
||||
Return name of the n-th day of the week.
|
||||
|
||||
.. note::
|
||||
|
||||
This follows the US convention of :const:`DAY_1` being Sunday, not the
|
||||
international convention (ISO 8601) that Monday is the first day of the week.
|
||||
|
||||
|
||||
.. data:: ABDAY_1 ... ABDAY_7
|
||||
|
||||
Return abbreviated name of the n-th day of the week.
|
||||
|
||||
|
||||
.. data:: MON_1 ... MON_12
|
||||
|
||||
Return name of the n-th month.
|
||||
|
||||
|
||||
.. data:: ABMON_1 ... ABMON_12
|
||||
|
||||
Return abbreviated name of the n-th month.
|
||||
|
||||
|
||||
.. data:: RADIXCHAR
|
||||
|
||||
Return radix character (decimal dot, decimal comma, etc.)
|
||||
|
||||
|
||||
.. data:: THOUSEP
|
||||
|
||||
Return separator character for thousands (groups of three digits).
|
||||
|
||||
|
||||
.. data:: YESEXPR
|
||||
|
||||
Return a regular expression that can be used with the regex function to
|
||||
recognize a positive response to a yes/no question.
|
||||
|
||||
.. note::
|
||||
|
||||
The expression is in the syntax suitable for the :cfunc:`regex` function from
|
||||
the C library, which might differ from the syntax used in :mod:`re`.
|
||||
|
||||
|
||||
.. data:: NOEXPR
|
||||
|
||||
Return a regular expression that can be used with the regex(3) function to
|
||||
recognize a negative response to a yes/no question.
|
||||
|
||||
|
||||
.. data:: CRNCYSTR
|
||||
|
||||
Return the currency symbol, preceded by "-" if the symbol should appear before
|
||||
the value, "+" if the symbol should appear after the value, or "." if the symbol
|
||||
should replace the radix character.
|
||||
|
||||
|
||||
.. data:: ERA
|
||||
|
||||
The return value represents the era used in the current locale.
|
||||
|
||||
Most locales do not define this value. An example of a locale which does define
|
||||
this value is the Japanese one. In Japan, the traditional representation of
|
||||
dates includes the name of the era corresponding to the then-emperor's reign.
|
||||
|
||||
Normally it should not be necessary to use this value directly. Specifying the
|
||||
``E`` modifier in their format strings causes the :func:`strftime` function to
|
||||
use this information. The format of the returned string is not specified, and
|
||||
therefore you should not assume knowledge of it on different systems.
|
||||
|
||||
|
||||
.. data:: ERA_YEAR
|
||||
|
||||
The return value gives the year in the relevant era of the locale.
|
||||
|
||||
|
||||
.. data:: ERA_D_T_FMT
|
||||
|
||||
This return value can be used as a format string for :func:`strftime` to
|
||||
represent dates and times in a locale-specific era-based way.
|
||||
|
||||
|
||||
.. data:: ERA_D_FMT
|
||||
|
||||
This return value can be used as a format string for :func:`strftime` to
|
||||
represent time in a locale-specific era-based way.
|
||||
|
||||
|
||||
.. data:: ALT_DIGITS
|
||||
|
||||
The return value is a representation of up to 100 values used to represent the
|
||||
values 0 to 99.
|
||||
|
||||
Example::
|
||||
|
||||
>>> import locale
|
||||
>>> loc = locale.getlocale() # get current locale
|
||||
>>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
|
||||
# use German locale; name might vary with platform
|
||||
>>> locale.setlocale(locale.LC_ALL, 'de_DE')
|
||||
>>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
|
||||
>>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
|
||||
>>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale
|
||||
|
|
|
@ -724,7 +724,7 @@ class Popen(object):
|
|||
# Windows methods
|
||||
#
|
||||
def _get_handles(self, stdin, stdout, stderr):
|
||||
"""Construct and return tupel with IO objects:
|
||||
"""Construct and return tuple with IO objects:
|
||||
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
|
||||
"""
|
||||
if stdin is None and stdout is None and stderr is None:
|
||||
|
@ -959,7 +959,7 @@ class Popen(object):
|
|||
# POSIX methods
|
||||
#
|
||||
def _get_handles(self, stdin, stdout, stderr):
|
||||
"""Construct and return tupel with IO objects:
|
||||
"""Construct and return tuple with IO objects:
|
||||
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
|
||||
"""
|
||||
p2cread, p2cwrite = None, None
|
||||
|
|
|
@ -453,13 +453,12 @@ def open_urlresource(url, *args, **kw):
|
|||
requires('urlfetch')
|
||||
filename = urllib.parse.urlparse(url)[2].split('/')[-1] # '/': it's URL!
|
||||
|
||||
for path in [os.path.curdir, os.path.pardir]:
|
||||
fn = os.path.join(path, filename)
|
||||
if os.path.exists(fn):
|
||||
return open(fn, *args, **kw)
|
||||
fn = os.path.join(os.path.dirname(__file__), "data", filename)
|
||||
if os.path.exists(fn):
|
||||
return open(fn)
|
||||
|
||||
print('\tfetching %s ...' % url, file=get_original_stdout())
|
||||
fn, _ = urllib.request.urlretrieve(url, filename)
|
||||
fn, _ = urllib.request.urlretrieve(url, fn)
|
||||
return open(fn, *args, **kw)
|
||||
|
||||
|
||||
|
|
|
@ -1181,6 +1181,7 @@ clobber: clean profile-removal
|
|||
# remove all generated files, even Makefile[.pre]
|
||||
# Keep configure and Python-ast.[ch], it's possible they can't be generated
|
||||
distclean: clobber
|
||||
-rm -f Lib/test/data/*
|
||||
-rm -f core Makefile Makefile.pre config.status \
|
||||
Modules/Setup Modules/Setup.local Modules/Setup.config
|
||||
find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
|
||||
|
|
|
@ -915,9 +915,6 @@ Library
|
|||
- Issue #2622: Fixed an ImportError when importing email.messsage from a
|
||||
standalone application built with py2exe or py2app.
|
||||
|
||||
- Issue #6459: distutils.command.build_ext.get_export_symbols now uses the
|
||||
"PyInit" prefix, rather than "init".
|
||||
|
||||
- Issue #6455: Fixed test_build_ext under win32.
|
||||
|
||||
- Issue #6377: Enabled the compiler option, and deprecate its usage as an
|
||||
|
|
Loading…
Reference in New Issue