Commit Graph

14904 Commits

Author SHA1 Message Date
Antoine Pitrou e08dd117fa Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn) 2009-10-14 18:12:54 +00:00
Antoine Pitrou e22997ec7c Silence a py3k warning claiming to affect Lib/calendar.py 2009-10-14 18:09:45 +00:00
Antoine Pitrou 63b0cb2f39 Fix py3k warnings in bsddb 2009-10-14 18:01:33 +00:00
Antoine Pitrou 868817eaf5 Fix a test_atexit failure when run with -3 2009-10-14 17:34:31 +00:00
Antoine Pitrou bca7b4894a Fix py3k warnings in the aifc module 2009-10-14 17:30:52 +00:00
Georg Brandl e1254d748d #7125: fix typo. 2009-10-14 15:51:48 +00:00
R. David Murray 14dcd43d0b Enhanced Issue 7058 patch, which will not be backported. Refactors the
code, adds checks for stdin/out/err, cwd, and sys.path, and adds a new
section in the summary for tests that modify the environment (thanks to
Ezio Melotti for that suggestion).
2009-10-14 13:58:07 +00:00
Senthil Kumaran 274686631a Fixed Issue6894, urllib2 doesn't respect "no_proxy" environment 2009-10-11 02:00:07 +00:00
Antoine Pitrou 58d2f2689a Issue #7055: test___all__ now greedily detects all modules which have an
__all__ attribute, rather than using a hardcoded and incomplete list.
2009-10-10 20:52:11 +00:00
Vinay Sajip 1c77b7f84c Issue #7086: Added TCP support to SysLogHandler and tidied up some anachronisms in the code. 2009-10-10 20:32:36 +00:00
Benjamin Peterson 6e3dbbdf39 replace has_key with 'in' operator 2009-10-09 22:15:50 +00:00
Benjamin Peterson de0559998f replace callable() 2009-10-09 22:05:45 +00:00
R. David Murray 0c8bee6393 Issue #7082: When falling back to the MIME 'name' parameter, the
correct place to look for it is the Content-Type header.

Patch by Darren Worrall.
2009-10-09 21:50:54 +00:00
Benjamin Peterson 4502dcd48c death to old CVS keyword 2009-10-09 03:11:36 +00:00
Mark Dickinson 539bff4234 Update decimal test data to the most recent set from Mike Cowlishaw. 2009-10-08 16:28:39 +00:00
Mark Dickinson 3d830828de Issue #7078: _struct.__doc__ was being ignored. Import it into struct.
Also add description of '?' struct format character.  Thanks Gabriel
Genellina for the patch.
2009-10-08 15:54:10 +00:00
Mark Dickinson 15ae41c2db Issue #7048: logb should round its result when that result doesn't fit
into the available precision.  (Tests for this change are included in
the most recent set of testcases from the Decimal Specification site;
those testcases will be updated shortly.)
2009-10-07 19:22:05 +00:00
Amaury Forgeot d'Arc d0052d17b1 #1571184: makeunicodedata.py now generates the functions _PyUnicode_ToNumeric,
_PyUnicode_IsLinebreak and _PyUnicode_IsWhitespace.

