Commit Graph

2263 Commits

Author SHA1 Message Date
Neal Norwitz
c2b4acf494 Backport: SF bug #1331563 ] string_subscript doesn't check for failed PyMem_Malloc. 2005-10-20 04:16:45 +00:00
Guido van Rossum
b693c1cea0 - On 64-bit platforms, when __len__() returns a value that cannot be
represented as a C int, raise OverflowError.
(Will forward-port.)
2005-09-20 16:36:07 +00:00
Georg Brandl
39871c8927 backport patch [ 1118729 ] Error in representation of complex numbers(again) 2005-09-16 06:42:32 +00:00
Walter Dörwald
fd8e0170e2 Backport checkin:
SF bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error handlers.
(This is a variant of the patch by Nik Haldimann that detects truncated data)
2005-08-30 10:46:06 +00:00
Georg Brandl
66e75ac6e0 Disallow keyword arguments for type constructors that don't use them
(fixes #1119418).
2005-08-26 06:43:16 +00:00
Raymond Hettinger
9314d3261d SF bug #1242657: list(obj) can swallow KeyboardInterrupt
Fix over-aggressive PyErr_Clear().  The same code fragment appears in
various guises in list.extend(), map(), filter(), zip(), and internally
in PySequence_Tuple().
2005-08-21 11:09:58 +00:00
Raymond Hettinger
ab294199b7 Teach set modules to correctly compute s-=s and s^=s as the empty set. 2005-08-13 02:28:54 +00:00
Raymond Hettinger
787b4c5fea * SF bug #1257731: Fix logic in set.__contains__(), set.remove(),
and set.discard for handling keys that both inherite from set and
  define their own __hash__() function.

* Fixed O(n) performance issue with set.pop() which should have been
  an O(1) process.
2005-08-12 23:47:50 +00:00
Georg Brandl
7f94414485 backporting fix by tim_one:
"""
SF bug #1238681:  freed pointer is used in longobject.c:long_pow().

In addition, long_pow() skipped a necessary (albeit extremely unlikely
to trigger) error check when converting an int modulus to long.

Alas, I was unable to write a test case that crashed due to either
cause.
"""
2005-07-18 07:24:37 +00:00
Georg Brandl
b3d587184c Backport:
SF bug 1185883:  PyObject_Realloc can't safely take over a block currently
managed by C, because it's possible for the block to be smaller than the
new requested size, and at the end of allocated VM.  Trying to copy over
nbytes bytes to a Python small-object block can segfault then, and there's
no portable way to avoid this (we would have to know how many bytes
starting at p are addressable, and std C has no means to determine that).
2005-07-11 05:57:11 +00:00
Raymond Hettinger
8f7dce605f SF patch #1200018: Restore GC support to set objects
Reverts 1.26 and 1.27.
And adds cycle testing.
2005-06-19 05:53:15 +00:00
Anthony Baxter
d855c5888e fix int.__divmod__.__doc__ 2005-06-03 14:13:47 +00:00
Raymond Hettinger
9e4b2e7817 SF bug #1183742: PyDict_Copy() can return non-NULL value on error 2005-04-15 16:07:09 +00:00
Michael W. Hudson
21f898741e Backport:
Fix for rather inaccurately titled bug

[ 1165306 ] Property access with decorator makes interpreter crash

Don't allow the creation of unbound methods with NULL im_class, because
attempting to call such crashes.

Backport candidate.
2005-03-31 10:22:43 +00:00
Raymond Hettinger
4cf27049b6 SF bug #1770766: weakref proxy has incorrect __nonzero__ behavior. 2005-03-31 04:07:55 +00:00
Raymond Hettinger
ace3f61994 Convert "__init__ should return None" from an exception to a warning. 2005-03-04 04:47:04 +00:00
Raymond Hettinger
2a06df6258 SF bug #1155938: Missing None check for __init__(). 2005-03-03 16:55:53 +00:00
Martin v. Löwis
77c8402c97 Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly.
2005-03-03 12:26:20 +00:00
Michael W. Hudson
8ed7e2e2db Backport: Fix
[ 1124295 ] Function's __name__ no longer accessible in restricted mode

which I introduced with a bit of mindless copy-paste when making
__name__ writable.  You can't assign to __name__ in restricted mode,
which I'm going to pretend was intentional :)
2005-02-17 10:43:12 +00:00
Raymond Hettinger
738a70a8d9 Bug #1079011: Incorrect error message (somewhat) 2004-12-19 20:47:25 +00:00
Raymond Hettinger
fe09fa2ff1 Backport fixes for bugs #1086555 and #1085744. 2004-12-17 14:44:45 +00:00
Marc-André Lemburg
a9cadcd41b Correct the handling of 0-termination of PyUnicode_AsWideChar()
and its usage in PyLocale_strcoll().

Clarify the documentation on this.

Thanks to Andreas Degert for pointing this out.
2004-11-22 13:02:31 +00:00
Raymond Hettinger
15056a5202 SF 1062353: set pickling problems
Support automatic pickling of dictionaries in instance of set subclasses.
2004-11-09 07:25:31 +00:00
Peter Astrand
f8e74b12b0 If close() fails in file_dealloc, then print an error message to
stderr. close() can fail if the user is out-of-quota, for example.
Fixes #959379.
2004-11-07 14:15:28 +00:00
Tim Peters
ead8b7ab30 SF 1055820: weakref callback vs gc vs threads
In cyclic gc, clear weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.

This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced.  I'll backport to 2.3.
2004-10-30 23:09:22 +00:00