| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
#define'd to an unreasonable value (several recent gcc systems have
misdefined it, causing bogus overflows in integer multiplication). Nuke
CHAR_BIT entirely.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
list. Discovered by Barry, fix approved by MAL.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
- use unidb compression for the unicodectype module. smaller, faster,
and slightly more portable...
|
|
|
|
|
|
|
|
| |
- 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...)
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
According to Justin Pettit, this also works on OpenBSD, so I've added
that symbol as well.
|
|
|
|
| |
_Py_Dealloc(), is a bad idea (and always was!). So let's drop it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
%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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
FRED, please check my monkey-see-monkey-do Tex fiddling!
|
|
|
|
| |
they are dead. Fixes bug #113812.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
strings. closes PEP-223.
also added \U escape (eight hex digits).
|
| |
|
|
|
|
| |
This should match the situation in the 1.6b1 tree.
|
| |
|
| |
|
|
|
|
|
| |
add sanity check to gc: if an exception occurs during GC, call
PyErr_WriteUnraisable and then call Py_FatalEror.
|
| |
|
|
|
|
|
|
|
|
| |
state for dictionaries that have only been indexed by string keys.
See the comments in SourceForge for more.
This closes SourceForge patch #101309.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
operator associativity.
|
|
|
|
|
|
| |
Remove some of GCC's warning in -Wstrict-prototypes mode.
This closes SourceForge patch #101342.
|
|
|
|
|
| |
expression next to a || expression; this is a readability-inspired
warning from GCC.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
the list object supports this currently, but other candidates are
gladly accepted (like arraymodule and such.)
|
|
|
|
| |
initialized in the 'if (..)', do so manually.
|
|
|
|
|
| |
in the PyNumber_* functions. Also, remove unnecessary tests from
PyNumber_Multiply: after BINOP(), neither argument can be an instance.
|
|
|
|
|
| |
Lowered the recursion limit on compares to 60 (one recursion depth can
take a whopping 2K of stack space when running test_b1!)
|
| |
|
|
|
|
| |
`str' is no longer necessary. Gotta turn on -Wall!
|
|
|
|
|
| |
PyUnicode_EncodeUTF8() already returns the created object with the
proper reference count. This fixes an Insure reported memory leak.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|