Ned Deily [Wed, 24 Feb 2016 14:01:48 +0000 (01:01 +1100)]
Change OS X installer builds targeted for 10.10 and above to build
and link with a private copy of OpenSSL, like installers targeted
for 10.5 already do, since Apple has deprecated use of the system
OpenSSL and removed its header files from the Xcode 7 SDK. Note
that this configuration is not currently used to build any
python.org-supplied installers and that the private copy of
OpenSSL requires its own root certificates.
Ned Deily [Wed, 24 Feb 2016 13:56:38 +0000 (00:56 +1100)]
Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries.
As of Xcode 7, SDKs for Apple platforms now include textual-format stub
libraries whose file names have a .tbd extension rather than the
standard OS X .dylib extension. The Apple compiler tool chain handles
these stub libraries transparently and the installed system shared libraries
are still .dylibs. However, the new stub libraries cause problems for
third-party programs that support building with Apple SDKs and make
build-time decisions based on the presence or paths of system-supplied
shared libraries in the SDK. In particular, building Python itself with
an SDK fails to find system-supplied libraries during setup.py's build of
standard library extension modules. The solution is to have
find_library_file() in Distutils search for .tbd files, along with
the existing types (.a, .so, and .dylib). Patch by Tim Smith.
Martin Panter [Tue, 23 Feb 2016 22:30:50 +0000 (22:30 +0000)]
Issue #22088: Clarify base-64 alphabets and which characters are discarded
* There are only two base-64 alphabets defined by the RFCs, not three
* Due to the internal translation, plus (+) and slash (/) are never discarded
* standard_ and urlsafe_b64decode() discard characters as well
Also update the doc strings to clarify data types, based on revision 92760d2edc9e, correct the exception raised by b16decode(), and correct the
parameter name for the base-85 functions.
Zachary Ware [Mon, 22 Feb 2016 10:02:30 +0000 (04:02 -0600)]
Issue #26268: Update the prepare_ssl.py script
It can now handle OpenSSL versions 1.0.2e and greater, which don't
include include files in include/.
Note that sources prepared by this script no longer support the old
project files for 2.7; you now have to have Perl available to use
the old build_ssl.py script with sources from svn.python.org.
Martin Panter [Mon, 22 Feb 2016 09:04:22 +0000 (09:04 +0000)]
Fix errors in XML-RPC client example code
* http.client.HTTP (does not exist in Python 3) → HTTPConnection
* Server (deprecated) → ServerProxy
* Transport.send_request() grew a new “debug” parameter in Python 3 (revision a528f7f8f97a)
Brett Cannon [Sun, 21 Feb 2016 02:35:41 +0000 (18:35 -0800)]
Issue #26186: Remove an invalid type check in
importlib.util.LazyLoader.
The class was checking its argument as to whether its implementation
of create_module() came directly from importlib.abc.Loader. The
problem is that the classes coming from imoprtlib.machinery do not
directly inherit from the ABC as they come from _frozen_importlib.
Because the documentation has always said that create_module() was
ignored, the check has simply been removed.
Martin Panter [Fri, 19 Feb 2016 23:34:56 +0000 (23:34 +0000)]
Issues #22468, #21996, #22208: Clarify gettarinfo() and TarInfo usage
* The Windows-specific binary notice was probably a Python 2 thing
* Make it more obvious gettarinfo() is based on stat(), and that non-ordinary
files may need special care
* The file name must be text; suggest dummy arcname as a workaround
* Indicate TarInfo may be used directly, not just via gettarinfo()
* Add headings for each concrete and mix-in class and list methods and
attributes under them
* Fix class and method cross references
* Changed RequestHandler to BaseRequestHandler and added class heading
* Pull out Stream/DatagramRequestHandler definitions
* Reordered the request handler setup(), handle(), finish() methods
* Document constructor parameters for the server classes
* Remove version 2.6 not relevant for Python 3 documentation
Issue #26198: Fixed error messages for some argument parsing errors.
Fixed the documented about buffer overflow error for "es#" and "et#" format
units.
Martin Panter [Mon, 8 Feb 2016 01:34:09 +0000 (01:34 +0000)]
Issue #25179: Preparatory cleanup of existing docs on string formatting
* Various sections were pointing to the section on the string.Formatter
class, when the section on the common format string syntax is probably more
appropriate
* Fix references to various format() functions and methods
* Nested replacement fields may contain conversions and format specifiers,
and this is tested; see Issue #19729 for instance
Issue #25945: Fixed bugs in functools.partial.
Fixed a crash when unpickle the functools.partial object with wrong state.
Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
Martin Panter [Tue, 2 Feb 2016 10:37:15 +0000 (10:37 +0000)]
Issue #19587: Remove masked and redundant tests in test_bytes
* test_contains() did not override anything
* test_expandtabs/upper/lower() in FixedStringTest were masking usable tests
in string_tests. These tests now get run for bytearray() and bytes().
* test_expandtabs/upper/lower() in buffer_tests were only run on bytearray()
and are redundant with string_tests
Martin Panter [Mon, 1 Feb 2016 21:58:11 +0000 (21:58 +0000)]
Issue #26173: Separate bad cert file tests and client rejection test
Test test_wrong_cert() runs a server that rejects the client's certificate,
so ECONNRESET is reasonable in addition to SSLError. On the other hand, the
other three tests don't even need to run a server because they are just
testing the parsing of invalid certificate files.
Also fix a ResourceWarning by closing the wrapped socket.
Victor Stinner [Sun, 31 Jan 2016 17:36:41 +0000 (18:36 +0100)]
Enhance os.scandir() doc
Issue #26248, patch written by Ben Hoyt:
1) Clarify that the return values of is_dir()/is_file()/etc are cached
separately for follow_symlinks True and False.
2) Be more specific about when the functions require a system call, and how it
relates to caching and follow_symlinks.
3) DRY up common stuff between is_dir and is_file by saying "Caching, system
calls made, and exceptions raised are as per is_dir" in is_file.
4) Tweak to the first paragraph of docs for is_dir/is_file to simplify: assume
the follow_symlinks=True default, then note the follow_symlinks=False
non-default case after.
Martin Panter [Sat, 30 Jan 2016 03:41:43 +0000 (03:41 +0000)]
Issue #26173: Fix test_ssl confusion with non-existing cert and wrongcert.pem
Testing for a non-existing certificate file is already done in test_errors().
Copy wrongcert.pem from Python 2 and use it to test the behaviour with a
mismatched certificate.
Victor Stinner [Thu, 28 Jan 2016 17:13:45 +0000 (18:13 +0100)]
Backport fixes on test_eintr
* Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging
* Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
especially on slow buildbots. Use a pipe to synchronize the parent and the
child processes.
Victor Stinner [Thu, 28 Jan 2016 14:41:01 +0000 (15:41 +0100)]
Windows: Decode hostname from ANSI code page
Issue #26227: On Windows, getnameinfo(), gethostbyaddr() and gethostbyname_ex()
functions of the socket module now decode the hostname from the ANSI code page
rather than UTF-8.
Victor Stinner [Wed, 27 Jan 2016 15:56:53 +0000 (16:56 +0100)]
Fix resize_compact()
Issue #26217: resize_compact() must set wstr_length to 0 after freeing the wstr
string. Otherwise, an assertion fails in _PyUnicode_CheckConsistency().
Victor Stinner [Fri, 22 Jan 2016 17:00:05 +0000 (18:00 +0100)]
doc: i18n HTML templates
Issue #25907: Use {% trans %} tags in HTML templates to ease the translation of
the documentation. The tag comes from Jinja templating system, used by Sphinx.
Victor Stinner [Fri, 22 Jan 2016 11:33:12 +0000 (12:33 +0100)]
code_richcompare() now uses the constants types
Issue #25843: When compiling code, don't merge constants if they are equal but
have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now
correctly compiled to two different functions: f1() returns 1 (int) and f2()
returns 1.0 (int), even if 1 and 1.0 are equal.