Patch #101810: check whether zst.avail_out is non-zero when getting
a Z_BUF_ERROR while decompressing. If it is, assume that this means
the data being decompressed is bad and raise an exception, instead of
just assuming that Z_BUF_ERROR always means that more space is required.
[ Bug #116174 ] using %% in cstrings sometimes fails with unicode paramsFix for the bug reported in Bug #116174: "%% %s" % u"abc" failed due
to the way string formatting delegated work to the Unicode formatting
function.
Tim Peters [Sat, 7 Oct 2000 05:09:39 +0000 (05:09 +0000)]
Possible fix for Skip's bug 116136 (sre recursion limit hit in tokenize.py).
tokenize.py has always used naive regexps for matching string literals,
and that appears to trigger the sre recursion limit on Skip's platform (he
has very long single-line string literals). Replaced all of tokenize.py's
string regexps with the "unrolled" forms used in IDLE, where they're known to
handle even absurd (multi-megabyte!) string literals without trouble. See
Friedl's book for explanation (at heart, the naive regexps create a backtracking
choice point for each character in the literal, while the unrolled forms create
none).
Tim Peters [Fri, 6 Oct 2000 23:09:00 +0000 (23:09 +0000)]
Fix for next iteration of SF bug 115690 (Unicode headaches in IDLE). The
parsing functions in support of auto-indent weren't expecting Unicode
strings, but text.get() can now return them (although it remains muddy as
to exactly when or why that can happen). Fixed that with a Big Hammer.
Martin v. Löwis [Fri, 6 Oct 2000 22:36:03 +0000 (22:36 +0000)]
minidom: access attribute value before printing it
correct order of constructor args in createAttributeNS
pulldom: use symbolic names for uri and localnames
correct usage of createAttribute and setAttributeNode signatures.
Martin v. Löwis [Fri, 6 Oct 2000 21:08:59 +0000 (21:08 +0000)]
Move translation from expat.error to SAXParseException into feed, so that
callers of feed will get a SAXException.
In close, feed the last chunk first before calling endDocument, so that
the parser may report errors before the end of the document. Don't do
anything in a nested parser.
Don't call endDocument in parse; that will be called in close.
Use self._source for finding the SystemID; XML_GetBase will be cleared in
case of an error.
Fred Drake [Fri, 6 Oct 2000 19:59:22 +0000 (19:59 +0000)]
Made a number of revisions suggested by Fredrik Lundh.
Revised the first paragraph so it doesn't sound like it was written
when 7-bit strings were assumed; note that Unicode strings can be used.
Jeremy Hylton [Fri, 6 Oct 2000 19:39:55 +0000 (19:39 +0000)]
test_linuxaudio:
read the header from the .au file and do a sanity check
pass only the data to the audio device
call flush() so that program does not exit until playback is complete
call all the other methods to verify that they work minimally
call setparameters with a bunch of bugs arguments
linuxaudiodev.c:
use explicit O_WRONLY and O_RDONLY instead of 1 and 0
add a string name to each of the entries in audio_types[]
add AFMT_A_LAW to the list of known formats
add x_mode attribute to lad object, stores imode from open call
test ioctl return value as == -1, not < 0
in read() method, resize string before return
add getptr() method, that calls does ioctl on GETIPTR or GETOPTR
depending on x_mode
in setparameters() method, do better error checking and raise
ValueErrors; also use ioctl calls recommended by Open Sound
System Programmer's Guido (www.opensound.com)
use PyModule_AddXXX to define names in module
Fred Drake [Fri, 6 Oct 2000 19:39:47 +0000 (19:39 +0000)]
It turns out that Guido does not like or encourage the use of the term
"disciplines" for the __*__() methods, so they should be referred to as
"methods" or "special methods", as appropriate in context.
Fred Drake [Fri, 6 Oct 2000 19:26:01 +0000 (19:26 +0000)]
__getslice__(): Make this use the constructor form that gets a sequence
as a parameter; this was the only use of the base
constructor or surgical alteration of another object's
data attribute.
This change simplifies the constructor requirements for subclasses.
I'm moving redemo.py here from Demo/tkinter/guido, since it is
somewhat useful to learn regular expressions, and this way it'll be
installed on Windows.
[ Bug #113803 ] [2.0b1 NT4.0] printing non asci char causes idle to abort
http://sourceforge.net/bugs/?func=detailbug&bug_id=113803&group_id=5470
Add Unicode support and error handling to AsString(). Both AsString()
and Merge() now return NULL and set a proper Python exception
condition when an error happens; Merge() and other callers of
AsString() check for errors from AsString(). Also fixed cleanup in
Merge() and Tkapp_Call() return cleanup code; the fv array was not
necessarily completely initialized, causing calls to ckfree() with
garbage arguments!
(Also reindented some lines that were longer than 80 chars and
reformatted some code that used an alien coding standard.)
Fred Drake [Fri, 6 Oct 2000 15:48:38 +0000 (15:48 +0000)]
Donn Cave <donn@u.washington.edu>:
Do not assume that all platforms using a MetroWorks compiler can use
POSIX threads; the assumption breaks on BeOS. This fix only helps
for BeOS.
Tim Peters [Fri, 6 Oct 2000 00:36:09 +0000 (00:36 +0000)]
SF bug 115831 and Ping's SF patch 101751, 0.0**-2.0 returns inf rather than
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 dropping
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.
Added Py_FPROTO macro which was available in Python 1.5.x and below.
This should not be used for new code, but will probably make porting
old extensions to 2.0 a lot easier.
Thomas Wouters [Thu, 5 Oct 2000 12:43:25 +0000 (12:43 +0000)]
Fix for SF bug #115987: PyInstance_HalfBinOp does not initialize the
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.
Fred Drake [Thu, 5 Oct 2000 04:05:30 +0000 (04:05 +0000)]
List of acknowledgements culled from CVS checkin logs and memory.
The documentation ACKS list will be maintained separately from the
CPython ACKS list.
Tim Peters [Thu, 5 Oct 2000 01:42:25 +0000 (01:42 +0000)]
Move LONG_BIT from intobject.c to pyport.h. #error if it's already been
#define'd to an unreasonable value (several recent gcc systems have
misdefined it, causing bogus overflows in integer multiplication). Nuke
CHAR_BIT entirely.
Trent Mick [Wed, 4 Oct 2000 20:57:29 +0000 (20:57 +0000)]
Enable the binascii module for Win64. It builds and passes the test suite.
(I had explicitly disabled it a while ago, possibly unecessarily, along with
rgbimg, audioop, and imageop, which are advertised as "not for 64-bit
platforms.)
Trent Mick [Wed, 4 Oct 2000 17:50:59 +0000 (17:50 +0000)]
Fix for test_class.py on Win64. id(self), which on Win64 returns a
PyLong, was used for the return value of a class __hash__ method, which
*must* return a PyInt. Solution: hash() the id(self) value.