Martin v. Löwis
aef4c6bc00
Patch #1610575 : Add support for _Bool to struct.
2007-01-21 09:33:07 +00:00
Walter Dörwald
71cd55150b
Port test_new.py to unittest.
2007-01-20 23:07:28 +00:00
Walter Dörwald
d414302eec
resource.RUSAGE_BOTH might not exist.
2007-01-20 19:03:17 +00:00
Walter Dörwald
66262ab064
Add argument tests an calls of resource.getrusage().
2007-01-20 18:19:33 +00:00
Walter Dörwald
9fab9a7da8
Port test_resource.py to unittest.
2007-01-20 17:28:31 +00:00
Neal Norwitz
06a9a0ccf4
This test doesn't pass on Windows. The cause seems to be that chmod
...
doesn't support the same funcationality as on Unix. I'm not sure if
this fix is the best (or if it will even work)--it's a test to see
if the buildbots start passing again.
It might be better to not even run this test if it's windows (or non-posix).
2007-01-18 06:20:55 +00:00
Neal Norwitz
7beeb2b0a5
Try reverting part of r53145 that seems to cause the Windows buildbots to fail in test_uu.UUFileTest.test_encode
2007-01-18 05:40:58 +00:00
Sjoerd Mullender
33a0a06d31
Fixed ntpath.expandvars to not replace references to non-existing
...
variables with nothing. Also added tests.
This fixes bug #494589 .
2007-01-16 16:42:38 +00:00
Guido van Rossum
bb2cc698c1
Patch #1635058 by Mark Roberts: ensure that htonl and friends never accept or
...
return negative numbers, per the underlying C implementation.
2007-01-14 17:03:32 +00:00
Guido van Rossum
0567ba20f3
Remove a dependency of this test on $COLUMNS.
2007-01-14 03:46:33 +00:00
Peter Astrand
10514a70ac
Fix for bug #1634343 : allow specifying empty arguments on Windows
2007-01-13 22:35:35 +00:00
Brett Cannon
093b67061a
Deprecate the sets module.
2007-01-13 00:29:49 +00:00
Raymond Hettinger
9fdfadb06e
SF #1486663 -- Allow keyword args in subclasses of set() and frozenset().
2007-01-11 18:22:55 +00:00
Raymond Hettinger
51c2f6cd18
Fix zero-length corner case for iterating over a mutating deque.
2007-01-08 18:09:20 +00:00
Raymond Hettinger
769a40a1d0
Fix stability of heapq's nlargest() and nsmallest().
2007-01-04 17:53:34 +00:00
Brett Cannon
92d54d5e9c
Add EnvironmentVarGuard to test.test_support. Provides a context manager to
...
temporarily set or unset environment variables.
2007-01-04 00:23:49 +00:00
Raymond Hettinger
5399910eba
For sets with cyclical reprs, emit an ellipsis instead of infinitely recursing.
2006-12-30 04:01:17 +00:00
Lars Gustäbel
a7ba6fc548
Patch #1504073 : Fix tarfile.open() for mode "r" with a fileobj argument.
...
Will backport to 2.5.
2006-12-27 10:30:46 +00:00
Lars Gustäbel
a4b2381b20
Patch #1262036 : Prevent TarFiles from being added to themselves under
...
certain conditions.
Will backport to 2.5.
2006-12-23 17:57:23 +00:00
Lars Gustäbel
6baa502769
Patch #1230446 : tarfile.py: fix ExFileObject so that read() and tell()
...
work correctly together with readline().
Will backport to 2.5.
2006-12-23 16:40:13 +00:00
Andrew M. Kuchling
55c54a2fa1
Frak; this test also fails
2006-12-22 21:48:19 +00:00
Andrew M. Kuchling
f2881e8315
Darn; this test works when you run test_pty.py directly, but fails when regrtest runs it (the os.read() raises os.error). I can't figure out the cause, so am commenting out the test.
2006-12-22 19:21:27 +00:00
Andrew M. Kuchling
ee0e6d16b3
[Patch #783050 from Patrick Lynch] The emulation of forkpty() is incorrect;
...
the master should close the slave fd.
Added a test to test_pty.py that reads from the master_fd after doing
a pty.fork(); without the fix it hangs forever instead of raising an
exception. (<crossing fingers for the buildbots>)
2.5 backport candidate.
2006-12-22 18:41:42 +00:00
Andrew M. Kuchling
3fa5e6ee45
[Bug #776202 ] Apply Walter Doerwald's patch to use text mode for encoded files
2006-12-22 16:43:26 +00:00
Andrew M. Kuchling
9ef0ef5b72
[Bug #802128 continued] Modify mode depending on the process umask.
...
Is there really no other way to read the umask than to set it?
Hope this works on Windows...
2006-12-22 15:16:58 +00:00
Andrew M. Kuchling
dc26758ffe
[Bug #802128 ] Make the mode argument of dumbdbm actually work the way it's
...
described, and add a test for it.
2.5 bugfix candidate, maybe; arguably this patch changes the API of
dumbdbm and shouldn't be added in a point-release.
2006-12-22 15:04:45 +00:00
Georg Brandl
ded1c4df0b
Testcase for patch #1484695 .
2006-12-20 11:55:16 +00:00
Raymond Hettinger
94547f7646
Bug #1590891 : random.randrange don't return correct value for big number
...
Needs to be backported.
2006-12-20 06:42:06 +00:00
Brett Cannon
6d9520c4f0
Add test.test_support.guard_warnings_filter . This function returns a context
...
manager that protects warnings.filter from being modified once the context is
exited.
2006-12-13 23:09:53 +00:00
Brett Cannon
c745df8519
Remove unneeded imports of 'warnings'.
2006-12-13 23:02:38 +00:00
Brett Cannon
905820ccba
Remove an unneeded import of 'warnings'.
2006-12-13 22:31:37 +00:00
Walter Dörwald
da1ad32cec
Fix typo.
2006-12-12 21:55:31 +00:00
Raymond Hettinger
c789f341bb
Add test for SF bug 1576657
2006-12-08 17:35:25 +00:00
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