Jack Jansen [Sun, 29 Jul 2001 21:50:44 +0000 (21:50 +0000)]
These demos used silly refcon values when creating their windows. This effectuively caused Pythons automatic cleanup of windows on refcount reaching zero to be disabled.
Jack Jansen [Sun, 29 Jul 2001 21:23:18 +0000 (21:23 +0000)]
If you double-click a file with creator Pyth but owner != TEXT exit with a warning that this is not a script but an auxiliary document such as a preferrences file or an aplication template. This is a lot better than giving syntax errors on binary data:-)
Fix showstopper SF bug #442983: use of site.addsitedir() was broken
because it references the global dirs_in_sys_path which is deleted.
The fix avoids deleting that global.
(My email through python.org or digicool.com is non-functional at the
moment; use gvanrossum@home.com to reach me.)
Fred Drake [Thu, 19 Jul 2001 03:47:04 +0000 (03:47 +0000)]
Remove some false comments.
Reorganize so the initialization sequences does not bite us in the foot.
(There is no good reason to discard classes that clients may want to
subclass.)
Thomas Wouters [Mon, 16 Jul 2001 16:03:31 +0000 (16:03 +0000)]
Backport of AMK's checkin 2.52:
[Bug #438050]
Include sys/poll.h if it was found by the configure script. The OpenGroup
spec says poll.h is the correct header file to use, so that file is
preferred.
Thomas Wouters [Mon, 16 Jul 2001 15:45:20 +0000 (15:45 +0000)]
Fix SF #441664: Python crash on del of a slice of a mmap
Check for slice/item deletion, which calls slice/item assignment with a NULL
value, and raise a TypeError instead of coredumping. Bugreport and suggested
fix by Alex Martelli.
Thomas Wouters [Fri, 13 Jul 2001 15:10:55 +0000 (15:10 +0000)]
Expand the blob on Solaris to mention passing '-Xc' to compile Python
correctly. Note that 'faulty' should actually be spelled 'fawlty', but I
don't want those bugreports assigned to me ;)
Thomas Wouters [Thu, 12 Jul 2001 12:43:11 +0000 (12:43 +0000)]
Net result of Tim's checkins 2.28 through 2.31:
- SF but #417587: compiler warnings compiling 2.1.
Repaired *some* of the SGI compiler warnings Sjoerd Mullender
reported.
- Minor fiddling related to
SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
- Fix the .find() method for memory maps.
1) it didn't obey the "start" parameter (and when it does, we must
validate the value)
2) the return value needs to be an absolute index, rather than
relative to some arbitrary point in the file
(checking CVS, it appears this method never worked; these changes
bring it into line with typical .find() behavior)
- Fix new compiler warnings. Also boost "start" from (C) int to long and
return a (C) long: PyArg_ParseTuple and Py_BuildValue may not let
us get at the size_t we really want, but C int is clearly too small
for a 64-bit box, and both the start parameter and the return value
should work for large mapped files even on 32-bit boxes. The code
really needs to be rethought from scratch (not by me, though ...).
Thomas Wouters [Wed, 11 Jul 2001 22:27:39 +0000 (22:27 +0000)]
Re-do the broken-nice() patch to break less platforms. Hopefully none :P
Also note that it isn't just Linux nice() that is broken: at least FreeBSD
and BSDI also have this problem. os.nice() should probably just be emulated
using getpriority()/setpriority(), if they are available, but that isn't
worth putting in 2.1.1.
Thomas Wouters [Wed, 11 Jul 2001 12:18:24 +0000 (12:18 +0000)]
Backport of Guido's checkins of acconfig.h (1.50), configure.in (1.224) and
readline.c (2.36), and re-generated config.h.in and configure:
SF Patch #432457 by Jason Tishler: support for readline 4.2.
This patch allows the readline module to build cleanly with GNU
readline 4.2 without breaking the build for earlier GNU readline
versions. The configure script checks for the presence of
rl_completion_matches in libreadline.
Thomas Wouters [Wed, 11 Jul 2001 12:15:15 +0000 (12:15 +0000)]
Backport of the socketserver test, including output file (which is still
necessary in the 2.1 branch.) Guido's original checkin message:
A test suite for SocketServer.py that exposes the various bugs just
fixed. Regrettably, this must be run manually -- somehow the I/O
redirection of the regression test breaks the test. When run under
the regression test, this raises ImportError with a warning to that
effect.
Thomas Wouters [Wed, 11 Jul 2001 12:05:49 +0000 (12:05 +0000)]
Backport of Guido's checkin 1.25:
Fix various serious problems:
- The ThreadingTCPServer class and its derived classes were completely
broken because the main thread would close the request before the
handler thread had time to look at it. This was introduced by
Ping's close_request() patch. The fix moves the close_request()
calls to after the handler has run to completion in the BaseServer
class and the ForkingMixIn class; when using the ThreadingMixIn,
closing the request is the handler's responsibility.
- The ForkingUDPServer class has always been been broken because the
socket was closed in the child before calling the handler. I fixed
this by simply not calling server_close() in the child at all.
- I cannot get the UnixDatagramServer class to work at all. The
recvfrom() call doesn't return a meaningful client address. I added
a comment to this effect. Maybe it works on other Unix versions.
- The __all__ variable was missing ThreadingMixIn and ForkingMixIn.
- Bumped __version__ to "0.4".
- Added a note about the test suite (to be checked in shortly).
Thomas Wouters [Wed, 11 Jul 2001 12:03:44 +0000 (12:03 +0000)]
Backport of Tim's checkin 2.178:
SF bug #438295: [Windows] __init__.py cause strange behavior
Probable fix (the bug report doesn't have enough info to say for sure).
find_init_module(): Insist on a case-sensitive match for __init__ files.
Given __INIT__.PY instead, find_init_module() thought that was fine, but
the later attempt to do find_module("__INIT__.PY") didn't and its caller
silently suppressed the resulting ImportError. Now find_init_module()
refuses to accept __INIT__.PY to begin with.
Thomas Wouters [Wed, 11 Jul 2001 11:38:20 +0000 (11:38 +0000)]
Backport Tim's checkin 1.17:
SF patch #440144: Tests and minor bugfix for uu module
decode(): While writing tests for uu.py, Nick Mathewson discovered
that the 'Truncated input file' exception could never get raised,
because its "if not str:" test was actually testing the builtin
function "str", not the local string vrbl "s" as intended.
Fred Drake [Tue, 10 Jul 2001 16:11:09 +0000 (16:11 +0000)]
Document PyObject_New(), PyObject_NewVar(), PyObject_Init(),
PyObject_InitVar(), PyObject_Del(), PyObject_NEW(),
PyObject_NEW_VAR(), and PyObject_DEL().
Add notes to PyMem_Malloc() and PyMem_New() about the memory buffers
not being initialized.
This fixes SF bug #439012.
Added explicit return value information for PyList_SetItem(),
PyDict_SetItem(), and PyDict_SetItemString(). Corrected return type
for PyList_SET_ITEM().
Fixed index entries in the descriptions of PyLong_AsLong() and
PyLong_AsUnignedLong().
This fixes the API manual portion of SF bug #440037.
Note that the headers properly declare everything as 'extern "C"' for
C++ users.
Document _Py_NoneStruct.
Added links to the Extending & Embedding manual for PyArg_ParseTuple()
and PyArg_ParseTupleAndKeywords().
Added note that PyArg_Parse() should not be used in new code.
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.
Thomas Wouters [Mon, 9 Jul 2001 14:34:16 +0000 (14:34 +0000)]
Fix for SF bug #436525, reported by Greg Kochanski:
The block/unblock thread macros are called 'Py_BLOCK_THREADS' and
'Py_UNBLOCK_THREADS', not 'Py_BEGIN_BLOCK_THREADS' and
'Py_BEGIN_UNBLOCK_THREADS'.
Fred Drake [Fri, 6 Jul 2001 17:23:22 +0000 (17:23 +0000)]
When reading a continuation line, make sure we still use the transformed
name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.
Fred Drake [Thu, 5 Jul 2001 18:22:48 +0000 (18:22 +0000)]
Allow underscores in tag names and quote characters in unquoted attribute
values. The change for attribute values matches the way Mozilla and
Navigator view the world, at least.
Fred Drake [Fri, 29 Jun 2001 15:41:19 +0000 (15:41 +0000)]
SourceForge bug #437041:
Use a portable format in the example that creates a timestamp suitable for
use in email, also updating it and the footnote from RFC 822 to RFC 2822.
Fred Drake [Fri, 29 Jun 2001 15:00:34 +0000 (15:00 +0000)]
Simplify an example based on comment from Thomas Holenstein <thomas@hex.ch>:
Do not use an extra flag variable to test only once in one subsequent if
statement.
Thomas Wouters [Wed, 27 Jun 2001 14:26:58 +0000 (14:26 +0000)]
Backport of Tim's checkin 1.35:
SF bug 434186: 0x80000000/2 != 0x80000000>>1
i_divmod: New and simpler algorithm. Old one returned gibberish on most
boxes when the numerator was -sys.maxint-1. Oddly enough, it worked in the
release (not debug) build on Windows, because the compiler optimized away
some tricky sign manipulations that were incorrect in this case.
Makes you wonder <wink> ...
Thomas Wouters [Wed, 27 Jun 2001 14:24:12 +0000 (14:24 +0000)]
Backport of Tim's checkin 2.57:
SF bug 434186: 0x80000000/2 != 0x80000000>>1
i_divmod: New and simpler algorithm. Old one returned gibberish on most
boxes when the numerator was -sys.maxint-1. Oddly enough, it worked in the
release (not debug) build on Windows, because the compiler optimized away
some tricky sign manipulations that were incorrect in this case.
Makes you wonder <wink> ...
Thomas Wouters [Wed, 27 Jun 2001 14:07:50 +0000 (14:07 +0000)]
Backport Tim's checkin 1.26 (patch probably by Michael Hudson, not Hundson):
SF bug 431772: traceback.print_exc() causes traceback
Patch from Michael Hundson.
format_exception_only() blew up when trying to report a SyntaxError
from a string input (line is None in this case, but it assumed a string).
Thomas Wouters [Wed, 27 Jun 2001 14:04:03 +0000 (14:04 +0000)]
Backport Tim's checkin 2.201:
SF bug 430991: wrong co_lnotab
Armin Rigo pointed out that the way the line-# table got built didn't work
for lines generating more than 255 bytes of bytecode. Fixed as he
suggested, plus corresponding changes to pyassem.py, plus added some long
overdue docs about this subtle table to compile.c.
Thomas Wouters [Wed, 27 Jun 2001 14:03:30 +0000 (14:03 +0000)]
Backport Tim's checkin 1.20:
SF bug 430991: wrong co_lnotab
Armin Rigo pointed out that the way the line-# table got built didn't work
for lines generating more than 255 bytes of bytecode. Fixed as he
suggested, plus corresponding changes to pyassem.py, plus added some long
overdue docs about this subtle table to compile.c.
Thomas Wouters [Wed, 27 Jun 2001 14:02:14 +0000 (14:02 +0000)]
Backport Tim's checkin 1.97:
SF bug 430991: wrong co_lnotab
Armin Rigo pointed out that the way the line-# table got built didn't work
for lines generating more than 255 bytes of bytecode. Fixed as he
suggested, plus corresponding changes to pyassem.py, plus added some long
overdue docs about this subtle table to compile.c.