It now also parses the Unihan.txt for numeric values.
2009-10-06 19:56:32 +00:00
Andrew M. Kuchling b6f0128c63 Use standard comma punctuation; reword some sentences in the docs 2009-10-05 22:32:48 +00:00
R. David Murray abe3d3ec85 Issue #7058: Added save/restore for argv and os.environ to runtest_inner
in regrtest, with warnings if the called test modifies them.
2009-10-05 17:03:09 +00:00
Mark Dickinson 245d915e3e Issue #7042: Fix test_signal failure on OS X 10.6 64-bit builds
(and also, with luck, on the x86 FreeBSD buildbot), by making sure
that some user time is used in test_itimer_virtual.
2009-10-04 18:38:39 +00:00
Benjamin Peterson 82d31e9b20 test logging 2009-10-04 13:38:38 +00:00
Benjamin Peterson 7adbb5a35d #7050 fix a SystemError when using tuple unpacking and augmented assignment 2009-10-03 20:23:24 +00:00
Tarek Ziadé 3b34dd871a now uses the right exception type 2009-10-03 14:52:33 +00:00
Tarek Ziadé f638486cf0 removing the last remaning apply() calls 2009-10-03 00:07:35 +00:00
Tarek Ziadé 1b48671ef1 #6516 added owner/group support for tarfiles in Distutils 2009-10-02 23:49:48 +00:00
Georg Brandl f895cf5d33 #7031: Add TestCase.assertIsInstance and negated method. 2009-10-01 20:59:31 +00:00
Georg Brandl 46cc46af07 Fix some weird whitespace and two other overlong lines. 2009-10-01 20:11:14 +00:00
Senthil Kumaran dc61ec35ec That's self.env.unset(k) and not env.unset(k) I was heading back to the problem. 2009-10-01 01:50:13 +00:00
Senthil Kumaran 5a43e86542 using dict.unset(k) instead of del dict[k]. consistent with release26-maint 2009-10-01 01:19:18 +00:00
Senthil Kumaran 91abd6e68d Fix for issue7026 test_urllib: unsetting missing 'env' variable. 2009-10-01 01:07:03 +00:00
Mark Dickinson 8ca7482cc9 Fix buggy accuracy test 2009-09-30 16:58:01 +00:00
Philip Jenvey 8b9020458a #5329: fix os.popen* regression from 2.5: don't execute commands as a sequence
through the shell. also document the correct subprocess replacement for this
case
patch from Jean-Paul Calderone and Jani Hakala
2009-09-29 19:10:15 +00:00
Mark Dickinson 7e7a3ec901 Issue #7019: Unmarshalling of bad long data could produce unnormalized
PyLongs.  Raise ValueError instead.
2009-09-29 19:01:06 +00:00
Antoine Pitrou 7248178cd9 Issue #6790: Make it possible again to pass an `array.array` to
`httplib.HTTPConnection.send`. Patch by Kirk McDonald.
2009-09-29 17:48:18 +00:00
Vinay Sajip f70867aabc Issue #7014: logging: Improved IronPython 2.6 compatibility. 2009-09-29 07:08:54 +00:00
Philip Jenvey dbf3b258e7 #6990: clear threading.local's key only after its thread state is removed:
fixes local subclasses leaving old state around after a ref cycle GC which
could be recycled by new locals
2009-09-29 04:32:44 +00:00
Mark Dickinson b93fff0a57 Issue #3366: Add gamma function to math module.
(lgamma, erf and erfc to follow).
2009-09-28 18:54:55 +00:00
R. David Murray ddfb6cdc2b Applying patches backported from 3.1, by Gregor Lingl. 2009-09-28 18:29:28 +00:00
R. David Murray 97f5ff37ff Prevent test_bad_address failure when a domain in the dns search
path implements a '*' default rule.  Also update comment with
a more complete explanation of the difficulties inherent in
the test.
2009-09-28 16:57:45 +00:00
Skip Montanaro b4fd4d37a1 Patch from Thomas Barr so that csv.Sniffer will set doublequote property.
Closes issue 6606.
2009-09-28 02:12:27 +00:00
Michael Foord d6aabcfe2f Test creation moved from TestProgram.parseArgs to TestProgram.createTests exclusively. Issue 6956. 2009-09-27 19:15:41 +00:00
Vinay Sajip 4780c9a0e0 Tidied up name of parameter in StreamHandler 2009-09-26 14:53:32 +00:00
Ezio Melotti 9aac2455ab #7000: document "sep" in capwords. Add a few tests 2009-09-26 11:20:53 +00:00
Andrew M. Kuchling b49e53ee16 #6243: fix segfault when keyname() returns a NULL pointer.
Bug noted by Trundle, patched by Trundle and Jerry Chen.
2009-09-25 22:23:54 +00:00
Kristján Valur Jónsson 2fcd03bb77 http://bugs.python.org/issue6971
Adding the SIO_KEEPALIVE_VALS command to socket.ioctl on windows
2009-09-25 15:19:51 +00:00
Ronald Oussoren 68776dbd3c Half of the fix for issue 6957: ensure that distutils
ignores the '-isysroot' option on OSX when the
corresponding SDK is not installed.

