summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #16335: Fix integer overflow in unicode-escape decoder.Serhiy Storchaka2013-01-211-1/+2
|\
| * Issue #16335: Fix integer overflow in unicode-escape decoder.Serhiy Storchaka2013-01-211-1/+2
| |\
| | * Issue #16335: Fix integer overflow in unicode-escape decoder.Serhiy Storchaka2013-01-211-1/+2
| | |
| * | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-193-4/+22
| |\ \ | | |/ | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
| | * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-193-4/+22
| | | | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* | | Issue #14850: Now a chamap decoder treates U+FFFE as "undefined mapping"Serhiy Storchaka2013-01-151-19/+33
|\ \ \ | |/ / | | | | | | in any mapping, not only in an unicode string.
| * | Issue #14850: Now a chamap decoder treates U+FFFE as "undefined mapping"Serhiy Storchaka2013-01-151-19/+22
| |\ \ | | |/ | | | | | | in any mapping, not only in an unicode string.
| | * Issue #14850: Now a chamap decoder treates U+FFFE as "undefined mapping"Serhiy Storchaka2013-01-151-21/+25
| | | | | | | | | | | | in any mapping, not only in an unicode string.
* | | Check for NULL before the pointer aligning in fastsearch_memchr_1char.Serhiy Storchaka2013-01-151-15/+10
|\ \ \ | |/ / | | | | | | There is no guarantee that NULL is aligned.
| * | Check for NULL before the pointer aligning in fastsearch_memchr_1char.Serhiy Storchaka2013-01-151-15/+10
| | | | | | | | | | | | There is no guarantee that NULL is aligned.
* | | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-143-4/+22
| | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks.
* | | merge 3.3 (#16906)Benjamin Peterson2013-01-091-6/+9
|\ \ \ | |/ /
| * | correct static string clearing loop (closes #16906)Benjamin Peterson2013-01-091-6/+9
| | |
* | | Issue #11461: Fix the incremental UTF-16 decoder. Original patch bySerhiy Storchaka2013-01-081-1/+4
|\ \ \ | |/ / | | | | | | | | | Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP characters.
| * | Issue #11461: Fix the incremental UTF-16 decoder. Original patch bySerhiy Storchaka2013-01-081-1/+4
| |\ \ | | |/ | | | | | | | | | Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP characters.
| | * Issue #11461: Fix the incremental UTF-16 decoder. Original patch bySerhiy Storchaka2013-01-081-1/+4
| | | | | | | | | | | | | | | Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP characters.
| | * Fix out of bound read in UTF-32 decoder on "narrow Unicode" builds.Serhiy Storchaka2013-01-081-1/+1
| | |
* | | Add a comment about *not* caching the hash value. Issue #9685 suggested to ↵Christian Heimes2013-01-071-0/+3
| | | | | | | | | | | | memorize the hash value, but the feature request was rejected because no speed ups were found.
* | | Issue #16856: Fix a segmentation fault from calling repr() on a dict withSerhiy Storchaka2013-01-041-1/+1
|\ \ \ | |/ / | | | | | | a key whose repr raise an exception.
| * | Issue #16856: Fix a segmentation fault from calling repr() on a dict withSerhiy Storchaka2013-01-041-1/+1
| | | | | | | | | | | | a key whose repr raise an exception.
| * | (Merge 3.2) Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2013-01-031-4/+4
| |\ \ | | |/ | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
| | * Issue #16455: On FreeBSD and Solaris, if the locale is C, theVictor Stinner2013-01-031-4/+4
| | | | | | | | | | | | | | | | | | | | | ASCII/surrogateescape codec is now used, instead of the locale encoding, to decode the command line arguments. This change fixes inconsistencies with os.fsencode() and os.fsdecode() because these operating systems announces an ASCII locale encoding, whereas the ISO-8859-1 encoding is used in practice.
* | | Close #16281: handle tailmatch() failure and remove useless commentVictor Stinner2013-01-031-2/+9
| | | | | | | | | | | | | | | | | | | | | "honor direction and do a forward or backwards search": the runtime speed may be different, but I consider that it doesn't really matter in practice. The direction was never honored before: Python 2.7 uses memcmp() for the str type for example.
* | | Fix the advertised size of PyCFunctionObjects in sys._debugmallocstats().Antoine Pitrou2012-12-301-2/+2
|\ \ \ | |/ /
| * | Fix the advertised size of PyCFunctionObjects in sys._debugmallocstats().Antoine Pitrou2012-12-301-2/+2
| | |
* | | Issue #16761: Raise TypeError when int() called with base argument only.Serhiy Storchaka2012-12-281-3/+9
|\ \ \ | |/ /
| * | Issue #16761: Raise TypeError when int() called with base argument only.Serhiy Storchaka2012-12-281-2/+8
| |\ \ | | |/
| | * Issue #16761: Raise TypeError when int() called with base argument only.Serhiy Storchaka2012-12-281-2/+8
| | |
| | * Keep y a Py_hash_t instead of Py_uhash_t as it is compared with == -1 and theGregory P. Smith2012-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | compiler logic will do the right thing with just x as a Py_uhash_t. This matches what was already done in the 3.3 version. cleanup only - no functionality or hash values change.
* | | use more specific typeBenjamin Peterson2012-12-261-1/+1
| | |
* | | Fix compilation error for #15422Andrew Svetlov2012-12-261-0/+3
| | |
* | | Test for issue16772 and redoes the previous fix to accept __index__-awareGregory P. Smith2012-12-261-4/+3
| | | | | | | | | | | | objects as the base by using PyNumber_AsSsize_t similar to round().
* | | Fixes issue #16772: int() constructor second argument (base) must be an int.Gregory P. Smith2012-12-251-0/+5
| | | | | | | | | | | | Consistent with the behavior in Python 2.
* | | Issue #15422: get rid of PyCFunction_New macroAndrew Svetlov2012-12-253-20/+12
| | |
* | | Issue #9856: Replace deprecation warinigs to raising TypeError in ↵Andrew Svetlov2012-12-231-13/+4
| | | | | | | | | | | | | | | | | | object.__format__ Patch by Florent Xicluna.
* | | merge 3.3 (#16722)Benjamin Peterson2012-12-191-5/+28
|\ \ \ | |/ /
| * | try to call __bytes__ before __index__ (closes #16722)Benjamin Peterson2012-12-191-5/+28
| | |
* | | Issue #16719: Get rid of WindowsError. Use OSError insteadAndrew Svetlov2012-12-191-5/+5
| | | | | | | | | | | | Patch by Serhiy Storchaka.
* | | Following issue #13390, fix compilation --without-pymalloc, and make ↵Antoine Pitrou2012-12-171-0/+7
| | | | | | | | | | | | sys.getallocatedblocks() return 0 in that situation.
* | | Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-113-11/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. NOTE: This change is smaller compared to 3.2 as much of this cleanup had already been done. I added the comment that my change in 3.2 added so that the code would match up. Otherwise this just adds or synchronizes appropriate UL designations on some constants to be pedantic. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. We could work to get rid of the -fwrapv requirement in 3.4 but that requires more planning. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
| * | Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-113-11/+11
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. NOTE: This change is smaller compared to 3.2 as much of this cleanup had already been done. I added the comment that my change in 3.2 added so that the code would match up. Otherwise this just adds or synchronizes appropriate UL designations on some constants to be pedantic. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
| | * Fix the internals of our hash functions to used unsigned values during hashGregory P. Smith2012-12-114-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | computation as the overflow behavior of signed integers is undefined. In practice we require compiling everything with -fwrapv which forces overflow to be defined as twos compliment but this keeps the code cleaner for checkers or in the case where someone has compiled it without -fwrapv or their compiler's equivalent. Found by Clang trunk's Undefined Behavior Sanitizer (UBSan). Cleanup only - no functionality or hash values change.
* | | Issue #13390: New function :func:`sys.getallocatedblocks()` returns the ↵Antoine Pitrou2012-12-091-1/+20
| | | | | | | | | | | | | | | | | | number of memory blocks currently allocated. Also, the ``-R`` option to regrtest uses this function to guard against memory allocation leaks.
* | | Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-3/+2
|\ \ \ | |/ / | | | | | | | | | | | | 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.
| * | Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-3/+2
| |\ \ | | |/ | | | | | | | | | | | | 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.
| | * Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-3/+2
| | | | | | | | | | | | | | | | | | 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.
| * | (Merge 3.2) Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner2012-12-031-4/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape.
| | * Issue #16416: On Mac OS X, operating system data are now alwaysVictor Stinner2012-12-031-4/+5
| | | | | | | | | | | | | | | | | | | | | encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape.
* | | Issue #16495: remove extraneous NULL encoding check from bytes_decode().Chris Jerdonek2012-12-071-2/+0
| | | | | | | | | | | | | | | | | | The NULL encoding check in bytes_decode() was unnecessary because this case is already taken care of by the call to _Py_normalize_encoding() inside PyUnicode_Decode().
* | | Cleanup unicodeobject.cVictor Stinner2012-12-041-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | * Remove micro-optization: (errors == "surrogateescape" || strcmp(errors, "surrogateescape") == 0). Only use strcmp() * Initialize 'arg' members in unicode_format_arg() to help the compiler to diagnose real bugs and also make the code simpler to read