Barry Warsaw [Wed, 12 Sep 2012 18:34:50 +0000 (14:34 -0400)]
A follow up for issue #15906: change the test for calling the type conversion
on the action's default, reverting it back to previous behavior. Conversion
is only done on string defaults.
Add a test for this and another test that ensures such type conversions are
only called once.
Christian Heimes [Wed, 12 Sep 2012 13:32:06 +0000 (15:32 +0200)]
Fix out of bounds read in long_new() for empty bytes with an explicit base. int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
Christian Heimes [Wed, 12 Sep 2012 13:31:43 +0000 (15:31 +0200)]
Fix out of bounds read in long_new() for empty bytes with an explicit base. int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359
Christian Heimes [Tue, 11 Sep 2012 15:31:08 +0000 (17:31 +0200)]
Fix null pointer dereferencing in structmember.c PyMember_SetOne() for T_CHAR. _PyUnicode_AsStringAndSize() can return NULL without touching the len argument. Also remove unnecessary PyUnicode_Check(), _PyUnicode_AsStringAndSize() performance the test again. CID 486815
Christian Heimes [Tue, 11 Sep 2012 15:30:53 +0000 (17:30 +0200)]
Fix null pointer dereferencing in structmember.c PyMember_SetOne() for T_CHAR. _PyUnicode_AsStringAndSize() can return NULL without touching the len argument. Also remove unnecessary PyUnicode_Check(), _PyUnicode_AsStringAndSize() performance the test again. CID 486815
Christian Heimes [Tue, 11 Sep 2012 13:47:28 +0000 (15:47 +0200)]
Issue #15895: my analysis was slightly off. The FILE pointer is only leaked when set_main_loader() fails for a pyc file with closeit=0. In the success case run_pyc_file() does its own cleanup of the fp. I've changed the code to use another FILE ptr for pyc files and moved the fclose() to PyRun_SimpleFileExFlags() to make it more obvious what's happening.
Stefan Krah [Mon, 10 Sep 2012 17:34:58 +0000 (19:34 +0200)]
Issue #15882: Change _decimal to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility
with decimal.py: Infinity coefficients are undefined in _decimal
(in accordance with the specification).
Christian Heimes [Mon, 10 Sep 2012 15:46:09 +0000 (17:46 +0200)]
Fixed reference leak in error branch of _bufferedreader_read_all(). The variable data can contain a bytes object but it wasn't cleaned up when PyList_New() failed. CID 715364
backport from the trunk, to fix test_tools with srcdir != builddir
changeset: 77827:c23b442b5d5e
user: Antoine Pitrou <solipsis@pitrou.net>
date: Thu Jun 28 01:20:26 2012 +0200
summary: Avoid using scrdir, it's broken.
changeset: 77826:f0e58e778215
user: Neil Schemenauer <nas@arctrix.com>
date: Wed Jun 27 15:58:37 2012 -0600
summary: Fix bug in test_tools that prevented building is separate directory.
Christian Heimes [Mon, 10 Sep 2012 01:50:48 +0000 (03:50 +0200)]
Fixed out-of-bounce write to rawmode buffer. The fixed size buffer wasn't enlarged for the new 'x' flag. The buffer may contain the 5 flags xrwa+ and the \0 byte
Make sure that *really* no more than sizeof(ifr.ifr_name) chars are strcpy-ed to ifr.ifr_name and that the string is *always* NUL terminated. New code shouldn't use strcpy(), too. CID 719692
Ned Deily [Sun, 9 Sep 2012 02:04:47 +0000 (19:04 -0700)]
Issue #15822: Fix installation of lib2to3 grammar pickles to ensure
they are created in the install locations and with the proper timestamp.
(Solution suggested by MvL)
Ned Deily [Sun, 9 Sep 2012 01:50:56 +0000 (18:50 -0700)]
Issue #15822: Fix installation of lib2to3 grammar pickles to ensure
they are created in the install locations and with the proper timestamp.
(Solution suggested by MvL)
R David Murray [Sat, 8 Sep 2012 16:14:25 +0000 (12:14 -0400)]
merge #15847: allow args to be a tuple in parse_args
This fixes a regression introduced by the fix for issue #13922. Although args
is not documented as being allowed to be a tuple, previously this worked and
so naturally there are programs in the field that depend on it.
R David Murray [Sat, 8 Sep 2012 16:08:01 +0000 (12:08 -0400)]
#15847: allow args to be a tuple in parse_args
This fixes a regression introduced by the fix for issue #13922. Although args
is not documented as being allowed to be a tuple, previously this worked and
so naturally there are programs in the field that depend on it.