IMPORTANT FIX: This should definitely go into the 2.1.1 release!!!
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).
Fred Drake [Mon, 9 Jul 2001 16:04:03 +0000 (16:04 +0000)]
Add a little bit more about the XML migration plan. This still needs a lot
of work, but mostly it needs time spent doing the work to make the
generated XML useful.
Thomas Wouters [Mon, 9 Jul 2001 14:35:01 +0000 (14:35 +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'.
Thomas Wouters [Mon, 9 Jul 2001 12:30:54 +0000 (12:30 +0000)]
Re-add 'advanced' xrange features, adding DeprecationWarnings as discussed
on python-dev. The features will still vanish, however, just one release
later.
Fred Drake [Fri, 6 Jul 2001 23:45:16 +0000 (23:45 +0000)]
Change the way notification mails are sent so people who respond to the
update announcements do not get bounces from trying to send mail to my
laptop, which has an identity crisis due to constant relocation.
Fred Drake [Fri, 6 Jul 2001 22:49:53 +0000 (22:49 +0000)]
Change the grammar productions to use the new productionlist environment;
this supports a hyperlinked version of the grammar that can make tracking
down details and definitions a little easier.
Fred Drake [Fri, 6 Jul 2001 22:43:02 +0000 (22:43 +0000)]
Add support for \ulink and hyperlink grammars.
do_cmd_verbatiminput(): Write out a text file containing the content of the
input file with a .txt extension, and add a link to it at the bottom of
the presentation. This easier retrieval of example source code for
copy & paste use.
Fred Drake [Fri, 6 Jul 2001 22:34:33 +0000 (22:34 +0000)]
Add new material on some markup that will be checked in shortly. This
includes some minor new inline markup and markup to generate hyperlinked
grammar productions.
Adopt a "style guide" document -- this beats writing our own and means
we'll have a chance at consistency, without having to make it all up
ourselves.
Fred Drake [Fri, 6 Jul 2001 22:28:47 +0000 (22:28 +0000)]
Packaged versions of the HTML format need to include any .txt files that
were generated by the use of the productionlist environment or the
\verbatiminput macro.
Fred Drake [Fri, 6 Jul 2001 21:01:19 +0000 (21:01 +0000)]
Allow optional arguments to LaTeX macros to span lines. This is legal in
LaTeX and we have at least one occurance of that in the content, so this
script needs to support it as well.
Fred Drake [Fri, 6 Jul 2001 20:30:11 +0000 (20:30 +0000)]
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.
Amazing. A very subtle change in policy in descr-branch actually
found a bug here. Here's the deal:
Class PyShell derives from class OutputWindow. Method PyShell.close()
wants to invoke its parent method, but because PyShell long ago was
inherited from class PyShellEditorWindow, it invokes
PyShelEditorWindow.close(self). Now, class PyShellEditorWindow itself
derives from class OutputWindow, and inherits the close() method from
there without overriding it. Under the old rules,
PyShellEditorWindow.close would return an unbound method restricted to
the class that defined the implementation of close(), which was
OutputWindow.close. Under the new rules, the unbound method is
restricted to the class whose method was requested, that is
PyShellEditorWindow, and this was correctly trapped as an error.
Fred Drake [Fri, 6 Jul 2001 20:23:02 +0000 (20:23 +0000)]
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.
Add an index entry for the Telnet protocol.
Always refer to the protocol as Telnet instead of telnet.
Fred Drake [Fri, 6 Jul 2001 19:28:48 +0000 (19:28 +0000)]
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.
Tim Peters [Fri, 6 Jul 2001 17:45:43 +0000 (17:45 +0000)]
SF bug #439104: Tuple richcompares has code-typo.
Symptom: (1, 2, 3) <= (1, 2) returned 1.
This was already fixed in CVS for tuples, but an isomorphic error was in
the list richcompare code.
Fred Drake [Fri, 6 Jul 2001 17:28:39 +0000 (17:28 +0000)]
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.
Fred Drake [Fri, 6 Jul 2001 17:22:48 +0000 (17:22 +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 [Fri, 6 Jul 2001 06:49:32 +0000 (06:49 +0000)]
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.
Fred Drake [Thu, 5 Jul 2001 18:21:57 +0000 (18:21 +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.
Rip out the fancy behaviors of xrange that nobody uses: repeat, slice,
contains, tolist(), and the start/stop/step attributes. This includes
removing the 4th ('repeat') argument to PyRange_New().
Tim Peters [Thu, 5 Jul 2001 03:47:53 +0000 (03:47 +0000)]
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.
Bugfix candidate; specific to platforms with case-insensitive filesystems.
Added a non-recursive implementation of conjoin(), and a Knight's Tour
solver. In conjunction, they easily found a tour of a 200x200 board:
that's 200**2 == 40,000 levels of backtracking. Explicitly resumable
generators allow that to be coded as easily as a recursive solver (easier,
actually, because different levels can use level-customized algorithms
without pain), but without blowing the stack. Indeed, I've never written
an exhaustive Tour solver in any language before that can handle boards so
large ("exhaustive" == guaranteed to find a solution if one exists, as
opposed to probabilistic heuristic approaches; of course, the age of the
universe may be a blip in the time needed!).
Fix for SF bug #425868.
We should not depend on two spaces between words, so use the white
space after the to-be-encoded word only as lookahead and don't
actually consume it in the regular expression.
Fred Drake [Tue, 3 Jul 2001 23:39:52 +0000 (23:39 +0000)]
This change adjusts the profiling/tracing support so that the common
path (with no profile/trace function) through eval_code2() and
eval_frame() avoids several checks.
In the common cases of calls, returns, and exception propogation,
eval_code2() and eval_frame() used to test two values in the
thread-state: the profiling function and the tracing function. With
this change, a flag is set in the thread-state if either of these is
active, allowing a single check to suffice when both are NULL. This
also simplifies the code needed when either function is in use but is
already active (to avoid profiling/tracing the profiler/tracer); the
flag is set to 0 when the profile/trace code is entered, allowing the
same check to suffice for "already in the tracer" for call/return/
exception events.
Fredrik Lundh [Mon, 2 Jul 2001 19:54:28 +0000 (19:54 +0000)]
reapplied darryl gallion's minimizing repeat fix. I'm still not 100%
sure about this one, but test #133283 now works even with the fix in
place, and so does the test suite. we'll see what comes up...
Tim Peters [Mon, 2 Jul 2001 01:38:33 +0000 (01:38 +0000)]
A clever union-find implementation from c.l.py, due to David Eppstein.
This is another one that leaks memory without an explict clear! Time to
bite this bullet.
Jack Jansen [Sun, 1 Jul 2001 22:09:29 +0000 (22:09 +0000)]
Added WeakLink...Generator classes (should have done that ages ago). These check the c-function pointer for being NULL before calling it and raise UnimplementedError if it is.
This allows system libs to be weak-linked, thereby allowing us to generate functions that are only available on some OS versions without getting a NULL dereference if the function isn't available.
Jack Jansen [Sun, 1 Jul 2001 22:04:02 +0000 (22:04 +0000)]
- Use weaklink generators so we can support OSX-only calls without crashing on OS9.
- Convert CFString to/from Python strings. Currently always MacRoman, to be fixed later (as is unicode support). Python->CFString conversion is automatic.
Tim Peters [Fri, 29 Jun 2001 23:51:08 +0000 (23:51 +0000)]
Turns out Neil didn't intend for *all* of his gen-branch work to get
committed.
tokenize.py: I like these changes, and have tested them extensively
without even realizing it, so I just updated the docstring and the docs.
tabnanny.py: Also liked this, but did a little code fiddling. I should
really rewrite this to *exploit* generators, but that's near the bottom
of my effort/benefit scale so doubt I'll get to it anytime soon (it
would be most useful as a non-trivial example of ideal use of generators;
but test_generators.py has already grown plenty of food-for-thought
examples).
inspect.py: I'm sure Ping intended for this to continue running even
under 1.5.2, so I reverted this to the last pre-gen-branch version. The
"bugfix" I checked in in-between was actually repairing a bug *introduced*
by the conversion to generators, so it's OK that the reverted version
doesn't reflect that checkin.
Fred Drake [Fri, 29 Jun 2001 15:39:53 +0000 (15:39 +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 14:59:01 +0000 (14:59 +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.
Guido van Rossum [Fri, 29 Jun 2001 13:06:06 +0000 (13:06 +0000)]
Solve SF bug #231249: cgi.py opens too many (temporary) files.
class FieldStorage: this patch changes read_lines() and co. to use a
StringIO() instead of a real file. The write() calls are redirected
to a private method that replaces it with a real, external file only
when it gets too big (> 1000 bytes).
This avoids problems in forms using the multipart/form-data encoding
with many fields. The original code created a temporary file for
*every* field (not just for file upload fields), thereby sometimes
exceeding the open file limit of some systems.
Note that the simpler solution "use a real file only for file uploads"
can't be used because the form field parser has no way to tell which
fields correspond to file uploads.
It's *possible* but extremely unlikely that this would break someone's
code; they would have to be stepping way outside the documented
interface for FieldStorage and use f.file.fileno(), or depend on
overriding make_file() to return a file-like object with additional
known properties.
Tim Peters [Fri, 29 Jun 2001 02:41:16 +0000 (02:41 +0000)]
Added a simple but general backtracking generator (conjoin), and a couple
examples of use. These poke stuff not specifically targeted before, incl.
recursive local generators relying on nested scopes, ditto but also
inside class methods and rebinding instance vars, and anonymous
partially-evaluated generators (the N-Queens solver creates a different
column-generator for each row -- AFAIK this is my invention, and it's
really pretty <wink>). No problems, not even a new leak.
Tim Peters [Thu, 28 Jun 2001 01:52:22 +0000 (01:52 +0000)]
Another "if 0:" hack, this time to complain about otherwise invisible
"return expr" instances in generators (which latter may be generators
due to otherwise invisible "yield" stmts hiding in "if 0" blocks).
This was fun the first time, but this has gotten truly ugly now.
Jack Jansen [Wed, 27 Jun 2001 22:00:55 +0000 (22:00 +0000)]
CFArray, CFData and CFDictonary are now covered, but mainly opaque.
CFStrings are in better shape, but Unicode support and automatic conversion to/from Python strings remains to be done.
Fred Drake [Wed, 27 Jun 2001 19:19:46 +0000 (19:19 +0000)]
Revise the interface to the profiling and tracing support for the
Python interpreter.
This change adds two new C-level APIs: PyEval_SetProfile() and
PyEval_SetTrace(). These can be used to install profile and trace
functions implemented in C, which can operate at much higher speeds
than Python-based functions. The overhead for calling a C-based
profile function is a very small fraction of a percent of the overhead
involved in calling a Python-based function.
The machinery required to call a Python-based profile or trace
function been moved to sysmodule.c, where sys.setprofile() and
sys.setprofile() simply become users of the new interface.
As a side effect, SF bug #436058 is fixed; there is no longer a
_PyTrace_Init() function to declare.
Fred Drake [Wed, 27 Jun 2001 19:18:03 +0000 (19:18 +0000)]
Revise the interface to the profiling and tracing support for the
Python interpreter.
This change adds two new C-level APIs: PyEval_SetProfile() and
PyEval_SetTrace(). These can be used to install profile and trace
functions implemented in C, which can operate at much higher speeds
than Python-based functions. The overhead for calling a C-based
profile function is a very small fraction of a percent of the overhead
involved in calling a Python-based function.
The machinery required to call a Python-based profile or trace
function been moved to sysmodule.c, where sys.setprofile() and
sys.setprofile() simply become users of the new interface.