Commit Graph

12146 Commits

Author SHA1 Message Date
Georg Brandl da5f16ab19 Bug #1688564: document os.path.join's absolute path behavior in the docstring. 2007-08-23 21:27:57 +00:00
Georg Brandl ac4018ae39 Use try-except-finally in contextlib. 2007-08-23 18:11:33 +00:00
Brett Cannon dbed7a7394 Make test_runpy re-entrant. 2007-08-23 14:53:17 +00:00
Gregory P. Smith ca4669c152 stop leaving log.0000001 __db.00* and xxx.db turds in developer
sandboxes when bsddb3 tests are run.
2007-08-22 21:32:34 +00:00
Alex Martelli d8672aa8a4 Fix compile.c so that it records 0.0 and -0.0 as separate constants in a code
object's co_consts tuple; add a test to show that the previous behavior (where
these two constants were "collapsed" into one) causes serious malfunctioning.
2007-08-22 21:14:17 +00:00
Facundo Batista 1bc8d639df Added test for behavior of operations on an unconnected SMTP object,
and tests for NOOP, RSET, and VRFY. Corrected typo in a comment for
testNonnumericPort. Added a check for constructing SMTP objects when
non-numeric ports are included in the host name. Derived a server from
SMTPServer to test various ESMTP/SMTP capabilities. Check that a
second HELO to DebuggingServer returns an error. [GSoC - Alan McIntyre]
2007-08-21 16:57:18 +00:00
Georg Brandl d7e9f608c3 Revert accidental checkins from last commit. 2007-08-21 06:03:43 +00:00
Georg Brandl fdca6d8599 Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers. 2007-08-21 06:01:18 +00:00
Mark Hammond 1bb124ad0d [ 1761786 ] distutils.util.get_platform() return value on 64bit Windows
As discussed on distutils-sig: Allows the generated installer name on
64bit Windows platforms to be different than the name generated for
32bit Windows platforms.
2007-08-21 01:05:16 +00:00
Mark Hammond e4f271f38d [ 1761786 ] distutils.util.get_platform() return value on 64bit Windows
As discussed on distutils-sig: Allows the generated installer name on
64bit Windows platforms to be different than the name generated for
32bit Windows platforms.
2007-08-21 01:04:47 +00:00
Facundo Batista c65a5f1b14 Catch ProtocolError exceptions and include the header information in
test output (to make it easier to debug test failures caused by
problems in the server). [GSoC - Alan McIntyre]
2007-08-21 00:16:21 +00:00
Guido van Rossum 54ec61ea6e Add a hack (originally devised in a slightly different form by Thomas Wouters)
to prevent spurious tracebacks when a daemon thread's cleanup happens to wake
up when the world around it has already been destroyed.
2007-08-20 15:18:04 +00:00
Hye-Shik Chang 2390104d81 Add cheot-ga-keut composed make-up sequence support in EUC-KR codec. 2007-08-20 06:49:18 +00:00
Brett Cannon 855da6cbbf Make test_warnings re-entrant. 2007-08-17 20:16:15 +00:00
Facundo Batista 7f686fce40 Added a flag (_send_traceback_header) to the SimpleXMLRPCServer class
that allows sending back exception/stack trace information about
internal server errors (this flag defaults to False to avoid sending
such information unless explicitly enabled).  Added tests to verify
behavior of this new feature (these tests are skipped on win32 because
of problems with WSAEWOULDBLOCK). Renamed HTTPTestCase to
SimpleServerTestCase. [GSoC - Alan McIntyre]
2007-08-17 19:16:44 +00:00
Walter Dörwald 6e39080649 Backport r57105 and r57145 from the py3k branch: UTF-32 codecs. 2007-08-17 16:41:28 +00:00
Facundo Batista 849693989a When passed a bad formed literal to Decimal, now we have a
better error message, more descriptive. (bug #1770009)
2007-08-15 15:13:09 +00:00
Brett Cannon 5a0382eeb6 Fix a missed instance of test.test_support.guard_warnings_filter (which was
recently removed).
2007-08-14 17:53:30 +00:00
Facundo Batista a53872b09a Added tests for simple function calls and introspection that are run
against a SimpleXMLRPCServer in a separate thread.  Because of
problems with WSAEWOULDBLOCK (error 10035) being raised by the server
on Windows, these new tests are skipped on win32. [GSoC - Alan McIntyre]
2007-08-14 13:35:00 +00:00
Brett Cannon 2ee4128e9b Remove test.test_support.guard_warnings_filter.
test.test_support.catch_warning is more full-featured and provides the same
functionality.

Since guard_warnings_filter was added in 2.6 there is no
backwards-compatibility issues.
2007-08-14 05:51:06 +00:00
Brett Cannon 7b97e8a9c2 Fix a minor typo in a docstring. 2007-08-14 03:38:47 +00:00
Georg Brandl 9616444427 Revert the fix for #1548891, it broke backwards compatibility with arbitrary read buffers.
Fixes #1730114.
2007-08-08 13:03:41 +00:00
Georg Brandl 0f6d360ac7 Replace unnecessary function call. 2007-08-06 07:39:09 +00:00
Hye-Shik Chang f3e93a0268 Fix gb18030 codec's bug that doesn't map two-byte characters on
GB18030 extension in encoding. (bug reported by Bjorn Stabell)
2007-08-04 04:10:18 +00:00
Facundo Batista 412b8b654c 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]
2007-08-01 23:18:36 +00:00
Nick Coghlan f8bbaa962f Eliminate RLock race condition reported in SF bug #1764059 2007-07-31 13:38:01 +00:00
Facundo Batista 4950442fb7 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]
2007-07-31 03:03:34 +00:00
Facundo Batista ec62423be4 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]
2007-07-29 14:23:08 +00:00
Facundo Batista 8eab424fb5 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]
2007-07-28 14:21:22 +00:00
Martin v. Löwis f1e0b3f630 Bug #1704793: Return UTF-16 pair if unicodedata.lookup cannot
represent the result in a single character.
2007-07-28 07:03:05 +00:00
Martin v. Löwis f25e35b9ec Bug #978833: Close https sockets by releasing the _ssl object. 2007-07-27 18:28:22 +00:00
Nick Coghlan ec2ce9bbae Make test_math error messages more meaningful for small discrepancies in results 2007-07-27 10:36:30 +00:00
Nick Coghlan 00f2029cd5 Add explicit test for a misbehaving math.floor 2007-07-26 14:03:00 +00:00
Martin v. Löwis 254b8f9096 Change location of the package index to pypi.python.org/pypi 2007-07-25 16:24:23 +00:00
Nick Coghlan 55248d6c61 Add a temporary diagnostic message before a strange failure on the alpha Debian buildbot 2007-07-25 13:18:58 +00:00
Nick Coghlan d44a5afaa9 More buildbot cleanup - let the OS assign the port for test_urllib2_localnet 2007-07-25 12:57:48 +00:00
Facundo Batista 16ed5b4bfe 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]
2007-07-24 21:20:42 +00:00
Nick Coghlan 12adef9b8b Try to get rid of spurious failure in test_resource on the Debian buildbots by changing the file size limit before attempting to close the file 2007-07-24 14:39:23 +00:00
Nick Coghlan 13c25c08ca 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 2007-07-24 13:58:28 +00:00
Nick Coghlan 4f82a03714 Tweak runpy test to do a better job of confirming that sys has been manipulated correctly 2007-07-24 13:07:38 +00:00
Nick Coghlan ae21fc6d1f 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)
2007-07-23 13:41:45 +00:00
Nick Coghlan f17a2e4f87 Add explicit relative import tests for runpy.run_module 2007-07-22 10:18:07 +00:00
Facundo Batista 7f4f41255f 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]
2007-07-22 00:13:00 +00:00
Facundo Batista b1994b4a5d 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]
2007-07-19 23:57:38 +00:00
Kurt B. Kaiser db98f3632a Fix failing unicode test caused by change to ast.c at r56441 2007-07-18 19:58:42 +00:00
Guido van Rossum b6ac23cd07 SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.
(Slightly tweaked for style and refcounts.)
2007-07-18 17:19:14 +00:00
Facundo Batista 78e19616f3 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]
2007-07-17 02:19:39 +00:00
Facundo Batista 66263cf151 Changed the used port and commented out some tests that uses
a non documented function that appers to uses resources
not present in Windows.
2007-07-15 20:30:39 +00:00
Facundo Batista f47bc182f1 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]
2007-07-14 22:41:45 +00:00
Andrew M. Kuchling 2b09ef0c6d 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.
2007-07-14 21:56:19 +00:00
Barry Warsaw 81a06d4260 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.

