Commit Graph

3564 Commits

Author SHA1 Message Date
Serhiy Storchaka 1d3acd4b59 Issue #16335: Fix integer overflow in unicode-escape decoder. 2013-01-21 11:48:24 +02:00
Serhiy Storchaka 926f3a37de Issue #15989: Fix possible integer overflow in str formatting as in unicode formatting. 2013-01-19 23:35:46 +02:00
Serhiy Storchaka 74f49ab28b Issue #15989: Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:55:39 +02:00
Raymond Hettinger ac7b49f407 Improve tooltips by listing the most common argument pattern first. 2013-01-18 23:23:11 -08:00
Serhiy Storchaka 9599745e2c Issue #14850: Now a chamap decoder treates U+FFFE as "undefined mapping"
in any mapping, not only in an unicode string.
2013-01-15 14:42:59 +02:00
Serhiy Storchaka c4b82c037e Issue #11461: Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP
characters.
2013-01-08 23:12:00 +02:00
Serhiy Storchaka c9631a14d7 Fix out of bound read in UTF-32 decoder on "narrow Unicode" builds. 2013-01-08 22:43:18 +02:00
Benjamin Peterson 8f53ded1ee untabify 2013-01-02 12:25:15 -06:00
Benjamin Peterson a708adfcf6 call PyErr_Clear() when ignoring error from PyNumber_Int (closes #15516)
Patch from Tom Tromey.
2013-01-02 12:21:32 -06:00
Benjamin Peterson 6b3f8d375b ensure the attribute name string is initalized before using it (closes #16839) 2013-01-02 09:36:23 -06:00
Benjamin Peterson 5ca88d2b18 get the core to compile --disable-unicode 2013-01-01 23:04:16 -06:00
Serhiy Storchaka cf095f8e0f Issue #16761: Raise TypeError when int() or long() called with base argument only. 2012-12-28 09:31:59 +02:00
Antoine Pitrou d38c990bb7 Issue #16602: When a weakref's target was part of a long deallocation chain, the object could remain reachable through its weakref even though its refcount had dropped to zero.
Thanks to Eugene Toder for diagnosing and reporting the issue.
2012-12-08 21:15:26 +01:00
Mark Dickinson 115bc79df8 Issue #9742: Sneaky fix for build failure on Solaris 9. 2012-11-17 20:18:52 +00:00
Antoine Pitrou e3ae321222 Issue #15379: Fix passing of non-BMP characters as integers for the charmap decoder (already working as unicode strings).
Patch by Serhiy Storchaka.
2012-11-17 21:14:58 +01:00
Antoine Pitrou b704eab599 Issue #16453: Fix equality testing of dead weakref objects.
Also add tests for hashing.
2012-11-11 19:36:51 +01:00
Christian Heimes 146a5fead2 Fix compilation on Windows 2012-11-03 23:07:59 +01:00
Ezio Melotti 67dc4a87fc #8401: assigning an int to a bytearray slice (e.g. b[3:4] = 5) now raises an error. 2012-11-03 21:10:45 +02:00
Benjamin Peterson 47fa4d54e8 avoid a function call with redundant checks for dict size 2012-10-31 14:22:12 -04:00
Benjamin Peterson 0ec820fc5f only fast-path fromkeys() when the constructor returns a empty dict (closes #16345) 2012-10-31 14:05:55 -04:00
Benjamin Peterson 6da3ed63d8 initialize more global type objects (closes #16369) 2012-10-30 23:21:10 -04:00
Mark Dickinson 75d3600466 Issue #14700: Fix buggy overflow checks for large precision and width in new-style and old-style formatting. 2012-10-28 10:00:46 +00:00
Chris Jerdonek ad4b000179 Issue #14783: Backport changes from 3.2. 2012-10-07 20:37:54 -07:00
Mark Dickinson 218a8ab5eb Issues #16029, #16030: Fix pickling and repr of large xranges. 2012-09-28 20:36:36 +01: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
Christian Heimes 074ebced1b PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak. 2012-09-10 02:54:51 +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
Benjamin Peterson 23d49d3e7e use the stricter PyMapping_Check (closes #15801) 2012-08-28 17:55:35 -04: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
Antoine Pitrou 715a63b783 Issue #14579: Fix error handling bug in the utf-16 decoder.
Patch by Serhiy Storchaka.
2012-07-21 00:52:06 +02:00
Benjamin Peterson 7d8a2e41a0 allow any number to be returned from __length_hint__ (closes #15354) 2012-07-14 17:53:55 -07:00
Gregory P. Smith b2ac4d693a Fixes issue #12268 for file readline, readlines and read() and readinto methods.
They no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR from
within these methods.
2012-06-25 20:57:36 -07:00
Raymond Hettinger aad5b02e62 Improve tooltips for splitlines() by showing that the default for keepends is False. 2012-06-02 01:42:58 -04:00
Martin v. Löwis ed11a5d018 Issue #8767: Restore building with --disable-unicode.
Original patch by Stefano Taschini.
2012-05-20 10:42:17 +02:00
Benjamin Peterson f1ae5cf5c7 fix possible refleak (closes #14752) 2012-05-08 09:22:24 -04:00
Benjamin Peterson d62da9d658 close() doesn't take any args (closes #14717) 2012-05-03 18:44:09 -04:00
Benjamin Peterson f3ad1f94a8 use formats that work on 2.7 2012-05-01 10:16:33 -04:00
Benjamin Peterson 042c47b2c7 fix calling the classmethod descriptor directly (closes #14699) 2012-05-01 09:51:09 -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 76605557ea SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno (closes #14612) 2012-04-18 11:14:31 -04:00
Benjamin Peterson fe146ea3c7 merge 2.7 release branch 2012-04-09 14:54:09 -04:00
Benjamin Peterson f51c384a0a fix build without Py_DEBUG and DNDEBUG (closes #14509) 2012-04-09 14:53:07 -04:00
Antoine Pitrou 02a380105d Issue #14505: Fix file descriptor leak when deallocating file objects created with PyFile_FromString(). 2012-04-05 14:07:52 +02:00
Antoine Pitrou fe9417726c Issue #13019: Fix potential reference leaks in bytearray.extend().
Patch by Suman Saha.
2012-04-01 16:05:46 +02:00
Benjamin Peterson e8ecc73844 kill this terribly outdated comment 2012-03-25 22:40:54 -04:00
Benjamin Peterson dbc52f8a0d check for string attribute names in old-style classes (closes #14334) 2012-03-16 10:58:46 -05:00
Benjamin Peterson 6e7832b04c check to make sure the attribute is a string (#14334) 2012-03-16 09:32:59 -05:00
Ezio Melotti eace3a7261 #14161: fix compile error under Windows. 2012-03-12 01:28:45 +02:00
Ezio Melotti 11f8b6872a #14161: fix the __repr__ of file objects to escape the file name. 2012-03-12 01:17:02 +02:00