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

Skip to content

Commit f08a9dd

Browse files
committed
Merged revisions 63724,63726,63732,63744,63754-63755,63757-63758,63760,63775,63781-63782,63787,63805-63808,63818-63819,63823-63824 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r63724 | gregory.p.smith | 2008-05-26 22:22:14 +0200 (Mon, 26 May 2008) | 6 lines Fixes issue2791: subprocess.Popen.communicate leaked a file descripton until the last reference to the Popen instance was dropped. Adding explicit close() calls fixes it. Candidate for backport to release25-maint. ........ r63726 | benjamin.peterson | 2008-05-26 22:43:24 +0200 (Mon, 26 May 2008) | 2 lines fix minor grammar typo ........ r63732 | benjamin.peterson | 2008-05-26 23:44:26 +0200 (Mon, 26 May 2008) | 2 lines remove duplication in test module ........ r63744 | lars.gustaebel | 2008-05-27 14:39:23 +0200 (Tue, 27 May 2008) | 3 lines Do not close external file objects passed to tarfile.open(mode='w:bz2') when the TarFile is closed. ........ r63754 | benjamin.peterson | 2008-05-28 03:12:35 +0200 (Wed, 28 May 2008) | 2 lines update tutorial function with more appropiate one from Eric Smith ........ r63755 | mark.hammond | 2008-05-28 03:54:55 +0200 (Wed, 28 May 2008) | 2 lines bdist_wininst now works correctly when both --skip-build and --plat-name are specified. ........ r63757 | georg.brandl | 2008-05-28 13:21:39 +0200 (Wed, 28 May 2008) | 2 lines #2989: add PyType_Modified(). ........ r63758 | benjamin.peterson | 2008-05-28 13:51:41 +0200 (Wed, 28 May 2008) | 2 lines fix spelling ........ r63760 | georg.brandl | 2008-05-28 17:41:36 +0200 (Wed, 28 May 2008) | 2 lines #2990: prevent inconsistent state while updating method cache. ........ r63775 | georg.brandl | 2008-05-29 09:18:17 +0200 (Thu, 29 May 2008) | 2 lines Two fixes in bytearray docs. ........ r63781 | georg.brandl | 2008-05-29 09:38:37 +0200 (Thu, 29 May 2008) | 2 lines #2988: add note about catching CookieError when parsing untrusted cookie data. ........ r63782 | georg.brandl | 2008-05-29 09:45:26 +0200 (Thu, 29 May 2008) | 2 lines #2985: allow i8 in XMLRPC responses. ........ r63787 | georg.brandl | 2008-05-29 16:35:39 +0200 (Thu, 29 May 2008) | 2 lines Revert #2990 patch; it's not necessary as Armin showed. ........ r63805 | raymond.hettinger | 2008-05-30 08:37:27 +0200 (Fri, 30 May 2008) | 1 line Issue 2784: fix leaks in exception exit. ........ r63806 | raymond.hettinger | 2008-05-30 08:49:47 +0200 (Fri, 30 May 2008) | 1 line Issue 2855: Fix obscure crasher by slowing down the entire module. Mimics what was done to dictionaries in r59223. ........ r63807 | raymond.hettinger | 2008-05-30 09:16:53 +0200 (Fri, 30 May 2008) | 1 line Issue 2903: Add __name__ in globals for namedtuple namespace. ........ r63808 | georg.brandl | 2008-05-30 09:54:16 +0200 (Fri, 30 May 2008) | 2 lines #2999: fix name of third parameter in unicode.replace()'s docstring. ........ r63818 | georg.brandl | 2008-05-30 21:12:13 +0200 (Fri, 30 May 2008) | 2 lines getloadavg() is not available on Windows. ........ r63819 | georg.brandl | 2008-05-30 21:17:29 +0200 (Fri, 30 May 2008) | 2 lines Better quote with single quotes. ........ r63823 | benjamin.peterson | 2008-05-30 22:44:39 +0200 (Fri, 30 May 2008) | 2 lines fix grammar ........ r63824 | marc-andre.lemburg | 2008-05-30 22:52:18 +0200 (Fri, 30 May 2008) | 5 lines Update the locale module alias table. Closes #3011. ........
1 parent 2507884 commit f08a9dd

21 files changed

Lines changed: 247 additions & 76 deletions

Doc/c-api/bytearray.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Byte Array Objects
1010

1111
.. ctype:: PyByteArrayObject
1212

13-
This subtype of :ctype:`PyObject` represents a Python string object.
13+
This subtype of :ctype:`PyObject` represents a Python bytearray object.
1414

1515

1616
.. cvar:: PyTypeObject PyByteArray_Type
@@ -36,10 +36,12 @@ Byte Array Objects
3636
Return a new bytearray object from any object, *o*, that implements the
3737
buffer protocol.
3838