The bug is invalid.
2007-07-13 22:12:58 +00:00
Thomas Heller fa704c6ade Fix for SF# 1701409: segfault in c_char_p of ctypes. The repr output
of c_char_p and c_wchar_p has changed as a sideeffect.
2007-07-13 17:12:23 +00:00
Thomas Heller ad0cfe3dd7 Do not try to load the GLUT library in the ctypes tests. This test
adds little value, but has a large problem on OS X, as explained in
SF# 1581906.
2007-07-13 16:50:43 +00:00
Thomas Heller 1fd1cc5be2 Add tests for _ctypes.COMError. 2007-07-13 14:18:06 +00:00
Facundo Batista 5a3b524e8e 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]
2007-07-13 10:43:44 +00:00
Georg Brandl 4b3ab6fcc0 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.
2007-07-12 09:59:22 +00:00
Georg Brandl b2e208f901 Patch #1731169: clean up expected skips list. 2007-07-12 09:24:04 +00:00
Georg Brandl 7c3b50db66 Patch #1673759: add a missing overflow check when formatting floats
with %G.
2007-07-12 08:38:00 +00:00
Georg Brandl bc5fbd9f8c Patch #1739696: use code.co_code only if really necessary 2007-07-12 08:11:29 +00:00
Georg Brandl f91149e4a1 Patch #1752270, #1750931: complain if urllib2 add_handler called
without handler.
2007-07-12 08:05:45 +00:00
Ronald Oussoren 9b0bcc1f4b Patch 1693258: Fix for duplicate "preferences" menu-OS X 2007-07-09 06:02:21 +00:00
Neal Norwitz e3b185f966 Fix typo in comment 2007-07-06 04:13:39 +00:00
Georg Brandl ee250301b7 Fix a few webbrowser.py problems. 2007-07-01 08:11:35 +00:00
Georg Brandl 75ec1dbd9d Bug #1737864: allow empty message in logging format routines. 2007-06-19 12:36:00 +00:00
Lars Gustäbel 104490e615 Added exclude keyword argument to the TarFile.add() method. 2007-06-18 11:42:11 +00:00
Marc-André Lemburg b24cd0f05a Add patch #1726668: Windows Vista support. 2007-06-12 09:26:49 +00:00
Marc-André Lemburg 0e09788eda Apply patch #1734945 to support TurboLinux as distribution. 2007-06-12 09:09:58 +00:00
Neal Norwitz c161cb9955 Bug #1734723: Fix repr.Repr() so it doesn't ignore the maxtuple attribute.
Will backport
2007-06-11 07:29:43 +00:00
Neal Norwitz ade2c216e1 Not sure why this only fails sometimes on Unix machines. Better
to disable it and only import msvccompiler on Windows since that's
the only place it can work anyways.
2007-06-11 06:16:48 +00:00
Neal Norwitz 478b99b89f Add all of the distuils modules that don't seem to have explicit tests. :-(
Move an import in mworkscompiler so that this module can be imported on
any platform.  Hopefully this works on all platforms.
2007-06-11 05:28:45 +00:00
Neal Norwitz fdffca27c1 Prevent hang if the port cannot be opened. 2007-06-11 04:52:37 +00:00
Neal Norwitz 5c9a81a3d8 Fix a bug when there was a newline in the string expandtabs was called on.
This also catches another condition that can overflow.

