Commit Graph

11975 Commits

Author SHA1 Message Date
Facundo Batista 3bdc002e39 Minor fix to the tests pass ok even with -O. 2007-04-10 03:00:37 +00:00
Žiga Seilnacht d5b3fed17d Patch #1695862: remove old test directory that causes test_urllib failures
on Windows buildbots.  The change is a one time fix and will be removed
after a successful buildbot run.
2007-04-09 19:10:29 +00:00
Vinay Sajip aa7b16a888 Added optional timeout to SocketHandler.makeSocket (SF #1695948) 2007-04-09 16:16:10 +00:00
Collin Winter bf61856427 Convert test_fileinput to use unittest. 2007-04-07 04:40:43 +00:00
Collin Winter 69c955f05d Convert test_module to use unittest. 2007-04-06 20:03:11 +00:00
Collin Winter fef1dcf433 Convert test_gc to use unittest. 2007-04-06 20:00:05 +00:00
Collin Winter e10deca7e0 Import cleanup in test_crypt. 2007-04-06 19:32:32 +00:00
Collin Winter 1dd9a2ccc3 Convert test_stringprep to use unittest. 2007-04-06 19:27:40 +00:00
Collin Winter 9405609c17 Convert test_normalization to use unittest. 2007-04-05 20:08:56 +00:00
Collin Winter fe712fb9ca Convert test_long_future to use unittest. 2007-04-05 20:05:07 +00:00
Raymond Hettinger 7a3d41f4ca Bug #1563759: struct.unpack doens't support buffer protocol objects 2007-04-05 18:00:03 +00:00
Žiga Seilnacht 18ffe42b4b Fix WalkTests.test_traversal() on Windows. The cleanup in
MakedirTests.setUp() can now be removed.
2007-04-04 18:38:47 +00:00
Collin Winter 10fe455529 Make test_softspace use unittest. 2007-04-04 18:36:30 +00:00
Collin Winter 82c3671565 Make test_getopt use unittest. 2007-04-04 18:33:40 +00:00
Martin v. Löwis 3bf573f918 Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
2007-04-04 18:30:36 +00:00
Collin Winter 80e8c998a2 Stop using test_support.verify(). 2007-04-04 18:16:24 +00:00
Collin Winter 9475db7662 Clean up imports. 2007-04-04 18:14:17 +00:00
Guido van Rossum b1bb01e2f6 Fix a race condition in this test -- instead of assuming that it will take
the test server thread at most 0.5 seconds to get ready, use an event
variable.
2007-04-04 17:43:02 +00:00
Facundo Batista 06c6579036 Fixed the way that the .pem files are looked for, and changed
how to kill the process in win32 to use the _handle attribute.
2007-04-04 14:10:40 +00:00
Facundo Batista a0da5c7bce Changed the whole structure of startup and checking if the
server is available. Hope to not get more false alarms.
2007-04-03 21:15:34 +00:00
Walter Dörwald e6dae6c655 Implement a contextmanager test.test_support.catch_warning that can
be used to catch the last warning issued by the warning framework.

Change test_warnings.py and test_structmembers.py to use this
new contextmanager.
2007-04-03 18:33:29 +00:00
Facundo Batista c4a106733c Added a SSL server to test_socket_ssl.py to be able to test
locally. Now, it checks if have openssl available and run
those specific tests (it starts openssl at the beggining of
all the tests and then kills it at the end).
2007-04-03 17:29:48 +00:00
Walter Dörwald e1a9b42c38 Add tests for the filename.
Test that the stacklevel is handled correctly.
2007-04-03 16:53:43 +00:00
Walter Dörwald 8bd65000d7 Document that CatchWarningTests is reused by test_structmembers.py. 2007-04-03 16:16:24 +00:00
Walter Dörwald d815d357b2 Move the functionality for catching warnings in test_warnings.py into a separate
class to that reusing the functionality in test_structmembers.py doesn't rerun
the tests from test_warnings.py.
2007-04-03 16:08:10 +00:00
Facundo Batista c3a35e19cc Now using unittest for the tests infraestructure. Also split the
tests in those who need the network, and that who doesn't.
2007-04-03 14:05:08 +00:00
Raymond Hettinger 7352cf5935 SF 1602378 Clarify docstrings for bisect 2007-04-03 00:02:11 +00:00
Guido van Rossum ab8802a4f7 Fix warnings about object.__init__() signature.
Two (test_array and test_descr) were bug IMO; the third (copy_reg)
is a work-around which recognizes that object.__init__() doesn't do
anything.
2007-04-02 23:55:37 +00:00
Raymond Hettinger 01a807db2a Array module's buffer interface can now handle empty arrays. 2007-04-02 22:54:21 +00:00
Raymond Hettinger e6e660bde3 SF #1693079: Cannot save empty array in shelve 2007-04-02 17:29:30 +00:00
Brett Cannon c7a2e4656e Fix the test for recreating the locale cache object by not worrying about if
one of the test locales cannot be set.
2007-04-01 19:46:19 +00:00
Brett Cannon c69066501b time.strptime's caching of its locale object was being recreated when the
locale changed but not used during the function call it was recreated during.

The test in this checkin is untested (OS X does not have the proper locale
support for me to test), although the fix for the bug this deals with
was tested by the OP (#1290505).  Once the buildbots verify the test at least
doesn't fail it becomes a backport candidate.
2007-04-01 18:47:27 +00:00
Neal Norwitz 8f35f44af3 SF #1685563, MSVCCompiler creates redundant and long PATH strings
If MSVCCompiler.initialize() was called multiple times, the path
would get duplicated.  On Windows, this is a problem because the
path is limited to 4k.  There's no benefit in adding a path multiple
times, so prevent that from occuring.  We also normalize the path
before checking for duplicates so things like /a and /a/ won't both
be stored.

Will backport.
2007-04-01 18:24:22 +00:00
Collin Winter 1520fe4e58 Shut up an occaisonal buildbot error due to test files being left around. 2007-03-31 19:31:34 +00:00
Marc-André Lemburg 2365fcde60 Bump the patch level version of distutils since there were a few bug fixes since
the 2.5.0 release.
2007-03-30 15:01:42 +00:00
Facundo Batista 93c33680a0 Added the posibility to pass the timeout to FTP.connect, not only when
instantiating the class. Docs and tests are updated.
2007-03-30 13:00:35 +00:00
Facundo Batista b6a5c9d605 Added timout parameter to telnetlib.Telnet. Also created
test_telnetlib.py with a basic test and timeout ones.
Docs are also updated.
2007-03-29 18:22:35 +00:00
Collin Winter 04a51ec8a3 Make test_zipfile clean up its temporary files properly. 2007-03-29 02:28:16 +00:00
Collin Winter d28fcbc7fb Consolidate patches #1690164, 1683397, and 1690169, all of which refactor XML-related test suites. The patches are applied together because they use a common output/xmltests file.
Thanks to Jerry Seutter for all three patches.
2007-03-28 23:34:06 +00:00
Facundo Batista 366d6262f8 Added timeout to smtplib (to SMTP and SMTP_SSL). Also created
the test_smtplib.py file, with a basic test and the timeout
ones. Docs are updated too.
2007-03-28 18:25:54 +00:00
Facundo Batista 1fe9f968a2 Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
2007-03-28 03:45:20 +00:00
Facundo Batista b20c500251 The basic test cases of poplib.py. 2007-03-27 18:50:29 +00:00
Facundo Batista 1b1c347311 Added an optional timeout to poplib.POP3. Also created a
test_poplib.py file with a basic test and the timeout
ones. Docs are also updated.
2007-03-27 18:23:21 +00:00
Facundo Batista 3f10099289 Forgot to add the file before the previous commit, here go
the ftplib tests.
2007-03-26 20:56:09 +00:00
Georg Brandl f03facfe90 Some nits. 2007-03-26 20:28:28 +00:00
Facundo Batista f196629eba Closing the HTTP connection after each test, and listening more. 2007-03-25 03:20:05 +00:00
Facundo Batista b8af7bcad5 Redone the tests, using the infrastructure already present
for threading and socket serving.
2007-03-25 01:53:21 +00:00
Collin Winter 75c7eb4fd8 Make test_relpath() pass on Windows. 2007-03-23 22:24:39 +00:00
Facundo Batista 14553b08a1 Surrounded with try/finally to socket's default timeout setting
changes in the tests, so failing one test won't produce strange
results in others. Also relaxed the timeout settings in the test
(where actually the value didn't mean anything).
2007-03-23 20:23:08 +00:00
Facundo Batista 07c78be0b4 Added a 'create_connect()' function to socket.py, which creates a
connection with an optional timeout, and modified httplib.py to
use this function in HTTPConnection. Applies patch 1676823.
2007-03-23 18:54:07 +00:00
Guido van Rossum f102e24bd3 Add a type.__init__() method that enforces the same signature as
type.__new__(), and then calls object.__init__(cls), just to be anal.

This allows us to restore the code in string.py's _TemplateMetaclass
that called super(...).__init__(name, bases, dct), which I commented
out yesterday since it broke due to the stricter argument checking
added to object.__init__().
2007-03-23 18:53:03 +00:00
Martin v. Löwis 0af338859b Bug #978833: Revert r50844, as it broke _socketobject.dup.
Will backport.
2007-03-23 13:27:15 +00:00
Guido van Rossum 143b564059 - Bug #1683368: The object.__init__() and object.__new__() methods are
now stricter in rejecting excess arguments.  The only time when
  either allows excess arguments is when it is not overridden and the
  other one is.  For backwards compatibility, when both are
  overridden, it is a deprecation warning (for now; maybe a Py3k
  warning later).

When merging this into 3.0, the warnings should become errors.

Note: without the change to string.py, lots of spurious warnings happen.
What's going on there?
2007-03-23 04:58:42 +00:00
Raymond Hettinger e3146f5aa3 Add test and fix for fromkeys() optional argument. 2007-03-21 20:33:57 +00:00
Žiga Seilnacht 7492e4260e Bug #1675967: re patterns pickled with older Python versions can
now be unpickled. Will backport.
2007-03-21 20:07:56 +00:00
Georg Brandl 972ca507aa Fix #1684254: split BROWSER contents with shlex to avoid displaying 'URL'. 2007-03-21 11:51:25 +00:00
Georg Brandl cae9f3d916 New test for rev. 54407 which only uses directories under TESTFN. 2007-03-21 09:10:29 +00:00
Georg Brandl 5cb76c19ba Patch #1682205: a TypeError while unpacking an iterable is no longer
masked by a generic one with the message "unpack non-sequence".
2007-03-21 09:00:39 +00:00
Georg Brandl b54a809825 Fix for glob.py if filesystem encoding is None. 2007-03-20 23:05:14 +00:00
Raymond Hettinger 0bbbfc4c0b Extend work on rev 52962 and 53829 eliminating redundant PyObject_Hash() calls and fixing set/dict interoperability. 2007-03-20 21:27:24 +00:00
Neal Norwitz ce55e21c70 Try to get test_urllib to pass on Windows by closing the file.
I'm guessing that's the problem.  h.getfile() must be called *after*
h.getreply() and the fp can be None.

I'm not entirely convinced this is the best fix (or even correct).
The buildbots will tell us if things improve or not.  I don't
know if this needs to be backported (assuming it actually works).
2007-03-20 08:14:57 +00:00
Neal Norwitz 6cbd8de641 Try to be a little more resilient to errors. This might help the test
pass, but my guess is that it won't.  I'm guessing that some other
test is leaving this file open which means it can't be removed
under Windows AFAIK.
2007-03-20 06:53:17 +00:00
Neal Norwitz b0a7d4ec68 Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-) 2007-03-20 06:16:26 +00:00
Neal Norwitz ce2ab351f0 Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-) 2007-03-20 06:13:25 +00:00
Neal Norwitz c990f6454f Try backing out 54407 to see if it corrects the problems on the Windows
buildbots.  This rev was backported, so we will need to keep both branches
in sync, pending the outcome of the test after this checkin.
2007-03-20 05:23:09 +00:00
Neal Norwitz c473d5ebab Get rid of deprecation warning when testing commands.getstatus() 2007-03-20 05:21:21 +00:00
Collin Winter a8785cc26a Patch #1630118: add a SpooledTemporaryFile class to tempfile. 2007-03-19 18:52:08 +00:00
Georg Brandl d9dbe72056 Patch #1678339: test case for bug in difflib. 2007-03-18 18:28:25 +00:00
Georg Brandl 2b869943fa Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
to complex using its __complex__() method before falling back to the
__float__() method. Therefore, the functions in the cmath module now
can operate on objects that define a __complex__() method.
 (backport)
2007-03-17 16:08:45 +00:00
Collin Winter 6f187743ff Patch 1339796: add a relpath() function to os.path. 2007-03-16 22:16:08 +00:00
Collin Winter 6de691d78c Remove test/output/test_popen2 (missed in r54417). 2007-03-16 21:15:35 +00:00
Collin Winter 1b4145dbb3 Patch #1676994: Refactor test_popen2 to use unittest. 2007-03-16 21:13:35 +00:00
Žiga Seilnacht 6f2d09c949 Patch #1623563: allow __class__ assignment for classes with __slots__.
The old and the new class are still required to have the same slot
names, but the order in which they are specified is not relevant.
2007-03-16 11:59:38 +00:00
Georg Brandl 8844e438b1 Patch #1273829: os.walk() now has a "followlinks" parameter. If set to
True (which is not the default), it visits symlinks pointing to
directories.
2007-03-16 08:22:40 +00:00
Georg Brandl 8f06d02935 Bug #1681228: the webbrowser module now correctly uses the default
GNOME or KDE browser, depending on whether there is a session of one
of those present. Also, it tries the Windows default browser before
trying Mozilla variants.
 (backport)
2007-03-16 07:55:09 +00:00
Collin Winter 77c67bd585 Patch #1642547: Fix an error/crash when encountering syntax errors in complex if statements.
Will backport.
2007-03-16 04:11:30 +00:00
Žiga Seilnacht 20f43d3018 Patch #1462488: prevent a segfault in object_reduce_ex() by splitting
the implementation for __reduce__ and __reduce_ex__ into two separate
functions. Fixes bug #931877. Will backport.
2007-03-15 11:44:55 +00:00
Georg Brandl ab1f4674ad Patch #1681153: the wave module now closes a file object it opened if
initialization failed.
2007-03-15 07:41:30 +00:00
Brett Cannon ea2835a860 Raise ResourceDenied in test_urllib2net when the Net connection goes bad. 2007-03-14 21:44:15 +00:00
Martin v. Löwis cd1210a55f Patch #1559413: Fix test_cmd_line if sys.executable contains a space.
Will backport.
2007-03-14 20:02:31 +00:00
Žiga Seilnacht 71436f0229 Patch #1680015: Don't modify __slots__ tuple if it contains an unicode
name. Remove a reference leak that happened if the name could not be
converted to string. Will backport.
2007-03-14 12:24:09 +00:00
Georg Brandl f66b6039c1 Bug #767111: fix long-standing bug in urllib which caused an
AttributeError instead of an IOError when the server's response didn't
contain a valid HTTP status line.
2007-03-14 08:27:52 +00:00
Barry Warsaw dcd24ae501 SF bug #1582282; decode_header() incorrectly splits not-conformant RFC
2047-like headers where there is no whitespace between encoded words.  This
fix changes the matching regexp to include a trailing lookahead assertion that
the closing ?= must be followed by whitespace, newline, or end-of-string.
This also changes the regexp to add the MULTILINE flag.
2007-03-14 04:59:50 +00:00
Georg Brandl 4aef7275cb Patch #1185447: binascii.b2a_qp() now correctly quotes binary characters
with ASCII value less than 32. Also, it correctly quotes dots only if
they occur on a single line, as opposed to the previous behavior of
quoting dots if they are the second character of any line.
2007-03-13 22:49:43 +00:00
Georg Brandl 7e2b6bb24f Patch #1194449: correctly detect unbound methods in pydoc. 2007-03-13 22:16:30 +00:00
Georg Brandl 03b90d8cfd Patch #957650: "%var%" environment variable references are now properly
expanded in ntpath.expandvars(), also "~user" home directory references
are recognized and handled on Windows.
2007-03-13 22:07:36 +00:00
Georg Brandl b6ae6aa8ac Patch #1429539: pdb now correctly initializes the __main__ module for
the debugged script, which means that imports from __main__ work
correctly now.
2007-03-13 21:58:44 +00:00
Georg Brandl 8044e5bbd4 Deprecate commands.getstatus(). 2007-03-13 21:32:01 +00:00
Georg Brandl 8e84c65660 Patch #1393667: pdb now has a "run" command which restarts the debugged
Python program, optionally with different arguments.
2007-03-13 21:08:15 +00:00
Georg Brandl 5240d7416c Patch #1444529: the builtin compile() now accepts keyword arguments.
(backport)
2007-03-13 20:46:32 +00:00
Thomas Heller 5dc4fe09b7 Patch #1649190: Adding support for _Bool to ctypes as c_bool, by David Remahl. 2007-03-13 20:42:52 +00:00
Georg Brandl 8441f15626 Patch #1530482: add pydoc.render_doc() which returns the documentation
for a thing instead of paging it to stdout, which pydoc.doc() does.
2007-03-13 20:02:57 +00:00
Georg Brandl d9bef35e3c Patch #1533909: the timeit module now accepts callables in addition to
strings for the code to time and the setup code. Also added two
convenience functions for instantiating a Timer and calling its methods.
2007-03-13 19:32:21 +00:00
Georg Brandl 4168c0466f Fix a tab. 2007-03-13 19:18:18 +00:00
Georg Brandl 35ef9c19fe Patch #1537850: tempfile.NamedTemporaryFile now has a "delete" parameter
which can be set to False to prevent the default delete-on-close
behavior.
2007-03-13 18:31:49 +00:00
Georg Brandl 6c104f6906 Patch #1605192: list allowed states in error messages for imaplib. 2007-03-13 18:24:40 +00:00
Georg Brandl 9e6b47002a Patch #1581073: add a flag to textwrap that prevents the dropping of
whitespace while wrapping.
2007-03-13 18:15:41 +00:00
Georg Brandl 92a6baed7b Patch #1603688: ConfigParser.SafeConfigParser now checks values that
are set for invalid interpolation sequences that would lead to errors
on reading back those values.
2007-03-13 17:43:32 +00:00
Lars Gustäbel a36cde4ccc Quick fix for tests that fail on systems with an encoding other
than 'iso8859-1'.
2007-03-13 15:47:07 +00:00
Lars Gustäbel c64e40215d This is the implementation of POSIX.1-2001 (pax) format read/write
support.

The TarInfo class now contains all necessary logic to process and
create tar header data which has been moved there from the TarFile
class. The fromtarfile() method was added. The new path and linkpath
properties are aliases for the name and linkname attributes in
correspondence to the pax naming scheme.

The TarFile constructor and classmethods now accept a number of
keyword arguments which could only be set as attributes before (e.g.
dereference, ignore_zeros). The encoding and pax_headers arguments
were added for pax support. There is a new tarinfo keyword argument
that allows using subclassed TarInfo objects in TarFile.

The boolean TarFile.posix attribute is deprecated, because now three
tar formats are supported. Instead, the desired format for writing is
specified using the constants USTAR_FORMAT, GNU_FORMAT and PAX_FORMAT
as the format keyword argument. This change affects TarInfo.tobuf()
as well.

The test suite has been heavily reorganized and partially rewritten.
A new testtar.tar was added that contains sample data in many formats
from 4 different tar programs.

Some bugs and quirks that also have been fixed:
Directory names do no longer have a trailing slash in TarInfo.name or
TarFile.getnames().
Adding the same file twice does not create a hardlink file member.
The TarFile constructor does no longer need a name argument.
The TarFile._mode attribute was renamed to mode and contains either
'r', 'w' or 'a'.
2007-03-13 10:47:19 +00:00