]> granicus.if.org Git - python/log
python
11 years agoAdd missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
Christian Heimes [Sat, 20 Jul 2013 12:48:21 +0000 (14:48 +0200)]
Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
CID 486647

11 years agoAdd missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
Christian Heimes [Sat, 20 Jul 2013 12:48:10 +0000 (14:48 +0200)]
Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
CID 486647

11 years agoIssue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto...
Christian Heimes [Sat, 20 Jul 2013 12:19:46 +0000 (14:19 +0200)]
Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto, attr).
The fix only affects the error message of __class__ assignment. CID 983564

11 years agoFix fishy sizeof(Py_ssize_t *).
Christian Heimes [Sat, 20 Jul 2013 12:11:52 +0000 (14:11 +0200)]
Fix fishy sizeof(Py_ssize_t *).
sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption.
CID 486403

11 years agoUse strncat() instead of strcat() to silence some warnings.
Christian Heimes [Sat, 20 Jul 2013 12:11:28 +0000 (14:11 +0200)]
Use strncat() instead of strcat() to silence some warnings.
CID 486616, CID 486617, CID 486615

11 years agoMake the GCC-4.8 compiler happy by moving declarations to the top of the function.
Raymond Hettinger [Sat, 20 Jul 2013 02:52:04 +0000 (19:52 -0700)]
Make the GCC-4.8 compiler happy by moving declarations to the top of the function.

11 years agoChange _names to _names_ since the latter is reserved for Enum use.
Ethan Furman [Sat, 20 Jul 2013 02:47:21 +0000 (19:47 -0700)]
Change _names to _names_ since the latter is reserved for Enum use.

Before this change only the methods were _single_underscored_; now
the attributes are as well.

11 years agoClose #18508 -- fix _value2member_map to always have the member's value
Ethan Furman [Sat, 20 Jul 2013 02:35:56 +0000 (19:35 -0700)]
Close #18508 -- fix _value2member_map to always have the member's value

11 years agoMerge.
Richard Oudkerk [Fri, 19 Jul 2013 21:54:37 +0000 (22:54 +0100)]
Merge.

11 years agoPrevent dangling threads/process warning for test_multiprocessing.
Richard Oudkerk [Fri, 19 Jul 2013 21:53:42 +0000 (22:53 +0100)]
Prevent dangling threads/process warning for test_multiprocessing.

11 years agoIssue #18408: Fix list_ass_slice(), handle list_resize() failure
Victor Stinner [Fri, 19 Jul 2013 21:06:21 +0000 (23:06 +0200)]
Issue #18408: Fix list_ass_slice(), handle list_resize() failure

I tested the patch manually by injecting a fault using gdb: list items are
correctly restored on failure.

11 years agoCloses #18479: Changed venv Activate.ps1 to make deactivate a function, and removed...
Vinay Sajip [Fri, 19 Jul 2013 10:03:55 +0000 (11:03 +0100)]
Closes #18479: Changed venv Activate.ps1 to make deactivate a function, and removed Deactivate.ps1.

11 years ago(3.3->default): #18480: Add missing PyType_Ready call to _elementtree extension
Ronald Oussoren [Fri, 19 Jul 2013 09:14:05 +0000 (11:14 +0200)]
(3.3->default): #18480: Add missing PyType_Ready call to _elementtree extension

11 years ago#18480: Add missing PyType_Ready call to _elementtree extension
Ronald Oussoren [Fri, 19 Jul 2013 09:11:25 +0000 (11:11 +0200)]
#18480: Add missing PyType_Ready call to _elementtree extension

11 years agocloses issue18042 -- a `unique` decorator is added to enum.py
Ethan Furman [Fri, 19 Jul 2013 00:05:39 +0000 (17:05 -0700)]
closes issue18042 -- a `unique` decorator is added to enum.py

The docs also clarify the 'Interesting Example' duplicate-free enum is for
demonstration purposes.

11 years ago(Merge 3.3) Fix posix_chflags(): return_value was uninitialized when
Victor Stinner [Thu, 18 Jul 2013 21:58:08 +0000 (23:58 +0200)]
(Merge 3.3) Fix posix_chflags(): return_value was uninitialized when
follow_symlinks=False whereas the fchmodat() function is not avaialble.

