summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Simple conversion to PyUnit.Fred Drake2001-05-181-11/+19
|
* Simple conversion to PyUnit.Fred Drake2001-05-181-23/+20
|
* Added test suite for the new HTMLParser module, originally from theFred Drake2001-05-182-0/+255
| | | | | TAL/PageTemplate package for Zope. This only needed a little boilerplate change; the tests themselves are unchanged.
* A much improved HTML parser -- a replacement for sgmllib. The API isGuido van Rossum2001-05-181-0/+432
| | | | | | | | | | | derived from but not quite compatible with that of sgmllib, so it's a new file. I suppose it needs documentation, and htmllib needs to be changed to use this instead of sgmllib, and sgmllib needs to be declared obsolete. But that can all be done later. This code was first published as part of TAL (part of Zope Page Templates), but that was strongly based on sgmllib anyway. Authors are Fred drake and Guido van Rossum.
* Fixed botched indent in _init_mac() code. (It may never be executed,Guido van Rossum2001-05-171-1/+1
| | | | | but it still can't have any syntax errors. Went a little too fast there, Jack? :-)
* Made distutils understand the MacPython Carbon runtime model. Distutils will ↵Jack Jansen2001-05-172-0/+6
| | | | build for the runtime model you are currently using for the interpreter.
* Moved the encoding map building logic from the individual mappingMarc-André Lemburg2001-05-1654-159/+74
| | | | | | codec files to codecs.py and added logic so that multi mappings in the decoding maps now result in mappings to None (undefined mapping) in the encoding maps.
* Just changed "x,y" to "x, y" everywhere (i.e., inserted horizontal spaceTim Peters2001-05-151-37/+34
| | | | after commas that didn't have any).
* Add quoted-printable codecGuido van Rossum2001-05-152-0/+59
|
* abspath(): Fix inconsistent indentation.Fred Drake2001-05-151-1/+1
|
* This patch changes the way the string .encode() method works slightlyMarc-André Lemburg2001-05-158-0/+434
| | | | | | | | | | | | | | | | | | | | | | | | | and introduces a new method .decode(). The major change is that strg.encode() will no longer try to convert Unicode returns from the codec into a string, but instead pass along the Unicode object as-is. The same is now true for all other codec return types. The underlying C APIs were changed accordingly. Note that even though this does have the potential of breaking existing code, the chances are low since conversion from Unicode previously took place using the default encoding which is normally set to ASCII rendering this auto-conversion mechanism useless for most Unicode encodings. The good news is that you can now use .encode() and .decode() with much greater ease and that the door was opened for better accessibility of the builtin codecs. As demonstration of the new feature, the patch includes a few new codecs which allow string to string encoding and decoding (rot13, hex, zip, uu, base64). Written by Marc-Andre Lemburg. Copyright assigned to the PSF.
* Add warnings to the strop module, for to those functions that reallyGuido van Rossum2001-05-151-0/+2
| | | | | | | | | *are* obsolete; three variables and the maketrans() function are not (yet) obsolete. Add a compensating warnings.filterwarnings() call to test_strop.py. Add this to the NEWS.
* Convert a couple of comments to docstrings -- PyUnit can use these whenFred Drake2001-05-141-2/+2
| | | | the regression test is run in verbose mode.
* pprint's workhorse _safe_repr() function took time quadratic in the # ofTim Peters2001-05-142-39/+44
| | | | | | | elements when crunching a list, dict or tuple. Now takes linear time instead -- huge speedup for even moderately large containers, and the code is notably simpler too. Added some basic "is the output correct?" tests to test_pprint.
* Convert the pprint test to use PyUnit.Fred Drake2001-05-141-35/+57
|
* SF bug[ #423781: pprint.isrecursive() broken.Tim Peters2001-05-143-21/+66
|
* A disgusting "fix" for the test___all__ failure under Windows.Tim Peters2001-05-131-0/+11
|
* Add support for Windows using "mbcs" as the default Unicode encoding when ↵Mark Hammond2001-05-134-13/+91
| | | | dealing with the file system. As discussed on python-dev and in patch 410465.
* Get rid of the superstitious "~" in dict hashing's "i = (~hash) & mask".Tim Peters2001-05-139-36/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment following used to say: /* We use ~hash instead of hash, as degenerate hash functions, such as for ints <sigh>, can have lots of leading zeros. It's not really a performance risk, but better safe than sorry. 12-Dec-00 tim: so ~hash produces lots of leading ones instead -- what's the gain? */ That is, there was never a good reason for doing it. And to the contrary, as explained on Python-Dev last December, it tended to make the *sum* (i + incr) & mask (which is the first table index examined in case of collison) the same "too often" across distinct hashes. Changing to the simpler "i = hash & mask" reduced the number of string-dict collisions (== # number of times we go around the lookup for-loop) from about 6 million to 5 million during a full run of the test suite (these are approximate because the test suite does some random stuff from run to run). The number of collisions in non-string dicts also decreased, but not as dramatically. Note that this may, for a given dict, change the order (wrt previous releases) of entries exposed by .keys(), .values() and .items(). A number of std tests suffered bogus failures as a result. For dicts keyed by small ints, or (less so) by characters, the order is much more likely to be in increasing order of key now; e.g., >>> d = {} >>> for i in range(10): ... d[i] = i ... >>> d {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9} >>> Unfortunately. people may latch on to that in small examples and draw a bogus conclusion. test_support.py Moved test_extcall's sortdict() into test_support, made it stronger, and imported sortdict into other std tests that needed it. test_unicode.py Excluced cp875 from the "roundtrip over range(128)" test, because cp875 doesn't have a well-defined inverse for unicode("?", "cp875"). See Python-Dev for excruciating details. Cookie.py Chaged various output functions to sort dicts before building strings from them. test_extcall Fiddled the expected-result file. This remains sensitive to native dict ordering, because, e.g., if there are multiple errors in a keyword-arg dict (and test_extcall sets up many cases like that), the specific error Python complains about first depends on native dict ordering.
* Fix one bare except: clause.Fred Drake2001-05-111-1/+1
|
* Remove a bare try/except completely -- it just did not make sense!Fred Drake2001-05-111-12/+12
| | | | Add a comment elsewhere making clear an assumption in the code.
* When guarding an import, only catch ImportError.Fred Drake2001-05-111-1/+1
|
* Clean up a bare except where we only expect to catch pcre.error.Fred Drake2001-05-111-1/+1
|
* Clean up bare except where only IOError makes sense.Fred Drake2001-05-111-1/+1
|
* Clean up bare except: when determining whether a file is seekable.Fred Drake2001-05-111-2/+2
|
* Opening a file for reading can raise IOError, so only catch that.Fred Drake2001-05-111-1/+1
|
* int() of a string is only expected to through ValueError, so do not useFred Drake2001-05-111-2/+2
| | | | a bare except clause.
* <socket>.getsockopt() and <socket>.setsockopt() can only raise socket.error,Fred Drake2001-05-111-1/+1
| | | | so only catch that specific exception.
* Catch only the relevant exceptions instead of using a bare except clause.Fred Drake2001-05-111-1/+1
|
* unlink() would normally be found in the "os" module, so use it from there.Fred Drake2001-05-111-5/+7
| | | | | | | | Remove unused import of "sys". If the file TESTFN exists before we start, try to remove it. Add spaces around the = in some assignments.
* Make test_mutants stronger by also adding random keys during comparisons.Tim Peters2001-05-101-2/+17
| | | | | | | | A Mystery: test_mutants ran amazingly slowly even before dictobject.c "got fixed". I don't have a clue as to why. dict comparison was and remains linear-time in the size of the dicts, and test_mutants only tries 100 dict pairs, of size averaging just 50. So "it should" run in less than an eyeblink; but it takes at least a second on this 800MHz box.
* Change test_mmap.py to use test_support.TESTFN instead of hardcoded "foo",Tim Peters2001-05-101-108/+119
| | | | | and wrap the body in try/finally to ensure TESTFN gets cleaned up no matter what.
* Repair typos in comments.Tim Peters2001-05-101-4/+4
|
* Change some text just a little to avoid font-lock hell.Fred Drake2001-05-101-1/+1
|
* Extend the weakref test suite to cover the complete mapping interface forFred Drake2001-05-101-4/+61
| | | | | | both weakref.Weak*Dictionary classes. This closes SF bug #416480.
* Do no regenerate modules that should no longer be here.Fred Drake2001-05-103-11/+0
|
* Remove all remaining uses of the FCNTL module from the standard library.Fred Drake2001-05-103-30/+29
|
* SF bug #422121 Insecurities in dict comparison.Tim Peters2001-05-102-0/+139
| | | | | | | Fixed a half dozen ways in which general dict comparison could crash Python (even cause Win98SE to reboot) in the presence of kay and/or value comparison routines that mutate the dict during dict comparison. Bugfix candidate.
* Update to reflect deprecation of the FCNTL module: The fcntl module doesFred Drake2001-05-101-4/+4
| | | | *not* define O_RDWR; get that from the os module.
* patch 418489 from Andrew Dalke for string format bugSteve Purcell2001-05-101-1/+1
|
* Guido has Spoken. Restore strop.replace()'s treatment of a 0 count asTim Peters2001-05-101-1/+3
| | | | | | | meaning infinity -- but at least warn about it in the code! I pissed away a couple hours on this today, and don't wish the same on the next in line. Bugfix candidate.
* The strop module and test_strop.py believe replace() with a 0 countTim Peters2001-05-101-1/+1
| | | | | | | means "replace everything". But the string module, string.replace() amd test_string.py believe a 0 count means "replace nothing". "Nothing" wins, strop loses. Bugfix candidate.
* SF bug #422088: [OSF1 alpha] string.replace().Tim Peters2001-05-091-0/+6
| | | | | | Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
* Remove the old platform-specific FCNTL.py modules; these are no longerFred Drake2001-05-0915-1993/+0
| | | | needed now that fcntl exports the constants.
* Add a new FCNTL.py backward compatibility module that issues a deprecationFred Drake2001-05-091-0/+14
| | | | warning. This is similar to the TERMIOS backward compatbility module.
* Update the tests for the fcntl module to check passing in file objects,Fred Drake2001-05-091-11/+21
| | | | and using the constants defined there instead of FCNTL.
* Trivial tests of urllib2 for recent SF bugJeremy Hylton2001-05-092-0/+18
|
* Raise useful exception when called with URL for which request typeJeremy Hylton2001-05-091-1/+2
| | | | | | cannot be determined. Pseudo-fix for SF bug #420724
* SF bug #422177: Results from .pyc differs from .pyTim Peters2001-05-081-0/+3
| | | | | | | | Store floats and doubles to full precision in marshal. Test that floats read from .pyc/.pyo closely match those read from .py. Declare PyFloat_AsString() in floatobject header file. Add new PyFloat_AsReprString() API function. Document the functions declared in floatobject.h.
* SF patch #421922: Implement rich comparison for dicts.Tim Peters2001-05-081-0/+28
| | | | | | d1 == d2 and d1 != d2 now work even if the keys and values in d1 and d2 don't support comparisons other than ==, and testing dicts for equality is faster now (especially when inequality obtains).