39+
.. XXX expand about the buffer protocol, at least somewhere
40+
3941
4042
.. cfunction:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4143

42-
Create a new bytearray object from *string* and it's length, *len*. On
44+
Create a new bytearray object from *string* and its length, *len*. On
4345
failure, *NULL* is returned.
4446

4547

Doc/c-api/type.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ Type Objects
3535

3636
.. cfunction:: unsigned int PyType_ClearCache(void)
3737

38-
Clears the internal lookup cache. Return the current version tag.
38+
Clear the internal lookup cache. Return the current version tag.
39+
40+
41+
.. cfunction:: void PyType_Modified(PyTypeObject *type)
42+
43+
Invalidate the internal lookup cache for the type and all of its
44+
subtypes. This function must be called after any manual
45+
modification of the attributes or base classes of the type.
3946

4047

4148
.. cfunction:: int PyType_HasFeature(PyObject *o, int feature)

Doc/library/codecs.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ Codec Base Classes
285285
------------------
286286

287287
The :mod:`codecs` module defines a set of base classes which define the
288-
interface and can also be used to easily write you own codecs for use in Python.
288+
interface and can also be used to easily write your own codecs for use in
289+
Python.
289290

290291
Each codec has to define four interfaces to make it usable as codec in Python:
291292
stateless encoder, stateless decoder, stream reader and stream writer. The

Doc/library/http.cookies.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ The module formerly strictly applied the parsing rules described in the
1717
MSIE 3.0x doesn't follow the character rules outlined in those specs. As a
1818
result, the parsing rules used are a bit less strict.
1919

20+
.. note::
21+
22+
On encountering an invalid cookie, :exc:`CookieError` is raised, so if your
23+
cookie data comes from a browser you should always prepare for invalid data
24+
and catch :exc:`CookieError` on parsing.
25+
2026

2127
.. exception:: CookieError
2228

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ Miscellaneous System Information
17481748

17491749
Return the number of processes in the system run queue averaged over the last
17501750
1, 5, and 15 minutes or raises :exc:`OSError` if the load average was
1751-
unobtainable.
1751+
unobtainable. Availability: Unix.
17521752

17531753

17541754
.. function:: sysconf(name)

Doc/tutorial/controlflow.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ called with an arbitrary number of arguments. These arguments will be wrapped
475475
up in a tuple. Before the variable number of arguments, zero or more normal
476476
arguments may occur. ::
477477

478-
def fprintf(file, template, *args):
479-
file.write(template.format(args))
478+
def write_multiple_items(file, separator, *args):
479+
file.write(separator.join(args))
480480

481481
482482
Normally, these ``variadic`` arguments will be last in the list of formal

Doc/tutorial/interpreter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ and executes a *script* from that file.
5151
A second way of starting the interpreter is ``python -c command [arg] ...``,
5252
which executes the statement(s) in *command*, analogous to the shell's
5353
:option:`-c` option. Since Python statements often contain spaces or other
54-
characters that are special to the shell, it is best to quote *command* in its
55-
entirety with double quotes.
54+
characters that are special to the shell, it is usually advised to quote
55+
*command* in its entirety with single quotes.
5656

5757
Some Python modules are also useful as scripts. These can be invoked using
5858
``python -m module [arg] ...``, which executes the source file for *module* as

Include/object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,
417417
PyObject *, PyObject *);
418418
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
419419
PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
420+
PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
420421

421422
/* Generic operations on objects */
422423
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);

Lib/collections.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ def _replace(self, **kwds):
9393
if verbose:
9494
print(template)
9595

96-
# Execute the template string in a temporary namespace
97-
namespace = dict(itemgetter=_itemgetter)
96+
# Execute the template string in a temporary namespace and
97+
# support tracing utilities by setting a value for frame.f_globals['__name__']
98+
namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename)
9899
try:
99100
exec(template, namespace)
100101
except SyntaxError as e:

Lib/distutils/command/bdist_wininst.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ def initialize_options(self):
7575

7676
def finalize_options(self):
7777
if self.bdist_dir is None:
78+
if self.skip_build and self.plat_name:
79+
# If build is skipped and plat_name is overridden, bdist will
80+
# not see the correct 'plat_name' - so set that up manually.
81+
bdist = self.distribution.get_command_obj('bdist')
82+
bdist.plat_name = self.plat_name
83+
# next the command will be initialized using that name
7884
bdist_base = self.get_finalized_command('bdist').bdist_base
7985
self.bdist_dir = os.path.join(bdist_base, 'wininst')
8086
if not self.target_version:

0 commit comments

Comments
 (0)