Tim Peters [Fri, 22 Mar 2002 02:48:46 +0000 (02:48 +0000)]
SF bug 533198: Complex power underflow raises exception.
Konrad was too kind. Not only did it raise an exception, the specific
exception it raised made no sense. These are old bugs in complex_pow()
and friends:
1. Raising 0 to a negative power isn't a range error, it's a domain
error, so changed c_pow() to set errno to EDOM in that case instead
of ERANGE.
2. Changed complex_pow() to:
A. Used the Py_ADJUST_ERANGE2 macro to try to clear errno of a spurious
ERANGE error due to underflow in the libm pow() called by c_pow().
B. Produced different exceptions depending on the errno value:
i) For errno==EDOM, raise ZeroDivisionError instead of ValueError.
This is for consistency with the non-complex cases 0.0**-2 and
0**-2 and 0L**-2.
ii) For errno==ERANGE, raise OverflowError.
[Bug #532115] netrc module was broken
* 'macdef' (macro definition) wasn't parsed correctly
* account value not reset for a subsequent 'default' line
* typo: 'whitepace' -> 'whitespace'
Jack Jansen [Thu, 21 Mar 2002 22:36:57 +0000 (22:36 +0000)]
For reasons I don't fully understand we sometimes get unexpected events
in MachoPython. As we don't have MacOS.HandleEvent() we drop these on
the floor (with a print).
Walter Dörwald [Thu, 21 Mar 2002 10:38:40 +0000 (10:38 +0000)]
[Apply SF patch #504943]
This patch makes it possible to pass Warning instances as the first
argument to warnings.warn. In this case the category argument
will be ignored. The message text used will be str(warninginstance).
Tim Peters [Wed, 20 Mar 2002 04:02:31 +0000 (04:02 +0000)]
Arrange to export the _PyMalloc_{Malloc, Realloc, Free} entry points. On
Windows some modules are considered (by me, and I don't care what anyone
else thinks about this <wink>) to be part of "the core" despite that they
happen to be compiled into separate DLLs (the "to DLL or not to DLL?"
question on Windows is nearly arbitrary). Making the pymalloc entry
points available to them allows the Windows build to complete without
incident when WITH_PYMALLOC is #define'd.
Note that this isn't unprecedented. Other "private API" functions we
export include _PySequence_IterSearch, _PyEval_SliceIndex, _PyCodec_Lookup,
_Py_ZeroStruct, _Py_TrueStruct, _PyLong_New and _PyModule_Clear.
Fred Drake [Tue, 19 Mar 2002 03:33:33 +0000 (03:33 +0000)]
Clarify that copy_reg.pickle() is not intended for use with "classic" classes.
This was stated before, but a minor grammatical error made it difficult to be
sure of the meaning.
This closes SF bug #530143.
[Bug #531616] Make HTTPS work again by adding a sendall method to the
FakeSocket class. Without it, the sendall() call got the method on
the underlying socket object, and that messed up SSL.
Does httplib use other methods of sockets that FakeSocket doesn't support?
Someone should take a look... (I'll try to give it a once-over.)
Barry Warsaw [Mon, 18 Mar 2002 18:53:56 +0000 (18:53 +0000)]
(py-temp-directory): Add /var/tmp to the list of directories this
searches. This is added after /tmp. Closes SF bug #505488, except
that /var/tmp comes after /tmp instead of the patch's suggestion of
putting it before /usr/tmp.
Guido van Rossum [Mon, 18 Mar 2002 03:09:06 +0000 (03:09 +0000)]
Fix for SF bug 528132 (Armin Rigo): classmethod().__get__() segfault
The proper fix is not quite what was submitted; it's really better to
take the class of the object passed rather than calling PyMethod_New
with NULL pointer args, because that can then cause other core dumps
later.
I also added a testcase for the fix to classmethods() in test_descr.py.
Paul Prescod [Mon, 18 Mar 2002 02:13:48 +0000 (02:13 +0000)]
netrc will now raise a more predictable exception when $HOME is not set
(as it is often not on Windows). The code was always designed so that it
would raise an IOError if there was no .netrc. But if there was no $HOME
it would return a KeyError which would be somewhat unexpected for code
that didn't know the algorithm it used to find .netrc. The particular
code that triggered this problem for me was ftpmirror.py which handled
the IOError gracefully, but not the KeyError.
Fred Drake [Sat, 16 Mar 2002 05:58:12 +0000 (05:58 +0000)]
Clarify the descriptions of the positive and negative lookbehind assertions.
Added examples of positive lookbehind assertions.
This closes SF bug #529708.
Fred Drake [Sat, 16 Mar 2002 04:52:36 +0000 (04:52 +0000)]
pdfTeX 0.13 and 0.14 do not agree on the name of the macro, and I will not
change the installed version on either of the machines I use to format the
docs. Instead, use a compatibility hack to support both versions. This is
also better for external users of the Python styles.
Fred Drake [Fri, 15 Mar 2002 23:21:37 +0000 (23:21 +0000)]
Revise the markup related to the grammar productions to increase the
level of predictability. This is not really "good" markup, but is arguably
better than we had before.
This closes SF bug #523117.
Barry Warsaw [Fri, 15 Mar 2002 16:46:46 +0000 (16:46 +0000)]
(py-honor-comment-indentation, py-compute-indentation): Fix the
implementation to match the documentation for
py-honor-comment-indentation w.r.t. not nil or t value. In that case
it should still ignore ## for indentation purposes. Closes SF bug
#523825, w/ patch provided by Christian Stork (mod'd by Barry).
Skip Montanaro [Fri, 15 Mar 2002 13:52:43 +0000 (13:52 +0000)]
Corrected _localized_name.__getitem__ based on code in patch 503202 (which I
thought was just a bug report, so didn't notice - doh!). This handles
slicing, which v 1.23 didn't.
Jack Jansen [Fri, 15 Mar 2002 13:50:54 +0000 (13:50 +0000)]
Skip test_longexp for MacPython on Mac OS X. It triggers a pathological realloc slowdown. Some tests with shorter expressions lead me to the conclusion that it will eventually finish, but it may take a few weeks:-)
Skip Montanaro [Fri, 15 Mar 2002 04:08:38 +0000 (04:08 +0000)]
make _localized_name instances work more like the tuples they replaced. In
particular, negative indexes work and they are limited by the actual length
of the names they represent (weekday and month names). This closes bug
#503202.
Guido van Rossum [Thu, 14 Mar 2002 23:05:54 +0000 (23:05 +0000)]
"Fix" for SF bug #520644: __slots__ are not pickled.
As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
Bugfix candidate (also the checkin to typeobject.c, of course).
Guido van Rossum [Thu, 14 Mar 2002 23:03:14 +0000 (23:03 +0000)]
"Fix" for SF bug #520644: __slots__ are not pickled.
As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
Skip Montanaro [Thu, 14 Mar 2002 17:35:25 +0000 (17:35 +0000)]
update text to refer to ServerProxy class in preference to Server, which is
only retained for backward compatibility with older versions of the library.
Tim Peters [Wed, 13 Mar 2002 21:51:55 +0000 (21:51 +0000)]
Move to zlib 1.1.4 on Windows (the new version that squashes the "double
free" glitch).
Bugfix candidate -- I'll backpatch this into 2.2.1 later this week.
Fred Drake [Wed, 13 Mar 2002 02:48:24 +0000 (02:48 +0000)]
Extend the list of special characters and magic markup used to produce them
to include various characters used in code samples, URLs, and other special
contexts.
This closes SF bug #525684.
Fred Drake [Wed, 13 Mar 2002 02:44:50 +0000 (02:44 +0000)]
Change the way \textasciitilde is implemented so it works more consistently
(dropping tildes into data that still goes through LaTeX-like processing is
a bad idea).