Commit Graph

4379 Commits

Author SHA1 Message Date
Andrew M. Kuchling 310bad077b #1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
The 2.6 version also converts to unittest, but it seems to work fine under 2.5.
2008-02-23 21:32:06 +00:00
Andrew M. Kuchling 05a19a507d #1433694: minidom's .normalize() failed to set .nextSibling for last element.
Fix by Malte Helmert
2008-02-23 17:21:44 +00:00
Martin v. Löwis 328c643bcb Bug #2137: Remove test_struct.test_crasher, which was meaningful
only on 32-bit systems.
2008-02-18 17:46:27 +00:00
Martin v. Löwis 42e4124304 Revert 60793 for test_array; on a 64-bit system,
MemoryError was not guaranteed.
2008-02-15 19:52:38 +00:00
Martin v. Löwis 73c01d4101 Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
2008-02-14 11:26:18 +00:00
Lars Gustäbel 08303dbd72 Backport the nts() function from the trunk. This fixes problems with
the xstar format that puts extra fields inside the space that POSIX
has reserved for the prefix field.
2008-02-11 18:36:07 +00:00
Nick Coghlan 5ca1cba252 Backport relevant part of issue 2021 fix (r60695): Support with statement properly in tempfile.NamedTemporaryFile 2008-02-11 12:53:42 +00:00
Nick Coghlan 0b5c17a9c3 Backport test_resource fix from trunk to stop it crashing on Ubuntu 2008-02-11 11:31:24 +00:00
Amaury Forgeot d'Arc 3e5f8a6975 issue 2045: Infinite recursion when printing a subclass of defaultdict,
if default_factory is set to a bound method.

Backport of r60663.
2008-02-08 01:05:21 +00:00
Amaury Forgeot d'Arc bc212104e4 No need to emit co_lnotab item when both offsets are zeros.
r60579 broke a test test_compile, which seems to test an "implementation detail" IMO.

Also test that this correction does not impact the debugger.
2008-02-04 23:51:55 +00:00
Amaury Forgeot d'Arc 316f8a8d3c backport of r60575 (issue #1750076): Debugger did not step on every iteration of a while statement.
The mapping between bytecode offsets and source lines (lnotab) did not contain
an entry for the beginning of the loop.

Now it does, and the lnotab can be a bit larger:
in particular, several statements on the same line generate several entries.
However, this does not bother the settrace function, which will trigger only
one 'line' event.

The lnotab seems to be exactly the same as with python2.4.
2008-02-04 22:34:57 +00:00
Neal Norwitz 249cbe794e Try harder to provoke the exception since the ia64 buildbot still
doesn't reliably produce an exception.
2008-01-28 01:33:23 +00:00
Neal Norwitz 209ea39d31 Sync up with trunk. Try to flush repeatedly to ensure the exception is raised. 2008-01-27 20:08:04 +00:00
Neal Norwitz 6179234803 Backport 60342:
Try to prevent this test from being flaky.  We might need a sleep in here
which isn't as bad as it sounds.  The close() *should* raise an exception,
so if it didn't we should give more time to sync and really raise it.
2008-01-27 05:02:56 +00:00
Neal Norwitz ab577c1b32 Backport r58453:
Let the O/S supply a port if none of the default ports can be used.
This should make the tests more robust at the expense of allowing
tests to be sloppier by not requiring them to cleanup after themselves.
(It will legitamitely help when running two test suites simultaneously
or if another process is already using one of the predefined ports.)

This will hopefully fix test_asynchat.
2008-01-27 01:24:44 +00:00
Neal Norwitz b03528ca20 Backport 60334:
On some systems (e.g., Ubuntu on hppa) the flush()
doesn't (always) cause the exception, but the close() does.
2008-01-27 01:23:50 +00:00
Amaury Forgeot d'Arc f1a7178cd5 #1920: when considering a block starting by "while 0", the compiler optimized the
whole construct away, even when an 'else' clause is present::

    while 0:
        print("no")
    else:
        print("yes")

did not generate any code at all.

Now the compiler emits the 'else' block, like it already does for 'if' statements.

Backport of r60265.
2008-01-24 23:42:08 +00:00
Andrew M. Kuchling 61c2c9536f Fix failing test_mailbox on Cygwin 2008-01-24 14:08:00 +00:00
Guido van Rossum 2c63442586 Backport r60208, skip some tests for huge passwd/group files. 2008-01-23 01:20:26 +00:00
Gregory P. Smith 8f034d9af2 Backport of r60190:
- Fix Issue #1703448: A joined thread could show up in the
  threading.enumerate() list after the join() for a brief period until
  it actually exited.
2008-01-22 01:29:11 +00:00
Mark Dickinson 9f26fcce04 Remove extra test that was accidentally backported from the trunk 2008-01-21 23:35:11 +00:00
Mark Dickinson 2bebadfe51 Issue 1678380: fix a bug identifying -0.0 and 0.0 2008-01-21 21:54:47 +00:00
Georg Brandl 7bdff2c8e5 Issue #1882: when compiling code from a string, encoding cookies in the
second line of code were not always recognized correctly.
 (backport from rev. 60168)
