Commit Graph

3247 Commits

Author SHA1 Message Date
Antoine Pitrou bb445a1f22 Issue #5677: Explicitly forbid write operations on read-only file objects,
and read operations on write-only file objects.  On Windows, the system C
library would return a bogus result; on Solaris, it was possible to crash
the interpreter.  Patch by Stefan Krah.
2010-02-05 17:05:54 +00:00
Antoine Pitrou 526e421b12 Issue #7385: Fix a crash in `MemoryView_FromObject` when
`PyObject_GetBuffer` fails.  Patch by Florent Xicluna.
2010-02-02 22:36:17 +00:00
Mark Dickinson a36507c64c Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow.  Patch by Case Van
Horsen.
2010-01-30 10:08:33 +00:00
Mark Dickinson 36ecd676ea Issue #7788: Fix a crash produced by deleting a list slice with huge
step value.  Patch by Marcin Bachry.
2010-01-29 17:11:39 +00:00
Ezio Melotti 1fafaab5e5 #7775: fixed docstring for rpartition 2010-01-25 11:24:37 +00:00
Antoine Pitrou e80a6a4ead Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
could crash in many places because of the PyByteArray_AS_STRING() macro
returning NULL.  The macro now returns a statically allocated empty
string instead.
2010-01-17 12:26:20 +00:00
Georg Brandl aee900338e Add note about usage of STRINGLIB_EMPTY. 2010-01-17 12:14:42 +00:00
Ezio Melotti d234208588 Fixed typo 2010-01-14 11:34:10 +00:00
Antoine Pitrou 10042922d9 Sanitize bloom filter macros 2010-01-13 14:01:26 +00:00
Antoine Pitrou a913a20c91 Test commit to try to diagnose failures of the IA-64 buildbot 2010-01-13 13:43:37 +00:00
Antoine Pitrou 5c767c2f87 Fix Windows build (re r77461) 2010-01-13 08:55:20 +00:00
Antoine Pitrou 6467213bfd Issue #7622: Improve the split(), rsplit(), splitlines() and replace()
methods of bytes, bytearray and unicode objects by using a common
implementation based on stringlib's fast search.  Patch by Florent Xicluna.
2010-01-13 07:55:48 +00:00
Alexandre Vassalotti 58a96efde5 Fixed repr of dictionary views. 2010-01-12 01:34:43 +00:00
Alexandre Vassalotti 69eb51697c Issue #1967: Backport dictionary views. 2010-01-11 23:17:10 +00:00
Benjamin Peterson 3694366af5 factor out __complex__ lookup code to fix another case 2010-01-04 01:00:47 +00:00
Benjamin Peterson ecdae19fbe do correct lookup of the __complex__ method 2010-01-04 00:43:01 +00:00
Antoine Pitrou 5b7139aab4 Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
`rindex`, `rsplit` and `rpartition` methods.  Patch by Florent Xicluna.
2010-01-02 21:12:58 +00:00
Mark Dickinson d3e323215c Refactor some longobject internals: PyLong_AsDouble and _PyLong_AsScaledDouble
(the latter renamed to _PyLong_Frexp) now use the same core code.  The
exponent produced by _PyLong_Frexp now has type Py_ssize_t instead of the
previously used int, and no longer needs scaling by PyLong_SHIFT.  This
frees the math module from having to know anything about the PyLong
implementation.  This closes issue #5576.
2010-01-02 14:45:40 +00:00
Mark Dickinson 99d652ef66 Issue #7534: Fix handling of nans, infinities, and negative zero in **
operator, on IEEE 754 platforms.  Thanks Marcos Donolo for original patch.
2009-12-30 12:12:23 +00:00
Mark Dickinson 4657283647 Issue #1811: Improve accuracy and consistency of true division for integers. 2009-12-27 14:55:57 +00:00
Ezio Melotti f84caf4eda #6108: unicode(exception) and str(exception) should return the same message 2009-12-24 22:25:17 +00:00
Mark Dickinson e31d300664 Issue #7528: Backport PyLong_AsLongAndOverflow from py3k to trunk.
Thanks Case Van Horsen for the patch.
2009-12-21 11:21:25 +00:00
Benjamin Peterson 0c0dcaf272 remove type_compare, since type_richcompare does the same trick 2009-12-16 03:36:22 +00:00
R. David Murray 0a0a1a842c Issue #1680159: unicode coercion during an 'in' operation was masking
any errors that might occur during coercion of the left operand and
turning them into a TypeError with a message text that was confusing in
the given context.  This patch lets any errors through, as was already
done during coercion of the right hand side.
2009-12-14 16:28:26 +00:00
Benjamin Peterson 4895af4ef1 fix the ignoring of __cmp__ method on metaclasses #7491 2009-12-13 16:36:53 +00:00
Antoine Pitrou c169c781a8 Issue #7466: segmentation fault when the garbage collector is called
in the middle of populating a tuple.  Patch by Florent Xicluna.

