Commit Graph

6905 Commits

Author SHA1 Message Date
Petri Lehtinen 92c28cace4 #14897: Enhance error messages of struct.pack and struct.pack_into
Patch by Matti Mäki.
2012-10-29 21:24:07 +02:00
Mark Dickinson 039e0cdc28 Issue #16305: Merge fix from 3.2. 2012-10-25 10:47:46 +01:00
Mark Dickinson 76464494bc Fix math.factorial KeyboardInterrupt segfault. Thanks Amaury for report and diagnosis. 2012-10-25 10:46:28 +01:00
Petri Lehtinen 5445a8cb41 Replace tabs with spaces in posixmodule.c 2012-10-23 16:29:59 +03:00
Nadeem Vawda 18b7fcc7a6 Merge #14398: Fix size truncation and overflow bugs in bz2 module. 2012-10-21 21:16:58 +02:00
Nadeem Vawda 5f8f0d6777 Issue #14398: Fix size truncation and overflow bugs in bz2 module. 2012-10-21 21:13:27 +02:00
Gregory P. Smith a10ddb8a55 Fixes Issue #16114: The subprocess module no longer provides a
misleading error message stating that args[0] did not exist when
either the cwd or executable keyword arguments specified a path that
did not exist.
2012-10-10 03:44:47 -07:00
Gregory P. Smith 5591b02a4c Fixes Issue #16114: The subprocess module no longer provides a
misleading error message stating that args[0] did not exist when
either the cwd or executable keyword arguments specified a path that
did not exist.

It now keeps track of if the child got as far as preexec and reports it if
not back to the parent via a special "noexec" error message value in
the error pipe so that the cwd can be blamed for a failed chdir
instead of the exec of the executable being blamed instead.

The executable is also always reported accurately when exec fails.