2008-01-21 18:35:52 +00:00
Andrew M. Kuchling ea72dcb05c Bug 1277: make Maildir use the user-provided factory instead of hard-wiring MaildirMessage. 2008-01-19 20:14:40 +00:00
Guido van Rossum 5f4fc831ad This got fixed in r60056. 2008-01-18 23:06:49 +00:00
Guido van Rossum 03706d2db0 Backport r55080:
Fix for #1303614 and #1174712:
- __dict__ descriptor abuse for subclasses of built-in types
- subclassing from both ModuleType and another built-in types
2008-01-18 21:31:32 +00:00
Mark Dickinson d77fedc745 Fix Decimal hash in Python 2.5 maintenance branch so that hash(x) == hash(int(x))
for any integral Decimal instance x.
2008-01-08 21:42:03 +00:00
Facundo Batista 5dfc48060b Decimal module and test cases were updated to their state of
the art.  It now complies latest specification and tests.

The only difference of this version with the one in the trunk
is that a small subset that hash tests were removed, because
they rely on modifications to core hash() function (see
issue 1182 for further details).
2008-01-08 16:20:31 +00:00
Guido van Rossum 81728cf4c9 Backport r59758.
Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.
2008-01-05 23:34:38 +00:00
Lars Gustäbel e5f9e588c6 Issue #1735: TarFile.extractall() now correctly sets directory
permissions and times.

(backport from r59712)
2008-01-04 14:44:23 +00:00
Guido van Rossum 6df9a82bd3 Issue #1700, reported by Nguyen Quan Son, fix by Fredruk Lundh:
Regular Expression inline flags not handled correctly for some unicode
characters.
2008-01-03 19:08:15 +00:00
Alexandre Vassalotti 483704508d Backport r59480.
Fix issue #1313119.
2007-12-13 18:18:47 +00:00
Lars Gustäbel 7cc9c8bbe1 Issue #1531: Read fileobj from the current offset, do not seek to
the start.

(backport from r59260)
2007-12-01 21:06:06 +00:00
Amaury Forgeot d'Arc 8334a4fc31 Backport of r59241: str.decode fails on very long strings on 64bit platforms.
PyArgs_ParseTuple t# and w# formats truncated the lengths to 32bit.
2007-11-30 21:53:17 +00:00
Amaury Forgeot d'Arc 30f61cbb13 Issue #1445: Fix a SystemError when accessing the ``cell_contents``
attribute of an empty cell object.  Now a ValueError is raised.

Backport of r59170.
2007-11-24 13:53:29 +00:00
Brett Cannon a95fdb4f9c Backport of a fix for the __loader__.get_data() test. 2007-11-23 00:07:49 +00:00
Brett Cannon d3a81df178 Backport of r59082 (doctest and using __loader__.get_data()). 2007-11-21 00:58:54 +00:00
Walter Dörwald f481598cd0 Backport r59049:
Fix for #1444: utf_8_sig.StreamReader was (indirectly through decode())
calling codecs.utf_8_decode() with final==True, which falled with incomplete
byte sequences. Fix and test by James G. Sack.
2007-11-19 12:43:39 +00:00
Walter Dörwald ad91c78698 Backport r59047: Fix typo in comment. 2007-11-19 12:23:44 +00:00
Amaury Forgeot d'Arc c572dc3752 Backport for issue1265 (pdb bug with "with" statement).
When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
is called with a GeneratorExit exception set.  This leads to funny results
if the sys.settrace function itself makes use of generators.
A visible effect is that the settrace function is reset to None.
Another is that the eventual "finally" block of the generator is not called.

It is necessary to save/restore the exception around the call to the trace
function.

This happens a lot with py3k: isinstance() of an ABCMeta instance runs
    def __instancecheck__(cls, instance):
        """Override for isinstance(instance, cls)."""
        return any(cls.__subclasscheck__(c)
                   for c in {instance.__class__, type(instance)})
which lets an opened generator expression each time it returns True.

And the problem can be reproduced in 2.5 with pure python code.
2007-11-13 22:43:05 +00:00
Guido van Rossum 809123c61f Issue 1704621. Fix segfaults in list_repeat() and list_inplace_repeat().
The C changes aren't quite the same as the patch given there; the test is.
2007-11-12 20:04:41 +00:00
Nick Coghlan e53fcfd7d3 Fix issue #1705170 (backport from trunk) 2007-11-07 12:26:40 +00:00
Gregory P. Smith a1e5387ec5 Backport r58868:
Fixes Issue 1385: The hmac module now computes the correct hmac when using
  hashes with a block size other than 64 bytes (such as sha384 and sha512).
2007-11-06 00:32:04 +00:00
Gregory P. Smith 76ee2272ff Backport 58348: use a reliable host in the test. 2007-10-06 15:55:25 +00:00
Sean Reifscheider 1644e6ebd1 issue1140: Guido's patch from revision 58098 (2.6) applied to 2.5. 2007-09-17 09:43:11 +00:00
Georg Brandl fed6bb7d70 Bug #1153: repr.repr() now doesn't require set and dictionary items
to be orderable to properly represent them.
 (backport from rev. 58122)
2007-09-12 19:00:10 +00:00
Martin v. Löwis fc787d515d Patch #1031213: Decode source line in SyntaxErrors back to its original
source encoding.
2007-09-04 14:20:25 +00:00
Martin v. Löwis 39f1f45262 Bug #1709599: Run test_1565150 only if the file system is NTFS. 2007-08-30 18:58:29 +00:00
Skip Montanaro 51cf11271f backport r57626 2007-08-28 23:26:55 +00:00
Lars Gustäbel a9bad98e3d TarFile.__init__() no longer fails if no name argument is passed and
the fileobj argument has no usable name attribute (e.g. StringIO).

(backported from r57616)
2007-08-28 12:33:15 +00:00