Commit Graph

7826 Commits

Author SHA1 Message Date
Antoine Pitrou 44d5214927 Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. 2013-03-04 20:30:01 +01:00
Gregory P. Smith 255bf5b9ec Issue #16962: Use getdents64 instead of the obsolete getdents syscall in
the subprocess module on Linux.
2013-03-03 10:45:05 -08:00
Victor Stinner 29ec595c6a Issue #17223: array module: Fix a crasher when converting an array containing
invalid characters (outside range [U+0000; U+10ffff]) to Unicode: repr(array),
str(array) and array.tounicode(). Patch written by Manuel Jacob.
2013-02-26 00:27:38 +01:00
R David Murray 9f10f56d13 Merge #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 22:07:55 -05:00
R David Murray 67bfe80758 #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 21:51:05 -05:00
Serhiy Storchaka df4aa642a5 Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
2013-02-18 13:02:41 +02:00
Serhiy Storchaka 59f5dee3d6 Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
2013-02-18 13:01:52 +02:00
Serhiy Storchaka b0c75a7dec Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat.  Patch by Matthew Barnett.
2013-02-16 21:25:05 +02:00
Serhiy Storchaka fa46816915 Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat.  Patch by Matthew Barnett.
2013-02-16 21:23:53 +02:00
Serhiy Storchaka f8def28ff0 Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units. 2013-02-16 17:29:56 +02:00
Serhiy Storchaka a0eb809995 Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
2013-02-16 16:54:33 +02:00
Serhiy Storchaka 70ca0210e8 Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
2013-02-16 16:47:47 +02:00
Richard Oudkerk 6d40134eba Merge 2013-02-13 12:32:32 +00:00
Richard Oudkerk 0d09ba8e0b Issue #16743: Fix mmap overflow check on 32 bit Windows 2013-02-13 12:18:03 +00:00
Serhiy Storchaka e4ad8aacd1 Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-12 09:24:16 +02:00
Serhiy Storchaka 55e2238272 Raise KeyError instead of OverflowError when getpwuid's argument is out of
uid_t range.
2013-02-11 20:32:47 +02:00
Serhiy Storchaka b462189921 Reject float as uid or gid.
A regression was introduced in the commit for issue issue #4591.
2013-02-10 23:28:02 +02:00
Serhiy Storchaka 7cf5599346 Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-10 21:56:49 +02:00
Raymond Hettinger 986bbfc079 Backport deque.rotate() improvements. 2013-02-09 20:00:55 -05:00
Antoine Pitrou c73c561181 Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
2013-02-09 23:14:42 +01:00
Antoine Pitrou 4de7457009 Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
2013-02-09 23:11:27 +01:00
Serhiy Storchaka 8135de80f7 Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
2013-02-09 11:12:36 +02:00
Serhiy Storchaka 01ad622a2c Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
2013-02-09 11:10:53 +02:00
Serhiy Storchaka 2efdc90b0f Issue #17073: Fix some integer overflows in sqlite3 module. 2013-02-07 17:03:46 +02:00
Serhiy Storchaka 3cf96ac248 Issue #17073: Fix some integer overflows in sqlite3 module. 2013-02-07 17:01:47 +02:00
Serhiy Storchaka 36b365ccff Issue #17089: Expat parser now correctly works with string input not only when
an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
strings larger than 2 GiB.
2013-02-04 18:28:01 +02:00
Serhiy Storchaka 43536e9e37 Issue #17089: Expat parser now correctly works with string input not only when
an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
strings larger than 2 GiB.
2013-02-04 18:26:15 +02:00
R David Murray b7be42b1f9 merge #17091: update docstring for _thread.Lock.acquire. 2013-02-04 10:22:39 -05:00
R David Murray 95b7110a11 #17091: update docstring for _thread.Lock.acquire.
The main docs were fixed to remove mention of None long ago,
but the docstring was not.  Reported by Armin Rigo, patch
by Ian Cordasco.
2013-02-04 10:15:58 -05:00
Serhiy Storchaka 1d0bb9c8f9 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:54:04 +02:00
Serhiy Storchaka 19c4e0df29 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:47:24 +02:00
Serhiy Storchaka d03ce4ae3d Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
2013-02-03 17:07:32 +02:00
Serhiy Storchaka 94dc6736bd Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
2013-02-03 17:03:31 +02:00
Nadeem Vawda c27bcbf863 Back out fix for issue #13886; it introduced a new bug in interactive readline use. 2013-02-02 20:25:19 +01:00
Nadeem Vawda 6375257188 Back out fix for issue #13886; it introduced a new bug in interactive readline use. 2013-02-02 20:05:11 +01:00
Gregory P. Smith 90fa9508a6 In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
2013-02-01 17:07:39 -08:00
Gregory P. Smith aded2e5e59 In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
2013-02-01 17:05:29 -08:00
Gregory P. Smith 99ec7f6f3e Additional fix for issue #12268: The io module file object write methods no
longer abort early when a write system call is interrupted (EINTR).
2013-02-01 13:08:23 -08:00
Gregory P. Smith b9817b01ed Additional fix for Issue #12268: The io module file object writelines() methods no longer abort early when one of its write system calls is interrupted (EINTR). 2013-02-01 13:03:39 -08:00
Brett Cannon 0ecd30b4af Issue #17098: Make sure every module has __loader__ defined.
Thanks to Thomas Heller for the bug report.
2013-02-01 14:04:12 -05:00
Nadeem Vawda 60cc32382f Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.
Also fix sporadic failures in test_builtin due to dependence on whether the
readline module has previously been imported.
2013-01-27 14:13:25 +01:00
Nadeem Vawda 6f02ea02c8 Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.
Also fix sporadic failures in test_builtin due to dependence on whether the
readline module has previously been imported.
2013-01-27 14:01:42 +01:00
Ezio Melotti 3f5db3940f Fix a few typos and a double semicolon. Patch by Eitan Adler. 2013-01-27 06:20:14 +02:00
Ronald Oussoren 1c90eed8a9 Issue #1602133: 'environ' is not really available with shared libraries on OSX (merge from 3.2)
There already was a workaround for this for framework builds on OSX,
this changeset enables the same workaround for shared libraries.