11 years agoFix posix_chflags(): return_value was uninitialized when follow_symlinks=False
Victor Stinner [Thu, 18 Jul 2013 21:57:35 +0000 (23:57 +0200)]
Fix posix_chflags(): return_value was uninitialized when follow_symlinks=False
whereas the fchmodat() function is not avaialble.

11 years agoIssue #18501, #18408: Fix expat handlers in pyexpat, don't call Python
Victor Stinner [Thu, 18 Jul 2013 21:17:01 +0000 (23:17 +0200)]
Issue #18501, #18408: Fix expat handlers in pyexpat, don't call Python
functions if a Python exception was raised

11 years agoIssue #18408: Fix _elementtree.c, don't call Python function from an expat
Victor Stinner [Thu, 18 Jul 2013 20:46:14 +0000 (22:46 +0200)]
Issue #18408: Fix _elementtree.c, don't call Python function from an expat
handler if a Python exception is set

11 years agoFix a compiler warning on FreeBSD
Victor Stinner [Thu, 18 Jul 2013 00:43:47 +0000 (02:43 +0200)]
Fix a compiler warning on FreeBSD

Modules/python.c:40: warning: ISO C90 forbids mixed declarations and code

11 years agoIssue #18408: Fix PyInit__curses_panel(), handle import_curses() failure
Victor Stinner [Thu, 18 Jul 2013 00:31:21 +0000 (02:31 +0200)]
Issue #18408: Fix PyInit__curses_panel(), handle import_curses() failure

Don't call PyErr_NewException() if an exception is set, or type_call() would
fail with an assertion error.

11 years agoIssue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with an
Victor Stinner [Wed, 17 Jul 2013 23:49:30 +0000 (01:49 +0200)]
Issue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with an
assertion error if they are called with an exception set (PyErr_Occurred()).

As PyEval_EvalFrameEx(), they may clear the current exception and so the caller
looses its exception.

11 years agoIssue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call
Victor Stinner [Wed, 17 Jul 2013 23:54:37 +0000 (01:54 +0200)]
Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call
type_call() with an exception set

11 years agoIssue #18408: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail
Victor Stinner [Wed, 17 Jul 2013 23:41:08 +0000 (01:41 +0200)]
Issue #18408: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail
with an assertion error if they are called with an exception set
(PyErr_Occurred()).

If these functions are called with an exception set, the exception may be
cleared and so the caller looses its exception.

Add also assertions to PyEval_CallObjectWithKeywords() and call_function() to
check if the function succeed with no exception set, or the function failed
with an exception set.

11 years agoIssue #18488: _pysqlite_final_callback() should not clear the exception set by
Victor Stinner [Wed, 17 Jul 2013 23:42:04 +0000 (01:42 +0200)]
Issue #18488: _pysqlite_final_callback() should not clear the exception set by
the last call to the step() method of a user function

11 years agoIssue #18408: Fix dict_repr(), don't call PyObject_Repr() with an exception set
Victor Stinner [Wed, 17 Jul 2013 23:00:45 +0000 (01:00 +0200)]
Issue #18408: Fix dict_repr(), don't call PyObject_Repr() with an exception set

PyObject_Repr() can removes the current exception. For example, module_repr()
calls PyErr_Clear() if calling loader.module_repr(mod) failed.

11 years agoIssue #18408: Fix array_tolist(), handle PyList_SetItem() failure
Victor Stinner [Wed, 17 Jul 2013 23:12:35 +0000 (01:12 +0200)]
Issue #18408: Fix array_tolist(), handle PyList_SetItem() failure

11 years agoIssue #18408: Fix array_index(), handle getarrayitem() failure
Victor Stinner [Wed, 17 Jul 2013 21:01:30 +0000 (23:01 +0200)]
Issue #18408: Fix array_index(), handle getarrayitem() failure

