Commit Graph

4639 Commits

Author SHA1 Message Date
Martin v. Löwis 0a04819a13 tr a-z A-Z does not work on Solaris (would require
/usr/xpg4/bin/tr); make the character ranges explicit.
2007-09-10 06:18:32 +00:00
Gregory P. Smith e9fef694b4 Change socket.error to inherit from IOError rather than being a stand
alone class.  This addresses the primary concern in

 http://bugs.python.org/issue1706815

python-dev discussion here:

 http://mail.python.org/pipermail/python-dev/2007-July/073749.html

I chose IOError rather than EnvironmentError as the base class since
socket objects are often used as transparent duck typed file objects
in code already prepared to deal with IOError exceptions.

also a minor fix:

 urllib2 - fix a couple places where IOError was raised rather than URLError.
           for better or worse, URLError already inherits from IOError so
           this won't break any existing code.

 test_urllib2net - replace bad ftp urls.
2007-09-09 23:36:46 +00:00
Gregory P. Smith f80578548d email address update 2007-09-09 20:25:00 +00:00
Brett Cannon 1e534b5425 Fix a crasher where Python code managed to infinitely recurse in C code without
ever going back out to Python code in PyObject_Call().  Required introducing a
static RuntimeError instance so that normalizing an exception there is no
reliance on a recursive call that would put the exception system over the
recursion check itself.
2007-09-07 04:18:30 +00:00
Brett Cannon 68a6da99e6 Make uuid1 and uuid4 tests conditional on whether ctypes can be imported;
implementation of either function depends on ctypes but uuid as a whole does
not.
2007-09-07 03:17:50 +00:00
Armin Rigo 337841dac7 PyDict_GetItem() returns a borrowed reference.
This attack is against ceval.c:IMPORT_NAME, which calls an
object (__builtin__.__import__) without holding a reference to it.
2007-09-06 09:30:38 +00:00
Armin Rigo 362bb51503 PyDict_GetItem() returns a borrowed reference.
There are probably a number of places that are open to attacks
such as the following one, in bltinmodule.c:min_max().
2007-09-05 07:51:21 +00:00
Bill Janssen ffe576dc78 SSL certificate distinguished names should be represented by tuples 2007-09-05 00:46:27 +00:00
Martin v. Löwis a5136196bc Patch #1031213: Decode source line in SyntaxErrors back to its original
source encoding. Will backport to 2.5.
2007-09-04 14:19:28 +00:00
Thomas Wouters 628e3bb808 One more fix to consider missing SSL support. 2007-08-30 22:35:31 +00:00
Martin v. Löwis 7dcb83cdc5 Bug #1709599: Run test_1565150 only if the file system is NTFS. 2007-08-30 19:04:09 +00:00
Georg Brandl 0226d85737 * Skip test_pipes on non-POSIX.
* Don't raise TestSkipped within a test function.
2007-08-30 12:32:23 +00:00
Georg Brandl 27d9ee32ab Patch #1680959: add test suite for pipes module. 2007-08-30 10:38:56 +00:00
Bill Janssen 426ea0a864 This contains a number of things:
1) Improve the documentation of the SSL module, with a fuller
   explanation of certificate usage, another reference, proper
   formatting of this and that.

2) Fix Windows bug in ssl.py, and general bug in sslsocket.close().
   Remove some unused code from ssl.py.  Allow accept() to be called on
   sslsocket sockets.

3) Use try-except-else in import of ssl in socket.py.  Deprecate use of
   socket.ssl().

4) Remove use of socket.ssl() in every library module, except for
   test_socket_ssl.py and test_ssl.py.
2007-08-29 22:35:05 +00:00
Facundo Batista 492e5920bc Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised during FailingServerTestCase tests.
[GSoC - Alan McIntyre]
2007-08-29 10:28:28 +00:00
Walter Dörwald 6d20b705dd Fix test output. 2007-08-28 23:35:33 +00:00
Skip Montanaro 1a41313684 fixes 813986 2007-08-28 23:22:52 +00:00
Georg Brandl bf138333ce Add a crasher for the thread-unsafety of file objects. 2007-08-28 18:54:44 +00:00
Thomas Wouters 3ccec68a05 Improve extended slicing support in builtin types and classes. Specifically:
- Specialcase extended slices that amount to a shallow copy the same way as
   is done for simple slices, in the tuple, string and unicode case.

 - Specialcase step-1 extended slices to optimize the common case for all
   involved types.

 - For lists, allow extended slice assignment of differing lengths as long
   as the step is 1. (Previously, 'l[:2:1] = []' failed even though
   'l[:2] = []' and 'l[:2:None] = []' do not.)

 - Implement extended slicing for buffer, array, structseq, mmap and
   UserString.UserString.

 - Implement slice-object support (but not non-step-1 slice assignment) for
   UserString.MutableString.

 - Add tests for all new functionality.
2007-08-28 15:28:19 +00:00
Lars Gustäbel 0f4a14b56f TarFile.__init__() no longer fails if no name argument is passed and
the fileobj argument has no usable name attribute (e.g. StringIO).