Closes #1602133
2013-01-25 18:01:05 +01:00
Ronald Oussoren 697e56d0f5 Issue #1602133: 'environ' is not really available with shared libraries on OSX
There already was a workaround for this for framework builds on OSX,
this changeset enables the same workaround for shared libraries.

Closes #1602133
2013-01-25 17:57:13 +01:00
Serhiy Storchaka d269b5e73d Clean trailing whitespace in itertoolsmodule.c. 2013-01-25 13:38:56 +02:00
Serhiy Storchaka e7e9c32195 Clean trailing whitespace in itertoolsmodule.c. 2013-01-25 13:37:39 +02:00
Serhiy Storchaka 339e91d4cb Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
2013-01-25 13:24:47 +02:00
Serhiy Storchaka a3e9128aba Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
2013-01-25 13:19:31 +02:00
Stefan Krah eb8c451bd2 Since the return type of format() is not a Decimal, raise ValueError instead of
InvalidOperation if the format specification (width, prec) exceeds the internal
limits of libmpdec.
2013-01-24 15:22:33 +01:00
Charles-François Natali 986a56cefe Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
Patch by Jeffrey Armstrong.
2013-01-19 12:19:10 +01:00
Serhiy Storchaka 441d30fac7 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:26:26 +02:00
Charles-François Natali 95195b35b8 Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
Patch by Jeffrey Armstrong.
2013-01-19 12:21:26 +01:00
Serhiy Storchaka 9101e23ff6 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:41:45 +02:00
Raymond Hettinger bd8f29028e Show the function signature in the docstring 2013-01-18 17:35:25 -08:00
Benjamin Peterson c68a4a048c check windows fd validity (closes #16992) 2013-01-18 00:10:24 -05:00
Stefan Krah 897c3e994f Issue #11729: Backport commit bff052d9 from libffi upstream in order to fix
a ctypes build failure with clang.
2013-01-16 23:18:34 +01:00
Stefan Krah 752bfb71d8 Remove trailing whitespace. 2013-01-16 15:16:10 +01:00
Stefan Krah 59a4a93f43 Issue #16422: Use strings for rounding mode constants for better readability
and pickling compatibility.
2013-01-16 12:58:59 +01:00
Richard Oudkerk ad1d5f908a Issue #10527: Use poll() instead of select() for multiprocessing pipes 2013-01-15 01:01:01 +00:00
Eli Bendersky 25771b3749 Issue #16922: fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
2013-01-13 05:26:07 -08:00
Eli Bendersky b09b167419 Issue #16922: fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
2013-01-13 05:22:05 -08:00
Eli Bendersky 4583990143 Clean trailing whitespace in _elementtree.c 2013-01-13 05:14:47 -08:00
Benjamin Peterson 0e5c48a917 make deque_clear void, since it's infallible 2013-01-12 21:22:18 -05:00
Antoine Pitrou 457a2292ca SSLContext.load_dh_params() now properly closes the input file. 2013-01-12 21:43:45 +01:00
Eli Bendersky 799e3edaf7 Issue #16076: check for return value of PyTuple_New for args (following
Coverity report) and cleanup code.
2013-01-12 05:42:38 -08:00
Eli Bendersky b8f6dc855c Issue #16076: fix refleak in pickling of Element.
Thanks to Ezio Melotti and Daniel Shahaf for the patch.
2013-01-12 05:20:16 -08:00
Eli Bendersky e6174ca85e Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
2013-01-10 06:27:53 -08:00
Eli Bendersky 698bdb2a6c Issue #16076: make _elementtree.Element pickle-able in a way that is compatible
with the Python version of the class.

