summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* append(): Bite the bullet and let charset be the string name of aBarry Warsaw2002-07-231-3/+6
| | | | character set, which we'll convert to a Charset instance. Sigh.
* make_header(): Watch out for charset is None, which decode_header()Barry Warsaw2002-07-231-3/+2
| | | | will return as the charset if implicit us-ascii is used.
* SF patch #581396, Canvas "select_item" always returns NoneNeal Norwitz2002-07-231-1/+1
| | | | Return the selected item, if there is any.
* New test "+sort", tacking 10 random floats on to the end of a sortedTim Peters2002-07-211-6/+9
| | | | | | | | | | array. Our samplesort special-cases the snot out of this, running about 12x faster than *sort. The experimental mergesort runs it about 8x faster than *sort without special-casing, but should really do better than that (when merging runs of different lengths, right now it only does something clever about finding where the second run begins in the first and where the first run ends in the second, and that's more of a temp-memory optimization).
* Changed import fromTim Peters2002-07-211-1/+1
| | | | | | | | | | | | | | | | | | from test.test_support import TestSkipped, run_unittest to from test_support import TestSkipped, run_unittest Otherwise, if the Japanese codecs aren't installed, regrtest doesn't believe the TestSkipped exception raised by this test matches the except (ImportError, test_support.TestSkipped), msg: it's looking for, and reports the skip as a crash failure instead of as a skipped test. I suppose this will make it harder to run this test outside of regrtest, but under the assumption only Barry does that, better to make it skip cleanly for everyone else.
* Bug: clearing the shell undo list after a prompt was allowing files to beKurt B. Kaiser2002-07-211-5/+11
| | | | opened on top of the shell instead of in a new window.
* Get popen test to work even if python is not in the pathNeal Norwitz2002-07-201-1/+1
|
* Added new test "3sort". This is sorted data but with 3 random exchanges.Tim Peters2002-07-201-1/+9
| | | | It's a little better than average for our sort.
* Move the setting of os.environ['LANGUAGE'] to setup(), and reset it toGuido van Rossum2002-07-201-1/+2
| | | | 'en' in teardown(). This way hopefully test_time.py won't fail.
* Shut the test up and add a missing importBarry Warsaw2002-07-192-2/+4
|
* The email package's tests live much better in a subpackageBarry Warsaw2002-07-196-2045/+2294
| | | | | | | | | | | | (i.e. email.test), so move the guts of them here from Lib/test. The latter directory will retain stubs to run the email.test tests using Python's standard regression test. test_email_torture.py is a torture tester which will not run under Python's test suite because I don't want to commit megs of data to that project (it will fail cleanly there). When run under the mimelib project it'll stress test the package with megs of message samples collected from various locations in the wild.
* The email package's tests live much better in a subpackageBarry Warsaw2002-07-1931-0/+1182
| | | | | | | | | | | | | | | (i.e. email.test), so move the guts of them here from Lib/test. The latter directory will retain stubs to run the email.test tests using Python's standard regression test. test_email_torture.py is a torture tester which will not run under Python's test suite because I don't want to commit megs of data to that project (it will fail cleanly there). When run under the mimelib project it'll stress test the package with megs of message samples collected from various locations in the wild. email/test/data is a copy of Lib/test/data. The fate of the latter is still undecided.
* message_from_string(), message_from_file(): The consensus on theBarry Warsaw2002-07-191-2/+2
| | | | | mimelib-devel list is that non-strict parsing should be the default. Make it so.
* Parser.__init__(): The consensus on the mimelib-devel list is thatBarry Warsaw2002-07-191-2/+2
| | | | non-strict parsing should be the default. Make it so.
* To better support default content types, fix an API wart, and preserveBarry Warsaw2002-07-191-13/+62
| | | | | | | | | | | | | | | | backwards compatibility, we're silently deprecating get_type(), get_subtype() and get_main_type(). We may eventually noisily deprecate these. For now, we'll just fix a bug in the splitting of the main and subtypes. get_content_type(), get_content_maintype(), get_content_subtype(): New methods which replace the above. These /always/ return a content type string and do not take a failobj, because an email message always at least has a default content type. set_default_type(): Someday there may be additional default content types, so don't hard code an assertion about the value of the ctype argument.
* _structure(): Take an optional `fp' argument which would be the objectBarry Warsaw2002-07-191-3/+7
| | | | to print>> the structure to. Defaults to sys.stdout.
* _dispatch(): Use the new Message.get_content_type() method as hashedBarry Warsaw2002-07-191-6/+1
| | | | out on the mimelib-devel list.
* Follow PyXML: Remove all prints from successful tests. This means we canFred Drake2002-07-192-241/+14
| | | | also drop the output file.
* Remove a few lines that aren't used and cause problems on platformsGuido van Rossum2002-07-191-6/+0
| | | | | where recvfrom() on a TCP stream returns None for the address. This should address the remaining problems on FreeBSD.
* Pure Python strptime implementation by Brett Cannon. See SF patch 474274.Guido van Rossum2002-07-193-0/+779
| | | | Also adds tests.
* A few days ago, Guido said (in the thread "[Python-Dev] PythonMichael W. Hudson2002-07-191-0/+14
| | | | | | | | version of PySlice_GetIndicesEx"): > OK. Michael, if you want to check in indices(), go ahead. Then I did what was needed, but didn't check it in. Here it is.
* Add test for previous core dump when sending on closed socket withGuido van Rossum2002-07-191-1/+10
| | | | | | | | timeout. Added small sleeps to _testAccept() and _testRecv() in NonBlockingTCPTests, to reduce race conditions (I know, this is not the solution!)
* Anthony Baxter's cleanup patch. Python project SF patch # 583190,Barry Warsaw2002-07-182-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | quoting: in non-strict mode, messages don't require a blank line at the end with a missing end-terminator. A single newline is sufficient now. Handle trailing whitespace at the end of a boundary. Had to switch from using string.split() to re.split() Handle whitespace on the end of a parameter list for Content-type. Handle whitespace on the end of a plain content-type header. Specifically, get_type(): Strip the content type string. _get_params_preserve(): Strip the parameter names and values on both sides. _parsebody(): Lots of changes as described above, with some stylistic changes by Barry (who hopefully didn't screw things up ;).
* Anthony Baxter's patch to expose the parser's `strict' flag in theseBarry Warsaw2002-07-181-5/+5
| | | | convenience functions. Closes SF # 583188 (python project).
* Add clarifying comment.Guido van Rossum2002-07-181-0/+1
|
* Script to run the pystones "benchmark" under HotShot.Fred Drake2002-07-181-0/+35
|
* Simplify; the low-level log reader is now always a modern iterator,Fred Drake2002-07-181-6/+1
| | | | | and should never return None. (It only did this for an old version of HotShot that was trying to still work with a patched Python 2.1.)
* Expose the fileno() method of the underlying profiler.Fred Drake2002-07-181-0/+4
|
* Expose the fileno() method of the underlying log reader.Fred Drake2002-07-181-6/+4
| | | | | Remove the crufty support for Python's that don't have StopIteration; the HotShot patch for Python 2.1 has not been maintained.
* Add default timeout functionality. This adds setdefaulttimeout() andGuido van Rossum2002-07-182-0/+32
| | | | | getdefaulttimeout() functions to the socket and _socket modules, and appropriate tests.
* Gave this a facelift: "/" vs "//", whrandom vs random, etc. BoostedTim Peters2002-07-181-35/+46
| | | | | | | | | | | | | | the default range to end at 2**20 (machines are much faster now). Fixed what was quite a arguably a bug, explaining an old mystery: the "!sort" case here contructs what *was* a quadratic-time disaster for the old quicksort implementation. But under the current samplesort, it always ran much faster than *sort (the random case). This never made sense. Turns out it was because !sort was sorting an integer array, while all the other cases sort floats; and comparing ints goes much quicker than comparing floats in Python. After changing !sort to chew on floats instead, it's now slower than the random sort case, which makes more sense (but is just a few percent slower; samplesort is massively less sensitive to "bad patterns" than quicksort).
* Gave hotshot.LogReader a close() method, to allow users to close theTim Peters2002-07-182-4/+4
| | | | | file object that LogReader opens. Used it then in test_hotshot; the test passes again on Windows. Thank Guido for the analysis.
* We're no longer trying to support older Python versions with thisGuido van Rossum2002-07-181-7/+2
| | | | codebase, so get rid of the pre-2.2 contingency.
* test_hotshot fails on Windows now. Added XXX comment explaining why,Tim Peters2002-07-171-0/+4
| | | | and that I don't know how to fix it. Fred?
* Add a test for the 'closed' attribute on the C-profiler object.Guido van Rossum2002-07-171-0/+3
|
* Add missing comma.Jeremy Hylton2002-07-171-1/+1
|
* Add a rather generous set of tests allowed to be skipped on sunos5.Guido van Rossum2002-07-171-0/+23
|
* Use sys.executable to run Python, as suggested by Neal Norwitz.Tim Peters2002-07-171-2/+3
|
* Bunch of tests to make sure that StopIteration is a sink state.Guido van Rossum2002-07-161-0/+76
|
* Fix typos and such caught by the pycheckerbot.Jeremy Hylton2002-07-161-3/+3
|
* Whitespace normalization.Tim Peters2002-07-1614-50/+48
|
* Send HTTP requests with a single send() call instead of many.Jeremy Hylton2002-07-161-15/+26
| | | | | | | | | | | | | | | | | | | | | | The implementation now stores all the lines of the request in a buffer and makes a single send() call when the request is finished, specifically when endheaders() is called. This appears to improve performance. The old code called send() for each line. The sends are all short, so they caused bad interactions with the Nagle algorithm and delayed acknowledgements. In simple tests, the second packet was delayed by 100s of ms. The second send was delayed by the Nagle algorithm, waiting for the ack. The delayed ack strategy delays the ack in hopes of piggybacking it on a data packet, but the server won't send any data until it receives the complete request. This change minimizes the problem that Nagle + delayed ack will cause a problem, although a request large enough to be broken into two packets will still suffer some delay. Luckily the MSS is large enough to accomodate most single packets. XXX Bug fix candidate?
* Given the persistent id code a shot at a class before calling save_global().Jeremy Hylton2002-07-161-5/+5
| | | | | Some persistent picklers (well, probably, the *only* persistent pickler) would like to pickle some classes in a special way.
* The atexit module effectively turned itself off if sys.exitfunc alreadyTim Peters2002-07-163-24/+53
| | | | | | | | | | | existed at the time atexit first got imported. That's a bug, and this fixes it. Also reworked test_atexit.py to test for this too, and to stop using an "expected output" file, and to test what actually happens at exit instead of just simulating what it thinks atexit will do at exit. Bugfix candidate, but it's messy so I'll backport to 2.2 myself.
* Tim_one's change to aggressively overallocate nodes when adding childAndrew MacIntyre2002-07-151-9/+2
| | | | | | nodes (in Parser/node.c) resolves the gross memory consumption exhibited by the EMX runtime on OS/2, so the test should be exercised on this platform.
* Remove httplib from tested modules.Jeremy Hylton2002-07-121-15/+0
| | | | | | | | The test of httplib makes it difficult to maintain httplib. There are two many idioms that pyclbr doesn't seem to understand, and I don't understand how to update these tests to make them work. Also remove commented out test of urllib2.
* Palm OS encoding from Sjoerd MullenderMarc-André Lemburg2002-07-121-0/+67
|
* Change _begin() back to begin().Jeremy Hylton2002-07-122-6/+5
| | | | Client code could create responses explicitly.
* Fix SF bug 579701 (Fernando Pérez); an input line consisting of one orGuido van Rossum2002-07-121-8/+8
| | | | | | | more spaces only crashed pdb. While I was at it, cleaned up some style nits (spaces between function and parenthesis, and redundant parentheses in if statement).
* Well, Fred never did explain why the code to determine whether theMichael W. Hudson2002-07-121-7/+3
| | | | | | calling Python was installed was so complicated, so I simplified it. This should get the snake-farm's build scripts working again.