Commit Graph

450 Commits

Author SHA1 Message Date
Christian Heimes
e81dc296f2 Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_name returns NULL. CID 715371 2012-09-10 16:57:36 +02:00
Christian Heimes
a0e7e41cba Fixed possible reference leak to mod when type_name() returns NULL 2012-09-10 03:00:14 +02:00
Antoine Pitrou
56cd62c04a Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.

Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
2012-09-06 00:59:49 +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
Antoine Pitrou
99cc629969 Issue #15142: Fix reference leak when deallocating instances of types created using PyType_FromSpec(). 2012-06-23 14:42:38 +02:00
Antoine Pitrou
a1433fed8e Remove tab characters 2012-05-14 14:43:25 +02:00
Antoine Pitrou
682d94c11a Use size_t, not ssize_t (issue #14801). 2012-05-14 14:43:03 +02:00
Benjamin Peterson
89a6e9a27b fix possible refleak (closes #14752) 2012-05-08 09:22:24 -04:00
Benjamin Peterson
7b1668735a don't use a slot wrapper from a different special method (closes #14658)
This also alters the fix to #11603. Specifically, setting __repr__ to
object.__str__ now raises a recursion RuntimeError when str() or repr() is
called instead of silently bypassing the recursion. I believe this behavior is
more correct.
2012-04-24 11:06:25 -04:00
Benjamin Peterson
b6af60c2a9 adjust formatting 2012-04-01 18:49:54 -04:00
Benjamin Peterson
3471bb67e7 remove extraneous condition 2012-04-01 18:48:40 -04:00
Benjamin Peterson
ab3c1c1994 be consistent with rest of function 2012-04-01 18:48:02 -04:00
Benjamin Peterson
16d84ac355 check to make sure the attribute is a string (#14334) 2012-03-16 09:32:59 -05:00
Benjamin Peterson
52c424343d allow cycles throught the __dict__ slot to be cleared (closes #1469629)
Patch from Armin, test from me.
2012-03-07 18:41:11 -06:00
Benjamin Peterson
2652d2570e ready types returned from PyType_FromSpec 2012-01-29 20:16:37 -05:00
Benjamin Peterson
e28108cbd7 adjust declaration 2012-01-29 20:13:18 -05:00
Antoine Pitrou
2e872082f6 Fix the fix for issue #12149: it was incorrect, although it had the side
effect of appearing to resolve the issue.  Thanks to Mark Shannon for
noticing.
2011-12-15 14:15:31 +01:00
Eli Bendersky
d3baae73be Issue #13161: fix doc strings of __i*__ operators 2011-11-11 16:57:05 +02:00
Nick Coghlan
de31b191e5 Issue 1294232: Fix errors in metaclass calculation affecting some cases of metaclass inheritance. Patch by Daniel Urban. 2011-10-23 22:04:16 +10:00
Benjamin Peterson
ae13c88d8d fix possible refleaks 2011-08-16 22:26:48 -05:00
Antoine Pitrou
ff35050493 Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:17:14 +02:00
Antoine Pitrou
8cdc40e3b0 Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:15:07 +02:00
Antoine Pitrou
84f1b1718d Issue #12149: Update the method cache after a type's dictionnary gets
cleared by the garbage collector.  This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase).

Diagnosis and patch by Davide Rizzo.
2011-07-12 21:57:15 +02:00
Benjamin Peterson
17658a1ca0 merge 3.1 2011-05-24 12:44:26 -05:00
Benjamin Peterson
fbe56bb8bd use '->' to indicate return values 2011-05-24 12:42:51 -05:00
Ezio Melotti
3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti
13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
Martin v. Löwis
7be5b78b4f Merged revisions 88456 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88456 | martin.v.loewis | 2011-02-21 17:24:00 +0100 (Mo, 21 Feb 2011) | 2 lines

  - Check for NULL result in PyType_FromSpec.
........
2011-02-21 16:26:47 +00:00
Georg Brandl
032400b2d8 #11249: in PyType_FromSpec, copy tp_doc slot since it usually will point to a static string literal which should not be deallocated together with the type. 2011-02-19 21:47:02 +00:00
Martin v. Löwis
738236dbd6 Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
2011-02-05 20:35:29 +00:00
Benjamin Peterson
32a8fe8b56 Merged revisions 88069 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88069 | benjamin.peterson | 2011-01-17 13:54:55 -0600 (Mon, 17 Jan 2011) | 1 line

  remove unneeded assertion
........
2011-01-17 20:03:01 +00:00
Benjamin Peterson
37b9e46a04 remove unneeded assertion 2011-01-17 19:54:55 +00:00
Benjamin Peterson
d82f45b720 Merged revisions 88066 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88066 | benjamin.peterson | 2011-01-17 13:44:46 -0600 (Mon, 17 Jan 2011) | 1 line

  correct assertion
........
2011-01-17 19:46:48 +00:00
Benjamin Peterson
0dd5ca0882 correct assertion 2011-01-17 19:44:46 +00:00
Benjamin Peterson
acd17591f5 Merged revisions 88063 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88063 | benjamin.peterson | 2011-01-17 13:24:34 -0600 (Mon, 17 Jan 2011) | 4 lines

  turn some checks into assertions, since they are implied by the caller

  Reviewed by Georg.
........
2011-01-17 19:36:44 +00:00
Benjamin Peterson
67641d25d4 turn some checks into assertions, since they are implied by the caller
Reviewed by Georg.
2011-01-17 19:24:34 +00:00
Benjamin Peterson
a53d2acb3d Merged revisions 87960 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87960 | benjamin.peterson | 2011-01-12 12:56:07 -0600 (Wed, 12 Jan 2011) | 1 line

  use PyErr_SetString instead of PyErr_Format
........
2011-01-12 19:02:36 +00:00
Benjamin Peterson
23b628ed0b use PyErr_SetString instead of PyErr_Format 2011-01-12 18:56:07 +00:00
Benjamin Peterson
de368717da Merged revisions 87952-87954 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87952 | benjamin.peterson | 2011-01-12 09:24:27 -0600 (Wed, 12 Jan 2011) | 1 line

  move this test to test_descr; it's not abc specific
........
  r87953 | benjamin.peterson | 2011-01-12 09:25:02 -0600 (Wed, 12 Jan 2011) | 1 line

  oops, wrong class
........
  r87954 | benjamin.peterson | 2011-01-12 09:34:01 -0600 (Wed, 12 Jan 2011) | 1 line

  don't segfault on deleting __abstractmethods__ #10892
........
2011-01-12 15:42:34 +00:00
Benjamin Peterson
477ba919c1 don't segfault on deleting __abstractmethods__ #10892 2011-01-12 15:34:01 +00:00
Victor Stinner
0fcab4a3ed Issue #9566: use Py_ssize_t instead of int 2011-01-04 12:59:15 +00:00
Martin v. Löwis
4d0d471a80 Merge branches/pep-0384. 2010-12-03 20:14:31 +00:00
Benjamin Peterson
8035bc5c04 follow up to #9778: define and use an unsigned hash type 2010-10-23 16:20:50 +00:00
Antoine Pitrou
ff150f2921 Revert r85797 (and r85798): it broke the Windows buildbots because of
test_multiprocessing's misbehaviour.
2010-10-22 21:41:05 +00:00
Antoine Pitrou
7eecffd05d Issue #9935: Speed up pickling of instances of user-defined classes. 2010-10-22 19:43:59 +00:00
Benjamin Peterson
e7dfeeb889 -1 is reserved for errors 2010-10-17 21:27:01 +00:00
Benjamin Peterson
8f67d0893f make hashes always the size of pointers; introduce Py_hash_t #9778 2010-10-17 20:54:53 +00:00
Benjamin Peterson
866c74e3d6 Merged revisions 85193 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85193 | benjamin.peterson | 2010-10-02 21:13:39 -0500 (Sat, 02 Oct 2010) | 1 line

  typo
........
2010-10-03 02:19:18 +00:00
Benjamin Peterson
84060b81e3 typo 2010-10-03 02:13:39 +00:00
Benjamin Peterson
0ad44fa3f7 Merged revisions 85154,85182 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85154 | benjamin.peterson | 2010-10-01 19:03:31 -0500 (Fri, 01 Oct 2010) | 1 line

  type.__abstractmethods__ should raise an AttributeError #10006
........
  r85182 | benjamin.peterson | 2010-10-02 12:55:47 -0500 (Sat, 02 Oct 2010) | 1 line

  add a test and a note about metaclasses now being abcs
........
2010-10-02 18:04:55 +00:00