]> granicus.if.org Git - python/log
python
11 years agoIssue #18342: Use the repr of a module name for ``from ... import
Brett Cannon [Fri, 12 Jul 2013 15:22:26 +0000 (11:22 -0400)]
Issue #18342: Use the repr of a module name for ``from ... import
...`` when an ImportError occurs.

Other cases had already been switched over to using the repr.

Thanks to Tomasz Maćkowiak for the patch.

11 years agoIssue #18415: Normalize what type of quotes are used with string
Brett Cannon [Fri, 12 Jul 2013 15:04:23 +0000 (11:04 -0400)]
Issue #18415: Normalize what type of quotes are used with string
constants in importlib._bootstrap. Along the way clean up from string
interpolation to use the repr explicitly.

Initial patch by Madison May.

11 years agoIssue #18408: Fix constructors of _elementtree.c
Victor Stinner [Fri, 12 Jul 2013 00:05:17 +0000 (02:05 +0200)]
Issue #18408: Fix constructors of _elementtree.c

* Use Py_DECREF() instead of PyObject_GC_Del() to release correctly all
  resources
* Raise MemoryError on memory allocation failure

11 years agoIssue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memory
Victor Stinner [Fri, 12 Jul 2013 00:03:34 +0000 (02:03 +0200)]
Issue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memory
allocation failure

11 years agoIssue #18408: parser module: fix error handling in node2tuple()
Victor Stinner [Thu, 11 Jul 2013 23:35:10 +0000 (01:35 +0200)]
Issue #18408: parser module: fix error handling in node2tuple()

Handle PyLong_FromLong() and PyUnicode_FromString() failures

11 years agoIssue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError
Victor Stinner [Thu, 11 Jul 2013 23:33:59 +0000 (01:33 +0200)]
Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError
on memory allocation failure

Instead of ignoring the memory allocation failure and create invalid objects.

11 years agoIssue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation failures
Victor Stinner [Thu, 11 Jul 2013 22:53:57 +0000 (00:53 +0200)]
Issue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation failures

11 years agoIssue #18408: _PyMemoTable_ResizeTable() now restores the old table if
Victor Stinner [Thu, 11 Jul 2013 22:53:26 +0000 (00:53 +0200)]
Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if
allocating a bigger table failed

PyMemoTable destructor does crash if mt_table is NULL.

11 years agoIssue #18408: pmerge() help of mro_implementation() now raises MemoryError on
Victor Stinner [Thu, 11 Jul 2013 22:42:14 +0000 (00:42 +0200)]
Issue #18408: pmerge() help of mro_implementation() now raises MemoryError on
memory allocation failure

Replace also PyMem_Free() with PyMem_FREE() to be consistent with the rest of
the function.

11 years agoIssue #18408: errors.c: in debug mode, calling PyErr_BadInternalCall() now
Victor Stinner [Thu, 11 Jul 2013 22:37:30 +0000 (00:37 +0200)]
Issue #18408: errors.c: in debug mode, calling PyErr_BadInternalCall() now
fails with an assertion error

11 years agoIssue #18408: ceval.c: in debug mode, convert the PyErr_Occurred() check on
Victor Stinner [Thu, 11 Jul 2013 22:11:58 +0000 (00:11 +0200)]
Issue #18408: ceval.c: in debug mode, convert the PyErr_Occurred() check on
exception (when getting NULL) to an assertion to detect bugs earlier

11 years agoIssue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy
Victor Stinner [Thu, 11 Jul 2013 22:08:59 +0000 (00:08 +0200)]
Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy
the newly created pickler, and not PyObject_GC_Del().

11 years agoIssue #18408: normalizestring() now raises MemoryError on memory allocation failure
Victor Stinner [Thu, 11 Jul 2013 22:02:55 +0000 (00:02 +0200)]
Issue #18408: normalizestring() now raises MemoryError on memory allocation failure

11 years agoIssue #18408: In debug mode, PyCFunction_Call() now checks if an exception was
Victor Stinner [Thu, 11 Jul 2013 21:44:46 +0000 (23:44 +0200)]
Issue #18408: In debug mode, PyCFunction_Call() now checks if an exception was
raised if the result is NULL to help to find bugs in C mode (get the error
earlier than the SystemError in ceval.c).

