Commit Graph

4393 Commits

Author SHA1 Message Date
Georg Brandl 87fa559479 Patch #1610437: fix a tarfile bug with long filename headers. 2006-12-06 22:21:18 +00:00
Martin v. Löwis a00bcac003 Patch #1371075: Make ConfigParser accept optional dict type
for ordering, sorting, etc.
2006-12-03 12:01:53 +00:00
Walter Dörwald f008203cb4 Move xdrlib tests from the module into a separate test script,
port the tests to unittest and add a few new tests.
2006-12-01 16:59:47 +00:00
Michael W. Hudson f390442130 a test for an error condition not covered by existing tests
(noticed this when writing the equivalent code for pypy)
2006-11-23 13:54:04 +00:00
Walter Dörwald 39b8b6afb5 Change decode() so that it works with a buffer (i.e. unicode(..., 'utf-8-sig'))
SF bug #1601501.
2006-11-23 05:03:56 +00:00
Martin v. Löwis 07529354db Patch #1070046: Marshal new-style objects like InstanceType
in xmlrpclib.
2006-11-19 18:51:54 +00:00
Andrew M. Kuchling 9eec51c04f Add a test case of data w/ bytes > 127 2006-11-19 18:40:01 +00:00
Martin v. Löwis cffcc8b195 Make cStringIO.truncate raise IOError for negative
arguments (even for -1). Fixes the last bit of
#1359365.
2006-11-19 10:41:41 +00:00
Georg Brandl 283a1353a0 Patch [ 1586791 ] better error msgs for some TypeErrors 2006-11-19 08:48:30 +00:00
Andrew M. Kuchling db4f255c61 Expand checking in test_sha 2006-11-18 22:17:33 +00:00
Andrew M. Kuchling 8c456f3b57 Remove file-locking in MH.pack() method.
This change looks massive but it's mostly a re-indenting after
removing some try...finally blocks.

Also adds a test case that does a pack() while the mailbox is locked; this
test would have turned up bugs in the original code on some platforms.

In both nmh and GNU Mailutils' implementation of MH-format mailboxes,
no locking is done of individual message files when renaming them.

The original mailbox.py code did do locking, which meant that message
files had to be opened.  This code was buggy on certain platforms
(found through reading the code); there were code paths that closed
the file object and then called _unlock_file() on it.