11 years agolongobject.c: add an assertion to ensure that MEDIUM_VALUE() is only called on
Victor Stinner [Wed, 17 Jul 2013 20:33:42 +0000 (22:33 +0200)]
longobject.c: add an assertion to ensure that MEDIUM_VALUE() is only called on
small integers (0 or 1 digit)

11 years agoIssue #18408: Rewrite NEGATE() macro in longobject.c to handle PyLong_FromLong()...
Victor Stinner [Wed, 17 Jul 2013 20:31:17 +0000 (22:31 +0200)]
Issue #18408: Rewrite NEGATE() macro in longobject.c to handle PyLong_FromLong() failure

11 years agoIssue #18408: Fix PyType_Ready(), handle _PyDict_SetItemId() failure
Victor Stinner [Wed, 17 Jul 2013 20:01:37 +0000 (22:01 +0200)]
Issue #18408: Fix PyType_Ready(), handle _PyDict_SetItemId() failure

11 years agoIssue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure
Victor Stinner [Wed, 17 Jul 2013 19:58:41 +0000 (21:58 +0200)]
Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure

11 years agoIssue #18408: Fix listpop(), handle list_ass_slice() failure
Victor Stinner [Wed, 17 Jul 2013 19:58:01 +0000 (21:58 +0200)]
Issue #18408: Fix listpop(), handle list_ass_slice() failure

11 years agoIssue #18408: Fix PyErr_SetImportError(), handle PyDict_SetItemString() failure
Victor Stinner [Wed, 17 Jul 2013 19:54:25 +0000 (21:54 +0200)]
Issue #18408: Fix PyErr_SetImportError(), handle PyDict_SetItemString() failure

11 years agoIssue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure
Victor Stinner [Wed, 17 Jul 2013 19:53:23 +0000 (21:53 +0200)]
Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure

11 years agoIssue #18408: Fix ast_for_atom(), PyErr_Fetch(&type, &value, &tback) can set value...
Victor Stinner [Wed, 17 Jul 2013 19:51:42 +0000 (21:51 +0200)]
Issue #18408: Fix ast_for_atom(), PyErr_Fetch(&type, &value, &tback) can set value to NULL

11 years agoIssue #18408: Fix heapq.heappop(), handle PyList_SetSlice() failure
Victor Stinner [Wed, 17 Jul 2013 19:50:21 +0000 (21:50 +0200)]
Issue #18408: Fix heapq.heappop(), handle PyList_SetSlice() failure

11 years agoIssue #18408: Fix time.tzset(), detect exception when calling PyInit_timezone()
Victor Stinner [Wed, 17 Jul 2013 19:42:45 +0000 (21:42 +0200)]
Issue #18408: Fix time.tzset(), detect exception when calling PyInit_timezone()

11 years agoIssue #18408: Fix structseq_reduce(), handle PyDict_SetItemString() failure
Victor Stinner [Wed, 17 Jul 2013 11:41:39 +0000 (13:41 +0200)]
Issue #18408: Fix structseq_reduce(), handle PyDict_SetItemString() failure

11 years agoIssue #18266: test_largefile now works with unittest test discovery and
Serhiy Storchaka [Wed, 17 Jul 2013 10:44:17 +0000 (13:44 +0300)]
Issue #18266: test_largefile now works with unittest test discovery and
supports running only selected tests.  Patch by Zachary Ware.

11 years agoIssue #18266: test_largefile now works with unittest test discovery and
Serhiy Storchaka [Wed, 17 Jul 2013 10:42:24 +0000 (13:42 +0300)]
Issue #18266: test_largefile now works with unittest test discovery and
supports running only selected tests.  Patch by Zachary Ware.

11 years agoIssue #17767: test_locale now works with unittest test discovery.
Serhiy Storchaka [Wed, 17 Jul 2013 10:26:48 +0000 (13:26 +0300)]
Issue #17767: test_locale now works with unittest test discovery.
Original patch by Zachary Ware.

11 years agoIssue #17767: test_locale now works with unittest test discovery.
Serhiy Storchaka [Wed, 17 Jul 2013 10:23:45 +0000 (13:23 +0300)]
Issue #17767: test_locale now works with unittest test discovery.
Original patch by Zachary Ware.

