Benjamin Peterson
dc782b55f2
backport keyword argument support for bytearray.decode
2009-09-18 21:46:21 +00:00
Benjamin Peterson
332d721750
add keyword arguments support to str/unicode encode and decode #6300
2009-09-18 21:14:55 +00:00
Mark Dickinson
2985dbb526
Use skipUnless to skip math module tests on non-IEEE 754 platforms.
2009-09-18 21:01:50 +00:00
Georg Brandl
ebf3adc4fe
#6844 followup: the warning when setting Exception.message was removed, do not test for it.
2009-09-17 11:48:31 +00:00
Georg Brandl
e9741f3ed8
Issue #6922 : Fix an infinite loop when trying to decode an invalid
...
UTF-32 stream with a non-raising error handler like "replace" or "ignore".
2009-09-17 11:28:09 +00:00
Georg Brandl
0674d3fb5f
#6844 : do not emit DeprecationWarnings on access if Exception.message has been set by the user.
...
This works by always setting it in __dict__, except when it's implicitly set in __init__.
2009-09-16 20:30:09 +00:00
Thomas Wouters
c4dcb3801e
Fix issue #1590864 , multiple threads and fork() can cause deadlocks, by
...
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.
This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.
This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.
Will backport to 2.6, minus the tiny AIX behaviour change.
2009-09-16 19:55:54 +00:00
Georg Brandl
69dfe8d80e
Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that.
2009-09-16 16:36:39 +00:00
Georg Brandl
6c39f06ab2
Remove some more boilerplate from the actual tests in test_pdb.
2009-09-16 16:22:12 +00:00
Michael Foord
e91ea56b30
Test discovery in unittest will only attempt to import modules that are importable; i.e. their names are valid Python identifiers. If an import fails during discovery this will be recorded as an error and test discovery will continue. Issue 6568.
2009-09-13 19:07:03 +00:00
Michael Foord
5a9719d627
unittest.TestLoader.loadTestsFromName honors the loader suiteClass attribute. Issue 6866.
2009-09-13 17:28:35 +00:00
Michael Foord
c3f79373e8
Objects that compare equal automatically pass or fail assertAlmostEqual and assertNotAlmostEqual tests on unittest.TestCase. Issue 6567.
2009-09-13 16:40:02 +00:00
Ezio Melotti
1036a7f7e1
#6026 - fix tests that failed without zlib
2009-09-12 14:43:43 +00:00
Lars Gustäbel
21121e64b4
Issue #6856 : Add a filter keyword argument to TarFile.add().
...
The filter argument must be a function that takes a TarInfo
object argument, changes it and returns it again. If the
function returns None the TarInfo object will be excluded
from the archive.
The exclude argument is deprecated from now on, because it
does something similar but is not as flexible.
2009-09-12 10:28:15 +00:00
Benjamin Peterson
93ed82048f
revert unintended changes
2009-09-09 11:42:57 +00:00
Benjamin Peterson
8246968b12
tabbify
2009-09-09 11:40:54 +00:00
Mark Dickinson
5cfa8044ff
Issue #6857 : Fix Decimal formatting to be consistent with existing float
...
formatting: both are now right-aligned by default.
2009-09-08 20:20:19 +00:00
Mark Dickinson
968f1690d3
#Issue 6795: Fix infinite recursion in long(Decimal('nan')); change int(Decimal('nan')) to raise ValueError instead of either returning NaN or raising InvalidContext.
2009-09-07 18:04:58 +00:00
Mark Dickinson
491ea55f28
Issue #6850 : Fix bug in Decimal._parse_format_specifier for formats
...
with no type specifier.
2009-09-07 16:17:41 +00:00
Mark Dickinson
c8a7c7c3b9
Issue #6846 : bytearray.pop was returning ints in the range [-128, 128)
...
instead of [0, 256). Thanks Hagen Fürstenau for the report and fix.
2009-09-06 10:03:31 +00:00
Ronald Oussoren
2596758cb4
Fix build issues on OSX 10.6 (issue 6802)
2009-09-06 10:00:26 +00:00
Georg Brandl
ed4ca821f1
#5101 : add back tests to test_funcattrs that were lost during unittest conversion, and make some PEP8 cleanups.
2009-09-04 11:19:34 +00:00
Brett Cannon
e7e941e7f7
test_platform fails on OS X Snow Leopard because the UNIX command to get the
...
canonical version, sw_vers, leaves off trailing zeros in the version number
(e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros
for the test comparison.
Fixes issue #6806 .
2009-09-03 21:25:21 +00:00
Armin Rigo
ffd0dc1e8b
Sorry, sorry! Ignore my previous two commits. I mixed up the version
...
of python with which I tried running the crashers. They don't crash
the current HEAD.
2009-09-03 19:45:27 +00:00
Armin Rigo
f866fbb303
Does not terminate: consume all memory without responding to Ctrl-C.
...
I am not too sure why, but you can surely find out by gdb'ing a bit...
2009-09-03 19:42:03 +00:00
Armin Rigo
f416690490
Found the next crasher by thinking about this logic in PyPy.
2009-09-03 19:40:07 +00:00
Benjamin Peterson
6fcf9b50bc
remove the check that classmethod's argument is a callable
2009-09-01 22:27:57 +00:00
Amaury Forgeot d'Arc
fff896b309
#6750 : TextIOWrapped could duplicate output when several threads write to it.
...
this affect text files opened with io.open(), and the print() function of py3k
2009-08-29 18:14:40 +00:00
Lars Gustäbel
f7cda5287d
Issue #6054 : Do not normalize stored pathnames.
...
No longer use tarfile.normpath() on pathnames. Store pathnames
unchanged, i.e. do not remove "./", "../" and "//" occurrences.
However, still convert absolute to relative paths.
2009-08-28 19:23:44 +00:00
Mark Dickinson
7a7739d75e
Issue #6794 : Fix handling of NaNs in Decimal.compare_total and
...
Decimal.compare_total_mag.
2009-08-28 13:25:02 +00:00
Kristján Valur Jónsson
429677ec38
Issue 6654
...
Allow the XML-RPC server to use the HTTP request path when dispatching. Added a MultiPathXMLRPCServer class that uses the feature, plus unit tests.
2009-08-27 23:13:18 +00:00
Kristján Valur Jónsson
e2a77980b6
issue 6275
...
Add an "exc_value" attribute to the _AssertRaisesContext context manager in the unittest package. This allows further tests on the exception that was raised after the context manager exits.
2009-08-27 22:20:21 +00:00
Tarek Ziadé
764fc235a6
#6693 : New functions in site.py to get user/global site packages paths.
2009-08-20 21:23:13 +00:00
Frank Wierzbicki
df756775f5
Add test of file.write(array) extracted from Jython.
2009-08-16 20:22:51 +00:00
Gregory P. Smith
b98d6b2cbc
Issue 6665: Fix fnmatch to properly match filenames with newlines in them.
2009-08-16 18:52:58 +00:00
Benjamin Peterson
c0ba828857
better col_offsets for "for" statements with tuple unpacking #6704
...
Patch from Frank Wierzbicki.
2009-08-15 22:59:21 +00:00
Benjamin Peterson
4c6e8088f5
#6707 fix a crash with dir() on an uninitialized module
2009-08-15 13:16:38 +00:00
Brett Cannon
764465f315
Expat could crash if given the wrong kind of input by never stopping its
...
tokenizing step.
Thanks to Ivan Krstić for the patch.
2009-08-13 19:27:12 +00:00
Gregory P. Smith
c4ad0345cf
Fix issue1628205: Socket file objects returned by socket.socket.makefile() now
...
properly handles EINTR within the read, readline, write & flush methods.
The socket.sendall() method now properly handles interrupted system calls.
2009-08-13 18:54:50 +00:00
Antoine Pitrou
20e1f932fa
Issue #6629 : Fix a data corruption issue in the new `io` package, which could
...
occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
"wb+" mode) after having buffered a certain amount of data for reading. This
bug was not present in the pure Python implementation.
Yes, this is a serious issue.
2009-08-06 20:18:29 +00:00
Raymond Hettinger
8fdab95260
Issue 6637: defaultdict.copy() failed with an empty factory.
2009-08-04 19:08:05 +00:00
Frank Wierzbicki
6c0f337904
Adding tests derived from the Jython project. These are primarily tests of
...
'single' statements with partial sentences (so they test things like "try:" in
interactive mode). Others tests hit areas that previously failed in Jython. A
couple still fail in Jython, mainly due to the difficulty of parsing partial
sentences (but should be fixed by Jython 2.6).
2009-08-02 20:37:48 +00:00
Mark Dickinson
4326ad8f72
Issue #6595 : Allow Decimal constructor to accept non-European decimal
...
digits, as recommended by the specification. (Backport of r74279 from
py3k.)
2009-08-02 10:59:36 +00:00
Amaury Forgeot d'Arc
3e5b027a64
#6511 : ZipFile will now raise BadZipfile when opening an empty or tiny file,
...
like it does for larger invalid files.
2009-07-28 22:15:30 +00:00
Amaury Forgeot d'Arc
e55df1fa2a
"Fix" for the refleak report: the ABC classes are now in the _pyio module
2009-07-28 20:47:55 +00:00
Mark Dickinson
fe67bd9168
Issue #6561 : '\d' regular expression should not match characters of
...
category [No]; only those of category [Nd]. (Backport of r74237
from py3k.)
2009-07-28 20:35:03 +00:00
Raymond Hettinger
c2b9e1a134
Issue 6573: Fix set.union() for cases where self is in the argument chain.
2009-07-27 20:32:04 +00:00
Amaury Forgeot d'Arc
74b3016783
#6553 : crash in cPickle.load(), when given a StringIO with incomplete data.
...
Will backport to 2.6, 3.x already fixed a similar issue with issue4298.
2009-07-23 19:26:02 +00:00
R. David Murray
46ca2f25eb
Backport of fix for issue 6542: make sure
...
test_os.TestInvalidFD.test_closerange does not close any
valid file descriptors.
2009-07-22 17:22:58 +00:00
Georg Brandl
ec812caf5d
Issue #6540 : Fixed crash for bytearray.translate() with invalid parameters.
2009-07-22 11:57:15 +00:00