summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Issue #18408: Fix constructors of _elementtree.cVictor Stinner2013-07-121-12/+15
| | | | | | * Use Py_DECREF() instead of PyObject_GC_Del() to release correctly all resources * Raise MemoryError on memory allocation failure
* Issue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memoryVictor Stinner2013-07-121-1/+3
| | | | allocation failure
* Issue #18408: parser module: fix error handling in node2tuple()Victor Stinner2013-07-111-28/+52
| | | | Handle PyLong_FromLong() and PyUnicode_FromString() failures
* Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryErrorVictor Stinner2013-07-111-4/+15
| | | | | | on memory allocation failure Instead of ignoring the memory allocation failure and create invalid objects.
* Issue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation ↵Victor Stinner2013-07-111-2/+7
| | | | failures
* Issue #18408: _PyMemoTable_ResizeTable() now restores the old table ifVictor Stinner2013-07-111-1/+1
| | | | | | allocating a bigger table failed PyMemoTable destructor does crash if mt_table is NULL.
* Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroyVictor Stinner2013-07-111-1/+1
| | | | the newly created pickler, and not PyObject_GC_Del().
* Issue #18408: Different fixes in _elementtree.c to handle correctly MemoryErrorVictor Stinner2013-07-111-8/+14
| | | | | | | | | | * 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
* Cleanup _elementtree.cVictor Stinner2013-07-111-7/+6
|
* Issue #18408: _elementtree.c now handles create_extra() failureVictor Stinner2013-07-111-12/+24
|
* Issue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize allVictor Stinner2013-07-111-22/+14
| | | | | | | | | 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.
* Issue #18101: Tcl.split() now process strings nested in a tuple as itSerhiy Storchaka2013-07-111-0/+15
|\ | | | | | | | | | | do with byte strings. Added tests for Tcl.split() and Tcl.splitline().
| * Issue #18101: Tcl.split() now process strings nested in a tuple as itSerhiy Storchaka2013-07-111-0/+15
| | | | | | | | | | | | do with byte strings. Added tests for Tcl.split() and Tcl.splitline().
* | Issue #18338: `python --version` now prints version string to stdout, andSerhiy Storchaka2013-07-111-1/+1
| | | | | | | | not to stderr. Patch by Berker Peksag and Michael Dickens.
* | Merge: #18399: fix comment typo.R David Murray2013-07-101-1/+1
|\ \ | |/
| * #18399: fix comment typo.R David Murray2013-07-101-1/+1
| | | | | | | | Patch by Andrew Rowe.
* | Add a spacing saving heuristic to deque's extend methodsRaymond Hettinger2013-07-091-0/+16
| |
* | Issue #18408: Fix select.select() to handle PyList_New() failure (MemoryError)Victor Stinner2013-07-081-3/+3
| | | | | | | | in set2list()
* | Issue #18408: Fix usage of _PyBytes_Resize()Victor Stinner2013-07-082-31/+16
| | | | | | | | | | _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);".
* | Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failureVictor Stinner2013-07-081-0/+4
| | | | | | | | (MemoryError).
* | Issue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failureVictor Stinner2013-07-081-0/+2
| | | | | | | | (MemoryError).
* | fix indentationVictor Stinner2013-07-081-13/+13
| |
* | Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitemsVictor Stinner2013-07-081-2/+9
| | | | | | | | is negative
* | gcmodule.c: strip trailing spacesVictor Stinner2013-07-081-7/+7
| |
* | Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()Victor Stinner2013-07-075-20/+21
| | | | | | | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not.
* | Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. ↵Christian Heimes2013-07-071-6/+6
| | | | | | | | cElementTree uses the same approach since at least Python 2.6
* | Issue #18227: "Free" function of bz2, lzma and zlib modules has no return ↵Victor Stinner2013-07-073-3/+3
| | | | | | | | value (void)
* | Issue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the passwordVictor Stinner2013-07-071-4/+4
| |
* | Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modulesVictor Stinner2013-07-073-8/+77
| |
* | Fix a compiler warning in posix_sendfile() on FreeBSD:Victor Stinner2013-07-071-2/+3
| | | | | | | | | | Modules/posixmodule.c: In function 'posix_sendfile': Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code
* | Issue #18203: Replace malloc() with PyMem_Malloc() in Python modulesVictor Stinner2013-07-079-53/+50
| | | | | | | | | | Replace malloc() with PyMem_Malloc() when the GIL is held, or with PyMem_RawMalloc() otherwise.
* | Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initializationVictor Stinner2013-07-073-27/+30
| | | | | | | | | | | | | | * 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()
* | Fix #ifdefRaymond Hettinger2013-07-071-1/+1
| |
* | Use macros for marking and checking endpoints in the doubly-linked list of ↵Raymond Hettinger2013-07-071-47/+81
| | | | | | | | | | | | | | | | | | | | 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.
* | mergeRaymond Hettinger2013-07-071-0/+163
|\ \
| * | Issue #3329: Implement the PEP 445Victor Stinner2013-07-071-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new enum: * PyMemAllocatorDomain Add new structures: * PyMemAllocator * PyObjectArenaAllocator Add new functions: * PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree() * PyMem_GetAllocator(), PyMem_SetAllocator() * PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator() * PyMem_SetupDebugHooks() Changes: * PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead of calling PyObject_Malloc()/PyObject_Realloc() in debug mode. * PyObject_Malloc()/PyObject_Realloc() now falls back to PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes. * Redesign debug checks on memory block allocators as hooks, instead of using C macros
* | | Improve variable names in deque_count()Raymond Hettinger2013-07-071-8/+8
|/ /
* | Apply the PyObject_VAR_HEAD and Py_SIZE macrosRaymond Hettinger2013-07-061-40/+39
| | | | | | | | to be consistent with practices in other modules.
* | Refactor deque_traverse().Raymond Hettinger2013-07-061-6/+6
| | | | | | | | | | Hoist conditional expression out of the loop. Use rightblock as the guard instead of checking for NULL.
* | Remove unnecessary branches from count() and reverse().Raymond Hettinger2013-07-061-6/+3
| |
* | Speed-up deque indexing by changing the deque block length to a power of two.Raymond Hettinger2013-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The division and modulo calculation in deque_item() can be compiled to fast bitwise operations when the BLOCKLEN is a power of two. Timing before: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0627 usec per loop Timing after: ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]' 10000000 loops, best of 7: 0.0581 usec per loop
* | (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signalVictor Stinner2013-07-011-1/+2
|\ \ | |/ | | | | | | handler when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
| * Issue #18343: faulthandler.register() now keeps the previous signal handlerVictor Stinner2013-07-011-1/+2
| | | | | | | | | | when the function is called twice, so faulthandler.unregister() restores correctly the original signal handler.
* | Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
|\ \ | |/
| * Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
| |
* | Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+5
|\ \ | |/ | | | | segfault inside the _pickle C extension.
| * Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+5
| | | | | | | | segfault inside the _pickle C extension.
* | Fix segfault in pyexpat.c caused by 84375Christian Heimes2013-06-291-1/+1
| | | | | | | | u can be NULL, use XDECREF
* | Fix resource leak in pickle moduleChristian Heimes2013-06-291-1/+3
| | | | | | | | | | CID 983309 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable unicode_str going out of scope leaks the storage it points to.
* | Fix NULL ptr dereferencing in local_timezone(). nameo can be NULLChristian Heimes2013-06-291-1/+1
| | | | | | | | | | CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) var_deref_op: Dereferencing null pointer _py_decref_tmp.