summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Add standard DOM exception hierarchy.Martin v. Löwis2000-12-131-0/+68
|
* Update the code to better reflect recommended style:Fred Drake2000-12-1236-99/+101
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Change the file's indentation from tabs to 4 spaces per level.Barry Warsaw2000-12-121-151/+163
|
* Accept Finn Bock's patch #102208 to hardcode EINVAL to 22 when errnoBarry Warsaw2000-12-121-13/+16
| | | | | | | | can't be imported. This makes StringIO.py work with Jython. Also, get rid of the string module by converting to string methods. Shorten some lines by using augmented assignment where appropriate.
* Update the code to better reflect recommended style:Fred Drake2000-12-1255-519/+520
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* The ".pth" code knew about the layout of Python trees on unix andJack Jansen2000-12-121-0/+2
| | | | windows, but not on the mac. Fixed.
* Add popitem().Guido van Rossum2000-12-121-0/+2
|
* Added test for {}.popitem().Guido van Rossum2000-12-121-0/+24
|
* Changed .getaliases() support to register the new aliases in theMarc-André Lemburg2000-12-121-4/+12
| | | | | | | | | | | encodings package aliases mapping dictionary rather than in the internal cache used by the search function. This enables aliases to take advantage of the full normalization process applied to encoding names which was previously not available. The patch restricts alias registration to new aliases. Existing aliases cannot be overridden anymore.
* Update the docstring.Fred Drake2000-12-111-2/+31
| | | | | Add a Node class that defines the NodeType constants, based on discussion in the XML-SIG.
* Added tests to avoid regression on bug #125375.Fred Drake2000-12-112-1/+34
| | | | | | | | roundtrip(): Show the offending syntax tree when things break; this makes it a little easier to debug the module by adding test cases. (Still need better tests for this module, but there's not enough time today.)
* Apply rstrip() to the lines read from _dirfile in _update(), so that aGuido van Rossum2000-12-111-1/+1
| | | | dumbdbm archive created on Windows can be read on Unix.
* Hoepeful fix for SF bug #123924: Windows - using OpenSSL, problem withGuido van Rossum2000-12-111-1/+4
| | | | | | | | | | | | | | | | socket in httplib.py. The bug reports that on Windows, you must pass sock._sock to the socket.ssl() call. But on Unix, you must pass sock itself. (sock is a wrapper on Windows but not on Unix; the ssl() call wants the real socket object, not the wrapper.) So we see if sock has an _sock attribute and if so, extract it. Unfortunately, the submitter of the bug didn't confirm that this patch works, so I'll just have to believe it (can't test it myself since I don't have OpenSSL on Windows set up, and that's a nontrivial thing I believe).
* Make ConfigParser.Error inherit from Exception.Fred Drake2000-12-111-1/+3
|
* (Patch #102698) Fix for a bug reported by Wade Leftwich:Andrew M. Kuchling2000-12-101-4/+4
| | | | StreamReader ignores the 'errors' parameter passed to its constructor
* Fix `credits' to credit the Jython developers when running under thatBarry Warsaw2000-12-061-3/+9
| | | | | interpreter. Update and reword the credits for CPython. Closes SF patch #102665.
* Two changes:Sjoerd Mullender2000-12-061-8/+16
| | | | | | | - Use new Error class (subclass of RuntimeError so is backward compatible) which is raised when RuntimeError used to be raised. - Report original attribute name in error messages instead of name mangled with namespace URL.
* Add test cases for ConfigParser.remove_option() behavior. This includesFred Drake2000-12-041-0/+24
| | | | coverage to ensure bug #124324 does not re-surface.
* remove_option(): Use the right variable name for the option name!Fred Drake2000-12-041-2/+2
| | | | This closes bug #124324.
* Call of _cmp had wrong number of paramereters.Moshe Zadka2000-12-031-2/+2
| | | | Fixed definition of _cmp.
* Convert Unicode strings to byte strings before passing them into specificMartin v. Löwis2000-12-031-14/+25
| | | | protocols. Closes bug #119822.
* Backing out my changes.Moshe Zadka2000-11-301-6/+0
| | | | Improved version coming soon to a Source Forge near you!
* Added .first{item,value,key}() to dictionaries.Moshe Zadka2000-11-301-0/+6
| | | | | Complete with docos and tests. OKed by Guido.
* Fox for SF bug #123859: %[duxXo] long formats inconsistent.Tim Peters2000-11-301-5/+16
|
* Slight improvement to Unicode test suite, inspired by patch #102563:Guido van Rossum2000-11-291-9/+11
| | | | | | | | also test join method of 8-bit strings. Also changed the test() function to (1) compare the types of the expected and actual result, and (2) in verbose mode, print the repr() of the output.
* Patch by Finn Bock to support PyStringMap in Jython.Guido van Rossum2000-11-271-0/+9
|
* Update test output.Fred Drake2000-11-211-2/+18
|
* testInsertBefore(): Rewritten to actually test insertBefore() somewhat.Fred Drake2000-11-211-14/+103
| | | | | | | | | | | | | | | | | | | | 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. testNormalize(): Added to check Node.normalize().
* Reduce the visibility of imported modules for cleaner "from ... import *"Fred Drake2000-11-211-76/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. AttributeList.items(), AttributeList.itemsNS(): Slight performance improvement (avoid lambda). Element.cloneNode(): Extend Node.cloneNode() with support for the attributes. Clone the Attr objects after creating the underlying clone. Element.unlink(): Clean out the attributes here instead of in the base class, since this is the only class that will have them. Element.toxml(): Adjust to create only one AttributeList instance; minor efficiency improvement. _nssplit(): No need to re-import string. Document.__init__(): No longer needed once constant attributes are initialized in the class itself. Document.createElementNS(), Document.createAttributeNS(): Use the defined constructors rather than directly access the classes. _get_StringIO(): New function. Create an output StringIO using the most efficient available flavor. parse(), parseString(): Import pulldom here instead of in the public namespace of the module.
* Verify that str(a) and repr(a) don't blow up (part of SF patch 102068).Tim Peters2000-11-141-0/+5
|
* Typo for Mac code, fixing SF bug 12195.Guido van Rossum2000-11-131-1/+1
|
* Removing DOS 8x3 supportGuido van Rossum2000-11-13113-18934/+0
|
* Jack Jansen: added 'get_command_list()' method, and Mac-specific code toGreg Ward2000-11-111-0/+38
| | | | | use it to generate a dialog for users to specify the command-line (because providing a command-line with MacPython is so awkward).
* Implement the suggestion of bug_id=122070: surround tell() call withGuido van Rossum2000-11-091-1/+5
| | | | try/except.
* SMTP.connect(): If the socket.connect() raises a socket.error, be sureBarry Warsaw2000-11-081-1/+5
| | | | | to call self.close() to reclaim some file descriptors, the reraise the exception. Closes SF patch #102185 and SF bug #119833.
* Added test cases to detect regression on SourceForge bug #121965.Fred Drake2000-11-081-0/+14
|
* This fixes several bug reports concering memory bloating during largeBarry Warsaw2000-11-061-5/+1
| | | | | | | | | | | | | | | | | | | 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.
* a few small optimizations that seem to give a 5-10% speedup; theJeremy Hylton2000-11-061-76/+80
| | | | further optimization of com_node makes the most difference.
* move pruneNext method to correct object (doh!)Jeremy Hylton2000-11-061-24/+24
|
* Change the graph structure to contain the code generator object forJeremy Hylton2000-11-063-21/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. misc.py: Implement __contains__ and copy for Set.
* If a function contains a doc string, remove the doc string node fromJeremy Hylton2000-11-061-1/+5
| | | | | | | the function's body. If assert is used without an error message, make the AST node None rather than Name('None').
* Added 38,642 missing characters to the Unicode database (first-lastFredrik Lundh2000-11-031-2/+2
| | | | | | | ranges) -- but thanks to the 2.0 compression scheme, this doesn't add a single byte to the resulting binaries (!) Closes bug #117524
* track recent change to test_extcall.pyJeremy Hylton2000-10-301-0/+4
|
* Fix for SF bug #117241Jeremy Hylton2000-10-301-0/+18
| | | | | | | | | When a method is called with no regular arguments and * args, defer the first arg is subclass check until after the * args have been expanded. N.B. The CALL_FUNCTION implementation is getting really hairy; should review it to see if it can be simplified.
* -- properly reset groups in findall (bug #117612)Fredrik Lundh2000-10-282-2/+15
| | | | | | | | -- fixed negative lookbehind to work correctly at the beginning of the target string (bug #117242) -- improved syntax check; you can no longer refer to a group inside itself (bug #110866)
* Fix two typos in __imul__. Closes Bug #117745.Guido van Rossum2000-10-251-2/+2
|
* Many changes.Jeremy Hylton2000-10-251-220/+145
| | | | | | | | | | | | | | | | | | | | | Reformatting -- long lines, "[ ]" -> "[]", a few indentation nits. Replace calls to Node function (which constructed ast nodes) with calls to actual constructors imported from ast module. Optimize com_node (most frequently used method) for the common case -- the appropriate method is found in _dispatch. Fix com_augassign to use class object's rather than node names (rendered invalid by recent changes to ast) Remove expensive tests for sequence-ness in com_stmt and com_append_stmt. These tests should never fail; if they do, something is really broken and exception will be raised elsewhere. Fix com_stmt and com_append_stmt to use isinstance rather than testing's type slot of ast node (this slot disappeared with recent changes to ast).
* Generated from rev 1.1 of ast.txtJeremy Hylton2000-10-251-677/+606
|
* Small optimizations in dispatch method: 1) lookup node's __class__ onceJeremy Hylton2000-10-251-12/+14
| | | | | and store in local; 2) define _preorder to be dispatch (rather than method that called dispatch).
* Also point TK_LIBRARY to the appropriate directory.Guido van Rossum2000-10-251-3/+4
| | | | Changed the landmark to tclIndex, which should occur in both.