Commit Graph

3379 Commits

Author SHA1 Message Date
Benjamin Peterson a7b0976c3e PyEval_CallObject requires a tuple of args (closes #13186) 2011-10-15 13:43:21 -04:00
Nadeem Vawda 36248154a9 Issue #13159: Replace FileIO's quadratic-time buffer growth algorithm with a linear-time one.
Also fix the builtin file class and the bz2 module, which used the same algorithm.
2011-10-13 13:52:46 +02:00
Victor Stinner 63c22fac72 Issue #7732: Fix a crash on importing a module if a directory has the same name
than a Python module (e.g. "__init__.py"): don't close the file twice.

PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
2011-09-23 19:37:03 +02:00
Mark Dickinson 4ac5d2cda4 Backport issue #12973 list_repeat fix from 3.x. 2011-09-19 19:23:55 +01:00
Mark Dickinson dbbed04941 Issue #12973: Fix int.__pow__ overflow checks that invoked undefined behaviour, thereby producing incorrect results on Clang. 2011-09-19 16:38:08 +01:00
Benjamin Peterson de66ecc75f fix possible refleaks 2011-08-16 22:26:48 -05:00
Ezio Melotti 15d6b65ead #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. 2011-08-15 09:22:24 +03:00
Senthil Kumaran 5e3a19d806 merge from 3.2 - Fix closes Issue12621 - Fix docstrings of find and rfind methods of bytes/bytearry/unicodeobject. 2011-07-27 23:36:51 +08: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
Raymond Hettinger bf7a266074 Fixup repr for dict_proxy objects. 2011-06-30 00:44:36 +01:00
Mark Dickinson cb9bf1ac9c Issue #12164: Document (in docstring) that str.translate accepts None for the first argument. 2011-06-25 11:00:12 +02:00
Benjamin Peterson 80a09c70bf use '->' to indicate return values 2011-05-24 12:42:51 -05:00
Benjamin Peterson 7f5cd45f1d must clear an AttributeError if it is set 2011-05-23 18:17:55 -05:00
Benjamin Peterson fd89af59e8 handle old-style instances 2011-05-23 17:11:21 -05:00
Benjamin Peterson 8de87a6403 correctly lookup __dir__ 2011-05-23 16:11:05 -05:00
Victor Stinner e363ec1057 (Merge 3.1) Issue #9756: When calling a method descriptor or a slot wrapper
descriptor, the check of the object type doesn't read the __class__ attribute
anymore.  Fix a crash if a class override its __class__ attribute (e.g. a proxy
of the str type).
2011-05-01 23:43:37 +02:00
Ezio Melotti e3685f6b1b #6780: fix starts/endswith error message to mention that tuples are accepted too. 2011-04-26 05:12:51 +03:00
Jesus Cea 44e81687a2 startswith and endswith don't accept None as slice index. Patch by Torsten Becker. (closes #11828) 2011-04-20 16:39:15 +02:00
Mark Dickinson 874d59ee91 Issue #11144: Fix corner cases where float-to-int conversion unnecessarily returned a long. 2011-03-26 12:18:00 +00:00
Eli Bendersky 72de205895 Issue #11634: Remove misleading paragraph from a comment 2011-03-24 22:38:25 +02:00
Éric Araujo f079c9bfbf Fix obscure set crashers (#4420). Backport of d56b3cafb1e6, reviewed by Raymond. 2011-03-22 23:47:32 +01:00
Ezio Melotti c2077b0d9b #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 12:34:31 +02:00
Ezio Melotti 24b07bcba3 #11515: fix several typos. Patch by Piotr Kasprzyk. 2011-03-15 18:55:01 +02:00
Eli Bendersky 680e6eb54f Merged revisions 88735 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88735 | eli.bendersky | 2011-03-04 06:55:25 +0200 (Fri, 04 Mar 2011) | 2 lines

  Issue #11386: Fixed the exception thrown by bytearray.pop() for empty bytearrays
........
2011-03-04 06:14:56 +00:00
Georg Brandl 28dadd988b Merged revisions 87050,87101,87146,87156,87172,87175,87371,87378,87522-87524,87526,87530-87535 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87050 | georg.brandl | 2010-12-04 18:09:30 +0100 (Sa, 04 Dez 2010) | 1 line

  Fix typo.
........
  r87101 | georg.brandl | 2010-12-06 23:02:48 +0100 (Mo, 06 Dez 2010) | 1 line

  Remove visible XXX comments.
........
  r87146 | georg.brandl | 2010-12-09 19:08:43 +0100 (Do, 09 Dez 2010) | 1 line

  Fix "seperate".
........
  r87156 | georg.brandl | 2010-12-10 11:01:44 +0100 (Fr, 10 Dez 2010) | 1 line

  #10668: fix wrong call of __init__.
........
  r87172 | georg.brandl | 2010-12-11 20:10:30 +0100 (Sa, 11 Dez 2010) | 1 line

  Avoid AttributeError(_closed) when a TemporaryDirectory is deallocated whose mkdtemp call failed.
........
  r87175 | georg.brandl | 2010-12-11 23:19:34 +0100 (Sa, 11 Dez 2010) | 1 line

  Fix markup.
........
  r87371 | georg.brandl | 2010-12-18 17:21:58 +0100 (Sa, 18 Dez 2010) | 1 line

  Fix typo.
........
  r87378 | georg.brandl | 2010-12-18 18:51:28 +0100 (Sa, 18 Dez 2010) | 1 line

  #10723: add missing builtin exceptions.
........
  r87522 | georg.brandl | 2010-12-28 10:16:12 +0100 (Di, 28 Dez 2010) | 1 line

  Replace sys.maxint mention by sys.maxsize.
........
  r87523 | georg.brandl | 2010-12-28 10:18:24 +0100 (Di, 28 Dez 2010) | 1 line

  Remove confusing paragraph -- this is relevant only to advanced users anyway and does not belong into the tutorial.
........
  r87524 | georg.brandl | 2010-12-28 10:29:19 +0100 (Di, 28 Dez 2010) | 1 line

  Fix advice: call PyType_Ready to fill in ob_type of custom types.
........
  r87526 | georg.brandl | 2010-12-28 11:38:33 +0100 (Di, 28 Dez 2010) | 1 line

  #10777: fix iteration over dict keys while mutating the dict.
........
  r87530 | georg.brandl | 2010-12-28 12:06:07 +0100 (Di, 28 Dez 2010) | 1 line

  #10767: update README in crashers; not all may have a bug entry and/or be fixed.
........
  r87531 | georg.brandl | 2010-12-28 12:08:17 +0100 (Di, 28 Dez 2010) | 1 line

  #10742: document readonly attribute of memoryviews.
........
  r87532 | georg.brandl | 2010-12-28 12:15:49 +0100 (Di, 28 Dez 2010) | 1 line

  #10781: clarify that *encoding* is not a parameter for Node objects in general.
........
  r87533 | georg.brandl | 2010-12-28 12:38:12 +0100 (Di, 28 Dez 2010) | 1 line

  Remove history; adapt a bit more to reST, since this will once be part of the dev guide.
........
  r87534 | georg.brandl | 2010-12-28 12:48:53 +0100 (Di, 28 Dez 2010) | 1 line

  Rewrap.
........
  r87535 | georg.brandl | 2010-12-28 12:49:41 +0100 (Di, 28 Dez 2010) | 1 line

  #10739: document that on Windows, socket.makefile() does not make a file that has a true file descriptor usable where such a thing is expected.
........
2011-02-25 10:50:32 +00:00
Antoine Pitrou 3013b16b62 Merged revisions 88097 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88097 | antoine.pitrou | 2011-01-18 19:57:52 +0100 (mar., 18 janv. 2011) | 4 lines

  Issue #10451: memoryview objects could allow to mutate a readable buffer.
  Initial patch by Ross Lagerwall.
........
2011-01-18 19:06:19 +00: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
Antoine Pitrou 5a72e76b69 Merged revisions 87834 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87834 | antoine.pitrou | 2011-01-07 22:43:59 +0100 (ven., 07 janv. 2011) | 5 lines

  Issue #8020: Avoid a crash where the small objects allocator would read
  non-Python managed memory while it is being modified by another thread.
  Patch by Matt Bandy.
........
2011-01-07 21:49:44 +00:00
Mark Dickinson ecf8ec67ce Merged revisions 87032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87032 | mark.dickinson | 2010-12-04 12:25:30 +0000 (Sat, 04 Dec 2010) | 3 lines

  Issue #10596: Fix float.__mod__ to have the same behaviour as
  float.__divmod__ with respect to signed zeros.
........
2010-12-04 12:30:41 +00:00
Stefan Krah 918c90ce06 Merged revisions 86791 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86791 | stefan.krah | 2010-11-26 11:54:09 +0100 (Fri, 26 Nov 2010) | 1 line

  Indentation cleanup.
........
2010-11-26 11:03:55 +00:00
Armin Rigo 39e32a7e81 Revert r86726. Sorry about interfering with the rc. 2010-11-24 13:17:48 +00:00
Armin Rigo 442e4477fe A no-op change. It looks like this call was not meant to be a recursive
call, but just call the helper (which the recursive call ends up doing).
2010-11-24 10:39:23 +00:00
Eric Smith 6c84085cfb Improved docstrings for str and unicode methods format and __format__. 2010-11-06 19:43:44 +00:00
Jesus Cea 33c722b795 CObject use is marked as a Py3k warning, not a deprecation warning 2010-11-04 21:39:52 +00:00
Raymond Hettinger 2ad17e19ee Issue 10221: Improve error message for dict.pop(). 2010-10-30 08:17:46 +00:00
Antoine Pitrou 638cee62d5 Issue #9295: Fix a crash under Windows when calling close() on a file
object with custom buffering from two threads at once.
2010-10-28 14:50:57 +00:00
Benjamin Peterson bf775542b0 iterators passed to writelines() can close their files; don't segfault #10125 2010-10-16 19:20:12 +00:00
Benjamin Peterson dc9542435b Merged revisions 85392 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85392 | benjamin.peterson | 2010-10-12 17:57:59 -0500 (Tue, 12 Oct 2010) | 1 line

  prefer clearing global objects to obscure module.__dict__ bugs #10068
........
2010-10-12 23:02:35 +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
Mark Dickinson cb61e5d9b5 Issue #9869: Make long() and PyNumber_Long return something of type
long for a class whose __long__ method returns a plain int.  This
fixes an interpreter crash (due to long_subtype_new assuming
PyNumber_Long returns a long) when initializing an instance of a long
subclass from an object whose __long__ method returns a plain int.
2010-09-26 10:37:12 +00:00
Victor Stinner caafd77060 Issue #4947: The write() method of sys.stdout and sys.stderr uses their
encoding and errors attributes instead of using utf-8 in strict mode, to get
the same behaviour than the print statement.
2010-09-08 10:51:01 +00:00
Antoine Pitrou 9cf85f144e Merged revisions 84408-84409 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84408 | antoine.pitrou | 2010-09-01 23:14:16 +0200 (mer., 01 sept. 2010) | 4 lines

  Issue #9737: Fix a crash when trying to delete a slice or an item from
  a memoryview object.
........
  r84409 | antoine.pitrou | 2010-09-01 23:14:46 +0200 (mer., 01 sept. 2010) | 3 lines

  Fix a compilation warning
........
2010-09-01 21:17:34 +00:00
Antoine Pitrou 1fcdba84be Merged revisions 84391 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84391 | antoine.pitrou | 2010-09-01 14:58:21 +0200 (mer., 01 sept. 2010) | 5 lines

  Issue #3101: Helper functions _add_one_to_C() and _add_one_to_F() become
  _Py_add_one_to_C() and _Py_add_one_to_F(), respectively.
........
2010-09-01 13:02:50 +00:00
Antoine Pitrou a408350a08 Merged revisions 84344 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84344 | antoine.pitrou | 2010-08-28 20:17:03 +0200 (sam., 28 août 2010) | 4 lines

  Issue #1868: Eliminate subtle timing issues in thread-local objects by
  getting rid of the cached copy of thread-local attribute dictionary.
........
2010-08-28 18:29:13 +00:00