Unittests enhanced to cover these cases.
2012-10-10 03:34:47 -07:00
Mark Dickinson c04ddff290 Issue #16096: Fix several occurrences of potential signed integer overflow. Thanks Serhiy Storchaka. 2012-10-06 18:04:49 +01:00
Antoine Pitrou ee329318db Issue #16089: Allow ElementTree.TreeBuilder to work again with a non-Element element_factory (fixes a regression in SimpleTAL). 2012-10-04 19:53:29 +02:00
Jesus Cea 6e1d2b6e78 Closes #16126: PyErr_Format format mismatch in _testcapimodule.c 2012-10-04 16:06:30 +02:00
Jesus Cea cf45325b61 Closes #15897: zipimport.c doesn't check return value of fseek(). Typo 2012-10-03 03:16:42 +02:00
Jesus Cea fb22f542d2 MERGE: Closes #15897: zipimport.c doesn't check return value of fseek() 2012-10-03 03:00:37 +02:00
Jesus Cea 09bf7a799d Closes #15897: zipimport.c doesn't check return value of fseek() 2012-10-03 02:13:05 +02:00
Antoine Pitrou c194884983 Sanitize and modernize some of the _elementtree code (see issue #16089). 2012-10-01 23:40:37 +02:00
Stefan Krah a0346e56ac Support gcc's -ansi flag: use "__asm__" instead of "asm". 2012-09-30 17:31:04 +02:00
Stefan Krah e59aa8c94d Revert 29506c7db353 (build output should be accurate). 2012-09-30 17:20:47 +02:00
Christian Heimes 5c9a5895d4 merge 2012-09-30 15:51:39 +02:00
Christian Heimes 72c9946718 Change libmpdec to use ANSI code in strict ansi mode as inline asm isn't supported in ANSI C 2012-09-30 15:49:56 +02:00
Stefan Krah 9a3f05e60f Make it clear that the pi function is modified for benchmarking purposes. 2012-09-30 09:24:41 +02:00
Stefan Krah 6b6a1df996 Restore the benchmark order to avoid waiting for decimal.py if just the
prec=9 test is used.
2012-09-25 17:07:55 +02:00
Brett Cannon 6cf50c5b1d Fix whitespace. 2012-09-25 10:26:15 -04:00
Brett Cannon 63092fe0ea Fix whitespace. 2012-09-25 10:25:41 -04:00
Brett Cannon d266c4451f Make the decimal bench file run under Python 2.7. 2012-09-25 10:23:47 -04:00
Senthil Kumaran 49d130227b merge 3.2: Issue #16013: Fix CSV Reader parsing issue with ending quote characters. Patch by Serhiy Storchaka. 2012-09-25 02:37:20 -07:00
Senthil Kumaran 67b7b98a47 Issue #16013: Fix CSV Reader parsing issue with ending quote characters. Patch by Serhiy Storchaka. 2012-09-25 02:30:27 -07:00
Christian Heimes 22340be15e Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
method doesn't require an argument again.
2012-09-24 13:27:28 +02:00
Christian Heimes e26d3af7ee Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
method doesn't require an argument again.
2012-09-24 13:17:08 +02:00
Christian Heimes 3b9493b53c Use C-style comments for C89 / ANSI C compatibility 2012-09-23 16:11:15 +02:00
Stefan Krah 91ceeceea7 Use C-style comments (required for the AIX build slave). 2012-09-23 15:51:16 +02:00
Stefan Krah 7e6523fbd7 Use C-style comments. 2012-09-23 15:46:09 +02:00
Victor Stinner a3ff101e6a Issue #5969: faulthandler module: rename dump_tracebacks_later() to
dump_traceback_later() and cancel_dump_tracebacks_later() to
cancel_dump_traceback_later().
2012-09-23 11:06:21 +02:00
Alexander Belopolsky 57caede470 Issue #15973: fixed 3.2 backport. 2012-09-20 17:23:46 -04:00
Alexander Belopolsky 9b9ed867bc merged 3.2 2012-09-20 16:42:34 -04:00
Alexander Belopolsky 3ec153681e Issue #15973: Fixed segmentation fault on timezone comparison to other types. 2012-09-20 16:39:33 -04:00
Antoine Pitrou ca8aa4acf6 Issue #15144: Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
2012-09-20 20:56:47 +02:00
Christian Heimes 1c47222a25 merge 2012-09-20 12:43:24 +02:00
Christian Heimes 5cb31c9277 Issue #15977: Fix memory leak in Modules/_ssl.c when the function _set_npn_protocols() is called multiple times 2012-09-20 12:42:54 +02:00
Trent Nelson 9a46105a89 #15965: Explicitly cast AT_FDCWD as (int).
Required on Solaris 10 (which defines AT_FDCWD as 0xffd19553),
harmless on other platforms.
2012-09-18 21:50:06 -04:00
Ezio Melotti 6d10b4d591 #15796: merge with 3.2. 2012-09-18 07:21:18 +03:00
Ezio Melotti 16d2b47837 #15796: Fix \n in readline docstring. Patch by Serhiy Storchaka. 2012-09-18 07:20:18 +03:00
Antoine Pitrou 9d20e0edd9 Issue #15926: Fix crash after multiple reinitializations of the interpreter. 2012-09-12 18:01:36 +02:00
Benjamin Peterson 6f3e5e48d3 remove useless and defined initialization (closes #15921) 2012-09-11 12:05:05 -04:00
Jesus Cea b7a2800831 MERGE: Closes #15793: Stack corruption in ssl.RAND_egd() 2012-09-11 02:08:48 +02:00
Jesus Cea c8754a13e6 Closes #15793: Stack corruption in ssl.RAND_egd() 2012-09-11 02:00:58 +02:00
Jesus Cea 67bd81b867 MERGE: #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2) 2012-09-10 22:58:35 +02:00
Jesus Cea e8db356cf1 #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete (fix 2) 2012-09-10 22:58:07 +02:00
Jesus Cea 4886d5b338 #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete 2012-09-10 22:50:21 +02:00
Jesus Cea 1f2799bef4 #15676: mmap: add empty file check prior to offset check <- Previous patch was incomplete 2012-09-10 22:49:50 +02:00
Stefan Krah 76e12179c5 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).
2012-09-10 19:34:58 +02:00
Christian Heimes f47d79fec1 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 2012-09-10 17:46:09 +02:00
Christian Heimes 89ff3c7f20 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 2012-09-10 03:50:48 +02:00
Christian Heimes 1b5c76a283 Fixed two memory leaks in make_filename() in zipimport.c. The allocated buffer wasn't cleaned up in two error cases. CID 486832 2012-09-10 02:00:34 +02:00
Christian Heimes 15b6885fe0 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 2012-09-10 01:25:50 +02:00
Jesus Cea 1b3f3b0316 Closes #15676: mmap: add empty file check prior to offset check 2012-09-10 01:23:05 +02:00
Jesus Cea 941bfcc537 Closes #15676: mmap: add empty file check prior to offset check 2012-09-10 00:27:55 +02:00
Stefan Krah ea94ba45fa Merge 3.2. 2012-09-08 11:19:27 +02:00
Stefan Krah 96efdd422c Issue #15868: Fix refleak in bytesio.c (Coverity #715365). 2012-09-08 11:12:33 +02:00
Ross Lagerwall 2dabaf63cf Issue #15876: Fix a refleak in the curses module
The refleak occurred when assigning to window.encoding.
2012-09-07 08:34:23 +02:00
Stefan Krah 527a2400fb _testbuffer.c: In all current use cases of cmp_structure() dest->format and
src->format are either both NULL or both non-NULL. However, it is safer to
generalize the function. Found by Coverity.
2012-09-06 09:42:29 +02:00
Antoine Pitrou 11946fbe80 Issue #15841: The readable(), writable() and seekable() methods of BytesIO
and StringIO objects now raise ValueError when the object has been closed.
Patch by Alessandro Moura.
2012-09-05 20:13:48 +02:00
Antoine Pitrou 1d857453b7 Issue #15841: The readable(), writable() and seekable() methods of BytesIO
and StringIO objects now raise ValueError when the object has been closed.
Patch by Alessandro Moura.
2012-09-05 20:11:49 +02:00
Victor Stinner 9f16e44a47 Close #14223: Fix window.addch(curses.ACS_HLINE)
Fix window.addch() of the curses module for special characters like
curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
to libncursesw.
2012-09-01 15:00:34 +02:00
Victor Stinner 1d39cde50c Issue #15785: Modify window.get_wch() API of the curses module: return a
character for most keys, and an integer for special keys, instead of always
returning an integer. So it is now possible to distinguish special keys like
keypad keys.
2012-08-29 01:40:57 +02:00
Ronald Oussoren cb460b920f Fix issue 13370: Ensure that ctypes works on Mac OS X when Python is
compiled using the clang compiler

(merge from 3.2)
2012-08-25 11:24:00 +02:00
Ronald Oussoren 25437565f9 Fix issue 13370: Ensure that ctypes works on Mac OS X when Python is compiled using the clang compiler 2012-08-25 11:19:14 +02:00
Mark Dickinson fc33d4ce0a Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs. 2012-08-24 18:53:10 +01:00
Ross Lagerwall a4b070102a Merge with 3.2 2012-08-24 13:32:14 +02:00
Ross Lagerwall f2b34b8b96 Issue 15777: Fix a refleak in _posixsubprocess.
It was exposed by 03c98d05b140 and dbbf3ccf72e8.
2012-08-24 13:25:59 +02:00
Stefan Krah 66e63170d9 Issue #15770: Check invalid arguments in test function. Patch by Victor Stinner. 2012-08-23 15:53:45 +02:00
Stefan Krah f21587e3a8 mpd_qpowmod(): calculate result with zero-exponent for compatibility with
decimal.py. The hack to remove the ideal exponent is no longer required.
2012-08-23 15:05:29 +02:00
Stefan Krah 17183a2972 Use zero bottom margin. 2012-08-22 19:28:12 +02:00
Stefan Krah ad5b43995e In the 32-bit build, dec_hash() raised InvalidOperation if the operand
had a coefficient with MAX_PREC=425000000 digits and a negative exponent.
Increasing the context limits above the official values fixes the issue
and is safe (in this case!).
2012-08-22 19:11:50 +02:00
Stefan Krah 2fd502f6a1 1) Use _mpd_basedivmod() regardless of the length of the dividend. This is
required for a corner case in dec_hash() in the following commit and also
   usually faster. dec_hash() needs some extra precision above MPD_MAX_PREC,
   and _mpd_base_ndivmod() is not audited for that.

