Commit graph

6293 commits

Author SHA1 Message Date
Mark Dickinson
bce783757f round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. 2009-11-24 10:54:58 +00:00
Mark Dickinson
9dd5e16c5d Issue #7117, continued: Remove substitution of %g-style formatting for
%f-style formatting, which used to occur at high precision.  Float formatting
should now be consistent between 2.7 and 3.1.
2009-11-23 20:54:09 +00:00
Mark Dickinson
18cfada1ea Remove restriction on precision when formatting floats. This is the
first step towards removing the %f -> %g switch (see issues 7117,
5859).
2009-11-23 18:46:41 +00:00
Senthil Kumaran
5c456e6f45 Fix for issue1488943 - difflib.Differ() doesn't always add hints for tab
characters.
2009-11-23 18:41:31 +00:00
Lars Gustäbel
12adc655c8 Add a testcase that checks if the TarFile constructor successfully
closes the internal file object in case of an error (issue #7341).
2009-11-23 15:46:19 +00:00
Lars Gustäbel
dd866d57af Issue #6123: Fix opening empty archives and files.
(Note that an empty archive is not the same as an empty file. An
empty archive contains no members and is correctly terminated with an
EOF block full of zeros. An empty file contains no data at all.)

The problem was that although tarfile was able to create empty
archives, it failed to open them raising a ReadError. On the other
hand, tarfile opened empty files without error in most read modes and
presented them as empty archives. (However, some modes still raised
errors: "r|gz" raised ReadError, but "r:gz" worked, "r:bz2" even
raised EOFError.)

In order to get a more fine-grained control over the various internal
error conditions I now split up the HeaderError exception into a
number of meaningful sub-exceptions. This makes it easier in the
TarFile.next() method to react to the different conditions in the
correct way.

The visible change in its behaviour now is that tarfile will open
empty archives correctly and raise ReadError consistently for empty
files.
2009-11-22 18:30:53 +00:00
Jesse Noller
814d02dcd1 issue6615: Additional test for logging support in multiprocessing 2009-11-21 14:38:23 +00:00
Mark Dickinson
c4920e86ef Issue #7272: Add configure test to detect whether sem_open works
properly, and use this to skip test_multiprocessing on platforms
where sem_open raises a signal.  This should fix some FreeBSD buildbot
failures for test_multiprocessing.
2009-11-20 19:30:22 +00:00
Benjamin Peterson
99a5023c80 improve several corner cases related with argument names in parenthesis
- Fix #7362: give a good error message for parenthesized arguments with
  defaults.

- Add a py3k warning for any parenthesized arguments since those are not allowed
  in Py3.  This warning is not given in tuple unpacking, since that incurs the
  tuple unpacking warning.
2009-11-19 22:54:57 +00:00
Benjamin Peterson
dc3c239b1e #5037 proxy __unicode__ correctly 2009-11-19 03:00:02 +00:00
Mark Dickinson
bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00
Nick Coghlan
815521fca0 Correctly escape arbitrary error message text in the runpy unit tests 2009-11-18 11:27:53 +00:00
Nick Coghlan
4b953bac94 Allow for backslashes in file paths passed to the regex engine 2009-11-16 03:57:32 +00:00
Nick Coghlan
4976e3287a Account for another cache when hunting ref leaks 2009-11-16 03:55:51 +00:00
Antoine Pitrou
ccd5e02d2b Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using
TLS or SSL.  Patch by Giampaolo Rodola'.
2009-11-15 17:22:09 +00:00
Antoine Pitrou
d5b34d4597 Issue #4969: The mimetypes module now reads the MIME database from
the registry under Windows.  Patch by Gabriel Genellina.
2009-11-15 14:10:48 +00:00
Mark Dickinson
009ae861f2 Avoid signed overflow in some xrange calculations, and extend
xrange tests to cover some special cases that caused problems
in py3k.  This is a partial backport of r76292-76293 (see
issue #7298.)
2009-11-15 12:31:13 +00:00
Nick Coghlan
49868cb686 Issue #6816: expose the zipfile and directory execution mechanism to Python code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation. 2009-11-15 07:30:34 +00:00
R. David Murray
4653b8c2de Remove 'g' from regrtest getopt argument string, since there's no
handler for it.
2009-11-15 00:07:00 +00:00
R. David Murray
da82689daa Issue 7324: add a sanity check to regrtest argument parsing to
catch the case of an option with no handler.
2009-11-15 00:04:32 +00:00
R. David Murray
7f7eea651f Issue #7312 (new feature): Add a -F flag to run the selected tests in
a loop until a test fails.  Can be combined with -j.  Patch by Antoine
Pitrou.
2009-11-14 15:18:22 +00:00
Benjamin Peterson
e36199b49d fix several compile() issues by translating newlines in the tokenizer 2009-11-12 23:39:44 +00:00
Antoine Pitrou
310c9fec1a Issue #7295: Do not use a hardcoded file name in test_tarfile. 2009-11-11 20:55:07 +00:00
Antoine Pitrou
0734c632d5 Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
unpickled. This fixes crashes under Windows when trying to run
test_multiprocessing in verbose mode.

Additionally, Test_TextTestRunner hadn't been enabled in test_unittest.
2009-11-10 20:49:30 +00:00
Mark Dickinson
c579b35740 Add extra information to a test_signal failure message to aid diagnosis of buildbot failure. 2009-11-09 19:54:51 +00:00
Mark Dickinson
a8fd66d6aa Issue #7251: Break out round tests for large values into a separate
test function, and skip that test on Linux/alpha systems with a broken
system round function.

This should turn the Debian/alpha buildbot green.
2009-11-09 17:03:34 +00:00
Antoine Pitrou
d7158d4c62 Issue #7282: Fix a memory leak when an RLock was used in a thread other
than those started through `threading.Thread` (for example, using
`thread.start_new_thread()`.
2009-11-09 16:00:11 +00:00
Antoine Pitrou
002533013f Kill a small potential leak in test_threading.
The leak may not manifest itself if the OS re-uses the same thread ids
(I suppose Neal's machine doesn't :-))
2009-11-08 00:24:12 +00:00
Nick Coghlan
2733d88dc2 Add test for runpy.run_module package execution and use something other than logging as the example of a non-executable package 2009-11-07 08:13:55 +00:00
Antoine Pitrou
c98efe0500 Issue #7270: Add some dedicated unit tests for multi-thread synchronization
primitives such as Lock, RLock, Condition, Event and Semaphore.
2009-11-06 22:34:35 +00:00
Antoine Pitrou
323b9da16d Issue #7211: Allow 64-bit values for the ident and data fields of kevent
objects on 64-bit systems.  Patch by Michael Broghton.

I will revert this checkin if it causes problems on our BSD buildbots.
2009-11-04 19:25:14 +00:00
Antoine Pitrou
4ac6b93c00 Make test_shutil clean up after itself 2009-11-04 00:50:26 +00:00
Antoine Pitrou
b3c169b08f Try to make test_wsgiref less fragile against environment changes by other tests 2009-11-03 16:41:20 +00:00
Antoine Pitrou
c6714bd1df Add acceptance of long ints to test_memoryio.py
(in preparation for fix of #7249 in 2.6)
2009-11-02 20:47:33 +00:00
Benjamin Peterson
28e463d131 enable test_parser in lib2to3 2009-11-02 18:24:57 +00:00
Benjamin Peterson
aed6c4556c add space 2009-11-02 18:16:36 +00:00
Antoine Pitrou
d8b16ab288 Fix and improve some assertions in test_site 2009-11-01 23:54:20 +00:00
Antoine Pitrou
84ee9e257e Use a custom timeout in test_support.open_urlresource. 2009-11-01 22:02:03 +00:00
Antoine Pitrou
e4c6b16b37 This should finally fix #6896. Let's watch the buildbots. 2009-11-01 21:29:33 +00:00
Antoine Pitrou
8844153d7f test_normalization should skip and not crash when the resource isn't available 2009-11-01 21:26:14 +00:00
Raymond Hettinger
fa7dadd339 Fix exception handling in itertools.izip_longest(). 2009-11-01 20:45:16 +00:00
Antoine Pitrou
235d942391 Hum, test skipping when the URL isn't reachable hadn't been applied to trunk. 2009-11-01 16:10:47 +00:00
Antoine Pitrou
0da5cb8db6 Use richer assertions in test_mailbox (for better failure messages). 2009-10-31 23:19:52 +00:00
Eric Smith
0b9e3a5423 Improved test for a deprecation warning. 2009-10-31 17:07:17 +00:00
Mark Dickinson
4b841d9156 Issue #7042: Use a better mechanism for testing timers in test_signal. 2009-10-31 10:36:06 +00:00
Benjamin Peterson
b2e31a1c63 add some checks for evaluation order with parenthesis #7210 2009-10-31 03:56:15 +00:00
Antoine Pitrou
161df94b0d Try to fix transient refleaks in test_pydoc. 2009-10-30 21:41:22 +00:00
Antoine Pitrou
3c96858480 Try to fix transient refleaks in test_xmlrpc. 2009-10-30 17:56:00 +00:00
Antoine Pitrou
643e85df48 Try to fix transient refleaks in test_asynchat. 2009-10-30 17:55:21 +00:00
Antoine Pitrou
61d5f6ff79 Fix transient refleaks in test_docxmlrpc. 2009-10-30 17:33:28 +00:00