Will backport.
2007-06-11 02:16:10 +00:00
Neal Norwitz ba965deea8 Prevent these tests from running on Win64 since they don\'t apply there either 2007-06-11 02:14:39 +00:00
Martin v. Löwis 6371cd8177 Patch #1733960: Allow T_LONGLONG to accept ints.
Will backport to 2.5.
2007-06-09 07:42:52 +00:00
Neal Norwitz 7dbd2a3720 Prevent expandtabs() on string and unicode objects from causing a segfault when
a large width is passed on 32-bit platforms.  Found by Google.

It would be good for people to review this especially carefully and verify
I don't have an off by one error and there is no other way to cause overflow.
2007-06-09 03:36:34 +00:00
Thomas Heller 1b9e041812 Make this test work with older Python releases where struct has no 't' format character. 2007-06-08 16:10:27 +00:00
Georg Brandl ff8712263d Patch #1667860: Fix UnboundLocalError in urllib2. 2007-06-07 13:34:10 +00:00
Georg Brandl e06cf4534f Disallow function calls like foo(None=1).
Backport from py3k rev. 55708 by Guido.
2007-06-07 13:23:24 +00:00
Facundo Batista 10951d51e2 Added an optional timeout parameter to function urllib2.urlopen,
with tests in test_urllib2net.py (must have network resource
enabled to execute them). Also modified test_urllib2.py because
testing mock classes must take it into acount. Docs are also
updated.
2007-06-06 17:15:23 +00:00
Facundo Batista 9249312020 FTP.ntransfercmd method now uses create_connection when passive,
using the timeout received in connection time.
2007-06-06 15:13:37 +00:00
Collin Winter 50b79ce8e6 Patch #1731049: make threading.py use a proper "raise" when checking internal state, rather than assert statements (which get stripped out by -O). 2007-06-06 00:17:35 +00:00
Hye-Shik Chang f9a0ea8ce1 Fix for Windows: close a temporary file before trying to delete it. 2007-06-05 19:28:15 +00:00
Hye-Shik Chang 9b5414090b Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it
reads a file that ends with incomplete sequence and sizehint argument
for .read() is specified.
2007-06-05 18:58:51 +00:00
Brett Cannon f7188cefb3 Make _strptime.TimeRE().pattern() use ``\s+`` for matching whitespace instead
of ``\s*``.  This prevents patterns from "stealing" bits from other patterns in
order to make a match work.

