summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #2844: Make int('42', n) consistently raise ValueError forMark Dickinson2010-05-261-9/+20
| | | | invalid integers n (including n = -909).
* Issue #8817: Expose round-to-nearest variant of divmod in _PyLong_Divmod_NearMark Dickinson2010-05-261-111/+140
| | | | for use by the datetime module; also refactor long_round to use this function.
* Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson2010-05-234-74/+145
| | | | | | (instances of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it easy to maintain the invariant that hash(x) == hash(y) whenever x and y have equal value.
* Issue #8749: remove unused code in Objects/object.c. Thanks Yaniv Aknin.Mark Dickinson2010-05-221-24/+0
|
* Issue #8748: Fix two issues with comparisons between complex and integerMark Dickinson2010-05-211-8/+44
| | | | | | | | | | objects. (1) The comparison could incorrectly return True in some cases (2**53+1 == complex(2**53) == 2**53), breaking transivity of equality. (2) The comparison raised an OverflowError for large integers, leading to unpredictable exceptions when combining integers and complex objects in sets or dicts. Patch by Meador Inge.
* Ooops, add missing ";" in my previous commit (r81324, typeobject.c)Victor Stinner2010-05-191-2/+2
| | | | It's time to go to bed...
* Issue #6697: Check that _PyUnicode_AsString() result is not NULL in typeobjectVictor Stinner2010-05-191-2/+12
| | | | | Type name and slots are already checked for surrogates somewhere else, but it's better to ensure that the result is not NULL.
* Issue #6697: Fix a crash if a module attribute name contains a surrogateVictor Stinner2010-05-191-8/+20
|
* Fix refleak in internal_print() introduced by myself in r81251Victor Stinner2010-05-171-0/+1
| | | | | | _PyUnicode_AsDefaultEncodedString() uses a magical PyUnicode attribute to automatically destroy PyUnicode_EncodeUTF8() result when the unicode string is destroyed.
* PyObject_Dump() encodes unicode objects to utf8 with backslashreplace (insteadVictor Stinner2010-05-171-1/+3
| | | | of strict) error handler to escape surrogates
* Issue #8715: Create PyUnicode_EncodeFSDefault() function: Encode a UnicodeVictor Stinner2010-05-151-3/+13
| | | | | | object to Py_FileSystemDefaultEncoding with the "surrogateescape" error handler, return a bytes object. If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
* Enable shortcuts for common encodings in PyUnicode_AsEncodedString() for anyVictor Stinner2010-05-151-23/+31
| | | | error handler, not only the default error handler (strict)
* Merged revisions 81037 via svnmerge fromMark Dickinson2010-05-101-33/+39
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81037 | mark.dickinson | 2010-05-09 21:42:09 +0100 (Sun, 09 May 2010) | 1 line Wrap multiline macros in a 'do {} while(0)', for safety. ........
* Merged revisions 81036 via svnmerge fromMark Dickinson2010-05-101-102/+101
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81036 | mark.dickinson | 2010-05-09 21:30:29 +0100 (Sun, 09 May 2010) | 1 line Post-detabification cleanup: whitespace fixes and long line rewraps only. ........
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-0933-30660/+30660
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 80961 via svnmerge fromMark Dickinson2010-05-081-5/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80961 | mark.dickinson | 2010-05-08 09:01:19 +0100 (Sat, 08 May 2010) | 2 lines Issue #8659: Remove redundant ABS calls. Thanks Daniel Stutzbach. ........
* module_repr(): use %U to format the file nameVictor Stinner2010-05-071-5/+15
| | | | Avoid useless encode/decode of the filename
* code_repr(): use %U to format the filenameVictor Stinner2010-05-071-8/+12
| | | | Avoid useless unicode decoding/recoding of the filename.
* Make (most of) Python's tests pass under Thread Sanitizer.Jeffrey Yasskin2010-05-031-1/+2
| | | | | | | | | | | | | | | | | | http://code.google.com/p/data-race-test/wiki/ThreadSanitizer is a dynamic data race detector that runs on top of valgrind. With this patch, the binaries at http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Binaries pass many but not all of the Python tests. All of regrtest still passes outside of tsan. I've implemented part of the C1x atomic types so that we can explicitly mark variables that are used across threads, and get defined behavior as compilers advance. I've added tsan's client header and implementation to the codebase in dynamic_annotations.{h,c} (docs at http://code.google.com/p/data-race-test/wiki/DynamicAnnotations). Unfortunately, I haven't been able to get helgrind and drd to give sensible error messages, even when I use their client annotations, so I'm not supporting them.
* PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead ofVictor Stinner2010-04-301-1/+1
| | | | | PyUnicode_FromString() to support surrogates in the filename and use the right encoding
* PyUnicode_DecodeFSDefaultAndSize() uses surrogateescape error handlerVictor Stinner2010-04-301-4/+4
| | | | | | This function is only used to decode Python module filenames, but Python doesn't support surrogates in modules filenames yet. So nobody noticed this minor bug.
* Simplify PyUnicode_FSConverter(): remove reference to PyByteArrayVictor Stinner2010-04-301-9/+3
| | | | PyByteArray is no more supported
* Don't decode/recode the unicode filename in SyntaxError_str()Victor Stinner2010-04-281-20/+34
| | | | | * Rewrite my_basename() to use unicode * Use '%U' format
* condense conditionBenjamin Peterson2010-04-251-4/+1
|
* prevent the dict constructor from accepting non-string keyword args #8419Benjamin Peterson2010-04-241-2/+21
| | | | | This adds PyArg_ValidateKeywordArguments, which checks that keyword arguments are all strings, using an optimized method if possible.
* Fix my previous commit (r80382) for wide build (unicodeobject.c)Victor Stinner2010-04-221-2/+3
|
* Issue #8092: Fix PyUnicode_EncodeUTF8() to support error handler producingVictor Stinner2010-04-221-47/+80
| | | | unicode string (eg. backslashreplace)
* Issue #8485: PyUnicode_FSConverter() doesn't accept bytearray object anymore,Victor Stinner2010-04-221-1/+1
| | | | you have to convert your bytearray filenames to bytes
* Issue 8436: set.__init__ accepts keyword argsRaymond Hettinger2010-04-181-0/+2
|
* Issue 8420: Fix ref counting problem in set_repr().Raymond Hettinger2010-04-181-3/+1
|
* Merged revisions 80129 via svnmerge fromBenjamin Peterson2010-04-161-2/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80129 | benjamin.peterson | 2010-04-16 17:52:44 -0500 (Fri, 16 Apr 2010) | 1 line tiny simplification ........
* Merged revisions 80126 via svnmerge fromBenjamin Peterson2010-04-162-12/+18
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r80126 | benjamin.peterson | 2010-04-16 17:35:38 -0500 (Fri, 16 Apr 2010) | 1 line have a clear error when passing something > sys.maxsize to bytearray ........
* Merged revisions 79885 via svnmerge fromStefan Krah2010-04-071-7/+7
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79885 | stefan.krah | 2010-04-07 10:24:44 +0200 (Wed, 07 Apr 2010) | 1 line Issue #8328: Silence Visual Studio warnings. ........
* Merged revisions 79856 via svnmerge fromMark Dickinson2010-04-061-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79856 | mark.dickinson | 2010-04-06 19:58:54 +0100 (Tue, 06 Apr 2010) | 1 line Silence a 'comparison between signed and unsigned integer expressions' gcc warning. ........
* Merged revisions 79843-79844 via svnmerge fromMark Dickinson2010-04-061-14/+6
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79843 | mark.dickinson | 2010-04-06 17:46:09 +0100 (Tue, 06 Apr 2010) | 4 lines Issue #8259: Get rid of 'outrageous left shift count' error when left-shifting an integer by more than 2**31 on a 64-bit machine. Also convert shift counts to a Py_ssize_t instead of a C long. ........ r79844 | mark.dickinson | 2010-04-06 17:47:55 +0100 (Tue, 06 Apr 2010) | 1 line Misc/NEWS entry for r79843. ........
* Merged revisions 79809 via svnmerge fromMark Dickinson2010-04-061-3/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79809 | mark.dickinson | 2010-04-05 19:54:51 +0100 (Mon, 05 Apr 2010) | 1 line Use a better NaN test in _Py_HashDouble as well. ........
* Merged revisions 79804 via svnmerge fromMark Dickinson2010-04-051-3/+3
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79804 | mark.dickinson | 2010-04-05 19:07:51 +0100 (Mon, 05 Apr 2010) | 5 lines Use a more robust infinity check in _Py_HashDouble. This fixes a test_decimal failure on FreeBSD 8.0. (modf apparently doesn't follow C99 Annex F on FreeBSD.) ........
* Merged revisions 79494,79496 via svnmerge fromFlorent Xicluna2010-03-302-6/+11
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79494 | florent.xicluna | 2010-03-30 10:24:06 +0200 (mar, 30 mar 2010) | 2 lines #7643: Unicode codepoints VT (0x0B) and FF (0x0C) are linebreaks according to Unicode Standard Annex #14. ........ r79496 | florent.xicluna | 2010-03-30 18:29:03 +0200 (mar, 30 mar 2010) | 2 lines Highlight the change of behavior related to r79494. Now VT and FF are linebreaks. ........
* Merged revisions 79278,79280 via svnmerge fromVictor Stinner2010-03-221-1/+1
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79278 | victor.stinner | 2010-03-22 13:24:37 +0100 (lun., 22 mars 2010) | 2 lines Issue #1583863: An unicode subclass can now override the __str__ method ........ r79280 | victor.stinner | 2010-03-22 13:36:28 +0100 (lun., 22 mars 2010) | 5 lines Fix the NEWS about my last commit: an unicode subclass can now override the __unicode__ method (and not the __str__ method). Simplify also the testcase. ........
* Fixed a failure in test_bigmem.Florent Xicluna2010-03-191-961/+1192
| | | | | | | | | | | Merged revision 79059 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79059 | florent.xicluna | 2010-03-18 22:50:06 +0100 (jeu, 18 mar 2010) | 2 lines Issue #8024: Update the Unicode database to 5.2 ........
* Remove out-of-date comment about making ints and longs hash equal.Mark Dickinson2010-03-191-3/+0
|
* Revert Unicode UCD 5.2 upgrade in 3.x. It broke repr() for unicode objects, ↵Florent Xicluna2010-03-191-1192/+961
| | | | and gave failures in test_bigmem. Revert 79062, 79065 and 79083.
* Merged revisions 79060 via svnmerge fromCollin Winter2010-03-181-1/+4
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79060 | collin.winter | 2010-03-18 14:54:01 -0700 (Thu, 18 Mar 2010) | 4 lines Add support for weak references to code objects. This will be used by an optimization in the incoming Python 3 JIT. Patch by Reid Kleckner! ........
* Merged revisions 79059 via svnmerge fromFlorent Xicluna2010-03-181-961/+1192
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79059 | florent.xicluna | 2010-03-18 22:50:06 +0100 (jeu, 18 mar 2010) | 2 lines Issue #8024: Update the Unicode database to 5.2 ........
* * Fix the refcount leak in _PySequence_BytesToCharpArray from r78946.Gregory P. Smith2010-03-151-1/+4
| | | | | * Also fixes a potential extra DECREF of an arg in the error case within _posixsubprocess.fork_exec() by not reusing the process_args variable.
* * Replaces the internals of the subprocess module from fork through exec onGregory P. Smith2010-03-141-0/+60
| | | | | | | | | | | | | | | POSIX systems with a C extension module. This is required in order for the subprocess module to be made thread safe. The pure python implementation is retained so that it can continue to be used if for some reason the _posixsubprocess extension module is not available. The unittest executes tests on both code paths to guarantee compatibility. * Moves PyLong_FromPid and PyLong_AsPid from posixmodule.c into longobject.h. Code reviewed by jeffrey.yasskin at http://codereview.appspot.com/223077/show
* Issue #8014: Fix PyLong_As<c-integer-type> methods not to produce anMark Dickinson2010-03-131-5/+20
| | | | | internal error on non-integer input: they now raise TypeError instead. This is needed for attributes declared via PyMemberDefs.
* Issue #7845: Make 1j.__le__(2j) return NotImplemented rather than raising ↵Mark Dickinson2010-03-131-4/+2
| | | | TypeError.
* Merged revisions 78886 via svnmerge fromVictor Stinner2010-03-131-1/+15
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78886 | victor.stinner | 2010-03-13 01:13:22 +0100 (sam., 13 mars 2010) | 2 lines Issue #7818: set().test_c_api() doesn't expect a set('abc'), modify the set. ........
* Issue #6697: catch _PyUnicode_AsString() errors in getattr() and setattr()Victor Stinner2010-03-121-5/+12
| | | | builtin functions.