Patch by Daniel Shahaf.
2013-01-10 06:01:06 -08:00
Serhiy Storchaka a2ad5c3ad1 Issue #15972: Fix error messages when os functions expecting a file name or
file descriptor receive the incorrect type.
2013-01-07 23:13:46 +02:00
Eli Bendersky a873690d2c The get() and iter() are now able to accept keyword arguments.
In conformance with the documentation and the Python version.
Patch by Franck Michea.
2013-01-05 06:26:39 -08:00
Christian Heimes f402e922f3 Issue #16847: Fixed improper use of _PyUnicode_CheckConsistency() in
non-pydebug builds. Several extension modules now compile cleanly when
assert()s are enabled in standard builds (-DDEBUG flag).
2013-01-03 09:21:55 +01:00
Victor Stinner 6f84659e5e (Merge 3.2) Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB. 2013-01-03 03:37:47 +01:00
Victor Stinner c44057dfbd Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB 2013-01-03 03:33:21 +01:00
Nadeem Vawda 57cb81d161 Issue #16828: Fix error incorrectly raised by bz2.compress('').
Initial patch by Martin Packman.
2013-01-02 23:05:56 +01:00
Nadeem Vawda 638fb9bbed Issue #16828: Fix error incorrectly raised by bz2.compress('').
Patch by Martin Packman.
2013-01-02 23:02:00 +01:00
Victor Stinner e4110dc11f Issue #9644: Fix the encoding used by os.statvfs(): use the filesystem encoding
with the surrogateescape error handler, instead of UTF-8 in strict mode.
2013-01-01 23:05:55 +01:00
Richard Oudkerk 9b4599322d Issue #9586: Merge 2013-01-01 17:36:53 +00:00
Richard Oudkerk 9866231eab Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy. 2013-01-01 17:29:44 +00:00
Eli Bendersky b829dea0cd Make indentation consistent 2013-01-01 07:41:51 -08:00
Eli Bendersky 03ab4d3581 Make indentation consistent and remove dead commented-out code. 2012-12-31 15:34:20 -08:00
Serhiy Storchaka c1b59d4552 Issue #16688: Fix backreferences did make case-insensitive regex fail on non-ASCII strings.
Patch by Matthew Barnett.
2012-12-29 23:38:48 +02:00
Andrew Svetlov 41dc9f3cd1 rename MathcObject to match object in doctrings for re module (#16760) 2012-12-25 18:49:08 +02:00
Andrew Svetlov 0b64c1415e rename MathcObject to match object in doctrings for re module (#16760) 2012-12-25 18:48:54 +02:00
Andrew Svetlov 70dcef4789 Issue #16443: Add docstrings to regular expression match objects.
Patch by Anton Kasyanov.
2012-12-23 19:59:27 +02:00
Andrew Svetlov 56ad5ed5ad Issue #16443: Add docstrings to regular expression match objects.
Patch by Anton Kasyanov.
2012-12-23 19:23:07 +02:00
Stefan Krah e3dff55a5e Issue #16753: Define __GNUC_STDC_INLINE__ to an integer (same as gcc). 2012-12-23 15:42:21 +01:00
Stefan Krah f03eee12b4 Issue #16745: The gcc visibility pragma is buggy on OpenIndiana and NetBSD. 2012-12-22 23:05:51 +01:00
Stefan Krah 66a6f3fa81 Fix Visual Studio build. 2012-12-22 14:46:44 +01:00
Stefan Krah fdf1a34ba1 Issue #16745: Hide symbols in _decimal.so. 2012-12-22 14:18:35 +01:00
Stefan Krah fb7f580e81 Issue #16745: Hide a couple of symbols by making them local. 2012-12-21 23:11:05 +01:00
Kristjan Valur Jonsson c51bafbbda Merge with 3.2 : Don't DECREF the ctypes error_object without the GIL held. 2012-12-21 11:22:29 +00:00
Kristjan Valur Jonsson 3cbdaa3fee Merge with 3.1 : Don't DECREF the ctypes error_object without the GIL held. 2012-12-21 11:20:53 +00:00
Kristjan Valur Jonsson 9946bd69fa Don't DECREF the ctypes error_object without the GIL held. 2012-12-21 09:41:25 +00:00
Benjamin Peterson 68623614f0 call close on the underlying stream even if flush raises (closes #16597)
Patch by Serhiy Storchaka.
2012-12-20 11:53:11 -06:00
Andrew Svetlov 5b89840d9c Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:26:36 +02:00
Andrew Svetlov 737fb89dd1 Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
2012-12-18 21:14:22 +02:00
Stefan Krah 9a4ff437d1 Issue #15783: Support None default values in the Context() constructor. 2012-12-16 21:10:35 +01:00
Stefan Krah 040e311826 Issue #15783: Except for the number methods, the C version of decimal now
supports all None default values present in decimal.py. These values were
largely undocumented.
2012-12-15 22:33:33 +01:00
Benjamin Peterson 18d105b824 merge 3.2 2012-12-15 15:44:08 -05:00
Benjamin Peterson 7eb8a1a0cb remove dead code 2012-12-15 15:43:58 -05:00
Ezio Melotti 11def426c0 #16681: merge with 3.2. 2012-12-14 20:13:39 +02:00
Ezio Melotti e3d7e54b11 #16681: use "bidirectional class" instead of "bidirectional category" in the docstring too. 2012-12-14 20:12:25 +02:00
Gregory P. Smith 08d5ca6cd4 Code style fixup: No need for double ((parenthesis)) and use {} on an if else. 2012-12-10 20:22:31 -08:00
Gregory P. Smith 9504b13145 Code style fixup: No need for double ((parenthesis)) and use {} on an if else. 2012-12-10 20:20:20 -08:00
Gregory P. Smith c0dd80e439 1 << 31 is invalid for signed integers, fix it by making 1 unsigned.
Found by Clang trunk's Undefined-Behavior Sanitizer.  [more to come]
2012-12-10 17:45:03 -08:00
Gregory P. Smith 90555d0f0d 1 << 31 is invalid for signed integers, fix it by making 1 unsigned.
Found by Clang trunk's Undefined-Behavior Sanitizer.  [more to come]
2012-12-10 17:44:44 -08:00
Antoine Pitrou 12f33df4a2 Issue #16628: Fix a memory leak in ctypes.resize(). 2012-12-08 11:07:16 +01:00
Antoine Pitrou 305e1a749f Issue #16628: Fix a memory leak in ctypes.resize(). 2012-12-08 11:05:50 +01:00
Victor Stinner 2660e427d1 (Merge 3.2) Issue #16416: On Mac OS X, operating system data are now always
encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
(which may be ASCII if no locale environment variable is set), to avoid
inconsistencies with os.fsencode() and os.fsdecode() functions which are
already using UTF-8/surrogateescape.
2012-12-03 12:48:53 +01:00
Victor Stinner 27b1ca29cc Issue #16416: On Mac OS X, operating system data are now always
encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding
(which may be ASCII if no locale environment variable is set), to avoid
inconsistencies with os.fsencode() and os.fsdecode() functions which are
already using UTF-8/surrogateescape.
2012-12-03 12:47:59 +01:00
Benjamin Peterson 47a00f3d1a support encoding error handlers that return bytes (closes #16585) 2012-12-02 11:20:28 -05:00
Benjamin Peterson aff472394c unicode -> str 2012-12-02 10:53:41 -05:00
Antoine Pitrou 9a2b26748b Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
Patch by Serhiy Storchaka.
2012-12-02 12:54:28 +01:00
Antoine Pitrou 43fb54cd4f Issue #10182: The re module doesn't truncate indices to 32 bits anymore.
Patch by Serhiy Storchaka.
2012-12-02 12:52:36 +01:00
Gregory P. Smith 14b04cd350 Plug a leak in timemodule. The module dictionary is saved during
initialization. If the interpreter is shut down and reinitialized (embedded
CPython), the old module dictionary was not dec-refed during the next import of
the time extension module.

Contributed by Torsten Marek of Google.
2012-11-27 10:16:55 -08:00
Antoine Pitrou 9982c53c2f Issue #12848: The pure Python pickle implementation now treats object lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
2012-11-24 20:41:34 +01:00
Antoine Pitrou bf6ecf92fa Issue #12848: The pure Python pickle implementation now treats object lengths as unsigned 32-bit integers, like the C implementation does.
Patch by Serhiy Storchaka.
2012-11-24 20:40:21 +01:00
Ezio Melotti 8a6d1fed41 #16306: merge with 3.2. 2012-11-23 18:52:39 +02:00
Ezio Melotti a0dd22e5e8 #16306: report only the first unknown option and add more tests. Patch by Serhiy Storchaka. 2012-11-23 18:48:32 +02:00
Antoine Pitrou 39bdad813a Issue #1160: Fix compiling large regular expressions on UCS2 builds.
Patch by Serhiy Storchaka.
2012-11-20 22:30:42 +01:00
Nadeem Vawda 6ff262e18f Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean 'no compression'.
Patch by Brian Brazil.
2012-11-11 14:14:47 +01:00
Nadeem Vawda 19e568d254 Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean 'no compression'.
Patch by Brian Brazil.
2012-11-11 14:04:14 +01:00
Gregory P. Smith 34b14951ee Fixes issue #9535: Fix pending signals that have been received but not
yet handled by Python to not persist after os.fork() in the child process.
2012-11-10 20:33:39 -08:00
Gregory P. Smith 9463e3ac8b Fixes issue #9535: Fix pending signals that have been received but not
yet handled by Python to not persist after os.fork() in the child process.
2012-11-10 20:33:07 -08:00
Nadeem Vawda ec6dfcffa0 Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access previously-freed memory.
Patch by Serhiy Storchaka.
2012-11-11 03:16:44 +01:00
Nadeem Vawda 7ee955550b Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access previously-freed memory.
Patch by Serhiy Storchaka.
2012-11-11 03:15:32 +01:00
Nadeem Vawda dd1253abdd Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).

Patch by Serhiy Storchaka.
2012-11-11 02:21:22 +01:00
Nadeem Vawda ee7889dec3 Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush().
Additionally, fix a bug where a MemoryError in allocating a bytes object could
leave the decompressor object in an invalid state (with its unconsumed_tail
member being NULL).

Patch by Serhiy Storchaka.
2012-11-11 02:14:36 +01:00
Stefan Krah 6e467049c6 Accept Unicode legacy strings in the Decimal constructor. 2012-11-10 23:09:04 +01:00
Stefan Krah 0f82b76b57 Issue #16431: Finally, consider all permutations. 2012-11-08 11:17:29 +01:00
Stefan Krah ed16eff57e Issue #16431: Also fix the opposite direction. 2012-11-07 23:47:19 +01:00
Stefan Krah f4abc7b8a0 Issue #16431: Use the type information when constructing a Decimal subtype
from a Decimal argument.
2012-11-07 23:12:25 +01:00
Nadeem Vawda 519f43844b Issue #16350: Fix zlib decompressor handling of unused_data with multiple calls to decompress() after EOF.
Patch by Serhiy Storchaka.
2012-11-05 00:38:48 +01:00
Nadeem Vawda 39079946a2 Issue #16350: Fix zlib decompressor handling of unused_data with multiple calls to decompress() after EOF.
Patch by Serhiy Storchaka.
2012-11-05 00:37:42 +01:00
Stefan Krah e6996ed5d9 Issue #16145: Support legacy strings in the _csv module. 2012-11-02 14:44:20 +01:00
Antoine Pitrou 0168d3d9b1 Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
2012-11-01 20:15:23 +01:00
Antoine Pitrou e4ad37e50e Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
2012-11-01 20:13:54 +01:00
Antoine Pitrou 5ebe65f8cb Issue #16228: Fix a crash in the json module where a list changes size while it is being encoded.
Patch by Serhiy Storchaka.
2012-11-01 19:59:21 +01:00
Antoine Pitrou 9f69e79c45 Issue #16228: Fix a crash in the json module where a list changes size while it is being encoded.
Patch by Serhiy Storchaka.
2012-11-01 19:52:06 +01:00
Andrew Svetlov 796c443f3d Merge: fix docstring for deque ctor to mark iterable parameter optional 2012-10-31 11:51:13 +02:00
Andrew Svetlov 6a5c7c341a Fix docstring for deque ctor to mark iterable parameter optional 2012-10-31 11:50:40 +02:00
Benjamin Peterson e8ea97fffb merge 3.2 (#16369) 2012-10-30 23:27:52 -04:00
Benjamin Peterson c43112823b initialize more global type objects (closes #16369) 2012-10-30 23:21:10 -04:00
Petri Lehtinen 4648b4779a #14897: Enhance error messages of struct.pack and struct.pack_into
Patch by Matti Mäki.
2012-10-29 21:25:01 +02:00
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
Jesus Cea 5323173dee Closes #15514: Correct __sizeof__ support for cpu_set 2012-08-03 14:18:11 +02:00
Antoine Pitrou 77821b68a7 Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation code.
Patch by Philipp Hagemeister.
2012-08-02 20:39:10 +02:00
Antoine Pitrou a9a53c7dc0 Issue #15538: Fix compilation of the getnameinfo() / getaddrinfo() emulation code.
Patch by Philipp Hagemeister.
2012-08-02 20:37:12 +02:00
Victor Stinner 98a387b65f Fix the user signal handler of faulthandler
Don't exit the tstate is NULL to restore the errno and chain the signal handler
if needed.
2012-08-01 19:36:36 +02:00
Antoine Pitrou 57911f6c1a Issue #15489: Add a __sizeof__ implementation for BytesIO objects.
Patch by Serhiy Storchaka.
2012-07-30 00:01:44 +02:00