Closes bug #1730389.  Will be backported.
2007-06-03 23:13:41 +00:00
Neal Norwitz 4a700bb469 SF 1668596/1720897: distutils now copies data files
even if package_dir is empty.

This needs to be backported.  I'm too tired tonight.  It would be great
if someone backports this if the buildbots are ok with it.  Otherwise,
I will try to get to it tomorrow.
2007-06-01 07:29:12 +00:00
Brett Cannon f0cb1d7ad6 Have cfmfile raise a DeprecationWarning as per PEP 4. 2007-05-31 20:01:11 +00:00
Brett Cannon 791d56f1f7 Cause buildtools to raise a DeprecationWarning. 2007-05-31 19:40:42 +00:00
Brett Cannon c2aa09ad80 Have the sha module raise a DeprecationWarning as specified in PEP 4. 2007-05-31 19:20:00 +00:00
Brett Cannon 7eec217908 Have md5 raise a DeprecationWarning as per PEP 4. 2007-05-30 22:24:28 +00:00
Brett Cannon c249bdab92 Have mimify raise a DeprecationWarning. The docs and PEP 4 have listed the
module as deprecated for a while.
2007-05-30 21:48:58 +00:00
Brett Cannon 90134c9a05 Have MimeWriter raise a DeprecationWarning as per PEP 4 and its documentation. 2007-05-30 20:46:26 +00:00
Thomas Heller b4eec28e33 Correct the name of a field in the WIN32_FIND_DATAA and WIN32_FIND_DATAW structures.
Closes bug #1726026.
2007-05-30 07:01:25 +00:00
Martin v. Löwis e9607e24a7 Revert 55634. 2007-05-29 04:02:03 +00:00
Martin v. Löwis a652f69c1c Test pre-commit hook for a link to a .py file. 2007-05-29 04:01:29 +00:00
Lars Gustäbel a0fcb9384e Added errors argument to TarFile class that allows the user to
specify an error handling scheme for character conversion. Additional
scheme "utf-8" in read mode. Unicode input filenames are now
supported by design. The values of the pax_headers dictionary are now
limited to unicode objects.

Fixed: The prefix field is no longer used in PAX_FORMAT (in
conformance with POSIX).
Fixed: In read mode use a possible pax header size field.
Fixed: Strip trailing slashes from pax header name values.
Fixed: Give values in user-specified pax_headers precedence when
writing.

Added unicode tests. Added pax/regtype4 member to testtar.tar all
possible number fields in a pax header.

Added two chapters to the documentation about the different formats
tarfile.py supports and how unicode issues are handled.
2007-05-27 19:49:30 +00:00
Peter Astrand 81a191b351 Applied patch 1669481, slightly modified: Support close_fds on Win32 2007-05-26 22:18:20 +00:00
Brett Cannon 6cef076ba5 Remove direct call's to file's constructor and replace them with calls to
open() as ths is considered best practice.
2007-05-25 20:17:15 +00:00
Vinay Sajip 754a5fb640 Updated docstring for SysLogHandler (#1720726). 2007-05-25 07:05:59 +00:00
Neal Norwitz 38917f56fe Get test passing again by commenting out the reference to the test class. 2007-05-25 05:13:40 +00:00
Facundo Batista d9880d07fc Commenting out the tests until find out who can test them in
one of the problematic enviroments.
2007-05-25 04:20:22 +00:00