Will backport to 25-maint once I see how the buildbots react to this patch.
2006-11-17 13:30:25 +00:00
Georg Brandl 25aabf4cbb Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode()
does.
2006-11-16 17:08:45 +00:00
Martin v. Löwis 065f0c8a06 Patch #1355023: support whence argument for GzipFile.seek. 2006-11-12 10:41:39 +00:00
Martin v. Löwis 040a927cd1 Patch #1065257: Support passing open files as body in
HTTPConnection.request().
2006-11-12 10:32:47 +00:00
Andrew M. Kuchling a3e5d3757c [Bug #1569790] mailbox.Maildir.get_folder() loses factory information
Both the Maildir and MH classes had this bug; the patch fixes both classes
and adds a test.

Will backport to 25-maint.
2006-11-09 13:27:07 +00:00
Martin v. Löwis 3a62404264 Correctly forward exception in instance_contains().
Fixes #1591996. Patch contributed by Neal Norwitz.
Will backport.
2006-11-08 06:46:37 +00:00
Neal Norwitz 85dbec6da7 Bug #1588287: fix invalid assertion for `1,2` in debug builds.
Will backport
2006-11-04 19:25:22 +00:00
Tim Peters abd8a336a3 Whitespace normalization. 2006-11-03 02:32:46 +00:00
Neal Norwitz 1ead698494 I'm assuming this is correct, it fixes the tests so they pass again 2006-10-29 23:58:36 +00:00
Walter Dörwald 98c70acf47 Add tests for incremental codecs with an errors
argument.
2006-10-29 23:02:27 +00:00
Walter Dörwald 92911bfc6a Add tests for basic argument errors. 2006-10-29 22:06:28 +00:00
Georg Brandl 7d00099021 Move the check for openpty to the beginning. 2006-10-29 21:54:18 +00:00
Georg Brandl 59ba4299d0 Remove leftover test output file. 2006-10-29 20:35:12 +00:00
Georg Brandl cd97208110 Convert test_openpty to unittest. 2006-10-29 20:31:17 +00:00
Georg Brandl e8328ba723 Convert test_MimeWriter to unittest. 2006-10-29 20:28:26 +00:00
Georg Brandl 71a2089712 Completely convert test_httplib to unittest. 2006-10-29 20:24:01 +00:00
Georg Brandl e184433654 Convert test_cgi to unittest. 2006-10-29 20:09:12 +00:00
Georg Brandl a962eb32d9 Convert test_cookie to unittest. 2006-10-29 19:51:16 +00:00
Georg Brandl bd0fb14e51 Convert test_types to unittest. 2006-10-29 19:35:03 +00:00
Georg Brandl 850b2be67e Convert test_nis to unittest. 2006-10-29 19:24:43 +00:00
Georg Brandl eecce795a3 Convert test_poll to unittest. 2006-10-29 19:20:45 +00:00
Georg Brandl 3163179f1b Convert test_mmap to unittest. 2006-10-29 19:13:40 +00:00
Georg Brandl b9f4ad3a9a Bug #1576657: when setting a KeyError for a tuple key, make sure that
the tuple isn't used as the "exception arguments tuple".
2006-10-29 18:31:42 +00:00
Georg Brandl 2c9838e30f Bug #1586613: fix zlib and bz2 codecs' incremental en/decoders. 2006-10-29 14:39:09 +00:00
Georg Brandl 5b4e1c2530 Fix the new EncodedFile test to work with big endian platforms. 2006-10-29 09:32:16 +00:00
Georg Brandl facd273198 Test assert if __debug__ is true. 2006-10-29 09:18:00 +00:00
Georg Brandl 8f99f81dfc Fix codecs.EncodedFile which did not use file_encoding in 2.5.0, and
fix all codecs file wrappers to work correctly with the "with"
statement (bug #1586513).
2006-10-29 08:39:22 +00:00
Neal Norwitz 07fdcfd6c9 Fix test_modulefinder so it doesn't fail when run after test_distutils. 2006-10-28 21:56:49 +00:00
Neal Norwitz 21997afb0c Fix bug #1565514, SystemError not raised on too many nested blocks.
It seems like this should be a different error than SystemError, but
I don't have any great ideas and SystemError was raised in 2.4 and earlier.

Will backport.
2006-10-28 21:19:07 +00:00
Georg Brandl b21e0815bf make test_grammar pass with python -O 2006-10-28 20:25:09 +00:00
Georg Brandl 0b679629c6 Convert test_opcodes to unittest. 2006-10-28 13:56:58 +00:00
Georg Brandl 2f03760a98 Convert test_math to unittest. 2006-10-28 13:51:49 +00:00
Georg Brandl 856b446793 Update outstanding bugs test file. 2006-10-28 13:11:41 +00:00
Georg Brandl c6fdec6d7e Convert test_global, test_scope and test_grammar to unittest.
I tried to enclose all tests which must be run at the toplevel
(instead of inside a method) in exec statements.
2006-10-28 13:10:17 +00:00
Walter Dörwald 3a3d8ea497 Port test_bufio to unittest. 2006-10-28 10:47:12 +00:00
Thomas Heller 112d1a64ac Modulefinder now handles absolute and relative imports, including
tests.

Will backport to release25-maint.
2006-10-27 19:05:53 +00:00
Thomas Heller df08f0b9a0 WindowsError.str should display the windows error code,
not the posix error code; with test.
Fixes #1576174.

Will backport to release25-maint.
2006-10-27 18:31:36 +00:00
Andrew M. Kuchling 0f87183cf5 [Bug #1575506] The _singlefileMailbox class was using the wrong file object in its flush() method, causing an error 2006-10-27 16:55:34 +00:00
Andrew M. Kuchling 41eb7164df [Bug #1576241] Let functools.wraps work with built-in functions 2006-10-27 16:39:10 +00:00
Martin v. Löwis b5bc537c5e Patch #1549049: Rewrite type conversion in structmember.
Fixes #1545696 and #1566140. Will backport to 2.5.
2006-10-27 06:16:31 +00:00
Georg Brandl a32e0a099b Patch [ 1583506 ] tarfile.py: 100-char filenames are truncated 2006-10-24 16:54:16 +00:00
Martin v. Löwis e97c759660 Remove passwd.adjunct.byname from list of maps
for test_nis. Will backport to 2.5.
2006-10-22 13:45:13 +00:00
Walter Dörwald d3973b578f Port test___future__ to unittest. 2006-10-22 08:59:41 +00:00
Tim Peters ef3f32f965 Whitespace normalization. 2006-10-18 05:09:12 +00:00
Martin v. Löwis a97e06d9db Round to int, because some systems support sub-second time stamps in stat, but not in utime.
Also be consistent with modifying only mtime, not atime.
2006-10-15 11:02:07 +00:00
Martin v. Löwis cfcd3a9569 Loosen the test for equal time stamps. 2006-10-15 09:35:51 +00:00
Martin v. Löwis 18aaa568fd Patch #1576166: Support os.utime for directories on Windows NT+. 2006-10-15 08:43:33 +00:00
Neal Norwitz cbeb687c68 Update the peephole optimizer to remove more dead code (jumps after returns)
and inline jumps to returns.
2006-10-14 21:33:38 +00:00
Georg Brandl 2c1375c8db Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
2006-10-12 11:27:59 +00:00
Georg Brandl 5597e261b2 Bug #1548891: The cStringIO.StringIO() constructor now encodes unicode
arguments with the system default encoding just like the write()
method does, instead of converting it to a raw buffer.
2006-10-12 09:47:12 +00:00
Martin v. Löwis f43893a878 Bug #1565150: Fix subsecond processing for os.utime on Windows. 2006-10-09 20:44:25 +00:00
Hye-Shik Chang b788346573 Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault
when encoding non-BMP unicode characters.  (Submitted by Ray Chason)
2006-10-08 13:48:34 +00:00
Armin Rigo 7ccbca93a2 Forward-port of r52136,52138: a review of overflow-detecting code.
* unified the way intobject, longobject and mystrtoul handle
  values around -sys.maxint-1.

* in general, trying to entierely avoid overflows in any computation
  involving signed ints or longs is extremely involved.  Fixed a few
  simple cases where a compiler might be too clever (but that's all
  guesswork).

* more overflow checks against bad data in marshal.c.

* 2.5 specific: fixed a number of places that were still confusing int
  and Py_ssize_t.  Some of them could potentially have caused
  "real-world" breakage.

* list.pop(x): fixing overflow issues on x was messy.  I just reverted
  to PyArg_ParseTuple("n"), which does the right thing.  (An obscure
  test was trying to give a Decimal to list.pop()... doesn't make
  sense any more IMHO)

* trying to write a few tests...
2006-10-04 12:17:45 +00:00
Martin v. Löwis 820d6ac9d7 Fix integer negation and absolute value to not rely
on undefined behaviour of the C compiler anymore.
Will backport to 2.5 and 2.4.
2006-10-04 05:47:34 +00:00
Jeremy Hylton 82271f13e7 Fix for SF bug 1569998: break permitted inside try.
The compiler was checking that there was something on the fblock
stack, but not that there was a loop on the stack.  Fixed that and
added a test for the specific syntax error.

Bug fix candidate.
2006-10-04 02:24:52 +00:00
Brett Cannon 373d90b365 Convert test_imp over to unittest. 2006-10-03 23:23:14 +00:00
Georg Brandl 54c3db55a2 Convert test_import to unittest. 2006-09-30 12:16:03 +00:00
Georg Brandl 4ddfcd3b60 Bug #1556784: allow format strings longer than 127 characters in
datetime's strftime function.
2006-09-30 11:17:34 +00:00
Georg Brandl 154324a8c3 Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
2006-09-30 11:06:47 +00:00
Georg Brandl 3267d28f9d Bug #1566800: make sure that EnvironmentError can be called with any
number of arguments, as was the case in Python 2.4.
2006-09-30 09:03:42 +00:00
Georg Brandl 5d59c09834 Patch #1567691: super() and new.instancemethod() now don't accept
keyword arguments any more (previously they accepted them, but didn't
use them).
2006-09-30 08:43:30 +00:00
Armin Rigo c839c2f226 Another crasher. 2006-09-25 15:16:26 +00:00
Georg Brandl c7986cee76 Fix a bug in traceback.format_exception_only() that led to an error
being raised when print_exc() was called without an exception set.
In version 2.4, this printed "None", restored that behavior.
2006-09-24 12:50:24 +00:00
Georg Brandl a10d3afed2 Fix a bug in the parser's future statement handling that led to "with"
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
2006-09-24 12:35:36 +00:00
Brett Cannon e042601251 Make output on test_strptime() be more verbose in face of failure. This is in
hopes that more information will help debug the failing test on HPPA Ubuntu.
2006-09-23 19:53:20 +00:00
Neal Norwitz 3a23017bb2 Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)).
These tests should be improved.  Hopefully this fixes variations when
flipping back and forth between fpdef and fplist.

Backport candidate.
2006-09-22 08:18:10 +00:00
Jack Diederich 36234e8f66 * regression bug, count_next was coercing a Py_ssize_t to an unsigned Py_size_t
which breaks negative counts
* added test for negative numbers
will backport to 2.5.1
2006-09-21 17:50:26 +00:00
Neal Norwitz 361b46be24 Add a "crasher" taken from the sgml bug report referenced in the comment 2006-09-11 04:32:57 +00:00
Neal Norwitz bcc119a22c Forward port of 51850 from release25-maint branch.
As mentioned on python-dev, reverting patch #1504333 because it introduced
an infinite loop in rev 47154.

This patch also adds a test to prevent the regression.
2006-09-11 04:24:09 +00:00
Brett Cannon ca2ca79d23 Remove the __unicode__ method from exceptions. Allows unicode() to be called
on exception classes.  Would require introducing a tp_unicode slot to make it
work otherwise.

Fixes bug #1551432 and will be backported.
2006-09-09 07:11:46 +00:00
Nick Coghlan c495c66ea9 Fix the speed regression in inspect.py by adding another cache to speed up getmodule(). Patch #1553314 2006-09-07 10:50:34 +00:00
Gustavo Niemeyer c36bede6ff Fixed subprocess bug #1531862 again, after removing tests
offending buildbot
2006-09-07 00:48:33 +00:00
Georg Brandl 38f6237dfe Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.
Also make sure that every exception class has __module__ set to
'exceptions'.
2006-09-06 06:50:05 +00:00
Neal Norwitz 314bef9fff Revert 51758 because it broke all the buildbots 2006-09-06 03:58:34 +00:00
Gustavo Niemeyer 8cb64eaaf3 Fixing #1531862: Do not close standard file descriptors in the
subprocess module.
2006-09-06 01:58:52 +00:00
Hye-Shik Chang 199f1db1fa Fix a few bugs on cjkcodecs found by Oren Tirosh:
- gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly.
- iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312
  codepoints to conform the standard.
- iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 2013:2
  codepoints now.
2006-09-05 12:07:09 +00:00
Neal Norwitz dac090d3e6 Bug #1520864 (again): unpacking singleton tuples in list comprehensions and
generator expressions (x for x, in ... ) works again.

Sigh, I only fixed for loops the first time, not list comps and genexprs too.
I couldn't find any more unpacking cases where there is a similar bug lurking.

This code should be refactored to eliminate the duplication.  I'm sure
the listcomp/genexpr code can be refactored.  I'm not sure if the for loop
can re-use any of the same code though.

Will backport to 2.5 (the only place it matters).
2006-09-05 03:53:08 +00:00
Neal Norwitz 4bc2c0919b Patch #1540470, for OpenBSD 4.0. Backport candidate for 2.[34]. 2006-09-05 02:57:01 +00:00
Neal Norwitz a22975fb35 Fix SF bug #1546288, crash in dict_equal. 2006-09-05 02:24:03 +00:00
Raymond Hettinger a0c95fa4d8 Fix endcase for str.rpartition() 2006-09-04 15:32:48 +00:00
Neal Norwitz c1120b4b66 Hmm, this test has failed at least twice recently on the OpenBSD and
Debian sparc buildbots.  Since this goes through a lot of tests
and hits the disk a lot it could be slow (especially if NFS is involved).
I'm not sure if that's the problem, but printing periodic msgs shouldn't hurt.
The code was stolen from test_compiler.
2006-09-02 19:40:19 +00:00
Nick Coghlan ced1218dd1 Make decimal.ContextManager a private implementation detail of decimal.localcontext() 2006-09-02 03:54:17 +00:00
Neal Norwitz 69e8897505 Bug #1550714: fix SystemError from itertools.tee on negative value for n.
Needs backport to 2.5.1 and earlier.
2006-09-02 02:58:13 +00:00
Nick Coghlan db38588a25 Remove the old decimal context management tests from test_contextlib (guess who didn't run the test suite before committing...) 2006-08-31 12:51:25 +00:00
Nick Coghlan 8b6999b4c5 Fix the wrongheaded implementation of context management in the decimal module and add unit tests. (python-dev discussion is ongoing regarding what we do about Python 2.5) 2006-08-31 12:00:43 +00:00
Jack Diederich 7b60464ceb - Move functions common to all path modules into genericpath.py and have the
OS speicifc path modules import them.
- Have os2emxpath import common functions fron ntpath instead of using copies
2006-08-26 18:42:06 +00:00
Tim Peters 4582d7d905 A new test here relied on preserving invisible trailing
whitespace in expected output.  Stop that.
2006-08-25 22:26:21 +00:00
Tim Peters 147f9ae6db Whitespace normalization. 2006-08-25 22:05:39 +00:00
Armin Rigo cd73a78b68 The regular expression engine in '_sre' can segfault when interpreting
bogus bytecode.  It is unclear whether this is a real bug or a "won't
fix" case like bogus_code_obj.py.
2006-08-25 12:44:28 +00:00
Thomas Wouters 9e398cac94 Fix SF bug #1545837: array.array borks on deepcopy.
array.__deepcopy__() needs to take an argument, even if it doesn't actually
use it. Will backport to 2.5 and 2.4 (if applicable.)
2006-08-24 18:40:20 +00:00
Alex Martelli 348dc88097 Reverting the patch that tried to fix the issue whereby x**2 raises
OverflowError while x*x succeeds and produces infinity; apparently
these inconsistencies cannot be fixed across ``all'' platforms and
there's a widespread feeling that therefore ``every'' platform
should keep suffering forevermore.  Ah well.
2006-08-23 22:17:59 +00:00
Jeremy Hylton 76467ba6d6 Bug fixes large and small for tokenize.
Small: Always generate a NL or NEWLINE token following
       a COMMENT token.  The old code did not generate an NL token if
       the comment was on a line by itself.

Large: The output of untokenize() will now match the
       input exactly if it is passed the full token sequence.  The
       old, crufty output is still generated if a limited input
       sequence is provided, where limited means that it does not
       include position information for tokens.

Remaining bug: There is no CONTINUATION token (\) so there is no way
for untokenize() to handle such code.

Also, expanded the number of doctests in hopes of eventually removing
the old-style tests that compare against a golden file.

Bug fix candidate for Python 2.5.1. (Sigh.)
2006-08-23 21:14:03 +00:00
Alex Martelli 20362a820b x**2 should about equal x*x (including for a float x such that the result is
inf) but didn't; added a test to test_float to verify that, and ignored the
ERANGE value for errno in the pow operation to make the new test pass (with
help from Marilyn Davis at the Google Python Sprint -- thanks!).
2006-08-23 20:42:02 +00:00
Jeremy Hylton 29bef0bbaa Baby steps towards better tests for tokenize 2006-08-23 18:37:43 +00:00
Jeremy Hylton 60e96f666c Expose column offset information in parse trees. 2006-08-22 20:46:00 +00:00
Neal Norwitz 17753ecbfa Patch #1541585: fix buffer overrun when performing repr() on
a unicode string in a build with wide unicode (UCS-4) support.

This code could be improved, so add an XXX comment.
2006-08-21 22:21:19 +00:00
Neal Norwitz 4f096d9487 Patch #1542451: disallow continue anywhere under a finally
I'm undecided if this should be backported to 2.5 or 2.5.1.
Armin suggested to wait (I'm of the same opinion).  Thomas W thinks
it's fine to go in 2.5.
2006-08-21 19:47:08 +00:00
Neal Norwitz 8a519392d5 Fix bug #1543303, tarfile adds padding that breaks gunzip.
Patch # 1543897.

Will backport to 2.5
2006-08-21 17:59:46 +00:00
Georg Brandl 8c036ccf93 Patch #1542948: fix urllib2 header casing issue. With new test. 2006-08-20 13:15:39 +00:00
Martin v. Löwis 2eb8c4f292 Bug #1541863: uuid.uuid1 failed to generate unique identifiers
on systems with low clock resolution.
2006-08-18 03:47:18 +00:00
Neil Schemenauer 4c6b0d5bec Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.
2006-08-16 23:38:05 +00:00
Fredrik Lundh dc075b9ddd SF#1534630
ignore data that arrives before the opening start tag
2006-08-16 16:47:07 +00:00
Ka-Ping Yee b1cb56ad17 Update code and tests to support the 'bytes_le' attribute (for
little-endian byte order on Windows), and to work around clocks
with low resolution yielding duplicate UUIDs.

Anthony Baxter has approved this change.
2006-08-16 07:02:50 +00:00
Neal Norwitz 271a8689e9 Subclasses of int/long are allowed to define an __index__. 2006-08-15 06:29:03 +00:00
Neal Norwitz b476fdf7c3 Fix the test for SocketServer so it should pass on cygwin and not fail
sporadically on other platforms.  This is really a band-aid that doesn't
fix the underlying issue in SocketServer.  It's not clear if it's worth
it to fix SocketServer, however, I opened a bug to track it:

	http://python.org/sf/1540386
2006-08-15 04:58:28 +00:00
Tim Peters c02c1c8a12 Whitespace normalization. 2006-08-15 00:25:04 +00:00
Georg Brandl 85fec59104 Add an additional test: BZ2File write methods should raise IOError
when file is read-only.
2006-08-14 21:45:32 +00:00
Georg Brandl 3335a7ad63 Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
2006-08-14 21:42:55 +00:00
Georg Brandl 2463f8f831 Make tabnanny recognize IndentationErrors raised by tokenize.
Add a test to test_inspect to make sure indented source
is recognized correctly. (fixes #1224621)
2006-08-14 21:34:08 +00:00
Marc-André Lemburg 040f76b79c Slightly revised version of patch #1538956:
Replace UnicodeDecodeErrors raised during == and !=
compares of Unicode and other objects with a new
UnicodeWarning.

All other comparisons continue to raise exceptions.
Exceptions other than UnicodeDecodeErrors are also left
untouched.
2006-08-14 10:55:19 +00:00
Neal Norwitz 56423e5762 Fix segfault when doing string formatting on subclasses of long if
__oct__, __hex__ don't return a string.

Klocwork 308
2006-08-13 18:11:08 +00:00
Neal Norwitz 1872b1c01f Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots
were failing due to inappropriate clipping of numbers larger than 2**31
with new-style classes. (typeobject.c)  In reviewing the code for classic
classes, there were 2 problems.  Any negative value return could be returned.
Always return -1 if there was an error.  Also make the checks similar
with the new-style classes.  I believe this is correct for 32 and 64 bit
boxes, including Windows64.

Add a test of classic classes too.
2006-08-12 18:44:06 +00:00
Neal Norwitz 8a87f5d37e Patch #1538606, Patch to fix __index__() clipping.
I modified this patch some by fixing style, some error checking, and adding
XXX comments.  This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward.  I don't want this to hold up release if possible.
2006-08-12 17:03:09 +00:00
Georg Brandl f3e304297e Repair logging test spew caused by rev. 51206. 2006-08-12 08:32:02 +00:00
Tim Peters 953c1897d2 Ah, fudge. One of the prints here actually "shouldn't be"
protected by "if verbose:", which caused the test to fail on
all non-Windows boxes.

Note that I deliberately didn't convert this to unittest yet,
because I expect it would be even harder to debug this on Tru64
after conversion.
2006-08-12 05:17:41 +00:00
Tim Peters 1742f3331f test_signal: Signal handling on the Tru64 buildbot
appears to be utterly insane.  Plug some theoretical
insecurities in the test script:

- Verify that the SIGALRM handler was actually installed.

- Don't call alarm() before the handler is installed.

- Move everything that can fail inside the try/finally,
  so the test cleans up after itself more often.

- Try sending all the expected signals in
  force_test_exit(), not just SIGALRM.  Since that was
  fixed to actually send SIGALRM (instead of invisibly
  dying with an AttributeError), we've seen that sending
  SIGALRM alone does not stop this from hanging.

- Move the "kill the child" business into the finally
  clause, so the child doesn't survive test failure
  to send SIGALRM to other tests later (there are also
  baffling SIGALRM-related failures in test_socket).

- Cancel the alarm in the finally clause -- if the
  test dies early, we again don't want SIGALRM showing
  up to confuse a later test.

Alas, this still relies on timing luck wrt the spawned
script that sends the test signals, but it's hard to see
how waiting for seconds can so often be so unlucky.

test_threadedsignals:  curiously, this test never fails
on Tru64, but doesn't normally signal SIGALRM.  Anyway,
fixed an obvious (but probably inconsequential) logic
error.
2006-08-12 04:42:47 +00:00
Neal Norwitz 421c1319ad Whoops, how did that get in there. :-) Revert all the parts of 51227 that were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed 2006-08-12 02:12:30 +00:00
Neal Norwitz 6b4953fd3d Check returned pointer is valid.
Klocwork #233
2006-08-12 02:06:34 +00:00
Neal Norwitz 003c9e2952 Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).
The first hunk changes the colon to an ! like other Windows variants.
We need to always wait on the child so the lock gets released and
no other tests fail.  This is the try/finally in the second hunk.
2006-08-11 06:09:41 +00:00
Tim Peters 8b8c59cf1d force_test_exit(): This has been completely ineffective
at stopping test_signal from hanging forever on the Tru64
buildbot.  That could be because there's no such thing as
signal.SIGALARM.  Changed to the idiotic (but standard)
signal.SIGALRM instead, and added some more debug output.
2006-08-11 03:49:10 +00:00
Tim Peters 08574770c5 test_PyThreadState_SetAsyncExc(): This is failing on some
64-bit boxes.  I have no idea what the ctypes docs mean
by "integers", and blind-guessing here that it intended to
mean the signed C "int" type, in which case perhaps I can
repair this by feeding the thread id argument to type
ctypes.c_long().

Also made the worker thread daemonic, so it doesn't hang
Python shutdown if the test continues to fail.
2006-08-11 00:49:01 +00:00
Tim Peters b7ad1eb2c6 Whitespace normalization broke test_cgi, because a line
of quoted test data relied on preserving a single trailing
blank.  Changed the string from raw to regular, and forced
in the trailing blank via an explicit \x20 escape.
2006-08-10 23:22:13 +00:00
Tim Peters 0d9ca9fa47 Whitespace normalization. 2006-08-10 22:48:45 +00:00
Tim Peters 4643c2fda1 Followup to bug #1069160.
PyThreadState_SetAsyncExc():  internal correctness changes wrt
refcount safety and deadlock avoidance.  Also added a basic test
case (relying on ctypes) and repaired the docs.
2006-08-10 22:45:34 +00:00
Guido van Rossum 9568b738ec Chris McDonough's patch to defend against certain DoS attacks on FieldStorage.
SF bug #1112549.
2006-08-10 17:41:07 +00:00
Tim Peters b2dd1a3906 test_copytree_simple(): This was leaving behind two new temp
directories each time it ran, at least on Windows.

Several changes:  explicitly closed all files; wrapped long
lines; stopped suppressing errors when removing a file or
directory fails (removing /shouldn't/ fail!); and changed
what appeared to be incorrect usage of os.removedirs() (that
doesn't remove empty directories at and /under/ the given
path, instead it must be given an empty leaf directory and
then deletes empty directories moving /up/ the path -- could
be that the conceptually simpler shutil.rmtree() was really
actually intended here).
2006-08-10 03:01:26 +00:00
Armin Rigo 97ff04789d Concatenation on a long string breaks (SF #1526585). 2006-08-09 15:37:26 +00:00
Armin Rigo 51fc8c456e Fix and test for an infinite C recursion. 2006-08-09 14:55:26 +00:00
Martin v. Löwis ab2f8f7bd5 __hash__ may now return long int; the final hash
value is obtained by invoking hash on the long int.
Fixes #1536021.
2006-08-09 07:57:39 +00:00
Tim Peters 8e24a9678f Whitespace normalization. 2006-08-09 00:52:26 +00:00
Thomas Heller dc68ffd003 Remove accidently committed, duplicated test. 2006-08-08 17:39:20 +00:00
Thomas Heller ab1049c046 memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
2006-08-08 17:37:00 +00:00
Andrew MacIntyre 16ee33adfc test_threading now skips testing alternate thread stack sizes on
platforms that don't support changing thread stack size.
2006-08-06 12:37:03 +00:00
Georg Brandl d336e98ed9 Don't produce output in test_builtin. 2006-08-06 09:17:16 +00:00
Georg Brandl 7e3ba2a699 Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
2006-08-06 08:23:54 +00:00
Georg Brandl 9908d1656c Bug #1535182: really test the xreadlines() method of bz2 objects. 2006-08-06 07:06:33 +00:00
Bob Ippolito e6c9f982a0 Fix #1530559, struct.pack raises TypeError where it used to convert.
Passing float arguments to struct.pack when integers are expected
now triggers a DeprecationWarning.
2006-08-04 23:59:21 +00:00
Tim Peters b1ccc4d409 Whitespace normalization. 2006-08-04 22:00:35 +00:00
Georg Brandl e9462c72bd Change fix for segfaulting property(), add a NEWS entry and a test. 2006-08-04 18:03:37 +00:00
Neil Schemenauer 06ded09d40 Fix the 'compiler' package to generate correct code for MAKE_CLOSURE.
In the 2.5 development cycle, MAKE_CLOSURE as changed to take free
variables as a tuple rather than as individual items on the stack.
Closes patch #1534084.
2006-08-04 16:20:30 +00:00