Commit Graph

11837 Commits

Author SHA1 Message Date
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
Martin v. Löwis bdd0f39de5 Patch #1449244: Support Unicode strings in
email.message.Message.{set_charset,get_content_charset}.
Will backport.
2007-03-13 10:24:00 +00:00
Georg Brandl 18c47f6a3b Patch #1569798: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.
2007-03-13 10:19:22 +00:00
Georg Brandl b6a87542b3 Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
pydoc's help keywords.
2007-03-13 10:06:48 +00:00
Georg Brandl 4ffc8f5107 Patch #1555098: use str.join() instead of repeated string
concatenation in robotparser.
2007-03-13 09:41:31 +00:00
Georg Brandl 94fe3f58d0 Patch #1635454: the csv.DictWriter class now includes the offending
field names in its exception message if you try to write a record with
a dictionary containing fields not in the CSV field names list.
2007-03-13 09:32:11 +00:00
Georg Brandl ceede5c359 Patch #1668100: urllib2 now correctly raises URLError instead of
OSError if accessing a local file via the file:// protocol fails.
2007-03-13 08:14:27 +00:00
Brett Cannon 09a86bc5ef Fix a typo where the variable name was not updated. 2007-03-13 03:05:40 +00:00
Brett Cannon 41d4e32353 Add test.test_support.transient_internet . Returns a context manager that
nests test.test_support.TransientResource context managers that capture
exceptions raised when the Internet connection is flaky.

Initially using in test_socket_ssl but should probably be expanded to cover any
test that should not raise the captured exceptions if the Internet connection
works.
2007-03-13 02:34:09 +00:00
Tim Peters ea5962f86e Whitespace normalization. 2007-03-12 18:07:52 +00:00
Collin Winter cb637c9ea3 Patch #1670993: Refactor test_threadedtempfile.py to use unittest. 2007-03-12 17:24:07 +00:00
Collin Winter 276887b16d Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
2007-03-12 16:11:39 +00:00
Collin Winter f567ca3e1a Patch #1678088: convert test_operations to use unittest, fold the result into test_dict. 2007-03-12 15:57:19 +00:00
Georg Brandl 871f1bc601 Backport from Py3k branch:
Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir.

Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
2007-03-12 13:17:36 +00:00
Martin v. Löwis 2681beb23e Patch #1677862: Require a space or tab after import in .pth files. 2007-03-12 11:01:10 +00:00
Skip Montanaro 9cea8e5118 Sane humans would call these invalid tests, but Andrew McNamara pointed out
that given the inputs in these tests Excel does indeed produce the output
these tests expect.  Document that for future confused folks.
2007-03-12 03:30:50 +00:00
Barry Warsaw cbbc3f19c1 Tokio Kikuchi's fix for SF bug #1629369; folding whitespace allowed in the
display name of an email address, e.g.

Foo
\tBar <foo@example.com>

Test case added by Barry.
2007-03-12 03:20:01 +00:00
Collin Winter 071d1ae136 Patch #1678662: ftp.python.org does not exist. So the testcode in urllib.py must use a more
stable FTP.
Will backport.
2007-03-12 01:55:54 +00:00
Vinay Sajip a5e764873a Fix resource leak reported in SF #1516995. 2007-03-11 18:32:07 +00:00
Collin Winter 2faa9e1466 Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap the IndexError caused by passing in an invalid breakpoint number.
Will backport.
2007-03-11 16:00:20 +00:00
Georg Brandl b27831887f Add missing "return" statements in exception handler. 2007-03-11 08:28:46 +00:00
Collin Winter ae04106a0e Patch #1599845: Add an option to disable the implicit calls to server_bind() and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer and DocXMLRPCServer. 2007-03-10 14:41:48 +00:00
Collin Winter 3351aa7dd5 Convert an assert to a raise so it works even in the presence of -O. 2007-03-10 14:33:32 +00:00
Neal Norwitz c8f6c23b0b Simplify a little by handling the TCP case first.
Update to use predominant style of spaces around = in args list
and print to stderr if debugging.
2007-03-10 03:19:18 +00:00
Collin Winter 22c42ba88c Bug #1531963: Make SocketServer.TCPServer's server_address always be equal to calling getsockname() on the server's socket.
Will backport.
2007-03-10 02:51:26 +00:00
Collin Winter dbead56cb6 * Unlink test files before and after each test; hopefully this will cut down on recent buildbot failures in test_islink.
* Drop safe_remove() in favor of test_support.unlink().
* Fix the indentation of test_samefile so that it runs.
2007-03-10 02:23:40 +00:00
Collin Winter 9453e5dce5 Hashing simplification pointed out by Thomas Wouters. 2007-03-09 23:30:39 +00:00
Thomas Heller 2456a3c02a Bug #1651235: When a tuple was passed to a ctypes function call,
Python would crash instead of raising an error.

The crash was caused by a section of code that should have been
removed long ago, at that time ctypes had other ways to pass
parameters to function calls.
2007-03-09 20:39:22 +00:00
Collin Winter e38051db87 Patch #1491866: change the complex() constructor to allow parthensized forms. This means complex(repr(x)) now works instead of raising a ValueError. 2007-03-09 20:33:07 +00:00
Thomas Heller c2f7725c86 Fix bug #1646630: ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
returned string up to the first NUL character.
2007-03-09 19:21:28 +00:00
Martin v. Löwis 1190a38d33 Patch #957003: Implement smtplib.LMTP. 2007-03-09 15:35:55 +00:00
Collin Winter 83b2bf6d9a Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py 2007-03-09 03:15:56 +00:00
Brett Cannon a30fcb4dae Introduce test.test_support.TransientResource. It's a context manager to
surround calls to resources that may or may not be available.  Specifying the
expected exception and attributes to be raised if the resource is not available
prevents overly broad catching of exceptions.

This is meant to help suppress spurious failures by raising
test.test_support.ResourceDenied if the exception matches.  It would probably
be good to go through the various network tests and surround the calls to catch
connection timeouts (as done with test_socket_ssl in this commit).
2007-03-08 23:58:11 +00:00
Collin Winter 9b2a109540 Patch #1668482: don't use '-' in mkstemp 2007-03-08 22:16:25 +00:00
Raymond Hettinger 0e520b46ab SF #1637850: make_table in difflib did not work with unicode 2007-03-08 21:33:47 +00:00
Collin Winter 5545314ba7 Backported r54226 from p3yk: Move test_unittest, test_doctest and test_doctest2 higher up in the testing order. 2007-03-08 19:58:14 +00:00
Raymond Hettinger 8b188e6a49 SF 1676321: empty() returned wrong result 2007-03-08 19:24:27 +00:00
Guido van Rossum f1200f8255 Windows doesn't support negative timestamps. Skip the tests involving them
if os.name == "nt".
2007-03-07 15:16:29 +00:00
Georg Brandl d9e50261e8 Add some sanity checks to unittest.TestSuite's addTest(s) methods.
Fixes #878275.
2007-03-07 11:54:49 +00:00