sprintf() to PyOS_snprintf() for buffer overrun avoidance.
complex_print(), complex_repr(), complex_str(): Call complex_to_buf()
passing in sizeof(buf).
parameters (like \UNIX) are commonly entered using an empty group to
separate the markup from a following inter-word space; this is not
needed when the next character is punctuation, or the markup is the
last thing in the enclosing group. These cases were marked
inconsistently; the empty group is now *only* used when needed.
PyEval_EvalCodeEx(): increment tstate->recursion_depth around the
decref of the frame, because the C stack for this call is still in
use and the decref can lead to __del__ methods getting called.
While this gives tstate->recursion_depth a value proportional to the
depth of the C stack (instead of a small constant no matter how
deeply __del__s recurse), it's not enough to stop the reported crash
when using the default recursion limit on Windows.
Bugfix candidate.
Bugfix candidate.
tb_displayline(): the sprintf format was choking off the file name, but
used plain %s for the function name (which can be arbitrarily long).
Limit both to 500 chars max.
More changes to the formatdate epoch test: the Mac epoch is in
localtime, so east of GMT it falls in 1903:-( Changed the test to
obtain the epoch in both local time and GMT, and do the right
thing in the comparisons. As a sanity measure also check that
day/month is Jan 1.
_verify(): Pass in the values of globals insted of eval()ing their
names. The use of eval() was obscure and unnecessary, and the patch
claimed random.py couldn't be used in Jython applets because of it.
- Fix for SF bug #482752: __getstate__ & __setstate__ ignored (by Anon.)
In fact, only __getstate__ isn't recognized. This fixes that.
- Separately, the test for base.__flags__ & _HEAPTYPE raised an
AttributeError exception when a classic class was amongst the
bases. Fixed this with a hasattr() bandaid (classic classes never
qualify as the "hard" base class anyway, which is what the code is
trying to find).
confusing error messages. If a new-style class has no sequence or
mapping behavior, attempting to use the indexing notation with a
non-integer key would complain that the sequence index must be an
integer, rather than complaining that the operation is not supported.