Commit Graph

425 Commits

Author SHA1 Message Date
Serhiy Storchaka 9ec6464008 Issue #26718: super.__init__ no longer leaks memory if called multiple times.
NOTE: A direct call of super.__init__ is not endorsed!
2016-04-13 15:27:33 +03:00
Serhiy Storchaka bc62af1bbe Issue #22570: Renamed Py_SETREF to Py_XSETREF. 2016-04-06 09:51:18 +03:00
Benjamin Peterson b59b04dd86 fix hash member name (closes #22847) 2016-02-06 22:36:06 -08:00
Benjamin Peterson 4a0a9556fc fix debug assertion 2016-02-04 22:26:10 -08:00
Antoine Pitrou 225e7c0def Issue #22847: Improve method cache efficiency. 2014-11-15 00:56:27 +01:00
Benjamin Peterson a4acf1ff84 set tp_new from the class in the hierarchy that actually owns the descriptor (closes #25731)
Debugging by Eryk Sun.
2016-01-18 21:17:54 -08:00
Barry Warsaw 607965eb7e Comment out two tests that won't pass now after reverting the typeobject.c
change.  Also, as per further discussion, we'll just remove the regressing
code in typeobject.c
2016-01-11 14:44:59 -05:00
Barry Warsaw f65395c8c2 Issue #22995: [UPDATE] Comment out the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects.
2016-01-11 13:52:23 -05:00
Serhiy Storchaka 28f35f246b Issue #25961: Fixed compilation error and a leak in type constructor. 2015-12-31 12:03:14 +02:00
Serhiy Storchaka f9347e3b44 Issue #25961: Disallowed null characters in the type name. 2015-12-30 21:39:21 +02:00
Serhiy Storchaka b8e54dd806 Issue #22995: Instances of extension types with a state that aren't
subclasses of list or dict and haven't implemented any pickle-related
methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__,
or __getstate__), can no longer be pickled.  Including memoryview.
2015-12-30 20:43:29 +02:00
Serhiy Storchaka 5951f2300f Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
2015-12-24 10:35:35 +02:00
Serhiy Storchaka ee1b24ccaa Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside
__getattr__.  Original patch by Antoine Pitrou.
2015-11-25 18:35:33 +02:00
Serhiy Storchaka fedcf9474e Issue #22995: Default implementation of __reduce__ and __reduce_ex__ now
rejects builtin types with not defined __new__.
2015-11-12 11:59:03 +02:00
Benjamin Peterson 77d12ecaad prevent unacceptable bases from becoming bases through multiple inheritance (#24806) 2015-10-06 19:36:54 -07:00
Serhiy Storchaka f0aa88f6e8 Fixed indentation of Python examples in C comments. 2015-06-11 00:06:27 +03:00
Serhiy Storchaka ce16424b0b Issue #22079: Py3k warning now is issued in PyType_Ready() instead of
raising TypeError when statically allocated type subclasses dynamically
allocated type
2015-03-22 09:45:35 +02:00
Antoine Pitrou 323ab6d732 Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects. 2015-03-10 22:32:00 +01:00
Serhiy Storchaka 4c54387f11 Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
2015-01-28 10:52:49 +02:00
Benjamin Peterson e2defc4132 remove tautological condition (closes #22954) 2014-11-26 23:03:11 -06:00
Georg Brandl 409062c669 Closes #22772: fix __ifloordiv__ and __itruediv__ docstring. 2014-10-31 13:12:57 +01:00
Mark Dickinson f794b143d3 Issue #16447: Fix potential segfault when setting __name__ on a class. 2013-04-13 15:19:05 +01:00
Benjamin Peterson 74001fad7d list slotdefs in offset order rather than sorting them (closes #17610)
This means we can remove our usage of qsort() than relied on undefined behavior.

Backport by Zbigniew Halas.
2013-04-07 09:52:59 -04:00
R David Murray 5aff27aec1 #7963: fix error message when 'object' called with arguments.
Patch by Alexander Belopolsky.
2013-02-18 22:04:59 -05:00
Raymond Hettinger ac7b49f407 Improve tooltips by listing the most common argument pattern first. 2013-01-18 23:23:11 -08:00
Christian Heimes 47770ed914 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 4e80eea60e Fixed possible reference leak to mod when type_name() returns NULL 2012-09-10 03:00:14 +02:00
Antoine Pitrou 58098a77e6 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 2.7.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 2.7.3 and earlier. However, extension modules
compiled for 2.7.3 and earlier will be loadable by 2.7.4.
2012-09-06 00:59:49 +02:00
Antoine Pitrou c5bef75c77 Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:16:51 +02:00
Benjamin Peterson f1ae5cf5c7 fix possible refleak (closes #14752) 2012-05-08 09:22:24 -04:00
Benjamin Peterson d157a4c3dd 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 6e7832b04c check to make sure the attribute is a string (#14334) 2012-03-16 09:32:59 -05:00
Benjamin Peterson a8d458560e 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
Antoine Pitrou 5b4b2da55d 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 d784185303 Issue #13161: fix doc strings of __i*__ operators 2011-11-11 16:52:16 +02:00
Benjamin Peterson de66ecc75f fix possible refleaks 2011-08-16 22:26:48 -05:00
Antoine Pitrou 304f0f952d Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:22:50 +02:00
Antoine Pitrou 1616645a00 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 22:04:20 +02:00
Benjamin Peterson 80a09c70bf use '->' to indicate return values 2011-05-24 12:42:51 -05:00
Ezio Melotti c2077b0d9b #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 12:34:31 +02:00
Benjamin Peterson fba33478a5 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 19:57:01 +00:00
Benjamin Peterson cd8500193f 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:48:58 +00:00
Benjamin Peterson cf94b8b4da 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:30:29 +00:00
Benjamin Peterson f4676b0378 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:00:37 +00:00
Benjamin Peterson 9b911ca14d 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:49:47 +00:00
Benjamin Peterson 35c6be0b74 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:17:04 +00:00
Benjamin Peterson a5d5cc45c9 Merged revisions 85154 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
........
2010-10-02 00:08:58 +00:00
Benjamin Peterson 6f3d6a9b23 Merged revisions 84320 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84320 | benjamin.peterson | 2010-08-25 18:13:17 -0500 (Wed, 25 Aug 2010) | 1 line

  basicsize and itemsize are Py_ssize_t #9688
........
2010-08-25 23:17:42 +00:00
Alexander Belopolsky b8de9fab30 Merged revisions 84106 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84106 | alexander.belopolsky | 2010-08-16 16:17:07 -0400 (Mon, 16 Aug 2010) | 1 line

  Issue #8983: Corrected docstrings.
........
2010-08-16 20:30:26 +00:00
Mark Dickinson 77acee9567 Fix comment typo. 2010-06-05 12:51:21 +00:00