Commit Graph

10481 Commits

Author SHA1 Message Date
Neal Norwitz d5b6715083 This should get test_timeout to pass when running on any python.org host. Will backport 2006-02-18 21:20:31 +00:00
Georg Brandl 7b4e7c24df Patch #1373643: The chunk module can now read chunks larger than
two gigabytes.
2006-02-18 21:10:56 +00:00
Tim Peters e2c9a6cea7 Suppress new deprecation warnings when running the
test suite.

For urllib2, move the import of gopherlib into the
only function that uses it:  users (including the
test suite) certainly shouldn't see a deprecation
warning just because they import urllib2!  If they
actually use gopher_open(), fine, _then_ they should
see a deprecation warning.
2006-02-18 04:14:16 +00:00
Tim Peters 24f7cad6ca Changed the new deprecation warning to show the
code _importing_ gopherlib instead of gopherlib's
call to warnings.warn.
2006-02-18 04:00:23 +00:00
Tim Peters b6be87f9b0 Whitespace normalization. 2006-02-18 03:10:56 +00:00
Georg Brandl 4cbd1e3fc1 Move test case for HTTP response dict to httplib. 2006-02-17 22:01:08 +00:00
Georg Brandl 6aab16e9f6 Move "httpresponses" dict from urllib2 to httplib where it belongs. 2006-02-17 19:17:25 +00:00
Georg Brandl 5d076961e2 Patch #1417555: SimpleHTTPServer now returns Last-Modified headers. 2006-02-17 13:34:16 +00:00
Georg Brandl b86a54f395 Add deprecation warning to modules deprecated since 2000. 2006-02-17 11:29:04 +00:00
Georg Brandl bd3bc4dc4c Bug #1430298: It is now possible to send a mail with an empty
return address using smtplib.
2006-02-17 09:52:53 +00:00
Georg Brandl 501dd0dd9d The names of lambda functions are now properly displayed in pydoc. 2006-02-17 09:45:40 +00:00
Martin v. Löwis 18e165558b Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
Tim Peters cffcfed126 New test code failed to close the file. This caused
test_file to fail on Windows in reality (can't delete
a still-open file), but a new bare "except:" hid that
test_file failed on Windows, and leaving behind the
still-open TESTFN caused a cascade of bogus failures
in later tests.

So, close the file, and stop hiding failure to unlink.
2006-02-14 17:41:18 +00:00
Thomas Wouters c45251a485 SF patch #1397960: When mixing file-iteration and
readline/readlines/read/readinto, loudly break by raising ValueError, rather
than silently deliver data out of order or hitting EOF prematurely.