11 years agoIssue #18408: parsetok() must not write into stderr on memory allocation error
Victor Stinner [Thu, 11 Jul 2013 21:17:33 +0000 (23:17 +0200)]
Issue #18408: parsetok() must not write into stderr on memory allocation error

The caller gets an error code and can raise a classic Python exception.

11 years agoIssue #18408: Different fixes in _elementtree.c to handle correctly MemoryError
Victor Stinner [Thu, 11 Jul 2013 21:08:39 +0000 (23:08 +0200)]
Issue #18408: Different fixes in _elementtree.c to handle correctly MemoryError

 * create_new_element() initializes all attributes before handling errors,
   to fix a crash in the destructor
* create_new_element() calls PyObject_GC_Del() on error, instead of
  PyObject_Del(), because the object was created by PyObject_GC_New()
* subelement() now handles create_new_element() failure
* element_getattro() now handles element_get_text() failure
* makeuniversal() now handles PyBytes_FromStringAndSize() failure

11 years agoCleanup _elementtree.c
Victor Stinner [Thu, 11 Jul 2013 21:05:03 +0000 (23:05 +0200)]
Cleanup _elementtree.c

11 years agoIssue #18408: _elementtree.c now handles create_extra() failure
Victor Stinner [Thu, 11 Jul 2013 21:01:36 +0000 (23:01 +0200)]
Issue #18408: _elementtree.c now handles create_extra() failure

11 years agoIssue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize all
Victor Stinner [Thu, 11 Jul 2013 20:56:25 +0000 (22:56 +0200)]
Issue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize all
attributes before handling errors

_Pickler_New() now calls PyObject_GC_Del() instead of Py_DECREF() on error,
because the pickle object is created using PyObject_GC_New().

Fix a crash in the destructor when an attribute is not initiallized.

11 years agoIssue #18408: parsetok() must not write into stderr on memory allocation error
Victor Stinner [Thu, 11 Jul 2013 20:52:19 +0000 (22:52 +0200)]
Issue #18408: parsetok() must not write into stderr on memory allocation error

The caller gets an error code and can raise a classic Python exception.

11 years agoIssue #18408: Fix compiler_import() to handle PyUnicode_Substring() failure properly
Victor Stinner [Thu, 11 Jul 2013 20:50:45 +0000 (22:50 +0200)]
Issue #18408: Fix compiler_import() to handle PyUnicode_Substring() failure properly

11 years agoIssue #18408: ste_new() initialize all attributes before handling error
Victor Stinner [Thu, 11 Jul 2013 20:49:00 +0000 (22:49 +0200)]
Issue #18408: ste_new() initialize all attributes before handling error

If an attribute is not initialized, the destructor can crash

11 years agoIssue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error
Victor Stinner [Thu, 11 Jul 2013 20:46:11 +0000 (22:46 +0200)]
Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error

type->tp_str must not point to slot_tp_str() if type has no __str__ attribute,
so there is no reason for slot_tp_str() to fallback on slot_tp_str() on lookup
error. Moreover, calling PyErr_Clear() may hide a real bug like MemoryError.

If __str__ attribute is removed, slots must be updated (which is done by
type_setattro()).

11 years agotypeobject.c: remove trailing spaces
Victor Stinner [Thu, 11 Jul 2013 20:42:25 +0000 (22:42 +0200)]
typeobject.c: remove trailing spaces

11 years agoMerge: #18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
R David Murray [Thu, 11 Jul 2013 19:58:07 +0000 (15:58 -0400)]
Merge: #18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=

11 years ago#18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=
R David Murray [Thu, 11 Jul 2013 19:52:57 +0000 (15:52 -0400)]
#18044: Fix parsing of encoded words of the form =?utf8?q?=XX...?=

