Ned Deily [Tue, 12 Feb 2013 06:10:59 +0000 (22:10 -0800)]
Issue #17111: Prevent test_surrogates (test_fileio) failure on OS X 10.4.
An odd bug in OS X 10.4 causes open(2) on a non-existent,
invalid-encoded filename to return errno 22, EINVAL: Invalid argument,
instead of the expected errno 2, ENOENT: No such file or directory,
*if* the containing directory is not empty. That caused frequent
failures when running the buildbot tests on 10.4 depending on the state
of the test working directory. The failure is easy to reproduce on
10.4 by running the test directly (not with regrtest), first in an empty
directory, then after adding a file to it. The fix is to check for and
pass if either errno is returned.
R David Murray [Sat, 9 Feb 2013 17:53:29 +0000 (12:53 -0500)]
#16564: test to confirm behavior that regressed in python3.
Also add running of test_email_renamed to the email regrtest. It contains
tests that the base email/tests/test_email.py does not, which I discovered
while trying to backport this test for confirmation of the behavior.
Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
Éric Araujo [Sun, 3 Feb 2013 16:41:19 +0000 (11:41 -0500)]
Add alias to restore 2.7.2 compatibility for setup scripts (#13994).
The customize_compiler function moved many times during the 2.7 series;
in 2.7.3, setup scripts importing this function from ccompiler were
broken. This commit restores compatibility without reintroducing the
issue that #13994 originally fixed (duplication of the function).
A unit test makes little sense here, as distutils tests never do imports
in functions, and the fix is very simple.
Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
Ned Deily [Sat, 2 Feb 2013 07:10:56 +0000 (23:10 -0800)]
Issue #15587: Enable Tk high-resolution text rendering on Macs with
Retina displays. Applies to Tkinter apps, such as IDLE, on OS X
framework builds linked with Cocoa Tk 8.5+.
Suggested by Kevin Walzer
In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
Additional fix for Issue #12268: The io module file object writelines() methods
no longer abort early when one of its write system calls is interrupted (EINTR).
Serhiy Storchaka [Thu, 31 Jan 2013 13:57:51 +0000 (15:57 +0200)]
Issue #17049: Localized calendar methods now return unicode if a locale
includes an encoding and the result string contains month or weekday (was
regression from Python 2.6).
Serhiy Storchaka [Thu, 31 Jan 2013 13:26:55 +0000 (15:26 +0200)]
Issue #4844: ZipFile now raises BadZipfile when opens a ZIP file with an
incomplete "End of Central Directory" record. Original patch by Guilherme
Polo and Alan McIntyre.
Ned Deily [Thu, 31 Jan 2013 09:24:55 +0000 (01:24 -0800)]
Issue #13590: OS X Xcode 4 - improve support for universal extension modules
In particular, fix extension module build failures when trying to use
32-bit-only installer Pythons on systems with Xcode 4 (currently
OS X 10.8, 10.7, and optionally 10.6).
* Backport 3.3.0 fixes to 2.7 branch (for release in 2.7.4)
* Since Xcode 4 removes ppc support, extension module builds now
check for ppc compiler support and by default remove ppc and
ppc64 archs when they are not available.
* Extension module builds now revert to using system installed
headers and libs (/usr and /System/Library) if the SDK used
to build the interpreter is not installed or has moved.
* Try to avoid building extension modules with deprecated
and problematic Apple llvm-gcc compiler. If original compiler
is not available, use clang instead by default.
Serhiy Storchaka [Tue, 22 Jan 2013 15:13:26 +0000 (17:13 +0200)]
Issue #1159051: GzipFile now raises EOFError when reading a corrupted file
with truncated header or footer.
Added tests for reading truncated gzip and bzip2 files.