11 years agoClose #18469: Replace PyDict_GetItemString() with _PyDict_GetItemId() in structseq.c
Victor Stinner [Tue, 16 Jul 2013 23:22:45 +0000 (01:22 +0200)]
Close #18469: Replace PyDict_GetItemString() with _PyDict_GetItemId() in structseq.c

_PyDict_GetItemId() is more efficient: it only builds the Unicode string once.
Identifiers (dictionary keys) are now created at Python initialization, and if
the creation failed, Python does exit with a fatal error.

Before, PyDict_GetItemString() failure was not handled: structseq_new() could
call PyObject_GC_NewVar() with a negative size, and structseq_dealloc() could
also crash.

11 years agoIssue #18408: Mention changes in Misc/NEWS
Victor Stinner [Tue, 16 Jul 2013 23:10:04 +0000 (01:10 +0200)]
Issue #18408: Mention changes in Misc/NEWS

11 years agoIssue #18408: Handle PyArena_AddPyObject() failure in ast.c
Victor Stinner [Tue, 16 Jul 2013 22:57:58 +0000 (00:57 +0200)]
Issue #18408: Handle PyArena_AddPyObject() failure in ast.c

PyList_Append() (called by PyArena_AddPyObject()) can fail because of a
MemoryError for example.

11 years agoIssue #18408: Fix locale.localeconv(), handle PyDict_SetItemString() failure
Victor Stinner [Tue, 16 Jul 2013 22:55:57 +0000 (00:55 +0200)]
Issue #18408: Fix locale.localeconv(), handle PyDict_SetItemString() failure

11 years agoIssue #18408: Fix PyErr_NormalizeException(), handle PyObject_IsSubclass() failure
Victor Stinner [Tue, 16 Jul 2013 22:44:53 +0000 (00:44 +0200)]
Issue #18408: Fix PyErr_NormalizeException(), handle PyObject_IsSubclass() failure

PyObject_IsSubclass() can fail and raise a new exception!

11 years agoIssue #18408: Fix Python-ast.c: handle init_types() failure (ex: MemoryError)
Victor Stinner [Tue, 16 Jul 2013 22:17:15 +0000 (00:17 +0200)]
Issue #18408: Fix Python-ast.c: handle init_types() failure (ex: MemoryError)

11 years agoIssue #18408: Fix typo in build_node_tree() of the parser module
Victor Stinner [Tue, 16 Jul 2013 22:13:52 +0000 (00:13 +0200)]
Issue #18408: Fix typo in build_node_tree() of the parser module

Type "o" format of Py_BuildValue() is invalid: it must be "O".

11 years agoCleanup type_call() to ease debug
Victor Stinner [Tue, 16 Jul 2013 20:51:21 +0000 (22:51 +0200)]
Cleanup type_call() to ease debug

It was easy to miss the call to type->tp_init because it was done in a long
conditional expression. Split the long expression in multiple lines to make the
debug step by step easier.

11 years agoIssue #18408: handle PySys_GetObject() failure, raise a RuntimeError
Victor Stinner [Tue, 16 Jul 2013 20:26:05 +0000 (22:26 +0200)]
Issue #18408: handle PySys_GetObject() failure, raise a RuntimeError

11 years agoIssue #18408: Py_ReprLeave() now saves/restores the current exception,
Victor Stinner [Tue, 16 Jul 2013 20:24:44 +0000 (22:24 +0200)]
Issue #18408: Py_ReprLeave() now saves/restores the current exception,
and ignores exceptions raised during the call

11 years agoIssue #18408: dict_new() now fails on new_keys_object() error
Victor Stinner [Tue, 16 Jul 2013 20:19:00 +0000 (22:19 +0200)]
Issue #18408: dict_new() now fails on new_keys_object() error

Pass the MemoryError exception to the caller, instead of using empty keys.

11 years agoCleanup dictobject.c
Victor Stinner [Tue, 16 Jul 2013 20:17:26 +0000 (22:17 +0200)]
Cleanup dictobject.c

