Neal Norwitz [Sun, 5 Aug 2007 03:23:31 +0000 (03:23 +0000)]
Handle errors when generating a warning.
The value is always written to the returned pointer if getting it was
successful, even if a warning causes an error. (This probably doesn't matter
as the caller will probably discard the value.)
Facundo Batista [Wed, 1 Aug 2007 23:18:36 +0000 (23:18 +0000)]
Allow the OS to select a free port for each test server. For
DebuggingServerTests, construct SMTP objects with a localhost argument
to avoid abysmally long FQDN lookups (not relevant to items under
test) on some machines that would cause the test to fail. Moved server
setup code in the server function inside the try block to avoid the
possibility of setup failure hanging the test. Minor edits to conform
to PEP 8. [GSoC - Alan McIntyre]
When running asynchat tests on OS X (darwin), the test client now
overrides asyncore.dispatcher.handle_expt to do nothing, since
select.poll gives a POLLHUP error at the completion of these tests.
Added timeout & count arguments to several asyncore.loop calls to
avoid the possibility of a test hanging up a build. [GSoC - Alan
McIntyre]
Added tests for asynchat classes simple_producer & fifo, and the
find_prefix_at_end function. Check behavior of a string given as a
producer. Added tests for behavior of asynchat.async_chat when given
int, long, and None terminator arguments. Added usepoll attribute to
TestAsynchat to allow running the asynchat tests with poll support
chosen whether it's available or not (improves coverage of asyncore
code). [GSoC - Alan McIntyre]
Moved all of the capture_server socket setup code into the try block
so that the event gets set if a failure occurs during server setup
(otherwise the test will block forever). Changed to let the OS assign
the server port number, and client side of test waits for port number
assignment before proceeding. The test data in DispatcherWithSendTests
is also sent in multiple send() calls instead of one to make sure this
works properly. [GSoC - Alan McIntyre]
New tests for basic behavior of smtplib.SMTP and
smtpd.DebuggingServer. Change to use global host & port number
variables. Modified the 'server' to take a string to send back in
order to vary test server responses. Added a test for the reaction of
smtplib.SMTP to a non-200 HELO response. [GSoC - Alan McIntyre]
Nick Coghlan [Tue, 24 Jul 2007 13:58:28 +0000 (13:58 +0000)]
Fix an incompatibility between the -i and -m command line switches as reported on python-dev by PJE - runpy.run_module now leaves any changes it makes to the sys module intact after the function terminates
Nick Coghlan [Mon, 23 Jul 2007 13:41:45 +0000 (13:41 +0000)]
Correctly cleanup sys.modules after executing runpy relative import
tests
Restore Python 2.4 ImportError when attempting to execute a package
(as imports cannot be guaranteed to work properly if you try it)
Selectively enable tests for asyncore.readwrite based on the presence
of poll support in the select module (since this is the only case in
which readwrite can be called). [GSoC - Alan McIntyre]
Martin v. Löwis [Sat, 21 Jul 2007 06:55:02 +0000 (06:55 +0000)]
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
Added a select.select call in the test server loop to make sure the
socket is ready to be read from before attempting a read (this
prevents an error 10035 on some Windows platforms). [GSoC - Alan
McIntyre]
Prevent asyncore.dispatcher tests from hanging by adding loop counters
to server & client, and by adding asyncore.close_all calls in
tearDown. Also choose correct expected logging results based on the
value of __debug__ [Alan McIntyre - GSoC]
First version. Includes tests for helper functions: read, write,
_exception, readwrite, closeall, compact_traceback; and for classes
dispatcher, dispatcher_with_send, and file_wrapper.
[Alan McIntyre - GSoC]
Avoid exception if there's a stray directory inside a Maildir folder.
The Maildir specification doesn't seem to say anything about this
situation, and it can happen if you're keeping a Maildir mailbox in
Subversion (.svn directories) or some similar system. The patch just
ignores directories in the cur/, new/, tmp/ folders.
Barry Warsaw [Fri, 13 Jul 2007 22:12:58 +0000 (22:12 +0000)]
In response to this SF bug:
[ 1752723 ] email.message_from_string: initial line gets discarded
I added a test to assert that when the first line of text passed to
message_from_string() contains a leading space, the message ends up with the
appropriate FirstHeaderLineIsContinuationDefect on its defects list.
Thomas Heller [Fri, 13 Jul 2007 13:59:39 +0000 (13:59 +0000)]
Repair COMError. Since exceptions are new style classes now, setting
the methods and docstring after the type creation does not work, they
must be in the dictionary before creating the type.
Added tests for basic behavior of DateTime, Binary, and Fault classes
and the escape function. Check that marshalling recursive sequences &
dicts raises TypeError. Check that marshalling out-of-range ints
raises OverflowError [Alan McIntyre - GSoC]
Georg Brandl [Thu, 12 Jul 2007 09:59:22 +0000 (09:59 +0000)]
Patch #1675424: Added tests for uncovered code in the zipfile module.
The KeyError raised by Zipfile.getinfo for nonexistent names now has
a descriptive message.
Kurt B. Kaiser [Thu, 5 Jul 2007 22:03:39 +0000 (22:03 +0000)]
Many calls to tk.call involve an arglist containing a single tuple.
Calls using METH_OLDARGS unpack this tuple; calls using METH_VARARG
don't. Tcl's concatenation of args was affected; IDLE doesn't start.
Modify Tkapp_Call() to unpack single tuple arglists.
Neal Norwitz [Fri, 15 Jun 2007 03:11:41 +0000 (03:11 +0000)]
urllib2_localnet says it leaks probably due to threads. So ignore it.
popen2 is also complaining probably for similar reasons.
make install always reports failure, so don't mail in this case.
Walter Dörwald [Wed, 13 Jun 2007 16:57:12 +0000 (16:57 +0000)]
Add T_PYSSIZET in structmember.h: This can be used for
Py_ssize_t members.
Simplify the implementation of UnicodeError objects:
start and end attributes are now stored directly as
Py_ssize_t members, which simplifies various get and
set functions.
Facundo Batista [Mon, 11 Jun 2007 16:27:08 +0000 (16:27 +0000)]
Added versionchanged flag to all the methods which received
a new optional timeout parameter, and a versionadded flag to
the socket.create_connection function.