The problem was I was only checking for decimal digits after the third '?',
not for *hex* digits :(.

This changeset also fixes a couple of comment typos, deletes an unused
function relating to encoded word parsing, and removed an invalid
'if' test from the folding function that was revealed by the tests
written to validate this issue.

11 years agoIssue #17872: Fix a segfault in marshal.load() when input stream returns
Serhiy Storchaka [Thu, 11 Jul 2013 19:28:18 +0000 (22:28 +0300)]
Issue #17872: Fix a segfault in marshal.load() when input stream returns
more bytes than requested.

11 years agoIssue #17872: Fix a segfault in marshal.load() when input stream returns
Serhiy Storchaka [Thu, 11 Jul 2013 19:20:47 +0000 (22:20 +0300)]
Issue #17872: Fix a segfault in marshal.load() when input stream returns
more bytes than requested.

11 years agoIssue #18085: Add missed const modifier for some entries in refcounts.dat.
Serhiy Storchaka [Thu, 11 Jul 2013 19:00:57 +0000 (22:00 +0300)]
Issue #18085: Add missed const modifier for some entries in refcounts.dat.

11 years agoIssue #18085: Add missed const modifier for some entries in refcounts.dat.
Serhiy Storchaka [Thu, 11 Jul 2013 18:57:34 +0000 (21:57 +0300)]
Issue #18085: Add missed const modifier for some entries in refcounts.dat.

11 years agoIssue #18101: Tcl.split() now process strings nested in a tuple as it
Serhiy Storchaka [Thu, 11 Jul 2013 17:36:00 +0000 (20:36 +0300)]
Issue #18101: Tcl.split() now process strings nested in a tuple as it
do with byte strings.

Added tests for Tcl.split() and Tcl.splitline().

11 years agoIssue #18101: Tcl.split() now process strings nested in a tuple as it
Serhiy Storchaka [Thu, 11 Jul 2013 17:34:47 +0000 (20:34 +0300)]
Issue #18101: Tcl.split() now process strings nested in a tuple as it
do with byte strings.

Added tests for Tcl.split() and Tcl.splitline().

11 years agoIssue #18338: `python --version` now prints version string to stdout, and
Serhiy Storchaka [Thu, 11 Jul 2013 17:01:17 +0000 (20:01 +0300)]
Issue #18338: `python --version` now prints version string to stdout, and
not to stderr.  Patch by Berker Peksag and Michael Dickens.

11 years agoMerge #17987: properly document support.captured_xxx.
R David Murray [Thu, 11 Jul 2013 16:29:31 +0000 (12:29 -0400)]
Merge #17987: properly document support.captured_xxx.

11 years ago#17987: properly document support.captured_xxx.
R David Murray [Thu, 11 Jul 2013 16:28:40 +0000 (12:28 -0400)]
#17987: properly document support.captured_xxx.

Patch by Dmi Baranov.

11 years agoFix reference leaks introduced by the patch for issue #5308.
Serhiy Storchaka [Thu, 11 Jul 2013 16:19:47 +0000 (19:19 +0300)]
Fix reference leaks introduced by the patch for issue #5308.

11 years agoFix reference leaks introduced by the patch for issue #5308.
Serhiy Storchaka [Thu, 11 Jul 2013 16:14:26 +0000 (19:14 +0300)]
Fix reference leaks introduced by the patch for issue #5308.

11 years agoIssue #18336. Fix a link to StreamReader's read() method.
Serhiy Storchaka [Thu, 11 Jul 2013 15:27:20 +0000 (18:27 +0300)]
Issue #18336. Fix a link to StreamReader's read() method.

11 years agoIssue #18336. Fix a link to StreamReader's read() method.
Serhiy Storchaka [Thu, 11 Jul 2013 15:26:13 +0000 (18:26 +0300)]
Issue #18336. Fix a link to StreamReader's read() method.

11 years agoIssue #18426: improve exception message. Courtesy of Amaury
Christian Heimes [Thu, 11 Jul 2013 11:02:37 +0000 (13:02 +0200)]
Issue #18426: improve exception message. Courtesy of Amaury

11 years agoIssue #18426: improve exception message. Courtesy of Amaury
Christian Heimes [Thu, 11 Jul 2013 11:02:30 +0000 (13:02 +0200)]
Issue #18426: improve exception message. Courtesy of Amaury

11 years agoIssue #18426: Fix NULL pointer dereference in C extension import when
Christian Heimes [Thu, 11 Jul 2013 09:23:34 +0000 (11:23 +0200)]
Issue #18426: Fix NULL pointer dereference in C extension import when
PyModule_GetDef() returns an error.

11 years agoIssue #18426: Fix NULL pointer dereference in C extension import when
Christian Heimes [Thu, 11 Jul 2013 09:22:21 +0000 (11:22 +0200)]
Issue #18426: Fix NULL pointer dereference in C extension import when
PyModule_GetDef() returns an error.

11 years ago#18116: getpass no longer always falls back to stdin.
R David Murray [Wed, 10 Jul 2013 21:02:24 +0000 (17:02 -0400)]
#18116: getpass no longer always falls back to stdin.

Also fixes a resource warning that occurred when the fallback is taken.

Patch by Serhiy Storchaka.

(We couldn't figure out how to write tests for this.)

11 years agoMerge: #18424: PEP8ify the tense of the sum docstring.
R David Murray [Wed, 10 Jul 2013 20:22:59 +0000 (16:22 -0400)]
Merge: #18424: PEP8ify the tense of the sum docstring.

11 years ago#18424: PEP8ify the tense of the sum docstring.
R David Murray [Wed, 10 Jul 2013 20:22:14 +0000 (16:22 -0400)]
#18424: PEP8ify the tense of the sum docstring.

11 years agoMerge: #18399: fix comment typo.
R David Murray [Wed, 10 Jul 2013 15:57:39 +0000 (11:57 -0400)]
Merge: #18399: fix comment typo.

11 years ago#18399: fix comment typo.
R David Murray [Wed, 10 Jul 2013 14:57:39 +0000 (10:57 -0400)]
#18399: fix comment typo.

Patch by Andrew Rowe.

11 years agoIssue #18408: Fix call_exc_trace(): if the traceback is NULL, use None when
Victor Stinner [Wed, 10 Jul 2013 11:57:55 +0000 (13:57 +0200)]
Issue #18408: Fix call_exc_trace(): if the traceback is NULL, use None when
building the tuple (type, value, traceback) passed to the callback.

PyTuple_Pack() does crash if an argument is NULL.

11 years agoIssue #18308: don't take the scope ID into account when comparing IPv6
Charles-François Natali [Tue, 9 Jul 2013 17:16:32 +0000 (19:16 +0200)]
Issue #18308: don't take the scope ID into account when comparing IPv6
addresses.

11 years agoIssue #18308: don't take the scope ID into account when comparing IPv6
Charles-François Natali [Tue, 9 Jul 2013 17:15:43 +0000 (19:15 +0200)]
Issue #18308: don't take the scope ID into account when comparing IPv6
addresses.

11 years agouse $(LN) makefile variable instead of ln
Christian Heimes [Tue, 9 Jul 2013 12:30:22 +0000 (14:30 +0200)]
use $(LN) makefile variable instead of ln

11 years agouse $(LN) makefile variable instead of ln
Christian Heimes [Tue, 9 Jul 2013 12:30:04 +0000 (14:30 +0200)]
use $(LN) makefile variable instead of ln

11 years agoAdd a spacing saving heuristic to deque's extend methods
Raymond Hettinger [Tue, 9 Jul 2013 07:13:21 +0000 (00:13 -0700)]
Add a spacing saving heuristic to deque's extend methods

11 years agoIssue #18408: Fix select.select() to handle PyList_New() failure (MemoryError)
Victor Stinner [Mon, 8 Jul 2013 22:49:03 +0000 (00:49 +0200)]
Issue #18408: Fix select.select() to handle PyList_New() failure (MemoryError)
in set2list()

11 years agoIssue #18408: Fix _PyMem_DebugRealloc()
Victor Stinner [Mon, 8 Jul 2013 22:44:43 +0000 (00:44 +0200)]
Issue #18408: Fix _PyMem_DebugRealloc()

Don't mark old extra memory dead before calling realloc(). realloc() can fail
and realloc() must not touch the original buffer on failure.

So mark old extra memory dead only on success if the new buffer did not move
(has the same address).

11 years agoIssue #18408: _PyUnicodeWriter_Finish() now clears its buffer attribute in all
Victor Stinner [Mon, 8 Jul 2013 22:37:24 +0000 (00:37 +0200)]
Issue #18408: _PyUnicodeWriter_Finish() now clears its buffer attribute in all
cases, so _PyUnicodeWriter_Dealloc() can be called after finish.

11 years agoIssue #18408: Fix usage of _PyBytes_Resize()
Victor Stinner [Mon, 8 Jul 2013 22:35:22 +0000 (00:35 +0200)]
Issue #18408: Fix usage of _PyBytes_Resize()

_PyBytes_Resize(&v, new_size) sets v to NULL on error, so v cannot be used
anymore. Replace "Py_DECREF(v); v = NULL;" with "Py_CLEAR(v);".

11 years agoIssue #18408: Fix PyCode_Optimize(): raise a MemoryError on memory allocation
Victor Stinner [Mon, 8 Jul 2013 22:32:04 +0000 (00:32 +0200)]
Issue #18408: Fix PyCode_Optimize(): raise a MemoryError on memory allocation
failure.

11 years agoIssue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure
Victor Stinner [Mon, 8 Jul 2013 22:29:03 +0000 (00:29 +0200)]
Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure
(MemoryError).

11 years agoIssue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failure
Victor Stinner [Mon, 8 Jul 2013 22:27:12 +0000 (00:27 +0200)]
Issue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failure
(MemoryError).

11 years agoAvoid spurious non-fatal install errors for OS X frameworks:
Ned Deily [Mon, 8 Jul 2013 21:33:03 +0000 (14:33 -0700)]
Avoid spurious non-fatal install errors for OS X frameworks:
for a framework install, the python shared library is installed in
the frameworkinstallstructure target, not in altbininstall.

11 years agoIssue #18408: Fix _PyUnicodeWriter_Finish(): clear writer->buffer,
Victor Stinner [Mon, 8 Jul 2013 20:29:55 +0000 (22:29 +0200)]
Issue #18408: Fix _PyUnicodeWriter_Finish(): clear writer->buffer,
so _PyUnicodeWriter_Dealloc() can be called on the writer after finish.

11 years agofix indentation
Victor Stinner [Mon, 8 Jul 2013 20:28:27 +0000 (22:28 +0200)]
fix indentation

11 years agoIssue #18408: Fix call_function() of ceval.c to handle PyTuple_New() failure
Victor Stinner [Mon, 8 Jul 2013 20:27:42 +0000 (22:27 +0200)]
Issue #18408: Fix call_function() of ceval.c to handle PyTuple_New() failure
(in load_args()), ex: MemoryError.

11 years agoIssue #18408: Fix PyType_Ready() and type.__bases__ setter to handle
Victor Stinner [Mon, 8 Jul 2013 20:25:48 +0000 (22:25 +0200)]
Issue #18408: Fix PyType_Ready() and type.__bases__ setter to handle
PyWeakref_NewRef() failure (ex: MemoryError).

11 years agoIssue #18408: Fix marshal reader for Unicode strings: handle
Victor Stinner [Mon, 8 Jul 2013 20:23:32 +0000 (22:23 +0200)]
Issue #18408: Fix marshal reader for Unicode strings: handle
PyUnicode_DecodeUTF8() failure (ex: MemoryError).

11 years agoIssue #18408: Fix list.pop() to handle list_resize() failure (MemoryError).
Victor Stinner [Mon, 8 Jul 2013 20:20:44 +0000 (22:20 +0200)]
Issue #18408: Fix list.pop() to handle list_resize() failure (MemoryError).

11 years agoIssue #18408: Fix PyDict_New() to handle correctly new_keys_object() failure
Victor Stinner [Mon, 8 Jul 2013 20:19:20 +0000 (22:19 +0200)]
Issue #18408: Fix PyDict_New() to handle correctly new_keys_object() failure
(MemoryError).

11 years agoIssue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitems
Victor Stinner [Mon, 8 Jul 2013 20:17:52 +0000 (22:17 +0200)]
Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitems
is negative

11 years agogcmodule.c: strip trailing spaces
Victor Stinner [Mon, 8 Jul 2013 20:15:05 +0000 (22:15 +0200)]
gcmodule.c: strip trailing spaces

11 years ago#18403: merge with 3.3.
Ezio Melotti [Mon, 8 Jul 2013 15:53:32 +0000 (17:53 +0200)]
#18403: merge with 3.3.

11 years ago#18403: fix an off-by-one typo noticed by Xue Fuqiao.
Ezio Melotti [Mon, 8 Jul 2013 15:52:54 +0000 (17:52 +0200)]
#18403: fix an off-by-one typo noticed by Xue Fuqiao.

11 years agoMerge str.center tests from 3.3.
Ezio Melotti [Mon, 8 Jul 2013 15:49:59 +0000 (17:49 +0200)]
Merge str.center tests from 3.3.

11 years agoAdd a couple of tests for str.center with non-ASCII chars.
Ezio Melotti [Mon, 8 Jul 2013 15:48:29 +0000 (17:48 +0200)]
Add a couple of tests for str.center with non-ASCII chars.

11 years agoIssue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()
Victor Stinner [Sun, 7 Jul 2013 21:30:24 +0000 (23:30 +0200)]
Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()

Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the
GIL is held or not.

11 years agoIssue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as _Py_char...
Victor Stinner [Sun, 7 Jul 2013 20:57:45 +0000 (22:57 +0200)]
Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar()

11 years agoIssue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. cElementTree uses...
Christian Heimes [Sun, 7 Jul 2013 15:35:11 +0000 (17:35 +0200)]
Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. cElementTree uses the same approach since at least Python 2.6

11 years agoIssue #18203: Replace malloc() with PyMem_Malloc() in _PySequence_BytesToCharpArray()
Victor Stinner [Sun, 7 Jul 2013 15:22:41 +0000 (17:22 +0200)]
Issue #18203:  Replace malloc() with PyMem_Malloc() in _PySequence_BytesToCharpArray()

11 years agoIssue #18203: Replace malloc() with PyMem_Malloc() to allocate arena objects
Victor Stinner [Sun, 7 Jul 2013 15:18:53 +0000 (17:18 +0200)]
Issue #18203: Replace malloc() with PyMem_Malloc() to allocate arena objects

11 years agoIssue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks
Victor Stinner [Sun, 7 Jul 2013 15:17:59 +0000 (17:17 +0200)]
Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks

11 years agoIssue #18227: "Free" function of bz2, lzma and zlib modules has no return value ...
Victor Stinner [Sun, 7 Jul 2013 15:10:34 +0000 (17:10 +0200)]
Issue #18227: "Free" function of bz2, lzma and zlib modules has no return value (void)

11 years agoIssue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the password
Victor Stinner [Sun, 7 Jul 2013 15:07:52 +0000 (17:07 +0200)]
Issue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the password

11 years agoIssue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modules
Victor Stinner [Sun, 7 Jul 2013 14:50:27 +0000 (16:50 +0200)]
Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modules

11 years agoIssue #18203: Fix decode_ascii_surrogateescape(), use PyMem_RawMalloc() as _Py_char2w...
Victor Stinner [Sun, 7 Jul 2013 14:35:54 +0000 (16:35 +0200)]
Issue #18203: Fix decode_ascii_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar()

11 years agoFix a compiler warning in posix_sendfile() on FreeBSD:
Victor Stinner [Sun, 7 Jul 2013 14:32:36 +0000 (16:32 +0200)]
Fix a compiler warning in posix_sendfile() on FreeBSD:

Modules/posixmodule.c: In function 'posix_sendfile':
Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code

11 years agoIssue #18203: Replace malloc() with PyMem_Malloc() in Python modules
Victor Stinner [Sun, 7 Jul 2013 14:21:41 +0000 (16:21 +0200)]
Issue #18203: Replace malloc() with PyMem_Malloc() in Python modules

Replace malloc() with PyMem_Malloc() when the GIL is held, or with
PyMem_RawMalloc() otherwise.

11 years agoIssue #18203: Replace malloc() with PyMem_RawMalloc() at Python initialization
Victor Stinner [Sun, 7 Jul 2013 14:25:15 +0000 (16:25 +0200)]
Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initialization

* Replace malloc() with PyMem_RawMalloc()
* Replace PyMem_Malloc() with PyMem_RawMalloc() where the GIL is not held.
* _Py_char2wchar() now returns a buffer allocated by PyMem_RawMalloc(), instead
  of PyMem_Malloc()

11 years agoIssue #18203: Fix Py_Finalize(): destroy the GIL after the last call to
Victor Stinner [Sun, 7 Jul 2013 13:50:49 +0000 (15:50 +0200)]
Issue #18203: Fix Py_Finalize(): destroy the GIL after the last call to
PyMem_Malloc() or PyObject_Malloc().

For example, PyCFunction_Fini() calls PyObject_GC_Del() which calls
PyObject_FREE().

11 years agoFix #ifdef
Raymond Hettinger [Sun, 7 Jul 2013 12:07:23 +0000 (02:07 -1000)]
Fix #ifdef

11 years agoUse macros for marking and checking endpoints in the doubly-linked list of blocks.
Raymond Hettinger [Sun, 7 Jul 2013 11:43:42 +0000 (01:43 -1000)]
Use macros for marking and checking endpoints in the doubly-linked list of blocks.

* Add comment explaining the endpoint checks
* Only do the checks in a debug build
* Simplify newblock() to only require a length argument
  and leave the link updates to the calling code.
* Also add comment for the freelisting logic.

11 years ago#18106: refactor tests to use subtests and proper assert methods. Patch by Vajrasky...
Ezio Melotti [Sun, 7 Jul 2013 11:37:20 +0000 (13:37 +0200)]
#18106: refactor tests to use subtests and proper assert methods.  Patch by Vajrasky Kok.

11 years ago#17198: merge with 3.3.
Ezio Melotti [Sun, 7 Jul 2013 11:16:05 +0000 (13:16 +0200)]
#17198: merge with 3.3.

11 years ago#17198: Fix a NameError in the dbm module. Patch by Valentina Mukhamedzhanova.
Ezio Melotti [Sun, 7 Jul 2013 11:15:08 +0000 (13:15 +0200)]
#17198: Fix a NameError in the dbm module.  Patch by Valentina Mukhamedzhanova.

11 years agoMerge #18013: Fix cgi.FieldStorage to parse the W3C sample form.
Florent Xicluna [Sun, 7 Jul 2013 10:46:28 +0000 (12:46 +0200)]
Merge #18013: Fix cgi.FieldStorage to parse the W3C sample form.

11 years agoIssue #18013: Fix cgi.FieldStorage to parse the W3C sample form.
Florent Xicluna [Sun, 7 Jul 2013 10:44:28 +0000 (12:44 +0200)]
Issue #18013: Fix cgi.FieldStorage to parse the W3C sample form.

11 years ago#18020: improve html.escape speed by an order of magnitude. Patch by Matt Bryant.
Ezio Melotti [Sun, 7 Jul 2013 09:11:24 +0000 (11:11 +0200)]
#18020: improve html.escape speed by an order of magnitude.  Patch by Matt Bryant.

11 years ago(3.3->default) Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren [Sun, 7 Jul 2013 07:54:08 +0000 (09:54 +0200)]
(3.3->default) Issue #18377: Code cleanup in Python Launcher

This changeset fixes a number of compiler warnings in the Python Launcher
binary for OSX. It also cleans up whitespace usage in those sources.

11 years agoIssue #18377: Code cleanup in Python Launcher
Ronald Oussoren [Sun, 7 Jul 2013 07:53:08 +0000 (09:53 +0200)]
Issue #18377: Code cleanup in Python Launcher

This changeset fixes a number of compiler warnings in the Python Launcher
binary for OSX. It also cleans up whitespace usage in those sources.

11 years ago(3.3->default) Cleanup of documentation change from #17860
Ronald Oussoren [Sun, 7 Jul 2013 07:28:01 +0000 (09:28 +0200)]
(3.3->default) Cleanup of documentation change from #17860

Reformulated the textual change, and applied it to the docstring as well.