summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* [ Bug #116174 ] using %% in cstrings sometimes fails with unicode paramsFix ↵Marc-André Lemburg2000-10-071-11/+17
| | | | | | | for the bug reported in Bug #116174: "%% %s" % u"abc" failed due to the way string formatting delegated work to the Unicode formatting function.
* Donn Cave <donn@oz.net>:Fred Drake2000-10-061-0/+2
| | | | | | | Fix large file support for BeOS. This closes SourceForge patch #101773. Refer to the patch discussion for information on possible alternate fixes.
* SF bug 115831 and Ping's SF patch 101751, 0.0**-2.0 returns inf rather thanTim Peters2000-10-063-32/+47
| | | | | | | | | | raise ValueError. Checked in the patch as far as it went, but also changed all of ints, longs and floats to raise ZeroDivisionError instead when raising 0 to a negative number. This is what 754-inspired stds require, as the "true result" is an infinity obtained from finite operands, i.e. it's a singularity. Also changed float pow to not be so timid about using its square-and-multiply algorithm. Note that what math.pow does is unrelated to what builtin pow does, and will still vary by platform.
* Simplify _PyTuple_Resize by not using the tuple free list and droppingNeil Schemenauer2000-10-051-86/+24
| | | | | support for the last_is_sticky flag. A few hard to find bugs may be fixed by this patch since the old code was buggy.
* Fix for SF bug #115987: PyInstance_HalfBinOp does not initialize theThomas Wouters2000-10-051-11/+11
| | | | | | result-object-pointer that is passed in, when an exception occurs during coercion. The pointer has to be explicitly initialized in the caller to avoid putting trash on the Python stack.
* Move LONG_BIT from intobject.c to pyport.h. #error if it's already beenTim Peters2000-10-051-8/+0
| | | | | | #define'd to an unreasonable value (several recent gcc systems have misdefined it, causing bogus overflows in integer multiplication). Nuke CHAR_BIT entirely.
* - fix a GC bug caused by malloc() failingNeil Schemenauer2000-10-041-1/+1
|
* _PyUnicode_Fini(): Initialize the local freelist walking variable `u'Barry Warsaw2000-10-031-2/+3
| | | | | | after unicode_empty has been freed, otherwise it might not point to the real start of the unicode_freelist. Final closure for SF bug #110681, Jitterbug PR#398.
* In _PyUnicode_Fini(), decref unicode_empty before tearng down the freeGuido van Rossum2000-10-031-2/+2
| | | | list. Discovered by Barry, fix approved by MAL.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-268-67/+1
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* - don't set the titlecase flag for uppercase letters (sorry, tim)Fredrik Lundh2000-09-251-40/+40
|
* unicode database compression, step 3:Fredrik Lundh2000-09-251-10021/+72
| | | | | - use unidb compression for the unicodectype module. smaller, faster, and slightly more portable...
* unicode database compression, step 3:Fredrik Lundh2000-09-251-0/+578
| | | | | | | | - use unidb compression for the unicodectype module. smaller, faster, and slightly more portable... (note: this commit doesn't include the unicodectype.c file itself; I'm still waiting for the reviewers...)
* Replace SIGFPE paranoia around strtod and atof. I don't believe theseTim Peters2000-09-251-0/+4
| | | | | fncs are allowed to raise SIGFPE (see the C std), but OK by me if people using --with-fpectl want to pay for checking anyway.
* Fix for SF bug 110624: float literals behave inconsistently.Tim Peters2000-09-231-16/+44
| | | | | | | | | | | | | | | | | | | | | | | | I fixed the specific complaint but left the (many) large issues untouched. See the (very long) bug report discussion for why: http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=110624 Note that while I left the interface to the undocumented public API function PyFloat_FromString alone, its 2nd argument is useless. From a comment block in the code: RED_FLAG 22-Sep-2000 tim PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG, 1. If v was a regular string, *pend was set to point to its terminating null byte. That's useless (the caller can find that without any help from this function!). 2. If v was a Unicode string, or an object convertible to a character buffer, *pend was set to point into stack trash (the auto temp vector holding the character buffer). That was downright dangerous. Since we can't change the interface of a public API function, pend is still supported but now *officially* useless: if pend is not NULL, *pend is set to NULL.
* Untested patch by Ty Sarna to make TELL64 work on older NetBSD systems.Guido van Rossum2000-09-211-2/+6
| | | | | According to Justin Pettit, this also works on OpenBSD, so I've added that symbol as well.
* As suggested by Toby Dickenson, setting ob_type to NULL inGuido van Rossum2000-09-211-4/+0
| | | | _Py_Dealloc(), is a bad idea (and always was!). So let's drop it.
* Derived from Martin's SF patch 110609: support unbounded ints in ↵Tim Peters2000-09-212-52/+271
| | | | | | | | | | | | | | | | %d,i,u,x,X,o formats. Note a curious extension to the std C rules: x, X and o formatting can never produce a sign character in C, so the '+' and ' ' flags are meaningless for them. But unbounded ints *can* produce a sign character under these conversions (no fixed- width bitstring is wide enough to hold all negative values in 2's-comp form). So these flags become meaningful in Python when formatting a Python long which is too big to fit in a C long. This required shuffling around existing code, which hacked x and X conversions to death when both the '#' and '0' flags were specified: the hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or '+' flags too, since signs were always meaningless before for x and X conversions. Isomorphic shuffling was required in unicodeobject.c. Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
* This patch adds a new Python C API called PyString_AsStringAndSize()Marc-André Lemburg2000-09-191-7/+63
| | | | | | | | | | | | | which implements the automatic conversion from Unicode to a string object using the default encoding. The new API is then put to use to have eval() and exec accept Unicode objects as code parameter. This closes bugs #110924 and #113890. As side-effect, the traditional C APIs PyString_Size() and PyString_AsString() will also accept Unicode objects as parameters.
* PyObject_SetAttr() and PyObject_GetAttr() now also accept UnicodeMarc-André Lemburg2000-09-181-11/+37
| | | | | | | | | | | | | | | objects for the attribute name. Unicode objects are converted to a string using the default encoding before trying the lookup. Note that previously it was allowed to pass arbitrary objects as attribute name in case the tp_getattro/setattro slots were defined. This patch fixes this by applying an explicit string check first: all uses of these slots expect string objects and do not check for the type resulting in a core dump. The tp_getattro/setattro are still useful as optimization for lookups using interned string objects though. This patch fixes bug #113829.
* Fix for SF bug 110688: Instance deallocation neglected to account forTim Peters2000-09-171-12/+28
| | | | | | | | | | that Py_INCREF boosts global _Py_RefTotal when Py_REF_DEBUG is defined but Py_TRACE_REFS isn't. There are, IMO, way too many preprocessor gimmicks in use for refcount debugging (at least 3 distinct true/false symbols, but not all 8 combos are supported by the code, etc etc), and no coherent documentation of this stuff -- 'twas too painful to track this one down.
* Fixed legit gripe from c.l.py that math.fmod docs aren't confusing enough.Tim Peters2000-09-161-1/+1
| | | | FRED, please check my monkey-see-monkey-do Tex fiddling!
* Don't remove instance objects from the GC container set until we areNeil Schemenauer2000-09-151-2/+1
| | | | they are dead. Fixes bug #113812.
* Correctly cast the return value of realloc.Martin v. Löwis2000-09-151-1/+1
|
* Correctly use realloc return value. Fixes bug #114424.Martin v. Löwis2000-09-151-1/+1
|
* 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.