Martin v. Löwis [Thu, 6 Sep 2001 08:51:38 +0000 (08:51 +0000)]
Patch #416079: fix the debug string output when receiving telnet commands.
added all the telnet options known to arpa/telnet.h
added all the options registered with IANA as of today
added the possibility for the user to have it's own option negotiation callback
Steve Purcell [Thu, 6 Sep 2001 08:24:40 +0000 (08:24 +0000)]
Changed TestResult to store only the text representation of an error.
This patch is similar to that proposed by Jeremy. The proposed patch altered
the interface of TestResult such that it would be passed the error
information as a string rather than an exc_info() tuple.
The implemented change leaves the interface untouched so that TestResults
are still passed the tracebacks, but stor them in stringified form for
later reporting.
Notes:
- Custom subclasses of TestResult written by users should be unaffected.
- The existing 'unittestgui.py' will still work with this module after the
change.
- Support can later be added to pop into the debugger when an error occurs;
this support should be added to a TestRunner rather than to TestCase itself,
which this change will enable.
(Jeremy, Fred, Guido: Thanks for all the feedback)
Tim Peters [Thu, 6 Sep 2001 01:17:45 +0000 (01:17 +0000)]
Dubious assumptions:
1. That seeking beyond the end of a file increases the size of a file.
2. That files so extended are magically filled with null bytes.
I find no support for either in the C std, and #2 in particular turns out
not to be true on Win32 (you apparently see whatever trash happened to be
on disk). Left #1 intact, but changed the test to check only bytes it
explicitly wrote. Also fiddled the "expected" vs "got" failure reports
to consistently use repr (%r) -- they weren't readable otherwise.
Tim Peters [Thu, 6 Sep 2001 00:32:15 +0000 (00:32 +0000)]
Enable large file support on Win32 systems.
Curious: the MS docs say stati64 etc are supported even on Win95, but
Win95 doesn't support a filesystem that allows partitions > 2 Gb.
test_largefile: This was opening its test file in text mode. I have no
idea how that worked under Win64, but it sure needs binary mode on Win98.
BTW, on Win98 test_largefile runs quickly (under a second).
Add PyMethod_Function(), PyMethod_Self(), PyMethod_Class() back.
While not even documented, they were clearly part of the C API,
there's no great difficulty to support them, and it has the cool
effect of not requiring any changes to ExtensionClass.c.
Tim Peters [Wed, 5 Sep 2001 22:36:56 +0000 (22:36 +0000)]
Rework the way we try to check for libm overflow, given that C99 no longer
requires that errno ever get set, and it looks like glibc is already
playing that game. New rules:
+ Never use HUGE_VAL. Use the new Py_HUGE_VAL instead.
+ Never believe errno. If overflow is the only thing you're interested in,
use the new Py_OVERFLOWED(x) macro. If you're interested in any libm
errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts
to set errno the way C89 said it worked.
Unfortunately, none of these are reliable, but they work on Windows and I
*expect* under glibc too.
Jack Jansen [Wed, 5 Sep 2001 22:09:50 +0000 (22:09 +0000)]
Rudimentary makefile for building the executable to go into a
fullblown OSX application. It is starting to work, but building
the application bundle is still handwork, and we need a minimal
readme file too.
Jack Jansen [Wed, 5 Sep 2001 22:07:52 +0000 (22:07 +0000)]
Changes to make these work under OSX as the main program for a
fullblown drag and drop application. To my surprise it is starting
to work already: Python actually executes a script dropped on it.
To be done:
- Make sure this still works in MacPython
- Don't lose argv[0] in the process
- Applet support
Jack Jansen [Wed, 5 Sep 2001 20:08:07 +0000 (20:08 +0000)]
LongReprTest fails on the Mac because it uses filenames with more than
32 characters per component. This makes mkdir() calls and such fail with EINVAL.
For now I am disabling the test on the Mac, and I'll open a bugreport.
SF bug #427073: DLINCLDIR defined incorrectly (Skip Montanaro).
I don't know what difference it makes, but '/' indeed makes less sense
as an include dir than '.', so I'm changing the default. Just so I
can close the bug. ;-)
Changes to automatically enable large file support on some systems.
I believe this works on Linux (tested both on a system with large file
support and one without it), and it may work on Solaris 2.7.
The changes are twofold:
(1) The configure script now boldly tries to set the two symbols that
are recommended (for Solaris and Linux), and then tries a test
script that does some simple seeking without writing.
(2) The _portable_{fseek,ftell} functions are a little more systematic
in how they try the different large file support options: first
try fseeko/ftello, but only if off_t is large; then try
fseek64/ftell64; then try hacking with fgetpos/fsetpos.
I'm keeping my fingers crossed. The meaning of the
HAVE_LARGEFILE_SUPPORT macro is not at all clear.
I'll see if I can get it to work on Windows as well.
Martin v. Löwis [Wed, 5 Sep 2001 14:45:54 +0000 (14:45 +0000)]
Patch #453627: Define the following macros when compiling on a UnixWare 7.x system:
SCO_ATAN2_BUG, SCO_ACCEPT_BUG, and STRICT_SYSV_CURSES.
Work aroudn a bug in the SCO UnixWare atan2() implementation.
Thomas Heller [Wed, 5 Sep 2001 13:00:40 +0000 (13:00 +0000)]
Implement PEP250: Use Lib/site-packages under windows.
bdist_wininst doesn't use the NT SCHEME any more, instead
a custom SCHEME is used, which is exchanged at installation
time, depending on the python version used.
Avoid a bogus warning frpom install_lib about installing
into a directory not on sys.path.
[Bug #404274] Restore some special-case code for AIX and BeOS under 1.5.2.
This will have to stay until we decide to drop 1.5.2 compatibility
completely.
Tim Peters [Wed, 5 Sep 2001 05:38:10 +0000 (05:38 +0000)]
Try to recover from that glibc's ldexp apparently doesn't set errno on
overflow. Needs testing on Linux (test_long.py and test_long_future.py
especially).
Tim Peters [Wed, 5 Sep 2001 00:53:45 +0000 (00:53 +0000)]
Return reasonable results for math.log(long) and math.log10(long) (we were
getting Infs, NaNs, or nonsense in 2.1 and before; in yesterday's CVS we
were getting OverflowError; but these functions always make good sense
for positive arguments, no matter how large).
Jack Jansen [Tue, 4 Sep 2001 21:33:12 +0000 (21:33 +0000)]
On MacOSX built the toolbox extension modules iff we're building with
--enable-framework.
Some modules that are also useful outside a fullblown application are
always built.
Tim Peters [Tue, 4 Sep 2001 19:48:01 +0000 (19:48 +0000)]
Revert one of the "division fixes" in test_long. It intends to try both
"/" and "//", and doesn't really care what they *mean*, just that both
are tried (and that, whatever they mean, they act similarly for int and
long arguments).
The first batch of changes recommended by the fixdiv tool. These are
mostly changes of / operators into //. Once or twice I did more or
less than recommended.
Move call_trace(..., PyTrace_CALL, ...) call to top of eval_frame. That
way it's called each time a generator is resumed. The tracing of normal
functions should be unaffected by this change.
Fred Drake [Tue, 4 Sep 2001 18:18:36 +0000 (18:18 +0000)]
Added documentation for sys.maxunicode and sys.warnoptions.
Fixed a markup error which caused an em dash to be presented as a minus sign.
This closes SF bug #458350.
Fred Drake [Tue, 4 Sep 2001 16:26:03 +0000 (16:26 +0000)]
HTMLParser is allowed to be more strict than sgmllib, so let's not
change their basic behavior: When parsing something that cannot possibly
be valid in either HTML or XHTML, raise an exception.
- Reverse the meaning of the -m option: warnings about multiple /
operators per line or statement are now on by default, and -m turns
these warnings off.
- Change the way multiple / operators are reported; a regular
recommendation is always emitted after the warning.
- Report ambiguous warnings (both int|long and float|complex used for
the same operator).
- Update the doc string again to clarify all this and describe the
possible messages more precisely.
Suppressing all DeprecationWarning messages was a bit of a problem for
the -Qwarnall option, so I've changed this to only filter out the one
warning that's a problem in practice.
Tim Peters [Tue, 4 Sep 2001 05:14:19 +0000 (05:14 +0000)]
Raise OverflowError when appropriate on long->float conversion. Most of
the fiddling is simply due to that no caller of PyLong_AsDouble ever
checked for failure (so that's fixing old bugs). PyLong_AsDouble is much
faster for big inputs now too, but that's more of a happy consequence
than a design goal.
PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense. Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
Tim Peters [Tue, 4 Sep 2001 02:50:49 +0000 (02:50 +0000)]
Introduce new private API function _PyLong_AsScaledDouble. Not used yet,
but will be the foundation for Good Things:
+ Speed PyLong_AsDouble.
+ Give PyLong_AsDouble the ability to detect overflow.
+ Make true division of long/long nearly as accurate as possible (no
spurious infinities or NaNs).
+ Return non-insane results from math.log and math.log10 when passing a
long that can't be approximated by a double better than HUGE_VAL.
Tim Peters [Tue, 4 Sep 2001 01:20:04 +0000 (01:20 +0000)]
builtin_dir(): Treat classic classes like types. Use PyDict_Keys instead
of PyMapping_Keys because we know we have a real dict. Tolerate that
objects may have an attr named "__dict__" that's not a dict (Py_None
popped up during testing).
test_descr.py, test_dir(): Test the new classic-class behavior; beef up
the new-style class test similarly.
test_pyclbr.py, checkModule(): dir(C) is no longer a synonym for
C.__dict__.keys() when C is a classic class (looks like the same thing
that burned distutils! -- should it be *made* a synoym again? Then it
would be inconsistent with new-style class behavior.).