summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
...
* | Issue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryErrorVictor Stinner2013-07-151-2/+6
| | | | | | | | on memory allocation failure
* | Issue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY()Victor Stinner2013-07-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | and _PyUnicode_HAS_WSTR_MEMORY() macros These macros are called in unicode_dealloc(), whereas the unicode object can be "inconsistent" if the creation of the object failed. For example, when unicode_subtype_new() fails on a memory allocation, _PyUnicode_CheckConsistency() fails with an assertion error because data is NULL.
* | Issue #18408: PyObject_Call() now fails with an assertion error in debug modeVictor Stinner2013-07-151-1/+7
| | | | | | | | | | if the function called failed whereas no exception was raised, to detect bugs earlier.
* | Issue #18408: pmerge() help of mro_implementation() now raises MemoryError onVictor Stinner2013-07-111-2/+4
| | | | | | | | | | | | | | memory allocation failure Replace also PyMem_Free() with PyMem_FREE() to be consistent with the rest of the function.
* | Issue #18408: In debug mode, PyCFunction_Call() now checks if an exception wasVictor Stinner2013-07-111-7/+23
| | | | | | | | | | raised if the result is NULL to help to find bugs in C mode (get the error earlier than the SystemError in ceval.c).
* | Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on errorVictor Stinner2013-07-111-19/+2
| | | | | | | | | | | | | | | | | | 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()).
* | typeobject.c: remove trailing spacesVictor Stinner2013-07-111-3/+3
| |
* | Issue #18408: Fix _PyMem_DebugRealloc()Victor Stinner2013-07-081-6/+8
| | | | | | | | | | | | | | | | 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).
* | Issue #18408: _PyUnicodeWriter_Finish() now clears its buffer attribute in allVictor Stinner2013-07-081-3/+6
| | | | | | | | cases, so _PyUnicodeWriter_Dealloc() can be called after finish.
* | Issue #18408: Fix _PyUnicodeWriter_Finish(): clear writer->buffer,Victor Stinner2013-07-081-2/+5
| | | | | | | | so _PyUnicodeWriter_Dealloc() can be called on the writer after finish.
* | Issue #18408: Fix PyType_Ready() and type.__bases__ setter to handleVictor Stinner2013-07-081-0/+2
| | | | | | | | PyWeakref_NewRef() failure (ex: MemoryError).
* | Issue #18408: Fix list.pop() to handle list_resize() failure (MemoryError).Victor Stinner2013-07-081-2/+4
| |
* | Issue #18408: Fix PyDict_New() to handle correctly new_keys_object() failureVictor Stinner2013-07-081-1/+5
| | | | | | | | (MemoryError).
* | Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()Victor Stinner2013-07-071-0/+28
| | | | | | | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not.
* | Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as ↵Victor Stinner2013-07-071-2/+2
| | | | | | | | _Py_char2wchar()
* | Issue #18203: Replace malloc() with PyMem_Malloc() in ↵Victor Stinner2013-07-071-8/+11
| | | | | | | | _PySequence_BytesToCharpArray()
* | Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initializationVictor Stinner2013-07-071-3/+3
| | | | | | | | | | | | | | * 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()
* | Issue #3329: Fix _PyObject_ArenaVirtualFree()Victor Stinner2013-07-071-1/+1
| | | | | | | | | | According to VirtualFree() documentation, the size must be zero if the "free type" is MEM_RELEASE.
* | Issue #3329: Implement the PEP 445Victor Stinner2013-07-072-169/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Issue #15767: back out 8a0ed9f63c6e, finishing the removal ofBrett Cannon2013-07-041-9/+0
| | | | | | | | ModuleNotFoundError.
* | Fix ref leak in error case of unicode find, count, formatlongChristian Heimes2013-06-291-3/+11
| | | | | | | | | | | | CID 983315: Resource leak (RESOURCE_LEAK) CID 983316: Resource leak (RESOURCE_LEAK) CID 983317: Resource leak (RESOURCE_LEAK)
* | Fix ref leak in error case of unicode indexChristian Heimes2013-06-291-2/+6
| | | | | | | | | | CID 983319 (#1 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to.
* | Fix ref leak in error case of unicode rindex and rfindChristian Heimes2013-06-291-4/+12
| | | | | | | | | | | | CID 983320: Resource leak (RESOURCE_LEAK) CID 983321: Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to.
* | Fix memory leak in endswithChristian Heimes2013-06-291-1/+1
| | | | | | | | | | CID 1040368 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to.
* | Issue #13483: Use VirtualAlloc in obmalloc on Windows.Martin v. Löwis2013-06-271-2/+12
| |
* | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-241-1/+1
| |
* | Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index)Victor Stinner2013-06-242-5/+5
| |
* | Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64Victor Stinner2013-06-241-1/+1
| |
* | Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raiseSerhiy Storchaka2013-06-231-1/+1
|\ \ | |/ | | | | OverflowError when an argument of %c format is out of range.
| * Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raiseSerhiy Storchaka2013-06-231-2/+7
| | | | | | | | OverflowError when an argument of %c format is out of range.
* | Fix compilation warning with gcc 4.8 (unused typedef)Antoine Pitrou2013-06-181-1/+0
| |
* | Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory ↵Victor Stinner2013-06-152-364/+157
| | | | | | | | | | | | allocators The new API require more discussion.
* | Issue #3329: Add new APIs to customize memory allocatorsVictor Stinner2013-06-142-157/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a new PyMemAllocators structure * New functions: - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory allocator functions - PyMem_GetRawAllocators(), PyMem_SetRawAllocators() - PyMem_GetAllocators(), PyMem_SetAllocators() - PyMem_SetupDebugHooks() - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators() * Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0) * Add unit test for new get/set allocators functions * PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls back on PyMem_Realloc() instead of realloc() * PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(), instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
* | Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* | merge 3.3 (#18183)Benjamin Peterson2013-06-101-24/+19
|\ \ | |/
| * remove MAX_MAXCHAR because it's unsafe for computing maximum codepoitn value ↵Benjamin Peterson2013-06-101-31/+26
| | | | | | | | (see #18183)
* | Issue #9566: Fix compiler warning on Windows 64-bitVictor Stinner2013-06-041-3/+5
| |
* | Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init()Victor Stinner2013-06-041-1/+1
| | | | | | | | | | | | The result type is int, return -1 to avoid a compiler warning (cast Py_ssize_t to int). PyObject_Size() can only fail with -1, and anyway a constructor should return -1 on error, not an arbitrary negative number.
* | Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tupleVictor Stinner2013-06-041-1/+1
| | | | | | | | | | iterators: change the C type of tupleiterobject.it_index from long to Py_ssize_t.
* | Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macrosVictor Stinner2013-06-043-26/+11
| | | | | | | | multiprocessing.h: remove unused MIN and MAX macros
* | Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators:Victor Stinner2013-06-041-1/+1
| | | | | | | | change the C type of seqiterobject.it_index from long to Py_ssize_t.
* | Issue #9369: The types of `char*` arguments of PyObject_CallFunction() andSerhiy Storchaka2013-05-291-7/+10
| | | | | | | | | | PyObject_CallMethod() now changed to `const char*`. Based on patches by Jörg Müller and Lars Buitinck.
* | rewrite the parsing of field names to be more consistent wrt recursive expansionBenjamin Peterson2013-05-171-62/+53
| |
* | merge 3.3Benjamin Peterson2013-05-171-2/+8
|\ \ | |/
| * only recursively expand in the format spec (closes #17644)Benjamin Peterson2013-05-171-2/+8
| |
* | mergeRaymond Hettinger2013-05-171-7/+11
|\ \ | |/
| * Issue #17563: Fix dict resize performance regression.Raymond Hettinger2013-05-171-7/+11
| |
| * when arguments are cells clear the locals slot (backport of #17927)Benjamin Peterson2013-05-151-0/+12
| |
* | Backout c89febab4648 following private feedback by Guido.Antoine Pitrou2013-05-142-266/+239
| | | | | | | | (Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
* | when an argument is a cell, set the local copy to NULL (see #17927)Benjamin Peterson2013-05-121-3/+11
| |