Probably not a bugfix candidate, even though it affects no 'working' code.
2006-02-12 11:53:32 +00:00
Armin Rigo f5b3e36493 Renamed _length_cue() to __length_hint__(). See:
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
2006-02-11 21:32:43 +00:00
Vinay Sajip ed1992f2aa Added function name to LogRecord. 2006-02-09 08:48:36 +00:00
Vinay Sajip 260ce43252 Propagate exceptions from shutdown() if raiseExceptions is not set.
Added 'extra' keyword argument handling to logging calls, as discussed on python-dev.
2006-02-09 08:34:14 +00:00
Vinay Sajip 1eb77a50c8 Added lock acquisition/release around shared data structure manipulation 2006-02-09 08:31:00 +00:00
Barry Warsaw e58df82919 Port relevant patches for SF 1409455 to the trunk for email 3.0/Python 2.5.
Will port to Python 2.4.
2006-02-08 14:34:21 +00:00
Armin Rigo a871ef2b3e Added the cProfile module.
Based on lsprof (patch #1212837) by Brett Rosen and Ted Czotter.
With further editing by Michael Hudson and myself.
History in svn repo: http://codespeak.net/svn/user/arigo/hack/misc/lsprof

* Module/_lsprof.c is the internal C module, Lib/cProfile.py a wrapper.
* pstats.py updated to display cProfile's caller/callee timings if available.
* setup.py and NEWS updated.
* documentation updates in the profiler section:
   - explain the differences between the three profilers that we have now
   - profile and cProfile can use a unified documentation, like (c)Pickle
   - mention that hotshot is "for specialized usage" now
   - removed references to the "old profiler" that no longer exists
* test updates:
   - extended test_profile to cover delicate cases like recursion
   - added tests for the caller/callee displays
   - added test_cProfile, performing the same tests for cProfile
* TO-DO:
   - cProfile gives a nicer name to built-in, particularly built-in methods,
     which could be backported to profile.
   - not tested on Windows recently!
2006-02-08 12:53:56 +00:00
Vinay Sajip e0f85926d6 Removed defensive test in Handler.close 2006-02-07 13:55:52 +00:00
Vinay Sajip f0a95eca45 Saved and restored logging._handlerList at the same time as saving/restoring logging._handlers. 2006-02-07 13:44:48 +00:00
Martin v. Löwis 0075690ced Patch #1412872: zipfile: use correct system type on unixy systems. 2006-02-05 17:09:41 +00:00
Neal Norwitz 55cd82fe0a Get test_logging to not hang when running under regrtest.py -R ::
Not sure why/how _handlers/_handlerList is out of sync.  This could
indicate a deeper problem.

In test_logging, the only absolutely necessary change to get working
was tcpserver.abort = 1.  But we don't want to wait infinitely
to join the threads, so give a 2.0 second timeout.

There doesn't appear to be a need for a local abort variable
in serve_until_stopped, so just use the instance member.

Note the problem is only on HEAD, not in 2.4.
2006-02-05 08:21:08 +00:00
Neal Norwitz 0e6bc8c260 Patch #1407135, bug #1424041, make mmap.mmap(-1, length) work the same
on both Unix (SVR4 and BSD) and Windows.  Restores behaviour of passing -1
for anonymous memory on Unix.  Use MAP_ANONYMOUS instead of _ANON since
the latter is deprecated according to Linux (gentoo) man pages.

Should we continue to allow mmap.mmap(0, length) to work on Windows?
0 is a valid fd.

Will backport bugfix portions.
2006-02-05 05:45:43 +00:00
Barry Warsaw e3dd5b2c87 Resolves SF bug #1423972. 2006-02-04 23:32:26 +00:00
Neal Norwitz faa26dfdd8 Fix typo 2006-02-04 03:26:20 +00:00
Barry Warsaw 602426e3cf parsedate_tz(): Minor cleanup.
Port from Python 2.3/email 2.5: Add a test for the tm_yday field is 1 in the
return of parsedate().
2006-02-03 04:44:52 +00:00
Gustavo Niemeyer 548148810b Patch #1413711: Certain patterns of differences were making difflib
touch the recursion limit. The applied patch inlines the recursive
__helper method in a non-recursive way.
2006-01-31 18:34:13 +00:00
Gregory P. Smith c26cf5a6f1 fix test import for use in standalone pybsddb project bsddb3 module as well
as python builtin bsddb.
2006-01-29 23:54:38 +00:00
Tim Peters 249c7b050b Whitespace normalization. 2006-01-29 22:50:26 +00:00
Martin v. Löwis 5b1e003da8 Try a number of ports, in case 9020 is already in use. 2006-01-29 20:10:38 +00:00
Martin v. Löwis f684888b1e Explicitly close the server socket. 2006-01-29 19:55:18 +00:00
Thomas Wouters 35f34f8d60 Work around a Solaris peculiarity that caused test_pty to sometimes fail: a
tty opened by os.openpty() isn't always a tty according to os.isatty(), when
it's tested inside the process that opened it. Doesn't affect actual
functionality, as using a tty this way is rarely, if ever, useful. Ignoring
the failure allows the test for actual functionality to continue.

Will backport to 2.4-maint.
2006-01-28 12:05:54 +00:00
Jeremy Hylton c960f26044 Improved handling of syntax errors.
Expand set of errors caught in set_context().  Some new errors, some
old error messages changed for consistency.

Fixed error checking in generator expression code.  The first set of
tests were impossible condition given the grammar.  In general, the
ast code uses REQ() for those sanity checks.

Fix some error handling for augmented assignments.  As comments in the
code explain, set_context() ought to work here, but I got unexpected
crashes when I tried it.  Should come back to this.

Add note to Grammar that yield expression is a special case.

Add doctest cases for SyntaxErrors raised by ast.c.
2006-01-27 15:18:39 +00:00
Gregory P. Smith 3d344e8b07 Add wrapper for DBEnv.set_tx_timeout method to allow time based DB_RECOVER
(test cases and dbobj wrapping)
2006-01-27 07:06:15 +00:00
Neal Norwitz 08e301f8bd There was a race condition where the connector would try to connect
before the listener was ready (on gentoo x86 buildslave).  This
caused the listener to not exit normally since nobody connected to it
(waited in accept()).  The exception was raised in the other thread
and the test failed.

This fix doesn't completely eliminate the race, but should make it
near impossible to trigger.  Hopefully it's good enough.
2006-01-25 08:39:35 +00:00
Neal Norwitz 14361fffc2 Remove generated test db files 2006-01-25 07:20:47 +00:00
Neal Norwitz 62a21121b4 Fix bug #1413192, fix seg fault in bsddb if a txn was deleted before the env.
Will backport.
2006-01-25 05:21:55 +00:00
Tim Peters 2a4712dc80 test_rude_shutdown(): Rewrote to use proper thread
synchronization and termination.
2006-01-24 22:44:54 +00:00
Tim Peters 92037a15a9 Whitespace normalization. 2006-01-24 22:44:08 +00:00
Martin v. Löwis 3e86595280 Patch #1349118: urllib2 now supports user:pass@ style proxy
specifications, raises IOErrors when proxies for unsupported protocols
are defined, and uses the https proxy on https redirections.
2006-01-24 15:51:21 +00:00
Tim Peters 68f2d000e9 Repaired new test failures on Windows:
- The path separator isn't "/" on Windows.

- Leaving behind a read-only file causes cascades
  of bogus failures on Windows.
2006-01-23 22:19:24 +00:00
Tim Peters bc29c1a4cc Whitespace normalization. 2006-01-23 21:28:42 +00:00
Neal Norwitz dbc95f4222 Disable this test until I can test on big-endian machines and get passing 2006-01-23 08:48:03 +00:00
Neal Norwitz b155b62f54 Test zipimporter a bit more. Also get working with -R :: option for finding ref leaks 2006-01-23 07:52:13 +00:00
Neal Norwitz 0e17f8cd38 Convenience function to remove a possibly non-existant file 2006-01-23 07:51:27 +00:00
Neal Norwitz 9730bcb4a6 Test getsignal() and some error conditions 2006-01-23 07:50:06 +00:00
Neal Norwitz cd3e219cda Use unittest and make sure a few other cases don't crash 2006-01-23 07:49:36 +00:00
Georg Brandl 531cebad4c Bug #902075: urllib2 now handles "host:port" proxy specifications
Can/should this be backported?
2006-01-21 07:20:56 +00:00