This ensures that the user can compile extensions
on OSX 10.6 using the Python.org installer and a
default installation of Xcode.
2009-09-22 19:27:44 +00:00
Brett Cannon 4d94743c28 When range checking was added to time.strftime() a check was placed on tm_isdst
to make sure it fell within [-1, 1] just in case someone implementing
strftime() in libc was stupid enough to assume this. Turns out, though, some
OSs (e.g. zOS) are stupid enough to use values outside of this range for time
structs created by the system itself. So instead of throwing a ValueError,
tm_isdst is now normalized before being passed to strftime().

Fixes issue #6823. Thanks Robert Shapiro for diagnosing the problem and
contributing an initial patch.
2009-09-22 00:29:48 +00:00
Tarek Ziadé 0cfef2c3a4 forgot to commit a file in previous commit (r74994, issue #6954) 2009-09-21 13:49:57 +00:00
Tarek Ziadé 9977335984 #6954: Fixed crash when using DISTUTILS_DEBUG flag in Distutils. 2009-09-21 13:41:08 +00:00
Tarek Ziadé ccaf380fab improving distutils coverage 2009-09-21 13:23:35 +00:00
Tarek Ziadé 6d2db3784a improved distutils test coverage: now the DEBUG mode is covered too (will help fix the issue #6954 in py3k branch) 2009-09-21 12:19:07 +00:00
Ronald Oussoren 9f20d9d0ee Issue 6877: this patch makes it possible to link the readline extension
to the libedit emulation of the readline API on OSX 10.5 or later.

This also adds a minimal testsuite for readline to check that the
history manipuation functions have the same interface with both
C libraries.
2009-09-20 14:18:15 +00:00
Ronald Oussoren 809073bee1 Followup for r74962 2009-09-20 10:54:07 +00:00
Ronald Oussoren 51f0633efd Fix for issue 6851: urllib.urlopen crashes in a thread on OSX 10.6 2009-09-20 10:31:22 +00:00
Georg Brandl 52c1794b98 Update bug tracker reference. 2009-09-19 08:43:16 +00:00
Georg Brandl ab849891ef #6944: the argument to PyArg_ParseTuple should be a tuple, otherwise a SystemError is set. Also clean up another usage of PyArg_ParseTuple. 2009-09-19 07:35:07 +00:00
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
Thomas Heller 6be522bfc2 Issue #4606: Passing 'None' if ctypes argtype is set to POINTER(...)
does now always result in NULL.
2009-09-18 20:05:44 +00:00
Thomas Heller 7a352c0ed8 Issue #5042: Structure sub-subclass does now initialize correctly with
base class positional arguments.
2009-09-18 18:55:17 +00:00
Georg Brandl 195261f823 Optimize optimization and fix method name in docstring. 2009-09-18 16:19:56 +00:00
Georg Brandl b019951875 Use str.format() to fix beginner's mistake with %-style string formatting. 2009-09-18 13:57:11 +00:00
Georg Brandl c40e60e5e5 #6938: "ident" is always a string, so use a format code which works. 2009-09-18 09:18:27 +00:00
Georg Brandl 097f70881a #6905: use better exception messages in inspect when the argument is of the wrong type. 2009-09-18 09:14:52 +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
Benjamin Peterson 4d714cbbf1 kill bare except 2009-09-17 02:46:54 +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
Ronald Oussoren 0180565054 Update distutils.util tests after my changes
to --with-universal-archs
2009-09-15 21:24:07 +00:00
Ronald Oussoren 5d90029041 Finish support for --with-universal-archs=intel
and --with-universal-archs=3-way (issue6245)
2009-09-15 19:13:15 +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
Matthias Klose 924eab64a3 Issue #6635: Fix profiler printing usage message. 2009-09-13 15:09:24 +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
Tarek Ziadé bed26a3ce3 Issue #6163: Fixed HP-UX runtime library dir options in distutils.unixcompiler 2009-09-09 08:14:20 +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
Ronald Oussoren 626faeb77b Fix for issue 4937 2009-09-06 12:23:18 +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
Chris Withers 68c6e92fd4 Fixes issue #6838: use a list to accumulate the value instead of repeatedly concatenating strings. 2009-09-04 16:12:32 +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
Georg Brandl d22b9519d1 Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as documented. 2009-09-04 08:17:04 +00:00
Georg Brandl 2e1308f520 Issue #2666: Handle BROWSER environment variable properly for unknown browser names in the webbrowser module. 2009-09-04 06:59:20 +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