(note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1)
2009-12-12 19:13:08 +00:00
Benjamin Peterson 5fb877027b substitute PyDict_Check() for PyObject_IsInstance 2009-12-10 03:37:59 +00:00
Mark Dickinson 1691025ff2 Avoid undefined behaviour due to overflow in i_divmod (Objects/intobject.c). 2009-12-04 11:24:38 +00:00
Benjamin Peterson 91c12ebc3d disable pymalloc tricks with the --with-valgrind option #2422
Patch from James Henstridge.
2009-12-03 02:52:39 +00:00
Mark Dickinson 34398184eb Issue #7406: Fix some occurrences of potential signed overflow in int
arithmetic.
2009-12-02 17:33:41 +00:00
Eric Smith c4ab8339e9 Issue #3382: Make '%F' and float.__format__('F') convert results to upper case. Much of the patch came from Mark Dickinson. 2009-11-29 17:40:57 +00:00
Mark Dickinson 31f0cfef0e Include ieeefp.h (when available) in pyport.h instead of individually in
Objects/floatobject.c and Objects/complexobject.c.  This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
2009-11-28 12:30:36 +00:00
Mark Dickinson 9dd5e16c5d Issue #7117, continued: Remove substitution of %g-style formatting for
%f-style formatting, which used to occur at high precision.  Float formatting
should now be consistent between 2.7 and 3.1.
2009-11-23 20:54:09 +00:00
Mark Dickinson 18cfada1ea Remove restriction on precision when formatting floats. This is the
first step towards removing the %f -> %g switch (see issues 7117,
5859).
2009-11-23 18:46:41 +00:00
Benjamin Peterson dc3c239b1e #5037 proxy __unicode__ correctly 2009-11-19 03:00:02 +00:00
Raymond Hettinger 79628d311f Issue 7263: Fix set.intersection() docstring. 2009-11-18 20:28:22 +00:00
Mark Dickinson bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00
Mark Dickinson 3d6790e49f Silence another MSVC warning about unary minus. 2009-11-16 19:17:16 +00:00
Mark Dickinson b2c3ca1e38 Silence MSVC warning about unary minus applied to unsigned type. 2009-11-16 17:33:25 +00:00
Mark Dickinson 82864d1ab1 Issue #7228: Add '%lld' and '%llu' support to PyFormat_FromString,
PyFormat_FromStringV and PyErr_Format.
2009-11-15 16:18:58 +00:00
Mark Dickinson 009ae861f2 Avoid signed overflow in some xrange calculations, and extend
xrange tests to cover some special cases that caused problems
in py3k.  This is a partial backport of r76292-76293 (see
issue #7298.)
2009-11-15 12:31:13 +00:00
Benjamin Peterson c45a0cfb5f grant list.index() a more informative error message #7252 2009-11-02 16:14:19 +00:00
Benjamin Peterson e2caf1f60e prevent a rather unlikely segfault 2009-11-02 15:06:45 +00:00
Mark Dickinson c04c7c5b72 Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
complexobject.c.  Also remove length restriction on unicode inputs to
the complex constructor.
2009-10-26 22:28:14 +00:00
Mark Dickinson 8568b19850 Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
floatobject.c.  Also, remove limitation on length of unicode inputs to
float().
2009-10-26 21:11:20 +00:00
Eric Smith c1bdf89145 Finished removing _PyOS_double_to_string, as mentioned in issue 7117. 2009-10-26 17:46:17 +00:00
Eric Smith cfaf79c56e Start to remove _PyOS_double_to_string, as mentioned in issue 7117. 2009-10-26 14:48:55 +00:00
Mark Dickinson 8d87dc0c29 Issue #1087418: Small performance boost for bitwise operations on longs.
Initial patch by Gregory Smith;  some tweaks added.
2009-10-25 20:39:06 +00:00
Eric Smith 8c3fb39440 Removed unused function PyFloat_AsStringEx. It is unused in floatobject.c, and it's not declared in any .h file. 2009-10-24 19:50:44 +00:00
Benjamin Peterson 97a57ec048 rewrite for style, clarify, and comments
Also, use the hasattr() like scheme of allowing BaseException exceptions through.
2009-10-22 02:50:38 +00:00