11 years agoIssue #18408: Fix PyDict_GetItemString(), suppress PyUnicode_FromString() error
Victor Stinner [Tue, 16 Jul 2013 20:16:05 +0000 (22:16 +0200)]
Issue #18408: Fix PyDict_GetItemString(), suppress PyUnicode_FromString() error

As PyDict_GetItem(), PyDict_GetItemString() suppresses all errors that may
occur for historical reasons.

11 years agoIssue #18408: Fix list.extend(), handle list_resize() failure
Victor Stinner [Tue, 16 Jul 2013 19:45:58 +0000 (21:45 +0200)]
Issue #18408: Fix list.extend(), handle list_resize() failure

11 years agoIssue #18408: Fix cjkcodecs decoders, add a new MBERR_EXCEPTION constant to
Victor Stinner [Tue, 16 Jul 2013 19:41:43 +0000 (21:41 +0200)]
Issue #18408: Fix cjkcodecs decoders, add a new MBERR_EXCEPTION constant to
notify exceptions raised by the _PyUnicodeWriter API

11 years agoIssue #18408: Fix fileio_read() on _PyBytes_Resize() failure
Victor Stinner [Tue, 16 Jul 2013 19:36:02 +0000 (21:36 +0200)]
Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure

bytes is NULL on _PyBytes_Resize() failure

11 years agoIssue #18448: Fix a typo in Tools/demo/eiffel.py.
Serhiy Storchaka [Tue, 16 Jul 2013 19:14:03 +0000 (22:14 +0300)]
Issue #18448: Fix a typo in Tools/demo/eiffel.py.

11 years agoIssue #18448: Fix a typo in Tools/demo/eiffel.py.
Serhiy Storchaka [Tue, 16 Jul 2013 19:12:03 +0000 (22:12 +0300)]
Issue #18448: Fix a typo in Tools/demo/eiffel.py.

11 years agoIssue #18457: Fixed saving of formulas and complex numbers in Tools/demo/ss1.py.
Serhiy Storchaka [Tue, 16 Jul 2013 18:58:37 +0000 (21:58 +0300)]
Issue #18457: Fixed saving of formulas and complex numbers in Tools/demo/ss1.py.
Useed context managers for file I/O.
Removed out-of-dated code and misleading comments.

11 years agoIssue #18457: Fixed saving of formulas and complex numbers in Tools/demo/ss1.py.
Serhiy Storchaka [Tue, 16 Jul 2013 18:55:36 +0000 (21:55 +0300)]
Issue #18457: Fixed saving of formulas and complex numbers in Tools/demo/ss1.py.
Useed context managers for file I/O.
Removed out-of-dated code and misleading comments.

11 years agoMerge: Closes #18475: add unittest.main() to test_email/test_inversions.
R David Murray [Tue, 16 Jul 2013 15:46:00 +0000 (11:46 -0400)]
Merge: Closes #18475: add unittest.main() to test_email/test_inversions.

11 years agoCloses #18475: add unittest.main() to test_email/test_inversions.
R David Murray [Tue, 16 Jul 2013 15:45:31 +0000 (11:45 -0400)]
Closes #18475: add unittest.main() to test_email/test_inversions.

Patch by Vajrasky Kok.

11 years agoIssue #17778: Fix test discovery for test_multiprocessing. (Patch by
Richard Oudkerk [Tue, 16 Jul 2013 14:57:16 +0000 (15:57 +0100)]
Issue #17778: Fix test discovery for test_multiprocessing. (Patch by
Zachary Ware.)

11 years agoIssue #17778: Fix test discovery for test_multiprocessing. (Patch by
Richard Oudkerk [Tue, 16 Jul 2013 14:33:41 +0000 (15:33 +0100)]
Issue #17778: Fix test discovery for test_multiprocessing. (Patch by
Zachary Ware.)

11 years agoAlso remove a (broken) leaker test for the code removed in issue #18393.
Ronald Oussoren [Tue, 16 Jul 2013 06:32:05 +0000 (08:32 +0200)]
Also remove a (broken) leaker test for the code removed in issue #18393.

11 years agomerge 3.3
Benjamin Peterson [Tue, 16 Jul 2013 03:50:25 +0000 (20:50 -0700)]
merge 3.3

