summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Fix for bug 113934. string*n and unicode*n did no overflow checking atTim Peters2000-09-092-4/+36
| | | | | | | all, either to see whether the # of chars fit in an int, or that the amount of memory needed fit in a size_t. Checking these is expensive, but the alternative is silently wrong answers (as in the bug report) or core dumps (which were easy to provoke using Unicode strings).
* changed \x to consume exactly two hex digits, also for unicodeFredrik Lundh2000-09-031-55/+66
| | | | | | strings. closes PEP-223. also added \U escape (eight hex digits).
* Cosmetic cleanup by Vladimir.Thomas Wouters2000-09-021-43/+49
|
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-0120-180/+0
| | | | This should match the situation in the 1.6b1 tree.
* Rewritten some pieces of PyNumber_InPlaceAdd() for clarity.Guido van Rossum2000-09-011-15/+20
|
* Fix grouping, again. This time properly :-) Sorry, guys.Thomas Wouters2000-09-011-3/+3
|
* refactor __del__ exception handler into PyErr_WriteUnraisableJeremy Hylton2000-09-011-20/+1
| | | | | add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror.
* Add parens suggested by gcc -Wall.Guido van Rossum2000-09-011-2/+3
|
* Slight performance hack that also avoids requiring the existence of threadFred Drake2000-08-311-12/+124
| | | | | | | | state for dictionaries that have only been indexed by string keys. See the comments in SourceForge for more. This closes SourceForge patch #101309.
* Clear errors raised by PyObject_Compare() without losing any existingFred Drake2000-08-311-9/+44
| | | | | | | | | | exception context. This avoids improperly propogating errors raised by a user-defined __cmp__() by a subsequent lookup operation. This patch does *not* include the performance enhancement patch for dictionaries with string keys only; that will be checked in separately. This closes SourceForge patch #101277 and bug #112558.
* Fix grouping: this is how I intended it, misguided as I was in booleanThomas Wouters2000-08-311-2/+2
| | | | operator associativity.
* Peter Schneider-Kamp <nowonder@nowonder.de>:Fred Drake2000-08-311-7/+3
| | | | | | Remove some of GCC's warning in -Wstrict-prototypes mode. This closes SourceForge patch #101342.
* Removed compiler warning about wanting explicit grouping around &&Fred Drake2000-08-311-4/+6
| | | | | expression next to a || expression; this is a readability-inspired warning from GCC.
* PyOS_CheckStack() returns 1 when failing, not -1.Guido van Rossum2000-08-301-1/+1
|
* Fixed a serious typo.Marc-André Lemburg2000-08-251-1/+1
|
* Fix to bug [ Bug #111860 ] file.writelines() crashes.Marc-André Lemburg2000-08-251-9/+34
| | | | | | | file.writelines() now tries to emulate the behaviour of file.write() as closely as possible. Due to the problems with releasing the interpreter lock the solution isn't exactly optimal, but still better than not supporting the file.write() semantics at all.
* Call PyErr_Clear() to clear the AttributeError raised by GetAttr.Thomas Wouters2000-08-251-0/+1
|
* Support for the in-place operations introduced by augmented assignment. OnlyThomas Wouters2000-08-243-29/+647
| | | | | the list object supports this currently, but other candidates are gladly accepted (like arraymodule and such.)
* Addendum to previous change: now that 'f' is not unconditionallyThomas Wouters2000-08-231-11/+11
| | | | initialized in the 'if (..)', do so manually.
* Add extra check on whether 'tp_as_number' is still non-NULL after coercion,Thomas Wouters2000-08-231-24/+28
| | | | | in the PyNumber_* functions. Also, remove unnecessary tests from PyNumber_Multiply: after BINOP(), neither argument can be an instance.
* Added PyOS_CheckStack call to PyObject_CompareJack Jansen2000-08-221-0/+13
| | | | | Lowered the recursion limit on compares to 60 (one recursion depth can take a whopping 2K of stack space when running test_b1!)
* Added include for limits.hJack Jansen2000-08-222-0/+8
|
* PyUnicode_AsUTF8String(): /F picks up what I missed: the local varBarry Warsaw2000-08-181-2/+0
| | | | `str' is no longer necessary. Gotta turn on -Wall!
* PyUnicode_AsUTF8String(): Don't need to explicitly incref str sinceBarry Warsaw2000-08-181-7/+3
| | | | | PyUnicode_EncodeUTF8() already returns the created object with the proper reference count. This fixes an Insure reported memory leak.
* make_pair(): When comparing the pointers, they must be cast to integerBarry Warsaw2000-08-181-2/+6
| | | | | | types (i.e. Py_uintptr_t, our spelling of C9X's uintptr_t). ANSI specifies that pointer compares other than == and != to non-related structures are undefined. This quiets an Insure portability warning.
* PyFloat_FromString(): Move s_buffer[] up to the top-level functionBarry Warsaw2000-08-181-2/+1
| | | | | | scope. Previously, s_buffer[] was defined inside the PyUnicode_Check() scope, but referred to in the outer scope via assignment to s. This quiets an Insure portability warning.
* PyInstance_DoBinOp(): When comparing the pointers, they must be castBarry Warsaw2000-08-181-1/+4
| | | | | | | to integer types (i.e. Py_uintptr_t, our spelling of C9X's uintptr_t). ANSI specifies that pointer compares other than == and != to non-related structures are undefined. This quiets an Insure portability warning.
* Apply SF patch #101029: call __getitem__ with a proper slice object if thereThomas Wouters2000-08-172-9/+97
| | | | | | | | is no __getslice__ available. Also does the same for C extension types. Includes rudimentary documentation (it could use a cross reference to the section on slice objects, I couldn't figure out how to do that) and a test suite for all Python __hooks__ I could think of, including the new behaviour.
* Insure properly identifies the `interned' dictionary as leaking atBarry Warsaw2000-08-161-0/+12
| | | | | | shutdown time, but CVS log entry for revision 2.45 explains why this is so. Simply include a comment so we don't have to re-figure it out again 5 years from now.
* Updated commentAndrew M. Kuchling2000-08-161-1/+1
|
* Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.Tim Peters2000-08-154-100/+74
| | | | | | | | | | | This was a misleading bug -- the true "bug" was that hash(x) gave an error return when x is an infinity. Fixed that. Added new Py_IS_INFINITY macro to pyport.h. Rearranged code to reduce growing duplication in hashing of float and complex numbers, pushing Trent's earlier stab at that to a logical conclusion. Fixed exceedingly rare bug where hashing of floats could return -1 even if there wasn't an error (didn't waste time trying to construct a test case, it was simply obvious from the code that it *could* happen). Improved complex hash so that hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
* Fixed a couple of instances where a 0-length string was beingMarc-André Lemburg2000-08-141-6/+13
| | | | | | | resized after creation. 0-length strings are usually shared and _PyString_Resize() fails on these shared strings. Fixes [ Bug #111667 ] unicode core dump.
* Check for overflow in list object insertion and raise OverflowError.Trent Mick2000-08-131-0/+5
| | | | see: http://www.python.org/pipermail/python-dev/2000-August/014971.html
* Clean up warning from Monterey compiler.Trent Mick2000-08-121-1/+1
| | | | | | Properly end a comment block. It was terminated fine later but by a subsequent block and. It was also in #if 0. This patch is so trivial I can't believe I am talking about it. :)
* Clean up a warning on Win64. The downcast of the strlen size_tTrent Mick2000-08-121-1/+1
| | | | | return value to int is safe here because it previously checked that there will be no overflow.
* Add the current Win64 compiler to the list of those that need theTrent Mick2000-08-121-1/+5
| | | | | huge switch statement broken up. This will probably not be necessary when the Win64 compiler matures.
* Add largefile support for Linux64 and WIn64. Add test_largefile and some minorTrent Mick2000-08-111-37/+145
| | | | | | | | | | change to regrtest.py to allow optional running of test_largefile ('cause it's slow on Win64). This closes patches: http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100510&group_id=5470 and http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=100511&group_id=5470
* Fix missing decrements of the recursive counter in PyObject_Compare().Vladimir Marangozov2000-08-111-6/+12
| | | | Closes Patch #101065.
* Barry's patch to implement the new setdefault() method.Guido van Rossum2000-08-081-0/+36
|
* Removing UTF-16 aware Unicode comparison code. This kind of compareMarc-André Lemburg2000-08-081-0/+33
| | | | | | | function (together with other locale aware ones) should into a new collation support module. See python-dev for a discussion of this removal. Note: This patch should also be applied to the 1.6 branch.
* Removing warnings found by gcc -WallMoshe Zadka2000-08-042-4/+9
|
* Boost buffer sizes in the absence of snprintf on Windows.Tim Peters2000-08-041-14/+19
| | | | Ensure that # of args to sprintf always matches # of format specifiers.
* snprintf() is not portable, so continue to use sprintf() until a portableFred Drake2000-08-041-8/+6
| | | | snprintf() is available.
* This patch finalizes the move from UTF-8 to a default encoding inMarc-André Lemburg2000-08-031-40/+40
| | | | | | | | | | | | | | | | | | the Python Unicode implementation. The internal buffer used for implementing the buffer protocol is renamed to defenc to make this change visible. It now holds the default encoded version of the Unicode object and is calculated on demand (NULL otherwise). Since the default encoding defaults to ASCII, this will mean that Unicode objects which hold non-ASCII characters will no longer work on C APIs using the "s" or "t" parser markers. C APIs must now explicitly provide Unicode support via the "u", "U" or "es"/"es#" parser markers in order to work with non-ASCII Unicode strings. (Note: this patch will also have to be applied to the 1.6 branch of the CVS tree.)
* Remove the tp_print handler.Fred Drake2000-08-031-31/+27
| | | | | Revise the tp_repr handler to produce a more "minimal" presentation. Make the tolist() method use PyArg_ParseTuple() and provide a docstring.
* Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.Guido van Rossum2000-08-031-10/+0
| | | | | | This doesn't change the copyright status for these files -- just the markings! Doing it on the main branch for these three files for which the HEAD revision was pushed back into 1.6.
* Changing the CNRI copyright notice according to CNRI's instructions.Guido van Rossum2000-08-032-2/+2
| | | | | This is a notice without a date, which apparently is not a claim to copyright but only advice to the reader. IANAL. :-)
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-316-7/+0
| | | | marked my*.h as obsolete
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-252-10/+10
| | | | Leave the actual #define in for API compatibility.
* ANSIfy functions that were hiding inside a macro.Thomas Wouters2000-07-231-1/+1
|