2) Use _mpd_basemul() if the length of the smaller operand is less than
   or equal to 256. While this is technically an optimization, it is
   required for *testing* corner cases in dec_hash() in reasonable time.
2012-08-22 18:54:37 +02:00
Ronald Oussoren 9bd9cd3fb9 Fix for issue 15716: interpreter could crash when PYTHONEXECUTABLE was set on Mac OS X.
This is due to an off-by-one error: the allocated buffer didn't have room for a NUL
character at the end of the mbstowcs result.

(merge with 3.2)
2012-08-22 14:40:35 +02:00
Ronald Oussoren eb61f8b3a7 Fix for issue 15716: interpreter could crash when PYTHONEXECUTABLE was set on Mac OS X.
This is due to an off-by-one error: the allocated buffer didn't have room for a NUL
character at the end of the mbstowcs result.
2012-08-22 14:24:14 +02:00
Richard Oudkerk 6733927761 Fix typo in error handling for WaitForMultipleObjects() 2012-08-21 14:54:22 +01:00
Stefan Krah c0c03be53e Merge 3.2. 2012-08-20 14:42:59 +02:00
Stefan Krah db579d7b25 Issue #15738: Fix a missing NULL check in subprocess_fork_exec(). 2012-08-20 14:36:47 +02:00
Stefan Krah 000fde9651 Closes #15737: Fix potential NULL dereference in zipimport.c. 2012-08-20 14:14:49 +02:00
Mark Dickinson 35fa864840 Issue #15477: Merge fix from 3.2 2012-08-18 12:26:15 +01:00
Mark Dickinson 05d79e9abf Issue #15477: Add workaround for log1p(-0.0) on platforms where it's broken. 2012-08-18 12:24:30 +01:00
Antoine Pitrou 721738fbee Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:20:39 +02:00
Antoine Pitrou 6f430e4963 Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:18:25 +02:00
Andrew Svetlov c53eb9dfe2 Merge 3.2 to default 2012-08-14 18:42:10 +03:00
Matthias Klose d182a6c77e Modules/socketmodule.c: netdb_lock: define static. 2012-08-14 17:29:04 +02:00
Meador Inge 80dd1af4e0 Issue #15424: Add a __sizeof__ implementation for array objects.
Patch by Ludwig Hähne.
2012-08-10 23:21:39 -05:00
Meador Inge 03b4d5072a Issue #15424: Add a __sizeof__ implementation for array objects.
Patch by Ludwig Hähne.
2012-08-10 22:35:45 -05:00
Victor Stinner 3cc635dabb faulthandler: fix the handler of user signals
Restore the errno before calling the previous signal handler, and not after.
2012-08-09 02:43:41 +02:00
Larry Hastings 22701e86d0 Issue #15589: Ensure double-alignment for brute-force capi argument parser test
that occasionally uses doubles.
2012-08-08 14:52:22 -07:00
Victor Stinner 62bb394729 Close #13072: Restore code before the PEP 393 for the array module
'u' format of the array module uses again Py_UNICODE type for backward
compatibility with Python 3.2.