(will backport to 2.5)
2007-08-28 12:31:09 +00:00
Guido van Rossum ba8c5653cc > Regardless, building a fixed test certificate and checking it in sounds like
> the better option.  Then the openssl command in the test code can be turned
> into a comment describing how the test data was pregenerated.

Here's a patch that does that.

Bill
2007-08-27 17:19:42 +00:00
Facundo Batista f91ad6a5da Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised in the test server thread, since SimpleXMLRPCServer
does not gracefully handle them.  Changed number of requests handled
by tests server thread to one (was 2) because no tests require more
than one request. [GSoC - Alan McIntyre]
2007-08-27 01:15:34 +00:00
Neal Norwitz 9eb9b10751 If we can't create a certificate, print a warning, but don't fail the test.
Modified patch from what Bill Janssen sent on python-3000.
2007-08-27 01:15:33 +00:00
Neal Norwitz 3e533c2290 Make a utility function for handling (printing) an error 2007-08-27 01:03:18 +00:00
Neal Norwitz f6f525b7c9 Stop using string.join (from the module) to ease upgrade to py3k 2007-08-27 00:58:33 +00:00
Neal Norwitz d6a51e64d7 Another patch from Bill Janssen that:
1)  Fixes the bug that two class names are initial-lower-case.
2)  Replaces the poll waiting for the server to become ready with
    a threading.Event signal.
2007-08-26 22:20:03 +00:00
Neal Norwitz 1b2f62d139 Catch IOError for when the device file doesn't exist or the user doesn't have
permission to write to the device.
2007-08-26 22:16:23 +00:00
Neal Norwitz 15d4e56c40 Get the test passing by commenting out some writes (should they be removed?) 2007-08-26 21:40:16 +00:00
Guido van Rossum e472933e27 Bill Janssen wrote:
Here's a patch which makes test_ssl a better player in the buildbots
environment.  I deep-ended on "try-except-else" clauses.
2007-08-26 19:35:09 +00:00
Neal Norwitz 7fc8e2993a Fail gracefully if the cert files cannot be created 2007-08-26 18:50:39 +00:00
Neal Norwitz 482043aed6 Reap children before the test starts so hopefully SocketServer
won't find any old children left around which causes an exception
in collect_children() and the test to fail.
2007-08-26 06:29:57 +00:00
Neal Norwitz 8e58b34ee8 Try to get this test to pass for systems that do not have SO_REUSEPORT 2007-08-25 17:25:17 +00:00
Neal Norwitz ce7fa56aac Fix test so it is skipped properly if there is no SSL support. 2007-08-25 16:54:38 +00:00
Guido van Rossum 4f2c3ddca4 Server-side SSL and certificate validation, by Bill Janssen.
While cleaning up Bill's C style, I may have cleaned up some code
he didn't touch as well (in _ssl.c).
2007-08-25 15:08:43 +00:00
Nick Coghlan 1a42ece0c7 Fix bug 1764407 - the -i switch now does the right thing when using the -m switch 2007-08-25 10:50:41 +00:00
Nick Coghlan 3af0e785e7 Revert misguided attempt at fixing incompatibility between -m and -i switches (better fix coming soon) 2007-08-25 04:32:07 +00:00
Collin Winter 68f525fdc8 Make test_structmembers pass when run with regrtests's -R flag. 2007-08-24 21:09:42 +00:00
Georg Brandl c325556505 Port test_class to unittest. Patch #1671298. 2007-08-24 19:33:53 +00:00
Georg Brandl ff9b963387 Catch the correct errors. 2007-08-24 19:22:34 +00:00
Collin Winter 0f5e87a266 Convert test_pkg to use unittest. 2007-08-24 19:13:58 +00:00
Georg Brandl fe3b4b9507 Convert test_linuxaudiodev to unittest. Fix a wrong finally clause in test_ossaudiodev. 2007-08-24 18:46:27 +00:00
Georg Brandl e7445de2b1 Remove output file for test_ossaudiodev, also properly close the dsp object. 2007-08-24 18:35:27 +00:00
Georg Brandl 0c6a438aea Remove test_rgbimg output file, there is no test_rgbimg.py. 2007-08-24 18:30:06 +00:00
Georg Brandl 692bbc4790 Port test_frozen to unittest. 2007-08-24 18:22:54 +00:00
Georg Brandl 9f2b93e03a Patch #1008: port test_signal to unittest. 2007-08-24 18:07:52 +00:00
Georg Brandl 3376a9a711 Patch #1006: port test_winreg to unittest. 2007-08-24 17:38:49 +00:00
Guido van Rossum 966bb8c59b Fix silly typo in test name. 2007-08-24 14:53:14 +00:00
Gregory P. Smith 1042a4d719 Fix bug 1725856. 2007-08-24 05:11:38 +00:00
Brett Cannon dbed7a7394 Make test_runpy re-entrant. 2007-08-23 14:53:17 +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