Patch by Thomas Wouters <thomas@xs4all.net> with small changes of mine
(in main(), use return instead of exit).
Closes patch #100832
(but I can't assign it to myself, nor close it -- sorry)
* There was no error reported if the .read() method returns a non-string
* If read() returned too much data, the buffer would be overflowed causing a
core dump
* Used strncpy, not memcpy, which seems incorrect if there are embedded \0s.
* The args and bytes objects were leaked
The first two warnings seem harmless enough,
but the last one looks like a potential bug: an
uninitialized int is returned on error. (I also
ended up reformatting some of the code,
because it was hard to read.)
use PyString_AS_STRING macro on local string object
when resizing string, make sure resized string will always be big enough
split string containing error message across two lines
add test to string_tests that causes resizing
Update the "in" / "not in" description to accomodate the current use
of the __contains__() discipline. This patch also incorporates
suggestions from Marc-Andre Lemburg <mal@lemburg.com>, minor markup
revisions from Fred Drake, and some rewording of the first affected
paragraph (also from Fred).
Closes SourceForge patch #100831.
used for indentation related errors. This patch includes Ping's
improvements for indentation-related error messages.
Closes SourceForge patches #100734 and #100856.
elements (since the table was pretty screwed up); this is how it is done
elsewhere in the manual.
I could use some help creating descriptions of the specific error
identifiers (input conditions that lead to each error, etc.).
The Compare close contains a close method that checks to see if there
is any unconsumed data in the Compare instance; i.e. if the canonical
output file contains more data than was produced by the current test
run. This method was never called, allowing differences to go
undetected.
Fix is to call close after the test is run (after __import__)
output/test_long and output/test_popen2 needed trivial changes
output/test_select contained lots of text, but test_select.py produced
no output
seqlen==1 clause, before returning item, we need to DECREF seq. In
the res=PyString... failure clause, we need to goto finally to also
decref seq (and the DECREF of res in finally is changed to a
XDECREF). Also, we need to DECREF seq just before the
PyUnicode_Join() return.
about int size mismatches at two calls to s_rand. Stuffed in
casts to make the code do what it did before but w/o warnings --
although unclear that's correct!
implementation -- use PySequence_Fast interface to iterate over elements
interface -- if instance object reports wrong length, ignore it;
previous version raised an IndexError if reported length was too high
value is calculated from the character values, in a way
that makes sure an 8-bit ASCII string and a unicode string
with the same contents get the same hash value.
(as a side effect, this also works for ISO Latin 1 strings).
for more details, see the python-dev discussion.