11 years agomove declaration to top of block
Benjamin Peterson [Tue, 16 Jul 2013 03:50:22 +0000 (20:50 -0700)]
move declaration to top of block

11 years agomerge 3.3 (closes #18470)
Benjamin Peterson [Tue, 16 Jul 2013 03:47:47 +0000 (20:47 -0700)]
merge 3.3 (closes #18470)

11 years agocheck the return value of new_string() (closes #18470)
Benjamin Peterson [Tue, 16 Jul 2013 02:15:34 +0000 (19:15 -0700)]
check the return value of new_string() (closes #18470)

11 years agoCloses #18471: Fix typo in heapq documentation (reported by François Pinard).
Ned Deily [Tue, 16 Jul 2013 02:09:27 +0000 (19:09 -0700)]
Closes #18471: Fix typo in heapq documentation (reported by François Pinard).

11 years agoIssue #18471: Fix typo in heapq documentation (reported by François Pinard).
Ned Deily [Tue, 16 Jul 2013 02:08:13 +0000 (19:08 -0700)]
Issue #18471: Fix typo in heapq documentation (reported by François Pinard).

11 years agoIssue #18408: Fix show_warning(), clear also the exception raised by
Victor Stinner [Mon, 15 Jul 2013 23:54:37 +0000 (01:54 +0200)]
Issue #18408: Fix show_warning(), clear also the exception raised by
_Py_DisplaySourceLine()

For example, _PyGC_DumpShutdownStats() calls PyErr_WarnExplicitFormat() while
the import machinery does not work anymore, _Py_DisplaySourceLine() fails when
trying to import the io module.

11 years agoIssue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs
Victor Stinner [Mon, 15 Jul 2013 23:02:12 +0000 (01:02 +0200)]
Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs
earlier

11 years agoIssue #18408: Fix _Py_DisplaySourceLine()
Victor Stinner [Mon, 15 Jul 2013 22:32:14 +0000 (00:32 +0200)]
Issue #18408: Fix _Py_DisplaySourceLine()

Report _Py_FindSourceFile() error, so the error is cleared;
and clear io.open(filename) exception on failure.

11 years agoIssue #18408: Fix PyEval_EvalFrameEx() for MemoryError
Victor Stinner [Mon, 15 Jul 2013 19:16:27 +0000 (21:16 +0200)]
Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError

Don't pass a NULL traceback to PyException_SetTraceback(): pass Py_None.
Passing NULL would raise a new exception.

11 years ago- Issue #18440: Clarify that `hash()` can truncate the value returned from an
Barry Warsaw [Mon, 15 Jul 2013 18:47:29 +0000 (14:47 -0400)]
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
  object's custom `__hash__()` method.

11 years agoIssue #18408: random_seed() now raises a MemoryError on memory allocation
Victor Stinner [Mon, 15 Jul 2013 18:00:36 +0000 (20:00 +0200)]
Issue #18408: random_seed() now raises a MemoryError on memory allocation
failure

11 years agotest_io: check_interrupted_write() now cancels the alarm if ZeroDivisionError
Victor Stinner [Mon, 15 Jul 2013 17:53:13 +0000 (19:53 +0200)]
test_io: check_interrupted_write() now cancels the alarm if ZeroDivisionError
exception was not raised.

Before the process was killed by SIGALRM in another random test (1 second later)

11 years agoIssue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryError
Victor Stinner [Mon, 15 Jul 2013 17:34:20 +0000 (19:34 +0200)]
Issue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryError
on memory allocation failure

11 years agoIssue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY()
Victor Stinner [Mon, 15 Jul 2013 16:22:47 +0000 (18:22 +0200)]
Issue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY()
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.

11 years agoCloses #18464: fix typo in test name.
R David Murray [Mon, 15 Jul 2013 16:09:47 +0000 (12:09 -0400)]
Closes #18464: fix typo in test name.

11 years agoIssue #18408: PyObject_Call() now fails with an assertion error in debug mode
Victor Stinner [Mon, 15 Jul 2013 15:50:07 +0000 (17:50 +0200)]
Issue #18408: PyObject_Call() now fails with an assertion error in debug mode
if the function called failed whereas no exception was raised, to detect bugs
earlier.

11 years agoIssue #18408: Fix CJK decoders, raise MemoryError on memory allocation failure
Victor Stinner [Mon, 15 Jul 2013 15:47:39 +0000 (17:47 +0200)]
Issue #18408: Fix CJK decoders, raise MemoryError on memory allocation failure

11 years agoIssue #18408: Fix pyexpat.ParserCreate()
Victor Stinner [Mon, 15 Jul 2013 15:15:57 +0000 (17:15 +0200)]
Issue #18408: Fix pyexpat.ParserCreate()

Check if XML_ParserCreate_MM() failed (ex: MemoryError) before using
self->itself.

11 years ago- Issue #18440: Clarify that `hash()` can truncate the value returned from an
Barry Warsaw [Mon, 15 Jul 2013 19:21:41 +0000 (15:21 -0400)]
- Issue #18440: Clarify that `hash()` can truncate the value returned from an
  object's custom `__hash__()` method.

11 years agoIssue #18393: Remove use of deprecated API on OSX
Ronald Oussoren [Mon, 15 Jul 2013 16:32:09 +0000 (18:32 +0200)]
Issue #18393: Remove use of deprecated API on OSX

The "Gestalt" function on OSX is deprecated (starting with OSX 10.8),
remove its usage from the stdlib. The patch removes a number of private
functions and a private module, but does not change the public API.

The removed code was effectively dead, the platform module has used
other code to fetch the OSX version for years and could only use
on the Gestalt-based code as a fallback. That fallback can only trigger
on broken OSX installs (that is, someone has removed parts of the system
install)

11 years agoMerge: Closes #18464: fix typo in test name.
R David Murray [Mon, 15 Jul 2013 16:10:29 +0000 (12:10 -0400)]
Merge: Closes #18464: fix typo in test name.

11 years agoIssue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
Richard Oudkerk [Mon, 15 Jul 2013 15:10:28 +0000 (16:10 +0100)]
Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().

11 years agoIssue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
Richard Oudkerk [Mon, 15 Jul 2013 15:05:22 +0000 (16:05 +0100)]
Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().

11 years agoClose issue 17482: don't overwrite __wrapped__
Nick Coghlan [Mon, 15 Jul 2013 11:13:08 +0000 (21:13 +1000)]
Close issue 17482: don't overwrite __wrapped__

11 years agoIssue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
Serhiy Storchaka [Mon, 15 Jul 2013 09:37:43 +0000 (12:37 +0300)]
Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
Févry Thibault.

11 years agoIssue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
Serhiy Storchaka [Mon, 15 Jul 2013 09:34:17 +0000 (12:34 +0300)]
Issue #18449: Make Tools/demo/ss1.py work again on Python 3.  Patch by
Févry Thibault.

11 years agoCloses #18452: fix several "occurrence" typos (reported by Févry Thibault).
Ned Deily [Sun, 14 Jul 2013 19:45:18 +0000 (12:45 -0700)]
Closes #18452: fix several "occurrence" typos (reported by Févry Thibault).

11 years agoIssue #18452: fix several "occurrence" typos (reported by Févry Thibault).
Ned Deily [Sun, 14 Jul 2013 19:43:16 +0000 (12:43 -0700)]
Issue #18452: fix several "occurrence" typos (reported by Févry Thibault).

11 years agoIssue #9893: remove an outdated mention of the Vim-related files.
Brett Cannon [Sun, 14 Jul 2013 13:50:50 +0000 (09:50 -0400)]
Issue #9893: remove an outdated mention of the Vim-related files.

11 years agomerge
Raymond Hettinger [Sun, 14 Jul 2013 05:48:49 +0000 (22:48 -0700)]
merge

11 years agoIssue #18432: Fix unintended API change in the sched module
Raymond Hettinger [Sun, 14 Jul 2013 05:42:09 +0000 (22:42 -0700)]
Issue #18432:  Fix unintended API change in the sched module