Fred Drake [Thu, 30 Nov 2000 07:12:54 +0000 (07:12 +0000)]
Use small tables instead of bare \item markers to describe the contents
of return tuples. The bare \item took advantage of an implementation
detail when formatting in LaTeX, and was just wrong when generating HTML.
It also broke the XML conversion scripts, since there was no enclosing
list-like environment to contain them.
Fred Drake [Wed, 29 Nov 2000 15:48:22 +0000 (15:48 +0000)]
In the first discussion showing how to handle exceptions from C, make the
Python equivalent actually equivalent to the C code. Also, in the C code,
place the "goto" statements on a line by themselves for better visibility
of statements that affect control flow.
Fred Drake [Wed, 29 Nov 2000 06:10:22 +0000 (06:10 +0000)]
Substantial re-organization of the DOM documentation. The abstract API
is now separated from the supplied standard implementation. Not all
interfaces are documented yet, but the structure is better set up to do
so.
There is still a lot to do here, but the shape of the documentation is
coming into line.
Fred Drake [Tue, 28 Nov 2000 16:20:50 +0000 (16:20 +0000)]
Use a subclass of buildindex.Node to clean up the HTML and get the
ordering fixed up (this makes sure that "xml.dom" comes before
"xml.dom.minidom" in the Module Index, which was not true before because
some HTML cruft crept into the data structures).
Guido van Rossum [Mon, 27 Nov 2000 22:22:36 +0000 (22:22 +0000)]
Plug a memory leak in com_import_stmt(): the tuple created to hold the
"..." in "from M import ..." was never DECREFed. Leak reported by
James Slaughter and nailed by Barry, who also provided an earlier
version of this patch.
Fred Drake [Wed, 22 Nov 2000 16:06:16 +0000 (16:06 +0000)]
Do not use \verb in the Python documentation -- it makes parsing the LaTeX
sources more difficult and other tools do not always work well with it.
Since we have better markup for this case, just fix it.
Fred Drake [Tue, 21 Nov 2000 22:02:43 +0000 (22:02 +0000)]
testInsertBefore(): Rewritten to actually test insertBefore() somewhat.
testAAA(),
testAAB(): Added checks that the results are right.
testTooManyDocumentElements(): Added code to actually test this.
testCloneElementDeep()
testCloneElementShallow(): Filled these in with test code.
_testCloneElementCopiesAttributes(),
_setupCloneElement(): Helper functions used with the other
testCloneElement*() functions.
testCloneElementShallowCopiesAttributes(): No longer a separate test;
_setupCloneElement() uses _testCloneElementCopiesAttributes() to
test that this is always done.
Fred Drake [Tue, 21 Nov 2000 22:02:22 +0000 (22:02 +0000)]
Reduce the visibility of imported modules for cleaner "from ... import *"
behavior.
Added support for the Attr.ownerElement attribute.
Everywhere: Define constant object attributes in the classes rather than
on the instances during object construction. This reduces the amount of
work needed for object construction and destruction; these need to be
lightweight operations on a DOM.
Node._get_firstChild(),
Node._get_lastChild(): Return None if there are no children (required for
compliance with DOM level 1).
Node.insertBefore(): If refChild is None, append the new node instead of
failing (required for compliance). Also, update the sibling
relationships. Return the inserted node (required for compliance).
Node.appendChild(): Update the parent of the appended node.
Node.replaceChild(): Actually replace the old child! Update the parent
and sibling relationships of both the old and new children. Return
the replaced child (required for compliance).
Node.normalize(): Implemented the normalize() method. Required for
compliance, but missing from the release. Useful for joining
adjacent Text nodes into a single node for easier processing.
Node.cloneNode(): Actually make this work. Don't let the new node share
the instance __dict__ with the original. Do proper recursion if
doing a "deep" clone. Move the attribute cloning out of the base
class, since only Element is supposed to have attributes.
Node.unlink(): Simplify handling of child nodes for efficiency, and
remove the attribute handling since only Element nodes support
attributes.
Attr.cloneNode(): Extend this to clear the ownerElement attribute in
the clone.
Jack Jansen [Sun, 19 Nov 2000 21:53:15 +0000 (21:53 +0000)]
Added MathLib and InterfaceLib. Added Python:Include so #include "package/file.h" works. Moved bits around so now at least Numeric with Distutils builds and instals.
Fred Drake [Fri, 17 Nov 2000 19:44:14 +0000 (19:44 +0000)]
Added information about the %r string formatting conversion. Added note
about the interpretation of radix 0 for int(), and added description of
the optional radix argument for long(). Based on comments from Reuben
Sumner <rasumner@users.sourceforge.net>.
Fred Drake [Fri, 17 Nov 2000 19:05:12 +0000 (19:05 +0000)]
Note that readframes() returns data in linear format, even if the original
is encoded in u-LAW format. Based on suggestion from Anthony Baxter
<anthony_baxter@users.sourceforge.net>.
Tim Peters [Tue, 14 Nov 2000 20:44:53 +0000 (20:44 +0000)]
SF bug 119622: compile errors due to redundant atof decls. I don't understand
the bug report (for details, look at it), but agree there's no need for Python
to declare atof itself: we #include stdlib.h, and ANSI C sez atof is declared
there already.
Guido van Rossum [Mon, 13 Nov 2000 20:29:20 +0000 (20:29 +0000)]
Allow new.function() called with explicit 3rd arg of None, as
documented, and as is reasonable (since it is optional, but there's
another argument following it that may require you to specify a
value). This solves SF bug 121887.
Guido van Rossum [Mon, 13 Nov 2000 19:48:22 +0000 (19:48 +0000)]
Added _HAVE_BSDI and __APPLE__ to the list of platforms that require a
hack for TELL64()... Sounds like there's something else going on
really. Does anybody have a clue I can buy?
Greg Ward [Sat, 11 Nov 2000 02:47:11 +0000 (02:47 +0000)]
Jack Jansen: added 'get_command_list()' method, and Mac-specific code to
use it to generate a dialog for users to specify the command-line (because
providing a command-line with MacPython is so awkward).
Tim Peters [Fri, 10 Nov 2000 19:04:19 +0000 (19:04 +0000)]
Fix for SF bug 117402, crashes on str(array) and repr(array). This was an
unfortunate consequence of somebody switching from PyArg_Parse to
PyArg_ParseTuple but without changing the argument from a NULL to a tuple.
Barry Warsaw [Wed, 8 Nov 2000 22:19:47 +0000 (22:19 +0000)]
SMTP.connect(): If the socket.connect() raises a socket.error, be sure
to call self.close() to reclaim some file descriptors, the reraise the
exception. Closes SF patch #102185 and SF bug #119833.
Fred Drake [Wed, 8 Nov 2000 20:22:59 +0000 (20:22 +0000)]
Remove AC_C_INLINE test from configure.in, since the only place the symbol
occurs in the Python sources appears to be as text in comments. We do not
want to interfere with C++ keywords!
Greg Ward [Tue, 7 Nov 2000 15:44:21 +0000 (15:44 +0000)]
Fix for SF bug #117606:
- when compiling with GCC on Solaris, use "$(CC) -shared" instead
of "$(CC) -G" to generate .so files
- when compiling with GCC on any platform, add "-fPIC" to OPT
(without this, "$(CC) -shared" dies horribly)
Barry Warsaw [Mon, 6 Nov 2000 18:46:09 +0000 (18:46 +0000)]
This fixes several bug reports concering memory bloating during large
file uploads.
In response to SF bugs 110674 and 119806, and discussions on
python-dev, we are removing the self.lines attribute from the
FieldStorage class. Specifically touched where methods __init__(),
read_lines_to_eof(), and skip_lines().
No one can remember why self.lines was added. Technically, it's part
of the public interface for the class, but it was never documented.
It's possible clever or nosy code will break because of this, but it
was decided to remove it and see who complains.
This resolution also closes the second half of the cgi.py entry in PEP
42. The first half of that PEP concerns specifically binary file
uploads, where there may be no end-of-line marker for a very long
time. This patch does not address that issue.
Jeremy Hylton [Mon, 6 Nov 2000 03:43:11 +0000 (03:43 +0000)]
Change the graph structure to contain the code generator object for
embedded code objects (e.g. functions) rather than the generated code
object. This change means that the compiler generates code for
everything at the end, rather then generating code for each function
as it finds it. Implementation note: _convert_LOAD_CONST in
pyassem.py must be change to call getCode().
Other changes follow. Several changes creates extra edges between
basic blocks to reflect control flow for loops and exceptions. These
missing edges had gone unnoticed because they do not affect the
current compilation process.
pyassem.py:
Add _enable_debug() and _disable_debug() methods that print
instructions and blocks to stdout as they are generated.
Add edges between blocks for instructions like SETUP_LOOP,
FOR_LOOP, etc.
Add pruneNext to get rid of bogus edges remaining after
unconditional transfer ops (e.g. JUMP_FORWARD)
Change repr of Block to omit block length.
pycodegen.py:
Make sure a new block is started after FOR_LOOP, etc.
Change assert implementation to use RAISE_VARARGS 1 when there is
no user-specified failure output.
Fredrik Lundh [Fri, 3 Nov 2000 20:24:15 +0000 (20:24 +0000)]
Added 38,642 missing characters to the Unicode database (first-last
ranges) -- but thanks to the 2.0 compression scheme, this doesn't add
a single byte to the resulting binaries (!)
Thomas Wouters [Fri, 3 Nov 2000 08:18:37 +0000 (08:18 +0000)]
Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
Patch from Randall Hopper to fix PR #116172, "curses module fails to
build on SGI":
* Check for 'sgi' preprocessor symbol, not '__sgi__'
* Surround individual character macros with #ifdef's, instead of making them
all rely on STRICT_SYSV_CURSES
Guido van Rossum [Mon, 30 Oct 2000 17:45:07 +0000 (17:45 +0000)]
Hack to force -lpthread instead instead of -lcma on HPUX, by Philipp
Jocham. Philipp asks: "Are there any success stories with HP-UX 11.00
and -lcma? Maybe libcma is broken."
Fred Drake [Mon, 30 Oct 2000 06:24:56 +0000 (06:24 +0000)]
define_module(): Change the "index sub-item" for definitions at module
scope to be " (in module <name>)" instead of
" (in <name>)" to be consistent with \withsubitem
usage throughout the documentation. This achieves
consistency in indexing throughout the documentation.