The only change from Python 3.2 is that PyUnicode_AsUnicode() result is now
checked for NULL value.
2012-08-06 00:46:05 +02:00
Antoine Pitrou 848698727f Issue #12655: Instead of requiring a custom type, os.sched_getaffinity and
os.sched_setaffinity now use regular sets of integers to represent the
CPUs a process is restricted to.
2012-08-04 16:16:35 +02:00
Victor Stinner d1f9352bd4 (Merge 3.2) open() / TextIOWrapper doc: make it explicit than newline='\n'
doesn't translate newlines on output.
2012-08-04 01:22:07 +02:00
Victor Stinner 401e17d0f0 open() / TextIOWrapper doc: make it explicit than newline='\n' doesn't
translate newlines on output.
2012-08-04 01:18:56 +02:00
Antoine Pitrou 3c25dfbf13 Make TextIOWrapper's documentation clearer by copying the newline argument's description from open(). 2012-08-04 00:56:19 +02:00
Antoine Pitrou 0c1c0d42dc Make TextIOWrapper's documentation clearer by copying the newline argument's description from open(). 2012-08-04 00:55:38 +02:00
Jesus Cea 1659b75189 MERGE: Closes #15469: Correct __sizeof__ support for deque 2012-08-03 14:52:12 +02:00
Jesus Cea 16e2fca47e Closes #15469: Correct __sizeof__ support for deque 2012-08-03 14:49:42 +02:00
Jesus Cea 88ca04e6a8 MERGE: Closes #15512: Correct __sizeof__ support for parser 2012-08-03 14:29:26 +02:00
Jesus Cea e9c5318967 Closes #15512: Correct __sizeof__ support for parser 2012-08-03 14:28:37 +02:00