From 932023666da32002277b878a91ff322a79c1a6a8 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Wed, 28 Mar 2018 15:18:09 -0500 Subject: [PATCH] WRS: Patch9000: 0001-WRS-Rollup-optimization-commits.patch --- .gitignore | 50 ++ .hgignore | 86 ++ Makefile.pre.in | 39 +- Misc/NEWS | 2647 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README | 29 + configure | 334 ++++++- configure.ac | 168 ++++ 7 files changed, 3341 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 .hgignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b87e93 --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +*.cover +*.o +*.orig +*.pyc +*.pyd +*.pyo +*.rej +*~ +*.gc?? +*.profclang? +*.profraw +Doc/build/ +Doc/tools/docutils/ +Doc/tools/jinja2/ +Doc/tools/pygments/ +Doc/tools/sphinx/ +Lib/lib2to3/*.pickle +Makefile +Makefile.pre +Misc/python.pc +Modules/Setup +Modules/Setup.config +Modules/Setup.local +Modules/config.c +Modules/ld_so_aix +PCbuild/*.bsc +PCbuild/*.dll +PCbuild/*.exe +PCbuild/*.exp +PCbuild/*.lib +PCbuild/*.ncb +PCbuild/*.o +PCbuild/*.pdb +PCbuild/Win32-temp-* +Parser/pgen +Parser/pgen.stamp +autom4te.cache +build/ +config.log +config.status +libpython*.a +libpython*.so* +pyconfig.h +python$ +python-gdb.py +tags +.coverage +coverage/ +externals/ +htmlcov/ diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..007aa7b --- /dev/null +++ b/.hgignore @@ -0,0 +1,86 @@ +.gdb_history +.purify +.svn/ +^.idea/ +.DS_Store +Makefile$ +Makefile.pre$ +TAGS$ +autom4te.cache$ +build/ +buildno$ +config.cache +config.log +config.status +config.status.lineno +db_home +platform$ +pyconfig.h$ +python$ +python.bat$ +python.exe$ +reflog.txt$ +tags$ +Lib/plat-mac/errors.rsrc.df.rsrc +Misc/python.pc +Modules/Setup$ +Modules/Setup.config +Modules/Setup.local +Modules/config.c +Modules/ld_so_aix$ +Parser/pgen$ +Parser/pgen.stamp$ +^core +^python-gdb.py +^pybuilddir.txt + +syntax: glob +python.exe-gdb.py +libpython*.a +libpython*.so* +*.swp +*.o +*.pyc +*.pyo +*.pyd +*.cover +*~ +*.gc?? +*.profclang? +*.profraw +Lib/distutils/command/*.pdb +Lib/lib2to3/*.pickle +Lib/test/data/* +Misc/*.wpu +PC/python_nt*.h +PC/pythonnt_rc*.h +PC/*/*.exe +PC/*/*.exp +PC/*/*.lib +PC/*/*.bsc +PC/*/*.dll +PC/*/*.pdb +PC/*/*.user +PC/*/*.ncb +PC/*/*.suo +PC/*/Win32-temp-* +PC/*/x64-temp-* +PC/*/amd64 +PCbuild/*.user +PCbuild/*.suo +PCbuild/*.*sdf +PCbuild/*-pgi +PCbuild/*-pgo +PCbuild/.vs +PCbuild/*.dll +PCbuild/*.exp +PCbuild/*.exe +PCbuild/*.ilk +PCbuild/*.lib +PCbuild/*.pdb +PCbuild/amd64 +PCbuild/obj +.coverage +coverage/ +externals/ +htmlcov/ diff --git a/Makefile.pre.in b/Makefile.pre.in index 611f63a..21b6478 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -42,6 +42,11 @@ SVNVERSION= @SVNVERSION@ HGVERSION= @HGVERSION@ HGTAG= @HGTAG@ HGBRANCH= @HGBRANCH@ +PGO_PROF_GEN_FLAG=@PGO_PROF_GEN_FLAG@ +PGO_PROF_USE_FLAG=@PGO_PROF_USE_FLAG@ +LLVM_PROF_MERGER=@LLVM_PROF_MERGER@ +LLVM_PROF_FILE=@LLVM_PROF_FILE@ +LLVM_PROF_ERR=@LLVM_PROF_ERR@ GNULD= @GNULD@ @@ -203,8 +208,7 @@ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ HOST_GNU_TYPE= @host@ # The task to run while instrument when building the profile-opt target -PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck -#PROFILE_TASK= $(srcdir)/Lib/test/regrtest.py +PROFILE_TASK=-m test.regrtest >/dev/null 2>&1 # === Definitions added by makesetup === @@ -417,42 +421,53 @@ LIBRARY_OBJS= \ # Rules # Default target -all: build_all +all: @DEF_MAKE_ALL_RULE@ build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks -# Compile a binary with gcc profile guided optimization. +# Compile a binary with profile guided optimization. profile-opt: + @if [ $(LLVM_PROF_ERR) == yes ]; then \ + echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\ + echo "Please add it to PATH and run ./configure again" ;\ + exit 1;\ + fi @echo "Building with support for profile generation:" $(MAKE) clean + $(MAKE) profile-removal $(MAKE) build_all_generate_profile - @echo "Running benchmark to generate profile data:" $(MAKE) profile-removal + @echo "Running code to generate profile data (this can take a while):" $(MAKE) run_profile_task + $(MAKE) build_all_merge_profile @echo "Rebuilding with profile guided optimizations:" $(MAKE) clean $(MAKE) build_all_use_profile + $(MAKE) profile-removal build_all_generate_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)" run_profile_task: : # FIXME: can't run for a cross build - ./$(BUILDPYTHON) $(PROFILE_TASK) + $(LLVM_PROF_FILE) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + +build_all_merge_profile: + $(LLVM_PROF_MERGER) build_all_use_profile: - $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" + $(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) $(PGO_PROF_USE_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) @LTOFLAGS@" coverage: @echo "Building with support for coverage checking:" - $(MAKE) clean - $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov" + $(MAKE) clean profile-removal + $(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov" # Build the interpreter $(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ Modules/python.o \ - $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + $(LIBRARY_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform @@ -1282,9 +1297,11 @@ clean: pycremoval find build -name 'fficonfig.h' -exec rm -f {} ';' || true find build -name 'fficonfig.py' -exec rm -f {} ';' || true -rm -f Lib/lib2to3/*Grammar*.pickle + -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';' profile-removal: find . -name '*.gc??' -exec rm -f {} ';' + find . -name '*.profclang?' -exec rm -f {} ';' clobber: clean profile-removal -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ diff --git a/Misc/NEWS b/Misc/NEWS index 8f97390..8e581ab 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1,6 +1,2653 @@ ++++++++++++ Python News +++++++++++ +What's New in Python 2.7.13? +============================ + +*Release date: XXXX-XX-XX* + +Core and Builtins +----------------- + +- bpo-28598: Support __rmod__ for subclasses of str being called before + str.__mod__. Patch by Martijn Pieters. + +- bpo-29602: Fix incorrect handling of signed zeros in complex constructor for + complex subclasses and for inputs having a __complex__ method. Patch + by Serhiy Storchaka. + +- bpo-29347: Fixed possibly dereferencing undefined pointers + when creating weakref objects. + +- Issue #14376: Allow sys.exit to accept longs as well as ints. Patch + by Gareth Rees. + +- Issue #29028: Fixed possible use-after-free bugs in the subscription of the + buffer object with custom index object. + +- Issue #29145: Fix overflow checks in string, bytearray and unicode. + Patch by jan matejek and Xiang Zhang. + +- Issue #28932: Do not include if it does not exist. + +Extension Modules +----------------- + +- Issue #29169: Update zlib to 1.2.11. + +Library +------- + +- bpo-29861: Release references to tasks, their arguments and their results + as soon as they are finished in multiprocessing.Pool. + +- bpo-27880: Fixed integer overflow in cPickle when pickle large strings or + too many objects. + +- bpo-29110: Fix file object leak in aifc.open() when file is given as a + filesystem path and is not in valid AIFF format. + Original patch by Anthony Zhang. + +- Issue #29354: Fixed inspect.getargs() for parameters which are cell + variables. + +- Issue #29335: Fix subprocess.Popen.wait() when the child process has + exited to a stopped instead of terminated state (ex: when under ptrace). + +- Issue #29219: Fixed infinite recursion in the repr of uninitialized + ctypes.CDLL instances. + +- Issue #29082: Fixed loading libraries in ctypes by unicode names on Windows. + Original patch by Chi Hsuan Yen. + +- Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function + but read from /dev/urandom to get random bytes, for example in os.urandom(). + On Linux, getentropy() is implemented which getrandom() is blocking mode, + whereas os.urandom() should not block. + +- Issue #29142: In urllib, suffixes in no_proxy environment variable with + leading dots could match related hostnames again (e.g. .b.c matches a.b.c). + Patch by Milan Oberkirch. + +- Issue #29094: Offsets in a ZIP file created with extern file object and mode + "w" now are relative to the start of the file. + +- Issue #13051: Fixed recursion errors in large or resized + curses.textpad.Textbox. Based on patch by Tycho Andersen. + +- Issue #9770: curses.ascii predicates now work correctly with negative + integers. + +- Issue #28427: old keys should not remove new values from + WeakValueDictionary when collecting from another thread. + +- Issue #28998: More APIs now support longs as well as ints. + +- Issue 28923: Remove editor artifacts from Tix.py, + including encoding not recognized by codecs.lookup. + +- Issue #29019: Fix dict.fromkeys(x) overallocates when x is sparce dict. + Original patch by Rasmus Villemoes. + +- Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and + WeakValueDictionary.pop() when a GC collection happens in another + thread. + +- Issue #28925: cPickle now correctly propagates errors when unpickle instances + of old-style classes. + +C API +----- + +- Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro. + +Documentation +------------- + +- bpo-28929: Link the documentation to its source file on GitHub. + +- Issue #26355: Add canonical header link on each page to corresponding major + version of the documentation. Patch by Matthias Bussonnier. + +- Issue #12067: Rewrite Comparisons section in the Expressions chapter of the + language reference. Some of the details of comparing mixed types were + incorrect or ambiguous. Added default behaviour and consistency suggestions + for user-defined classes. Based on patch from Andy Maier. + +Build +----- + +- bpo-29643: Fix ``--enable-optimization`` configure option didn't work. + +- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k. + +- Issue #28768: Fix implicit declaration of function _setmode. Patch by + Masayuki Yamamoto + + +What's New in Python 2.7.13 +=========================== + +*Release date: 2016-12-17* + +Core and Builtins +----------------- + +- Revert a37cc3d926ec (Issue #5322). + + +What's New in Python 2.7.13 release candidate 1? +================================================ + +*Release date: 2016-12-03* + +Core and Builtins +----------------- + +- Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code. + Original patch by Andreas Stührk. + +- Issue #28847: dumbdbm no longer writes the index file in when it is not + changed and supports reading read-only files. + +- Issue #11145: Fixed miscellaneous issues with C-style formatting of types + with custom __oct__ and __hex__. + +- Issue #24469: Fixed memory leak caused by int subclasses without overridden + tp_free (e.g. C-inherited Cython classes). + +- Issue #19398: Extra slash no longer added to sys.path components in case of + empty compile-time PYTHONPATH components. + +- Issue #21720: Improve exception message when the type of fromlist is unicode. + fromlist parameter of __import__() only accepts str in Python 2 and this + will help to identify the problem especially when the unicode_literals + future import is used. + +- Issue #26906: Resolving special methods of uninitialized type now causes + implicit initialization of the type instead of a fail. + +- Issue #18287: PyType_Ready() now checks that tp_name is not NULL. + Original patch by Niklas Koep. + +- Issue #24098: Fixed possible crash when AST is changed in process of + compiling it. + +- Issue #28350: String constants with null character no longer interned. + +- Issue #27942: String constants now interned recursively in tuples and frozensets. + +- Issue #15578: Correctly incref the parent module while importing. + +- Issue #26307: The profile-opt build now applys PGO to the built-in modules. + +- Issue #27870: A left shift of zero by a large integer no longer attempts + to allocate large amounts of memory. + +- Issue #25604: Fix a minor bug in integer true division; this bug could + potentially have caused off-by-one-ulp results on platforms with + unreliable ldexp implementations. + +- Issue #27473: Fixed possible integer overflow in str, unicode and bytearray + concatenations and repetitions. Based on patch by Xiang Zhang. + +- Issue #27507: Add integer overflow check in bytearray.extend(). Patch by + Xiang Zhang. + +- Issue #27581: Don't rely on wrapping for overflow check in + PySequence_Tuple(). Patch by Xiang Zhang. + +- Issue #23908: os functions, open() and the io.FileIO constructor now reject + unicode paths with embedded null character on Windows instead of silently + truncating them. + +- Issue #27514: Make having too many statically nested blocks a SyntaxError + instead of SystemError. + +Library +------- + +- Issue #27570: Avoid zero-length memcpy() etc calls with null source + pointers in the "ctypes" and "array" modules. + +- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file + between runs given the same Grammar.txt input regardless of the hash + randomization setting. + +- Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name + fields in X.509 certs. + +- Issue #27850: Remove 3DES from ssl module's default cipher list to counter + measure sweet32 attack (CVE-2016-2183). + +- Issue #27766: Add ChaCha20 Poly1305 to ssl module's default ciper list. + (Required OpenSSL 1.1.0 or LibreSSL). + +- Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0. + +- Issue #27944: Fix some memory-corruption bugs in the log reading code of the + _hotshot module. + +- Issue #27934: Use ``float.__repr__`` instead of plain ``repr`` when JSON- + encoding an instance of a float subclass. Thanks Eddie James. + +- Issue #27861: Fixed a crash in sqlite3.Connection.cursor() when a factory + creates not a cursor. Patch by Xiang Zhang. + +- Issue #19884: Avoid spurious output on OS X with Gnu Readline. + +- Issue #10513: Fix a regression in Connection.commit(). Statements should + not be reset after a commit. + +- Issue #2466: posixpath.ismount now correctly recognizes mount points which + the user does not have permission to access. + +- Issue #27783: Fix possible usage of uninitialized memory in operator.methodcaller. + +- Issue #27774: Fix possible Py_DECREF on unowned object in _sre. + +- Issue #27760: Fix possible integer overflow in binascii.b2a_qp. + +- In the curses module, raise an error if window.getstr() or window.instr() is + passed a negative value. + +- Issue #27758: Fix possible integer overflow in the _csv module for large record + lengths. + +- Issue #23369: Fixed possible integer overflow in + _json.encode_basestring_ascii. + +- Issue #27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the + HTTP_PROXY variable when REQUEST_METHOD environment is set, which indicates + that the script is in CGI mode. + +- Issue #27130: In the "zlib" module, fix handling of large buffers + (typically 2 or 4 GiB). Previously, inputs were limited to 2 GiB, and + compression and decompression operations did not properly handle results of + 2 or 4 GiB. + +- Issue #23804: Fix SSL zero-length recv() calls to not block and not raise + an error about unclean EOF. + +- Issue #27466: Change time format returned by http.cookie.time2netscape, + confirming the netscape cookie format and making it consistent with + documentation. + +- Issue #22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong + mode no longer break tracing, trace_vinfo() now always returns a list of + pairs of strings. + +- Issue #27079: Fixed curses.ascii functions isblank(), iscntrl() and ispunct(). + +- Issue #22636: Avoid shell injection problems with + ctypes.util.find_library(). + +- Issue #27330: Fixed possible leaks in the ctypes module. + +- Issue #27238: Got rid of bare excepts in the turtle module. Original patch + by Jelle Zijlstra. + +- Issue #26386: Fixed ttk.TreeView selection operations with item id's + containing spaces. + +- Issue #25455: Fixed a crash in repr of cElementTree.Element with recursive tag. + +IDLE +---- + +- Issue #27714: text_textview and test_autocomplete now pass when re-run + in the same process. This occurs when test_idle fails when run with the + -w option but without -jn. Fix warning from test_config. + +- Issue #27452: add line counter and crc to IDLE configHandler test dump. + +- Issue #27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names. + +- Issue #27245: IDLE: Cleanly delete custom themes and key bindings. + Previously, when IDLE was started from a console or by import, a cascade + of warnings was emitted. Patch by Serhiy Storchaka. + +Documentation +------------- + +- Issue #16484: Change the default PYTHONDOCS URL to "https:", and fix the + resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik + Nadikuditi. + +Tests +----- + +- Issue #27369: In test_pyexpat, avoid testing an error message detail that + changed in Expat 2.2.0. + +Build +----- + +- Issue #26359: Rename --with-optimiations to --enable-optimizations. + +- Issue #28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j. + +- Issue #28258: Fixed build with Estonian locale (distclean target in + Makefile). Patch by Arfrever Frehtes Taifersar Arahesis. + +- Issue #26661: setup.py now detects system libffi with multiarch wrapper. + +- Issue #15819: The Include directory in the build tree is already searched; + drop unused code trying to add it again. + +- Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach) + +- Issue #27983: Cause lack of llvm-profdata tool when using clang as + required for PGO linking to be a configure time error rather than + make time when --with-optimizations is enabled. Also improve our + ability to find the llvm-profdata tool on MacOS and some Linuxes. + +- Issue #26359: Add the --with-optimizations configure flag. + +- Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X. + Also update FreedBSD version checks for the original ctype UTF-8 workaround. + +Windows +------- + +- Issue #27888: Prevent Windows installer from displaying console windows and + failing when pip cannot be installed/uninstalled. + +What's New in Python 2.7.12? +============================ + +*Release date: XXXX-XX-XX* + +Core and Builtins +----------------- + +- Issue #25702: A --with-lto configure option has been added that will + enable link time optimizations at build time during a make profile-opt. + Some compilers and toolchains are known to not produce stable code when + using LTO, be sure to test things thoroughly before relying on it. + It can provide a few % speed up over profile-opt alone. + +- Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N" + format unit. + +- Issue #27039: Fixed bytearray.remove() for values greater than 127. Patch by + Joe Jevnik. + +- Issue #4806: Avoid masking the original TypeError exception when using star + (*) unpacking and the exception was raised from a generator. Based on + patch by Hagen Fürstenau. + +- Issue #26659: Make the builtin slice type support cycle collection. + +- Issue #26718: super.__init__ no longer leaks memory if called multiple times. + NOTE: A direct call of super.__init__ is not endorsed! + +- Issue #13410: Fixed a bug in PyUnicode_Format where it failed to properly + ignore errors from a __int__() method. + +- Issue #26494: Fixed crash on iterating exhausting iterators. + Affected classes are generic sequence iterators, iterators of bytearray, + list, tuple, set, frozenset, dict, OrderedDict and corresponding views. + +- Issue #26581: If coding cookie is specified multiple times on a line in + Python source code file, only the first one is taken to account. + +- Issue #22836: Ensure exception reports from PyErr_Display() and + PyErr_WriteUnraisable() are sensible even when formatting them produces + secondary errors. This affects the reports produced by + sys.__excepthook__() and when __del__() raises an exception. + +- Issue #22847: Improve method cache efficiency. + +- 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. + +- Issue #22995: [UPDATE] Remove the one of the pickleability tests in + _PyObject_GetState() due to regressions observed in Cython-based projects. + +- Issue #25961: Disallowed null characters in the type name. + +- Issue #22995: Instances of extension types with a state that aren't + subclasses of list or dict and haven't implemented any pickle-related + methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, + or __getstate__), can no longer be pickled. Including memoryview. + +- Issue #20440: Massive replacing unsafe attribute setting code with special + macro Py_SETREF. + +- Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size. + This allows sys.getsize() to work correctly with their subclasses with + __slots__ defined. + +- Issue #19543: Added Py3k warning for decoding unicode. + +- Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside + __getattr__. + +- Issue #24731: Fixed crash on converting objects with special methods + __str__, __trunc__, and __float__ returning instances of subclasses of + str, long, and float to subclasses of str, long, and float correspondingly. + +- Issue #26478: Fix semantic bugs when using binary operators with dictionary + views and tuples. + +- Issue #26171: Fix possible integer overflow and heap corruption in + zipimporter.get_data(). + +Library +------- + +- Issue #27114: Fix SSLContext._load_windows_store_certs fails with + PermissionError + +- Issue #14132: Fix urllib.request redirect handling when the target only has + a query string. Fix by Ján Janech. + +- Removed the requirements for the ctypes and modulefinder modules to be + compatible with earlier Python versions. + +- Issue #22274: In the subprocess module, allow stderr to be redirected to + stdout even when stdout is not redirected. Patch by Akira Li. + +- Issue #12045: Avoid duplicate execution of command in ctypes.util._get_soname(). + Patch by Sijin Joseph. + +- Issue #26960: Backported #16270 from Python 3 to Python 2, to prevent urllib + from hanging when retrieving certain FTP files. + +- Issue #25745: Fixed leaking a userptr in curses panel destructor. + +- Issue #17765: weakref.ref() no longer silently ignores keyword arguments. + Patch by Georg Brandl. + +- Issue #26873: xmlrpclib now raises ResponseError on unsupported type tags + instead of silently return incorrect result. + +- Issue #24114: Fix an uninitialized variable in `ctypes.util`. + + The bug only occurs on SunOS when the ctypes implementation searches + for the `crle` program. Patch by Xiang Zhang. Tested on SunOS by + Kees Bos. + +- Issue #26864: In urllib, change the proxy bypass host checking against + no_proxy to be case-insensitive, and to not match unrelated host names that + happen to have a bypassed hostname as a suffix. Patch by Xiang Zhang. + +- Issue #26804: urllib will prefer lower_case proxy environment variables over + UPPER_CASE or Mixed_Case ones. Patch contributed by Hans-Peter Jansen. + +- Issue #26837: assertSequenceEqual() now correctly outputs non-stringified + differing items. This affects assertListEqual() and assertTupleEqual(). + +- Issue #26822: itemgetter, attrgetter and methodcaller objects no longer + silently ignore keyword arguments. + +- Issue #26657: Fix directory traversal vulnerability with SimpleHTTPServer + on Windows. This fixes a regression that was introduced in 2.7.7. Based + on patch by Philipp Hagemeister. + +- Issue #19377: Add .svg to mimetypes.types_map. + +- Issue #13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson. + +- Issue #16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'. + +- Issue #23735: Handle terminal resizing with Readline 6.3+ by installing our + own SIGWINCH handler. Patch by Eric Price. + +- Issue #26644: Raise ValueError rather than SystemError when a negative + length is passed to SSLSocket.recv() or read(). + +- Issue #23804: Fix SSL recv(0) and read(0) methods to return zero bytes + instead of up to 1024. + +- Issue #24266: Ctrl+C during Readline history search now cancels the search + mode when compiled with Readline 7. + +- Issue #23857: Implement PEP 493, adding a Python-2-only ssl module API and + environment variable to configure the default handling of SSL/TLS certificates + for HTTPS connections. + +- Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store + is empty. Patch by Baji. + +- Issue #26513: Fixes platform module detection of Windows Server + +- Issue #23718: Fixed parsing time in week 0 before Jan 1. Original patch by + Tamás Bence Gedai. + +- Issue #26177: Fixed the keys() method for Canvas and Scrollbar widgets. + +- Issue #15068: Got rid of excessive buffering in the fileinput module. + The bufsize parameter is no longer used. + +- Issue #2202: Fix UnboundLocalError in + AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu Dupuy. + +- Issue #26475: Fixed debugging output for regular expressions with the (?x) + flag. + +- Issue #26385: Remove the file if the internal fdopen() call in + NamedTemporaryFile() fails. Based on patch by Silent Ghost. + +- Issue #26309: In the "socketserver" module, shut down the request (closing + the connected socket) when verify_request() returns false. Based on patch + by Aviv Palivoda. + +- Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates. + +- Issue #24303: Fix random EEXIST upon multiprocessing semaphores creation with + Linux PID namespaces enabled. + +- Issue #25698: Importing module if the stack is too deep no longer replaces + imported module with the empty one. + +- Issue #12923: Reset FancyURLopener's redirect counter even if there is an + exception. Based on patches by Brian Brazil and Daniel Rocco. + +- Issue #25945: 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. + +- Issue #19883: Fixed possible integer overflows in zipimport. + +- Issue #26147: xmlrpclib now works with unicode not encodable with used + non-UTF-8 encoding. + +- Issue #16620: Fixed AttributeError in msilib.Directory.glob(). + +- Issue #21847: Fixed xmlrpclib on Unicode-disabled builds. + +- Issue #6500: Fixed infinite recursion in urllib2.Request.__getattr__(). + +- Issue #26083: Workaround a subprocess bug that raises an incorrect + "ValueError: insecure string pickle" exception instead of the actual + exception on some platforms such as Mac OS X when an exception raised + in the forked child process prior to the exec() was large enough that + it overflowed the internal errpipe_read pipe buffer. + +- Issue #24103: Fixed possible use after free in ElementTree.iterparse(). + +- Issue #20954: _args_from_interpreter_flags used by multiprocessing and some + tests no longer behaves incorrectly in the presence of the PYTHONHASHSEED + environment variable. + +- Issue #14285: When executing a package with the "python -m package" option, + and package initialization raises ImportError, a proper traceback is now + reported. + +- Issue #6478: _strptime's regexp cache now is reset after changing timezone + with time.tzset(). + +- Issue #25718: Fixed copying object with state with boolean value is false. + +- Issue #25742: :func:`locale.setlocale` now accepts a Unicode string for + its second parameter. + +- Issue #10131: Fixed deep copying of minidom documents. Based on patch + by Marian Ganisin. + +- Issue #25725: Fixed a reference leak in cPickle.loads() when unpickling + invalid data including tuple instructions. + +- Issue #25663: In the Readline completer, avoid listing duplicate global + names, and search the global namespace before searching builtins. + +- Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error. + +- Issue #23914: Fixed SystemError raised by CPickle unpickler on broken data. + +- Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on + OS X versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis. + +- Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on + current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis. + +IDLE +---- + +- Issue #26673: When tk reports font size as 0, change to size 10. + Such fonts on Linux prevented the configuration dialog from opening. + +- Issue #27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks. + +- In the 'IDLE-console differences' section of the IDLE doc, clarify + how running with IDLE affects sys.modules and the standard streams. + +- Issue #25507: fix incorrect change in IOBinding that prevented printing. + Change also prevented saving shell window with non-ascii characters. + Augment IOBinding htest to include all major IOBinding functions. + +- Issue #25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION + MARK in README.txt and open this and NEWS.txt with 'ascii'. + Re-encode CREDITS.txt to utf-8 and open it with 'utf-8'. + +- Issue #26417: Prevent spurious errors and incorrect defaults when + installing IDLE 2.7 on OS X: default configuration settings are + no longer installed from OS X specific copies. + +Documentation +------------- + +- Issue #26736: Used HTTPS for external links in the documentation if possible. + +- Issue #6953: Rework the Readline module documentation to group related + functions together, and add more details such as what underlying Readline + functions and variables are accessed. + +Tests +----- + +- Issue #25940: Changed test_ssl to use self-signed.pythontest.net. This + avoids relying on svn.python.org, which recently changed root certificate. + +- Issue #25616: Tests for OrderedDict are extracted from test_collections + into separate file test_ordered_dict. + +Build +----- + +- Issue #22359: Avoid incorrect recursive $(MAKE), and disable the rules for + running pgen when cross-compiling. The pgen output is normally saved with + the source code anyway, and is still regenerated when doing a native build. + Patch by Jonas Wagner and Xavier de Gaye. + +- Issue #19450: Update Windows builds to use SQLite 3.8.11.0. + +- Issue #17603: Avoid error about nonexistant fileblocks.o file by using a + lower-level check for st_blocks in struct stat. + +- Issue #26465: Update Windows builds to use OpenSSL 1.0.2g. + +- Issue #24421: Compile Modules/_math.c once, before building extensions. + Previously it could fail to compile properly if the math and cmath builds + were concurrent. + +- Issue #25824: Fixes sys.winver to not include any architecture suffix. + +- Issue #25348: Added ``--pgo`` and ``--pgo-job`` arguments to + ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The + old ``PCbuild\build_pgo.bat`` script is now deprecated, and simply calls + ``PCbuild\build.bat --pgo %*``. + +- Issue #25827: Add support for building with ICC to ``configure``, including + a new ``--with-icc`` flag. + +- Issue #25696: Fix installation of Python on UNIX with make -j9. + +- Issue #26465: Update OS X 10.5+ 32-bit-only installer to build + and link with OpenSSL 1.0.2g. + +- Issue #26268: Update Windows builds to use OpenSSL 1.0.2f. + +- Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries. + +Tools/Demos +----------- + +- Issue #26799: Fix python-gdb.py: don't get C types once when the Python code + is loaded, but get C types on demand. The C types can change if + python-gdb.py is loaded before the Python executable. Patch written by Thomas + Ilsche. + +C API +----- + +- Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++. + Patch by Jeroen Demeyer. + + +What's New in Python 2.7.11? +============================ + +*Release date: XXXX-XX-XX* + +Core and Builtins +----------------- + +- Issue #21167: NAN operations are now handled correctly when python is + compiled with ICC even if -fp-model strict is not specified. + +- Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray + object now always allocates place for trailing null byte and it's buffer now + is always null-terminated. + +- Issue #19543: encode() and decode() methods and constructors of str, + unicode and bytearray classes now emit deprecation warning for known + non-text encodings when Python is ran with the -3 option. + +- Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(), + PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() + to check for and handle errors correctly. + +- Issue #4753: On compilers where it is supported, use "computed gotos" for + bytecode dispatch in the interpreter. This improves interpretation + performance. + +- Issue #22939: Fixed integer overflow in iterator object. Original patch by + Clement Rouault. + +- Issue #24102: Fixed exception type checking in standard error handlers. + +Library +------- + +- Issue #24684: socket.socket.getaddrinfo() now calls + PyUnicode_AsEncodedString() instead of calling the encode() method of the + host, to handle correctly custom unicode string with an encode() method + which doesn't return a byte string. The encoder of the IDNA codec is now + called directly instead of calling the encode() method of the string. + +- Issue #24982: shutil.make_archive() with the "zip" format now adds entries + for directories (including empty directories) in ZIP file. + +- Issue #17849: Raise a sensible exception if an invalid response is + received for a HTTP tunnel request, as seen with some servers that + do not support tunnelling. Initial patch from Cory Benfield. + +- Issue #16180: Exit pdb if file has syntax error, instead of trapping user + in an infinite loop. Patch by Xavier de Gaye. + +- Issue #22812: Fix unittest discovery examples. + Patch from Pam McA'Nulty. + +- Issue #24634: Importing uuid should not try to load libc on Windows + +- Issue #23652: Make it possible to compile the select module against the + libc headers from the Linux Standard Base, which do not include some + EPOLL macros. Initial patch by Matt Frank. + +- Issue #15138: Speed up base64.urlsafe_b64{en,de}code considerably. + +- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch + written by Matthieu Gautier. + +- Issue #23254: Document how to close the TCPServer listening socket. + Patch from Martin Panter. + +- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella. + +- Issue #24613: Calling array.fromstring() with self is no longer allowed + to prevent the use-after-free error. Patch by John Leitch. + +- Issue #24708: Fix possible integer overflow in strop.replace(). + +- Issue #24620: Random.setstate() now validates the value of state last element. + +- Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. + +- Issue #24611: Fixed compiling the posix module on non-Windows platforms + without mknod() or makedev() (e.g. on Unixware). + +- Issue #18684: Fixed reading out of the buffer in the re module. + +- Issue #24259: tarfile now raises a ReadError if an archive is truncated + inside a data segment. + +- Issue #24514: tarfile now tolerates number fields consisting of only + whitespace. + +- Issue #20387: Restore semantic round-trip correctness in tokenize/untokenize + for tab-indented blocks. + +- Issue #24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm() + functions of the audioop module. Fixed SystemError when the state is not a + tuple. Fixed possible memory leak. + +- Issue #24481: Fix possible memory corruption with large profiler info strings + in hotshot. + +- Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar(). + +- Issue #19543: io.TextIOWrapper (and hence io.open()) now uses the internal + codec marking system added to emit deprecation warning for known non-text + encodings at stream construction time when Python is ran with the -3 option. + +- Issue #24264: Fixed buffer overflow in the imageop module. + +- Issue #5633: Fixed timeit when the statement is a string and the setup is not. + +- Issue #24326: Fixed audioop.ratecv() with non-default weightB argument. + Original patch by David Moore. + +- Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port + value in the host header was set to "None". Patch by Demian Brecht. + +- Issue #24257: Fixed segmentation fault in sqlite3.Row constructor with faked + cursor type. + +- Issue #24286: Dict view were not registered with the MappingView abstract + base classes. This caused key and item views in OrderedDict to not be equal + to their regular dict counterparts. + +- Issue #22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again + when a directory with the chosen name already exists on Windows as well as + on Unix. tempfile.mkstemp() now fails early if parent directory is not + valid (not exists or is a file) on Windows. + +- Issue #6598: Increased time precision and random number range in + email.utils.make_msgid() to strengthen the uniqueness of the message ID. + +- Issue #24091: Fixed various crashes in corner cases in cElementTree. + +- Issue #15267: HTTPConnection.request() now is compatibile with old-style + classes (such as TemporaryFile). Original patch by Atsuo Ishimoto. + +- Issue #20014: array.array() now accepts unicode typecodes. Based on patch by + Vajrasky Kok. + +- Issue #23637: Showing a warning no longer fails with UnicodeErrror. + Formatting unicode warning in the file with the path containing non-ascii + characters no longer fails with UnicodeErrror. + +- Issue #24134: Reverted issue #24134 changes. + +Build +----- + +- Issue #24915: When doing a PGO build, the test suite is now used instead of + pybench; Clang support was also added as part off this work. + +- Issue #24986: It is now possible to build Python on Windows without errors + when external libraries are not available. + +- Issue #24508: Backported the MSBuild project files from Python 3.5. The + backported files replace the old project files in PCbuild; the old files moved + to PC/VS9.0 and remain supported. + +- Issue #24603: Update Windows builds and OS X 10.5 installer to use OpenSSL + 1.0.2d. + +IDLE +---- + +- Issue #23672: Allow Idle to edit and run files with astral chars in name. + Patch by Mohd Sanad Zaki Rizvi. + +- Issue 24745: Idle editor default font. Switch from Courier to + platform-sensitive TkFixedFont. This should not affect current customized + font selections. If there is a problem, edit $HOME/.idlerc/config-main.cfg + and remove 'fontxxx' entries from [Editor Window]. Patch by Mark Roseman. + +- Issue #21192: Idle editor. When a file is run, put its name in the restart bar. + Do not print false prompts. Original patch by Adnan Umer. + +- Issue #13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy. + +- Issue #15809: IDLE shell now uses locale encoding instead of Latin1 for + decoding unicode literals. + +Documentation +------------- + +- Issue #24952: Clarify the default size argument of stack_size() in + the "threading" and "thread" modules. Patch from Mattip. + +- Issue #20769: Improve reload() docs. Patch by Dorian Pula. + +- Issue #23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan. + +- Issue #22155: Add File Handlers subsection with createfilehandler to Tkinter + doc. Remove obsolete example from FAQ. Patch by Martin Panter. + +Tests +----- + +- Issue #24751: When running regrtest with the ``-w`` command line option, + a test run is no longer marked as a failure if all tests succeed when + re-run. + +- PCbuild\rt.bat now accepts an unlimited number of arguments to pass along + to regrtest.py. Previously there was a limit of 9. + +Windows +------- + +- Issue #25022: Removed very outdated PC/example_nt/ directory. + + +What's New in Python 2.7.10? +============================ + +*Release date: 2015-05-23* + +Library +------- + +- Issue #22931: Allow '[' and ']' in cookie values. + + +What's New in Python 2.7.10 release candidate 1? +================================================ + +*Release date: 2015-05-10* + +Core and Builtins +----------------- + +- Issue #23971: Fix underestimated presizing in dict.fromkeys(). + +- Issue #23757: PySequence_Tuple() incorrectly called the concrete list API + when the data was a list subclass. + +- Issue #23629: Fix the default __sizeof__ implementation for variable-sized + objects. + +- Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV. Analysis + and fix by Guido Vranken. + +- Issue #23048: Fix jumping out of an infinite while loop in the pdb. + +Library +------- + +- The keywords attribute of functools.partial is now always a dictionary. + +- Issue #20274: When calling a _sqlite.Connection, it now complains if passed + any keyword arguments. Previously it silently ignored them. + +- Issue #20274: Remove ignored and erroneous "kwargs" parameters from three + METH_VARARGS methods on _sqlite.Connection. + +- Issue #24134: assertRaises() and assertRaisesRegexp() checks are not longer + successful if the callable is None. + +- Issue #23008: Fixed resolving attributes with boolean value is False in pydoc. + +- Issues #24099, #24100, and #24101: Fix use-after-free bug in heapq's siftup + and siftdown functions. + +- Backport collections.deque fixes from Python 3.5. Prevents reentrant badness + during deletion by deferring the decref until the container has been restored + to a consistent state. + +- Issue #23842: os.major(), os.minor() and os.makedev() now support ints again. + +- Issue #23811: Add missing newline to the PyCompileError error message. + Patch by Alex Shkop. + +- Issue #17898: Fix exception in gettext.py when parsing certain plural forms. + +- Issue #23865: close() methods in multiple modules now are idempotent and more + robust at shutdown. If they need to release multiple resources, all are + released even if errors occur. + +- Issue #23881: urllib.ftpwrapper constructor now closes the socket if the FTP + connection failed. + +- Issue #15133: _tkinter.tkapp.getboolean() now supports long and Tcl_Obj and + always returns bool. tkinter.BooleanVar now validates input values (accepted + bool, int, long, str, unicode, and Tcl_Obj). tkinter.BooleanVar.get() now + always returns bool. + +- Issue #23338: Fixed formatting ctypes error messages on Cygwin. + Patch by Makoto Kato. + +- Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and + arbitrary precision integers added in Tcl 8.5. + +- Issue #23834: Fix socket.sendto(), use the C long type to store the result of + sendto() instead of the C int type. + +- Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. + +- Issue #23838: linecache now clears the cache and returns an empty result on + MemoryError. + +- Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. + +- Issue #21802: The reader in BufferedRWPair now is closed even when closing + writer failed in BufferedRWPair.close(). + +- Issue #23671: string.Template now allows to specify the "self" parameter as + keyword argument. string.Formatter now allows to specify the "self" and + the "format_string" parameters as keyword arguments. + +- Issue #21560: An attempt to write a data of wrong type no longer cause + GzipFile corruption. Original patch by Wolfgang Maier. + +- Issue #23647: Increase impalib's MAXLINE to accommodate modern mailbox sizes. + +- Issue #23539: If body is None, http.client.HTTPConnection.request now sets + Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors from + some web servers. + +- Issue #23136: _strptime now uniformly handles all days in week 0, including + Dec 30 of previous year. Based on patch by Jim Carroll. + +- Issue #23138: Fixed parsing cookies with absent keys or values in cookiejar. + Patch by Demian Brecht. + +- Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now + handle exceptions raised by an iterator. Patch by Alon Diamant and Davin + Potts. + +- Issue #22928: Disabled HTTP header injections in httplib. + Original patch by Demian Brecht. + +- Issue #23615: Module tarfile is now can be reloaded with imp.reload(). + +- Issue #22853: Fixed a deadlock when use multiprocessing.Queue at import time. + Patch by Florian Finkernagel and Davin Potts. + +- Issue #23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST + flag on certificate stores when it is available. + +- Issue #23576: Avoid stalling in SSL reads when EOF has been reached in the + SSL layer but the underlying connection hasn't been closed. + +- Issue #23504: Added an __all__ to the types module. + +- Issue #23458: On POSIX, the file descriptor kept open by os.urandom() is now + set to non inheritable + +- Issue #22113: struct.pack_into() now supports new buffer protocol (in + particular accepts writable memoryview). + +- Issues #814253, #9179: Warnings now are raised when group references and + conditional group references are used in lookbehind assertions in regular + expressions. + +- Issue #23215: Multibyte codecs with custom error handlers that ignores errors + consumed too much memory and raised SystemError or MemoryError. + Original patch by Aleksi Torhamo. + +- Issue #5700: io.FileIO() called flush() after closing the file. + flush() was not called in close() if closefd=False. + +- Issue #21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty + docstrings. Initial patch by Yuyang Guo. + +- Issue #22885: Fixed arbitrary code execution vulnerability in the dumbdbm + module. Original patch by Claudiu Popa. + +- Issue #23481: Remove RC4 from the SSL module's default cipher list. + +- Issue #21849: Fixed xmlrpclib serialization of non-ASCII unicode strings in + the multiprocessing module. + +- Issue #21840: Fixed expanding unicode variables of form $var in + posixpath.expandvars(). Fixed all os.path implementations on + unicode-disabled builds. + +- Issue #23367: Fix possible overflows in the unicodedata module. + +- Issue #23363: Fix possible overflow in itertools.permutations. + +- Issue #23364: Fix possible overflow in itertools.product. + +- Issue #23365: Fixed possible integer overflow in + itertools.combinations_with_replacement. + +- Issue #23366: Fixed possible integer overflow in itertools.combinations. + +- Issue #23191: fnmatch functions that use caching are now threadsafe. + +- Issue #18518: timeit now rejects statements which can't be compiled outside + a function or a loop (e.g. "return" or "break"). + +- Issue #19996: Make :mod:`httplib` ignore headers with no name rather than + assuming the body has started. + +- Issue #20188: Support Application-Layer Protocol Negotiation (ALPN) in the ssl + module. + +- Issue #23248: Update ssl error codes from latest OpenSSL git master. + +- Issue #23098: 64-bit dev_t is now supported in the os module. + +- Issue #23063: In the disutils' check command, fix parsing of reST with code or + code-block directives. + +- Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The + availability of the function is checked during the compilation. Patch written + by Bernard Spil. + +- Backport the context argument to ftplib.FTP_TLS. + +- Issue #23111: Maximize compatibility in protocol versions of ftplib.FTP_TLS. + +- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and + fragment when it redirects to add a trailing slash. + +- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(), + instead of reading /dev/urandom, to get pseudo-random bytes. + +- Issue #23093: In the io, module allow more operations to work on detached + streams. + +- Issue #23071: Added missing names to codecs.__all__. Patch by Martin Panter. + +- Issue #23016: A warning no longer produces an AttributeError when sys.stderr + is None. + +- Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails. + Original patch by Martin Panter. + +- Issue #22609: Constructors and update methods of mapping classes in the + collections module now accept the self keyword argument. + +Documentation +------------- + +- Issue #23006: Improve the documentation and indexing of dict.__missing__. + Add an entry in the language datamodel special methods section. + Revise and index its discussion in the stdtypes mapping/dict section. + Backport the code example from 3.4. + +- Issue #21514: The documentation of the json module now refers to new JSON RFC + 7159 instead of obsoleted RFC 4627. + +Tools/Demos +----------- + +- Issue #23330: h2py now supports arbitrary filenames in #include. + +- Issue #6639: Module-level turtle functions no longer raise TclError after + closing the window. + +- Issue #22314: pydoc now works when the LINES environment variable is set. + +- Issue #18905: "pydoc -p 0" now outputs actually used port. Based on patch by + Wieland Hoffmann. + +- Issue #23345: Prevent test_ssl failures with large OpenSSL patch level + values (like 0.9.8zc). + +Tests +----- + +- Issue #23799: Added test.test_support.start_threads() for running and + cleaning up multiple threads. + +- Issue #22390: test.regrtest now emits a warning if temporary files or + directories are left after running a test. + +- Issue #23583: Added tests for standard IO streams in IDLE. + +- Issue #23392: Added tests for marshal C API that works with FILE*. + +- Issue #18982: Add tests for CLI of the calendar module. + +- Issue #19949: The test_xpickle test now tests compatibility with installed + Python 2.7 and reports skipped tests. Based on patch by Zachary Ware. + +- Issue #11578: Backported test for the timeit module. + +- Issue #22943: bsddb tests are locale independend now. + +IDLE +---- + +- Issue #23583: Fixed writing unicode to standard output stream in IDLE. + +- Issue #20577: Configuration of the max line length for the FormatParagraph + extension has been moved from the General tab of the Idle preferences dialog + to the FormatParagraph tab of the Config Extensions dialog. + Patch by Tal Einat. + +- Issue #16893: Update Idle doc chapter to match current Idle and add new + information. + +- Issue #23180: Rename IDLE "Windows" menu item to "Window". + Patch by Al Sweigart. + +Build +----- + +- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure + script. + +- Issue #23032: Fix installer build failures on OS X 10.4 Tiger + by disabling assembly code in the OpenSSL build. + +- Issue #23686: Update OS X 10.5 installer and Windows builds to use + OpenSSL 1.0.2a. + +C API +----- + +- Issue #23998: PyImport_ReInitLock() now checks for lock allocation error + +- Issue #22079: PyType_Ready() now checks that statically allocated type has + no dynamically allocated bases. + + +What's New in Python 2.7.9? +=========================== + +*Release date: 2014-12-10* + +Library +------- + +- Issue #22959: Remove the *check_hostname* parameter of + httplib.HTTPSConnection. The *context* parameter should be used instead. + +- Issue #16043: Add a default limit for the amount of data xmlrpclib.gzip_decode + will return. This resolves CVE-2013-1753. + +- Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by limiting + the call to readline(). Original patch by Christian Heimes. + +- Issue #16041: In poplib, limit maximum line length read from the server to + prevent CVE-2013-1752. + +- Issue #22960: Add a context argument to xmlrpclib.ServerProxy. + +Build +----- + +- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support + SSL 3. + +- Issue #17128: Use private version of OpenSSL for 2.7.9 OS X 10.5+ installer. + + +What's New in Python 2.7.9 release candidate 1? +=============================================== + +*Release date: 2014-11-25* + +Core and Builtins +----------------- + +- Issue #21963: backout issue #1856 patch (avoid crashes and lockups when + daemon threads run while the interpreter is shutting down; instead, these + threads are now killed when they try to take the GIL), as it seems to + break some existing code. + +- Issue #22604: Fix assertion error in debug mode when dividing a complex + number by (nan+0j). + +- Issue #22470: Fixed integer overflow issues in "backslashreplace" and + "xmlcharrefreplace" error handlers. + +- Issue #22526: Fix iterating through files with lines longer than 2^31 bytes. + +- Issue #22519: Fix overflow checking in PyString_Repr. + +- Issue #22518: Fix integer overflow issues in latin-1 encoding. + +- Issue #22379: Fix empty exception message in a TypeError raised in + ``str.join``. + +- Issue #22221: Now the source encoding declaration on the second line isn't + effective if the first line contains anything except a comment. + +- Issue #22023: Fix ``%S``, ``%R`` and ``%V`` formats of + :c:func:`PyUnicode_FromFormat`. + +- Issue #21591: Correctly handle qualified exec statements in tuple form by + moving compatibility layer from run-time to AST transformation. + +Library +------- + +- Issue #22417: Verify certificates by default in httplib (PEP 476). + +- Issue #22927: Allow urllib.urlopen to take a *context* parameter to control + SSL settings for HTTPS connections. + +- Issue #22921: Allow SSLContext to take the *hostname* parameter even if + OpenSSL doesn't support SNI. + +- Issue #9003 and #22366: httplib.HTTPSConnection, urllib2.HTTPSHandler and + urllib2.urlopen now take optional arguments to allow for server certificate + checking, as recommended in public uses of HTTPS. This backport is part of PEP + 467. + +- Issue #12728: Different Unicode characters having the same uppercase but + different lowercase are now matched in case-insensitive regular expressions. + +- Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian + platforms. + +- Issue #17293: uuid.getnode() now determines MAC address on AIX using netstat. + Based on patch by Aivars Kalvāns. + +- Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments. + +- Issue #22787: Allow the keyfile argument of SSLContext.load_cert_chain to be + None. + +- Issue #22775: Fixed unpickling of Cookie.SimpleCookie with protocol 2. + Patch by Tim Graham. + +- Issue #22776: Brought excluded code into the scope of a try block in + SysLogHandler.emit(). + +- Issue #17381: Fixed ranges handling in case-insensitive regular expressions. + +- Issue #19329: Optimized compiling charsets in regular expressions. + +- Issue #22410: Module level functions in the re module now cache compiled + locale-dependent regular expressions taking into account the locale. + +- Issue #8876: distutils now falls back to copying files when hard linking + doesn't work. This allows use with special filesystems such as VirtualBox + shared folders. + +- Issue #9351: Defaults set with set_defaults on an argparse subparser + are no longer ignored when also set on the parent parser. + +- Issue #20421: Add a .version() method to SSL sockets exposing the actual + protocol version in use. + +- Issue #22435: Fix a file descriptor leak when SocketServer bind fails. + +- Issue #13664: GzipFile now supports non-ascii Unicode filenames. + +- Issue #13096: Fixed segfault in CTypes POINTER handling of large + values. + +- Issue #11694: Raise ConversionError in xdrlib as documented. Patch + by Filip Gruszczyński and Claudiu Popa. + +- Issue #1686: Fix string.Template when overriding the pattern attribute. + +- Issue #11866: Eliminated race condition in the computation of names + for new threads. + +- Issue #22219: The zipfile module CLI now adds entries for directories + (including empty directories) in ZIP file. + +- Issue #22449: In the ssl.SSLContext.load_default_certs, consult the + enviromental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows. + +- Issue #8473: doctest.testfile now uses universal newline mode to read + the test file. + +- Issue #20076: Added non derived UTF-8 aliases to locale aliases table. + +- Issue #20079: Added locales supported in glibc 2.18 to locale alias table. + +- Issue #22530: Allow the ``group()`` method of regular expression match objects + to take a ``long`` as an index. + +- Issue #22517: When a io.BufferedRWPair object is deallocated, clear its + weakrefs. + +- Issue #10510: distutils register and upload methods now use HTML standards + compliant CRLF line endings. + +- Issue #9850: Fixed macpath.join() for empty first component. Patch by + Oleg Oshmyan. + +- Issue #20912: Now directories added to ZIP file have correct Unix and MS-DOS + directory attributes. + +- Issue #21866: ZipFile.close() no longer writes ZIP64 central directory + records if allowZip64 is false. + +- Issue #22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re + module. + +- Issue #22423: Unhandled exception in thread no longer causes unhandled + AttributeError when sys.stderr is None. + +- Issue #22419: Limit the length of incoming HTTP request in wsgiref server to + 65536 bytes and send a 414 error code for higher lengths. Patch contributed + by Devin Cook. + +- Lax cookie parsing in http.cookies could be a security issue when combined + with non-standard cookie handling in some Web browsers. Reported by + Sergey Bobrov. + +- Issue #21147: sqlite3 now raises an exception if the request contains a null + character instead of truncate it. Based on patch by Victor Stinner. + +- Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with + empty string or tuple argument. + +- Issue #21951: Tkinter now most likely raises MemoryError instead of crash + if the memory allocation fails. + +- Issue #22226: First letter no longer is stripped from the "status" key in + the result of Treeview.heading(). + +- Issue #22051: turtledemo no longer reloads examples to re-run them. + Initialization of variables and gui setup should be done in main(), + which is called each time a demo is run, but not on import. + +- Issue #21597: The separator between the turtledemo text pane and the drawing + canvas can now be grabbed and dragged with a mouse. The code text pane can + be widened to easily view or copy the full width of the text. The canvas + can be widened on small screens. Original patches by Jan Kanis and Lita Cho. + +- Issue #18132: Turtledemo buttons no longer disappear when the window is + shrunk. Original patches by Jan Kanis and Lita Cho. + +- Issue #22312: Fix ntpath.splitdrive IndexError. + +- Issue #22216: smtplib now resets its state more completely after a quit. The + most obvious consequence of the previous behavior was a STARTTLS failure + during a connect/starttls/quit/connect/starttls sequence. + +- Issue #21305: os.urandom now caches a fd to /dev/urandom. This is a PEP 466 + backport from Python 3. + +- Issue #21307: As part of PEP 466, backport hashlib.algorithms_guaranteed and + hashlib.algorithms_available. + +- Issue #22259: Fix segfault when attempting to fopen a file descriptor + corresponding to a directory. + +- Issue #22236: Fixed Tkinter images copying operations in NoDefaultRoot mode. + +- Issue #22191: Fixed warnings.__all__. + +- Issue #21308: Backport numerous features from Python's ssl module. This is + part of PEP 466. + +- Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. + +- Issue #8797: Raise HTTPError on failed Basic Authentication immediately. + Initial patch by Sam Bull. + +- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter. + +- Issue #21448: Changed FeedParser feed() to avoid O(N**2) behavior when + parsing long line. Original patch by Raymond Hettinger. + +- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on + AIX. Based on patch by Delhallt. + +- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular + when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the + __new__() method. + +- Issue #16037: HTTPMessage.readheaders() raises an HTTPException when more + than 100 headers are read. Patch by Jyrki Pulliainen and Daniel Eriksson. + +- Issue #21580: Now Tkinter correctly handles binary "data" and "maskdata" + configure options of tkinter.PhotoImage. + +- Issue #19612: subprocess.communicate() now also ignores EINVAL when using at + least two pipes. + +- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError + on closed socket. + +- Issue #16133: The asynchat.async_chat.handle_read() method now ignores + socket.error() exceptions with blocking I/O errors: EAGAIN, EALREADY, + EINPROGRESS, or EWOULDBLOCK. + +- Issue #21990: Clean-up unnecessary and slow inner class definition in + saxutils (Contributed by Alex Gaynor). + +- Issue #1730136: Fix the comparison between a tkFont.Font and an object of + another kind. + +- Issue #19884: readline: Disable the meta modifier key if stdout is not + a terminal to not write the ANSI sequence "\033[1034h" into stdout. This + sequence is used on some terminal (ex: TERM=xterm-256color") to enable + support of 8 bit characters. + +- Issue #22017: Correct reference counting errror in the initialization of the + _warnings module. + +- Issue #21868: Prevent turtle crash when undo buffer set to a value less + than one. + +- Issue #21151: Fixed a segfault in the _winreg module when ``None`` is passed + as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman. + +- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, + it ignored I/O errors if at least the first C call read() succeed. + +- Issue #19870: BaseCookie now parses 'secure' and 'httponly' flags. + Backport of issue #16611. + +- Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler + due to possible uninitialized _config_vars. + +- Issue #21323: Fix CGIHTTPServer to again handle scripts in CGI subdirectories, + broken by the fix for security issue #19435. Patch by Zach Byrne. + +- Issue #22199: Make get_makefile_filename() available in Lib/sysconfig.py + for 2.7 to match other versions of sysconfig. + +IDLE +---- + +- Issue #3068: Add Idle extension configuration dialog to Options menu. + Changes are written to HOME/.idlerc/config-extensions.cfg. + Original patch by Tal Einat. + +- Issue #16233: A module browser (File : Class Browser, Alt+C) requires a + editor window with a filename. When Class Browser is requested otherwise, + from a shell, output window, or 'Untitled' editor, Idle no longer displays + an error box. It now pops up an Open Module box (Alt+M). If a valid name + is entered and a module is opened, a corresponding browser is also opened. + +- Issue #4832: Save As to type Python files automatically adds .py to the + name you enter (even if your system does not display it). Some systems + automatically add .txt when type is Text files. + +- Issue #21986: Code objects are not normally pickled by the pickle module. + To match this, they are no longer pickled when running under Idle. + +- Issue #22221: IDLE now ignores the source encoding declaration on the second + line if the first line contains anything except a comment. + +- Issue #17390: Adjust Editor window title; remove 'Python', + move version to end. + +- Issue #14105: Idle debugger breakpoints no longer disappear + when inseting or deleting lines. + +Extension Modules +----------------- + +- Issue #22381: Update zlib to 1.2.8. + +- Issue #22176: Update the ctypes module's libffi to v3.1. This release + adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian + architectures. + +Tools/Demos +----------- + +- Issue #10712: 2to3 has a new "asserts" fixer that replaces deprecated names + of unittest methods (e.g. failUnlessEqual -> assertEqual). + +- Issue #22221: 2to3 and the findnocoding.py script now ignore the source + encoding declaration on the second line if the first line contains anything + except a comment. + +- Issue #22201: Command-line interface of the zipfile module now correctly + extracts ZIP files with directory entries. Patch by Ryan Wilson. + +Tests +----- + +- Issue #22236: Tkinter tests now don't reuse default root window. New root + window is created for every test class. + +- Issue #18004: test_overflow in test_list by mistake consumed 40 GiB of memory + on 64-bit systems. + +- Issue #21976: Fix test_ssl to accept LibreSSL version strings. Thanks + to William Orr. + +- Issue #22770: Prevent some Tk segfaults on OS X when running gui tests. + +Build +----- + +- Issue #20221: Removed conflicting (or circular) hypot definition when + compiled with VS 2010 or above. Initial patch by Tabrez Mohammed. + +- Issue #16537: Check whether self.extensions is empty in setup.py. Patch by + Jonathan Hosmer. + +- The documentation Makefile no longer automatically downloads Sphinx. Users are + now required to have Sphinx already installed to build the documentation. + +- Issue #21958: Define HAVE_ROUND when building with Visual Studio 2013 and + above. Patch by Zachary Turner. + +- Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/ + now display special message when and only when there are failures. + +- Issue #21166: Prevent possible segfaults and other random failures of + python --generate-posix-vars in pybuilddir.txt build target. + +- Issue #18096: Fix library order returned by python-config. + +- Issue #17219: Add library build dir for Python extension cross-builds. + +- Issue #22877: PEP 477 - OS X installer now installs pip. + +- Issue #22878: PEP 477 - "make install" and "make altinstall" can now install + or upgrade pip, using the bundled pip provided by the backported ensurepip + module. A configure option, --with-ensurepip[=upgrade|install|no], is + available to set the option for subsequent installs; the default for Python 2 + in "no" (do not install or upgrade pip). The option can also be set with + "make [alt]install ENSUREPIP=[upgrade|install|no]". + +Windows +------- + +- Issue #17896: The Windows build scripts now expect external library sources + to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``. + +- Issue #17717: The Windows build scripts now use a copy of NASM pulled from + svn.python.org to build OpenSSL. + +- Issue #22644: The bundled version of OpenSSL has been updated to 1.0.1j. + + +What's New in Python 2.7.8? +=========================== + +*Release date: 2014-06-29* + +Core and Builtins +----------------- + +- Issue #4346: In PyObject_CallMethod and PyObject_CallMethodObjArgs, don't + overwrite the error set in PyObject_GetAttr. + +- Issue #21831: Avoid integer overflow when large sizes and offsets are given to + the buffer type. CVE-2014-7185. + +- Issue #19656: Running Python with the -3 option now also warns about + non-ascii bytes literals. + +- Issue #21642: If the conditional if-else expression, allow an integer written + with no space between itself and the ``else`` keyword (e.g. ``True if 42else + False``) to be valid syntax. + +- Issue #21523: Fix over-pessimistic computation of the stack effect of + some opcodes in the compiler. This also fixes a quadratic compilation + time issue noticeable when compiling code with a large number of "and" + and "or" operators. + +Library +------- + +- Issue #21652: Prevent mimetypes.type_map from containing unicode keys on + Windows. + +- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure + files closing. + +- Issue #21672: Fix the behavior of ntpath.join on UNC-style paths. + +- Issue #19145: The times argument for itertools.repeat now handles + negative values the same way for keyword arguments as it does for + positional arguments. + +- Issue #21832: Require named tuple inputs to be exact strings. + +- Issue #8343: Named group error messages in the re module did not show + the name of the erroneous group. + +- Issue #21491: SocketServer: Fix a race condition in child processes reaping. + +- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method + cache didn't match the actual result. The former was a list of tuples + and the latter was a list of named tuples. + +- Issue #21722: The distutils "upload" command now exits with a non-zero + return code when uploading fails. Patch by Martin Dengler. + +- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths + before checking for a CGI script at that path. + +- Issue #21310: Fixed possible resource leak in failed open(). + +- Issue #21304: Backport the key derivation function hashlib.pbkdf2_hmac from + Python 3 per PEP 466. + +- Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a + valid file. + +- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods + that use 'self' in the example code is generated correctly. + +- Issue #21552: Fixed possible integer overflow of too long string lengths in + the tkinter module on 64-bit platforms. + +- Issue #14315: The zipfile module now ignores extra fields in the central + directory that are too short to be parsed instead of letting a struct.unpack + error bubble up as this "bad data" appears in many real world zip files in + the wild and is ignored by other zip tools. + +- Issue #21402: Tkinter.ttk now works when default root window is not set. + +- Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr + it supports reverse() and negative indices. Original patch by Claudiu Popa. + +- Issue #8743: Fix interoperability between set objects and the + collections.Set() abstract base class. + +- Issue #21481: Argparse equality and inequality tests now return + NotImplemented when comparing to an unknown type. + +IDLE +---- + +- Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav + Heblikar. + +- Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster. + +- Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar. + +- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav + Heblikar. + +- Issue #12387: Add missing upper(lower)case versions of default Windows key + bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy. + +- Issue #21695: Closing a Find-in-files output window while the search is + still in progress no longer closes Idle. + +- Issue #18910: Add unittest for textView. Patch by Phil Webster. + +- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar. + +- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster. + +Tests +----- + +- Issue #20155: Changed HTTP method names in failing tests in test_httpservers + so that packet filtering software (specifically Windows Base Filtering Engine) + does not interfere with the transaction semantics expected by the tests. + +- Issue #19493: Refactored the ctypes test package to skip tests explicitly + rather than silently. + +- Issue #18492: All resources are now allowed when tests are not run by + regrtest.py. + +- Issue #21605: Added tests for Tkinter images. + +- Issue #21493: Added test for ntpath.expanduser(). Original patch by + Claudiu Popa. + +- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok. + +- Issue #13355: random.triangular() no longer fails with a ZeroDivisionError + when low equals high. + +- Issue #21522: Added Tkinter tests for Listbox.itemconfigure(), + PanedWindow.paneconfigure(), and Menu.entryconfigure(). + +- Issue #20635: Added tests for Tk geometry managers. + +Build +----- + +- Issue #21811: Anticipated fixes to support OS X versions > 10.9. + +Windows +------- + +- Issue #21671, CVE-2014-0224: The bundled version of OpenSSL has been + updated to 1.0.1h. + + +What's New in Python 2.7.7 +========================== + +*Release date: 2014-05-31* + +Build +----- + +- Issue #21462: Build the Windows installers with OpenSSL 1.0.1g. + +- Issue #19866: Include some test data in the Windows installers, so tests don't + fail. + + +What's New in Python 2.7.7 release candidate 1? +=============================================== + +*Release date: 2014-05-17* + +Core and Builtins +----------------- + +- Issue #21350: Fix file.writelines() to accept arbitrary buffer objects, + as advertised. Patch by Brian Kearns. + +- Issue #20437: Fixed 43 potential bugs when deleting objects references. + +- Issue #21134: Fix segfault when str is called on an uninitialized + UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object. + +- Issue #20494: Ensure that free()d memory arenas are really released on POSIX + systems supporting anonymous memory mappings. Patch by Charles-François + Natali. + +- Issue #17825: Cursor "^" is correctly positioned for SyntaxError and + IndentationError. + +- Raise a better error when non-unicode codecs are used for a file's coding + cookie. + +- Issue #17976: Fixed potential problem with file.write() not detecting IO error + by inspecting the return value of fwrite(). Based on patches by Jaakko Moisio + and Victor Stinner. + +- Issue #14432: Generator now clears the borrowed reference to the thread + state. Fix a crash when a generator is created in a C thread that is + destroyed while the generator is still used. The issue was that a generator + contains a frame, and the frame kept a reference to the Python state of the + destroyed C thread. The crash occurs when a trace function is setup. + +- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes. + +- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2 + billion characters) input strings in _Py_dg_strtod. + +- Issue #12546: Allow \x00 to be used as a fill character when using str, int, + float, and complex __format__ methods. + +Library +------- + +- Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial + shape. + +- Issue #7776: Backport Fix ``Host:'' header and reconnection when using + http.client.HTTPConnection.set_tunnel() from Python 3. Patch by Nikolaus + Rath. + +- Issue #21306: Backport hmac.compare_digest from Python 3. This is part of PEP + 466. + +- Issue #21470: Do a better job seeding the random number generator by + using enough bytes to span the full state space of the Mersenne Twister. + +- Issue #21469: Reduced the risk of false positives in robotparser by + checking to make sure that robots.txt has been read or does not exist + prior to returning True in can_fetch(). + +- Issue #21321: itertools.islice() now releases the reference to the source + iterator when the slice is exhausted. Patch by Anton Afanasyev. + +- Issue #9291: Do not attempt to re-encode mimetype data read from registry in + ANSI mode. Initial patches by Dmitry Jemerov & Vladimir Iofik. + +- Issue #21349: Passing a memoryview to _winreg.SetValueEx now correctly raises + a TypeError where it previously crashed the interpreter. Patch by Brian Kearns + +- Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second + parameter. Bug reported by Guido Vranken. + +- Issue #21172: isinstance check relaxed from dict to collections.Mapping. + +- Issue #21191: In os.fdopen, never close the file descriptor when an exception + happens. + +- Issue #21149: Improved thread-safety in logging cleanup during interpreter + shutdown. Thanks to Devin Jeanpierre for the patch. + +- Fix possible overflow bug in strop.expandtabs. You shouldn't be using this + module! + +- Issue #20145: `assertRaisesRegex` now raises a TypeError if the second + argument is not a string or compiled regex. + +- Issue #21058: Fix a leak of file descriptor in tempfile.NamedTemporaryFile(), + close the file descriptor if os.fdopen() fails + +- Issue #20283: RE pattern methods now accept the string keyword parameters + as documented. The pattern and source keyword parameters are left as + deprecated aliases. + +- Issue #11599: When an external command (e.g. compiler) fails, distutils now + prints out the whole command line (instead of just the command name) if the + environment variable DISTUTILS_DEBUG is set. + +- Issue #4931: distutils should not produce unhelpful "error: None" messages + anymore. distutils.util.grok_environment_error is kept but doc-deprecated. + +- Improve the random module's default seeding to use 256 bits of entropy + from os.urandom(). This was already done for Python 3, mildly improving + security with a bigger seed space. + +- Issue #15618: Make turtle.py compatible with 'from __future__ import + unicode_literals'. Initial patch by Juancarlo Añez. + +- Issue #20501: fileinput module no longer reads whole file into memory when using + fileinput.hook_encoded. + +- Issue #6815: os.path.expandvars() now supports non-ASCII Unicode environment + variables names and values. + +- Issue #20635: Fixed grid_columnconfigure() and grid_rowconfigure() methods of + Tkinter widgets to work in wantobjects=True mode. + +- Issue #17671: Fixed a crash when use non-initialized io.BufferedRWPair. + Based on patch by Stephen Tu. + +- Issue #8478: Untokenizer.compat processes first token from iterator input. + Patch based on lines from Georg Brandl, Eric Snow, and Gareth Rees. + +- Issue #20594: Avoid name clash with the libc function posix_close. + +- Issue #19856: shutil.move() failed to move a directory to other directory + on Windows if source name ends with os.altsep. + +- Issue #14983: email.generator now always adds a line end after each MIME + boundary marker, instead of doing so only when there is an epilogue. This + fixes an RFC compliance bug and solves an issue with signed MIME parts. + +- Issue #20013: Some imap servers disconnect if the current mailbox is + deleted, and imaplib did not handle that case gracefully. Now it + handles the 'bye' correctly. + +- Issue #20426: When passing the re.DEBUG flag, re.compile() displays the + debug output every time it is called, regardless of the compilation cache. + +- Issue #20368: The null character now correctly passed from Tcl to Python (in + unicode strings only). Improved error handling in variables-related commands. + +- Issue #20435: Fix _pyio.StringIO.getvalue() to take into account newline + translation settings. + +- Issue #20288: fix handling of invalid numeric charrefs in HTMLParser. + +- Issue #19456: ntpath.join() now joins relative paths correctly when a drive + is present. + +- Issue #8260: The read(), readline() and readlines() methods of + codecs.StreamReader returned incomplete data when were called after + readline() or read(size). Based on patch by Amaury Forgeot d'Arc. + +- Issue #20374: Fix build with GNU readline >= 6.3. + +- Issue #14548: Make multiprocessing finalizers check pid before + running to cope with possibility of gc running just after fork. + (Backport from 3.x.) + +- Issue #20262: Warnings are raised now when duplicate names are added in the + ZIP file or too long ZIP file comment is truncated. + +- Issue #20270: urllib and urlparse now support empty ports. + +- Issue #20243: TarFile no longer raise ReadError when opened in write mode. + +- Issue #20245: The open functions in the tarfile module now correctly handle + empty mode. + +- Issue #20086: Restored the use of locale-independent mapping instead of + locale-dependent str.lower() in locale.normalize(). + +- Issue #20246: Fix buffer overflow in socket.recvfrom_into. + +- Issue #19082: Working SimpleXMLRPCServer and xmlrpclib examples, both in + modules and documentation. + +- Issue #13107: argparse and optparse no longer raises an exception when output + a help on environment with too small COLUMNS. Based on patch by + Elazar Gershuni. + +- Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly + asked for. + +- Issue #20072: Fixed multiple errors in tkinter with wantobjects is False. + +- Issue #1065986: pydoc can now handle unicode strings. + +- Issue #16039: CVE-2013-1752: Change use of readline in imaplib module to + limit line length. Patch by Emil Lind. + +- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl + module, rather than silently let them emit clear text data. + +- Issue #20027: Fixed locale aliases for devanagari locales. + +- Issue #20067: Tkinter variables now work when wantobjects is false. + +- Issue #19020: Tkinter now uses splitlist() instead of split() in configure + methods. + +- Issue #12226: HTTPS is now used by default when connecting to PyPI. + +- Issue #20048: Fixed ZipExtFile.peek() when it is called on the boundary of + the uncompress buffer and read() goes through more than one readbuffer. + +- Issue #20034: Updated alias mapping to most recent locale.alias file + from X.org distribution using makelocalealias.py. + +- Issue #5815: Fixed support for locales with modifiers. Fixed support for + locale encodings with hyphens. + +- Issue #20026: Fix the sqlite module to handle correctly invalid isolation + level (wrong type). + +- Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and + quotechar fields. Original patch by Vajrasky Kok. + +- Issue #19855: uuid.getnode() on Unix now looks on the PATH for the + executables used to find the mac address, with /sbin and /usr/sbin as + fallbacks. + +- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection. + Original patch by Simon Sapin. + +- Issue #19912: Fixed numerous bugs in ntpath.splitunc(). + +- Issue #19623: Fixed writing to unseekable files in the aifc module. + Fixed writing 'ulaw' (lower case) compressed AIFC files. + +- Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX. + Fixed integer overflow in the eventmask parameter. + +- Issue #17200: telnetlib's read_until and expect timeout was broken by the + fix to Issue #14635 in Python 2.7.4 to be interpreted as milliseconds + instead of seconds when the platform supports select.poll (ie: everywhere). + It is now treated as seconds once again. + +- Issue #19099: The struct module now supports Unicode format strings. + +- Issue #19878: Fix segfault in bz2 module after calling __init__ twice with + non-existent filename. Initial patch by Vajrasky Kok. + +- Issue #16373: Prevent infinite recursion for ABC Set class comparisons. + +- Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows a match when + no exception detail exists (no colon following the exception's name, or + a colon does follow but no text follows the colon). + +- Issue #16231: Fixed pickle.Pickler to only fallback to its default pickling + behaviour when Pickler.persistent_id returns None, but not for any other + false values. This allows false values other than None to be used as + persistent IDs. This behaviour is consistent with cPickle. + +- Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with + virtual interface. Original patch by Kent Frazier. + +- Issue #11489: JSON decoder now accepts lone surrogates. + +- Fix test.test_support.bind_port() to not cause an error when Python was + compiled on a system with SO_REUSEPORT defined in the headers but run on + a system with an OS kernel that does not support that new socket option. + +- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on + big-endian platforms. + +- Issue #19449: in csv's writerow, handle non-string keys when generating the + error message that certain keys are not in the 'fieldnames' list. + +- Issue #12853: Fix NameError in distutils.command.upload. + +- Issue #19523: Closed FileHandler leak which occurred when delay was set. + +- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms. + +- Issue #19480: HTMLParser now accepts all valid start-tag names as defined + by the HTML5 standard. + +- Issue #17827: Add the missing documentation for ``codecs.encode`` and + ``codecs.decode``. + +- Issue #6157: Fixed Tkinter.Text.debug(). Original patch by Guilherme Polo. + +- Issue #6160: The bbox() method of tkinter.Spinbox now returns a tuple of + integers instead of a string. Based on patch by Guilherme Polo. + +- Issue #19286: Directories in ``package_data`` are no longer added to + the filelist, preventing failure outlined in the ticket. + +- Issue #6676: Ensure a meaningful exception is raised when attempting + to parse more than one XML document per pyexpat xmlparser instance. + (Original patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with + suggested wording by David Gutteridge) + +- Issue #21311: Avoid exception in _osx_support with non-standard compiler + configurations. Patch by John Szakmeister. + +Tools/Demos +----------- + +- Issue #3561: The Windows installer now has an option, off by default, for + placing the Python installation into the system "Path" environment variable. + This was backported from Python 3.3. + +- Add support for ``yield from`` to 2to3. + +- Add support for the PEP 465 matrix multiplication operator to 2to3. + +- Issue #19936: Added executable bits or shebang lines to Python scripts which + requires them. Disable executable bits and shebang lines in test and + benchmark files in order to prevent using a random system python, and in + source files of modules which don't provide command line interface. + +IDLE +---- + +- Issue #18104: Add idlelib/idle_test/htest.py with a few sample tests to begin + consolidating and improving human-validated tests of Idle. Change other files + as needed to work with htest. Running the module as __main__ runs all tests. + +- Issue #21139: Change default paragraph width to 72, the PEP 8 recommendation. + +- Issue #21284: Paragraph reformat test passes after user changes reformat width. + +- Issue #20406: Use Python application icons for Idle window title bars. + Patch mostly by Serhiy Storchaka. + +- Issue #21029: Occurrences of "print" are now consistently colored as + being a keyword (the colorizer doesn't know if print functions are + enabled in the source). + +- Issue #17721: Remove non-functional configuration dialog help button until we + make it actually gives some help when clicked. Patch by Guilherme Simões. + +- Issue #17390: Add Python version to Idle editor window title bar. + Original patches by Edmond Burnett and Kent Johnson. + +- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line. + +- Issue #19481: print() of unicode, str or bytearray subclass instance in IDLE + no more hangs. + +- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial + shell window is present. + +- Issue #17654: Ensure IDLE menus are customized properly on OS X for + non-framework builds and for all variants of Tk. + +Tests +----- + +- Issue #17752: Fix distutils tests when run from the installed location. + +- Issue #18604: Consolidated checks for GUI availability. All platforms now + at least check whether Tk can be instantiated when the GUI resource is + requested. + +- Issue #20946: Correct alignment assumptions of some ctypes tests. + +- Issue #20743: Fix a reference leak in test_tcl. + +- Issue #20510: Rewrote test_exit in test_sys to match existing comments, + use modern unittest features, and use helpers from test.script_helper + instead of using subprocess directly. Initial patch by Gareth Rees. + +- Issue #20532: Tests which use _testcapi now are marked as CPython only. + +- Issue #19920: Added tests for TarFile.list(). Based on patch by Vajrasky Kok. + +- Issue #19990: Added tests for the imghdr module. Based on patch by + Claudiu Popa. + +- Issue #19804: The test_find_mac test in test_uuid is now skipped if the + ifconfig executable is not available. + +- Issue #19886: Use better estimated memory requirements for bigmem tests. + +- Backported tests for Tkinter variables. + +- Issue #19320: test_tcl no longer fails when wantobjects is false. + +- Issue #19683: Removed empty tests from test_minidom. Initial patch by + Ajitesh Gupta. + +- Issue #19928: Implemented a test for repr() of cell objects. + +- Issue #19595, #19987: Re-enabled a long-disabled test in test_winsound. + +- Issue #19588: Fixed tests in test_random that were silently skipped most + of the time. Patch by Julian Gindi. + +- Issue #17883: Tweak test_tcl testLoadWithUNC to skip the test in the + event of a permission error on Windows and to properly report other + skip conditions. + +- Issue #17883: Backported _is_gui_available() in test.test_support to + avoid hanging Windows buildbots on test_ttk_guionly. + +- Issue #18702, #19572: All skipped tests now reported as skipped. + +- Issue #19085: Added basic tests for all tkinter widget options. + +- Issue #20605: Make test_socket getaddrinfo OS X segfault test more robust. + +- Issue #20939: Avoid various network test failures due to new + redirect of http://www.python.org/ to https://www.python.org: + use http://www.example.com instead. + +- Issue #21093: Prevent failures of ctypes test_macholib on OS X if a + copy of libz exists in $HOME/lib or /usr/local/lib. + +Build +----- + +- Issue #21285: Refactor and fix curses configure check to always search + in a ncursesw directory. + +Documentation +------------- + +- Issue #20255: Update the about and bugs pages. + +- Issue #18840: Introduce the json module in the tutorial, and de-emphasize + the pickle module. + +- Issue #19795: Improved markup of True/False constants. + +Windows +------- + +- Issue #21303, #20565: Updated the version of Tcl/Tk included in the + installer from 8.5.2 to 8.5.15. + +Mac OS X +-------- + +- As of 2.7.8, the 32-bit-only installer will support OS X 10.5 + and later systems as is currently done for Python 3.x installers. + For 2.7.7 only, we will provide three installers: + the legacy deprecated 10.3+ 32-bit-only format; + the newer 10.5+ 32-bit-only format; + and the unchanged 10.6+ 64-/32-bit format. + Although binary installers will no longer be available from + python.org as of 2.7.8, it will still be possible to build from + source on 10.3.9 and 10.4 systems if necessary. + See Mac/BuildScript/README.txt for more information. + + +Whats' New in Python 2.7.6? +=========================== + +*Release date: 2013-11-10* + +Library +------- + +- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler. + +IDLE +---- + +- Issue #19426: Fixed the opening of Python source file with specified encoding. + +Tests +----- + +- Issue #19457: Fixed xmlcharrefreplace tests on wide build when tests are + loaded from .py[co] files. + +Build +----- + +- Issue #15663: Revert OS X installer built-in Tcl/Tk support for 2.7.6. + Some third-party projects, such as Matplotlib and PIL/Pillow, + depended on being able to build with Tcl and Tk frameworks in + /Library/Frameworks. + + +What's New in Python 2.7.6 release candidate 1? +=============================================== + +*Release date: 2013-10-26* + +Core and Builtins +----------------- + +- Issue #18603: Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the + Python executable and not removed by the linker's optimizer. + +- Issue #19279: UTF-7 decoder no more produces illegal unicode strings. + +- Issue #18739: Fix an inconsistency between math.log(n) and math.log(long(n)); + the results could be off from one another by a ulp or two. + +- Issue #13461: Fix a crash in the "replace" error handler on 64-bit platforms. + Patch by Yogesh Chaudhari. + +- Issue #15866: The xmlcharrefreplace error handler no more produces two XML + entities for a non-BMP character on narrow build. + +- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise + OverflowError when an argument of %c format is out of range. + +- Issue #18137: Detect integer overflow on precision in float.__format__() + and complex.__format__(). + +- Issue #18038: SyntaxError raised during compilation sources with illegal + encoding now always contains an encoding name. + +- Issue #18019: Fix crash in the repr of dictionaries containing their own + views. + +- Issue #18427: str.replace could crash the interpreter with huge strings. + +Library +------- + +- Issue #19393: Fix symtable.symtable function to not be confused when there are + functions or classes named "top". + +- Issue #19327: Fixed the working of regular expressions with too big charset. + +- Issue #19350: Increasing the test coverage of macurl2path. Patch by Colin + Williams. + +- Issue #19352: Fix unittest discovery when a module can be reached + through several paths (e.g. under Debian/Ubuntu with virtualenv). + +- Issue #15207: Fix mimetypes to read from correct part of Windows registry + Original patch by Dave Chambers + +- Issue #8964: fix platform._sys_version to handle IronPython 2.6+. + Patch by Martin Matusiak. + +- Issue #16038: CVE-2013-1752: ftplib: Limit amount of data read by + limiting the call to readline(). Original patch by Michał + Jastrzębski and Giampaolo Rodola. + +- Issue #19276: Fixed the wave module on 64-bit big-endian platforms. + +- Issue #18458: Prevent crashes with newer versions of libedit. Its readline + emulation has changed from 0-based indexing to 1-based like gnu readline. + Original patch by Ronald Oussoren. + +- Issue #18919: If the close() method of a writer in the sunau or wave module + failed, second invocation of close() and destructor no more raise an + exception. Second invocation of close() on sunau writer now has no effects. + The aifc module now accepts lower case of names of the 'ulaw' and 'alaw' + codecs. + +- Issue #19131: The aifc module now correctly reads and writes sampwidth of + compressed streams. + +- Issue #19158: A rare race in BoundedSemaphore could allow .release() too + often. + +- Issue #18037: 2to3 now escapes '\u' and '\U' in native strings. + +- Issue #19137: The pprint module now correctly formats empty set and frozenset + and instances of set and frozenset subclasses. + +- Issue #16040: CVE-2013-1752: nntplib: Limit maximum line lengths to 2048 to + prevent readline() calls from consuming too much memory. Patch by Jyrki + Pulliainen. + +- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except + when necessary. Patch by Oscar Benjamin. + +- Properly initialize all fields of a SSL object after allocation. + +- Issue #4366: Fix building extensions on all platforms when --enable-shared + is used. + +- Issue #18950: Fix miscellaneous bugs in the sunau module. + Au_read.readframes() now updates current file position and reads correct + number of frames from multichannel stream. Au_write.writeframesraw() now + correctly updates current file position. Au_read and Au_write now correctly + work with file object if start file position is not a zero. + +- Issue #18050: Fixed an incompatibility of the re module with Python 2.7.3 + and older binaries. + +- Issue #19037: The mailbox module now makes all changes to maildir files + before moving them into place, to avoid race conditions with other programs + that may be accessing the maildir directory. + +- Issue #14984: On POSIX systems, when netrc is called without a filename + argument (and therefore is reading the user's $HOME/.netrc file), it now + enforces the same security rules as typical ftp clients: the .netrc file must + be owned by the user that owns the process and must not be readable by any + other user. + +- Issue #17324: Fix http.server's request handling case on trailing '/'. Patch + contributed by Vajrasky Kok. + +- Issue #19018: The heapq.merge() function no longer suppresses IndexError + in the underlying iterables. + +- Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL, + if all necessary functions are already found in libuuid. + Patch by Evgeny Sologubov. + +- Issue #14971: unittest test discovery no longer gets confused when a function + has a different __name__ than its name in the TestCase class dictionary. + +- Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in + the _sre module. + +- Issue #18830: inspect.getclasstree() no more produces duplicated entries even + when input list contains duplicates. + +- Issue #18909: Fix _tkinter.tkapp.interpaddr() on Windows 64-bit, don't cast + 64-bit pointer to long (32 bits). + +- Issue #18876: The FileIO.mode attribute now better reflects the actual mode + under which the file was opened. Patch by Erik Bray. + +- Issue #18851: Avoid a double close of subprocess pipes when the child + process fails starting. + +- Issue #18418: After fork(), reinit all threads states, not only active ones. + Patch by A. Jesse Jiryu Davis. + +- Issue #11973: Fix a problem in kevent. The flags and fflags fields are now + properly handled as unsigned. + +- Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6. + +- Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj + argument. + +- Issue #17119: Fixed integer overflows when processing large Unicode strings + and tuples in the tkinter module. + +- Issue #15233: Python now guarantees that callables registered with the atexit + module will be called in a deterministic order. + +- Issue #18747: Re-seed OpenSSL's pseudo-random number generator after fork. + A pthread_atfork() parent handler is used to seed the PRNG with pid, time + and some stack data. + +- Issue #8865: Concurrent invocation of select.poll.poll() now raises a + RuntimeError exception. Patch by Christian Schubert. + +- Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit + platforms. Patch by Yogesh Chaudhari. + +- Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of + OpenSSL 1.0.0+ instead of the deprecated CRYPTO id callback function. + +- Issue #18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok. + +- Issue #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke + malloc weak symbols. + +- Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes + inside subjectAltName correctly. Formerly the module has used OpenSSL's + GENERAL_NAME_print() function to get the string represention of ASN.1 + strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and + ``uniformResourceIdentifier`` (URI). + +- Issue #18756: Improve error reporting in os.urandom() when the failure + is due to something else than /dev/urandom not existing (for example, + exhausting the file descriptor limit). + +- Fix tkinter regression introduced by the security fix in issue #16248. + +- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get + docstrings and ValueError messages. Patch by Zhongyue Luo + +- Issue #17998: Fix an internal error in regular expression engine. + +- Issue #17557: Fix os.getgroups() to work with the modified behavior of + getgroups(2) on OS X 10.8. Original patch by Mateusz Lenik. + +- Issue #18455: multiprocessing should not retry connect() with same socket. + +- Issue #18513: Fix behaviour of cmath.rect w.r.t. signed zeros on OS X 10.8 + + gcc. + +- Issue #18101: Tcl.split() now process Unicode strings nested in a tuple as it + do with byte strings. + +- Issue #18347: ElementTree's html serializer now preserves the case of + closing tags. + +- Issue #17261: Ensure multiprocessing's proxies use proper address. + +- Issue #17097: Make multiprocessing ignore EINTR. + +- Issue #18155: The csv module now correctly handles csv files that use + a delimiter character that has a special meaning in regexes, instead of + throwing an exception. + +- Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input + string in longer than 2 gigabytes. The ssl module does not support partial + write. + +- Issue #18167: cgi.FieldStorage no longer fails to handle multipart/form-data + when \r\n appears at end of 65535 bytes without other newlines. + +- Issue #17403: urllib.parse.robotparser normalizes the urls before adding to + ruleline. This helps in handling certain types invalid urls in a conservative + manner. Patch contributed by Mher Movsisyan. + +- Implement inequality on weakref.WeakSet. + +- Issue #17981: Closed socket on error in SysLogHandler. + +- Issue #18015: Fix unpickling of 2.7.3 and 2.7.4 namedtuples. + +- Issue #17754: Make ctypes.util.find_library() independent of the locale. + +- Fix typos in the multiprocessing module. + +- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X + with port None or "0" and flags AI_NUMERICSERV. + +- Issue #18080: When building a C extension module on OS X, if the compiler + is overridden with the CC environment variable, use the new compiler as + the default for linking if LDSHARED is not also overridden. This restores + Distutils behavior introduced in 2.7.3 and inadvertently dropped in 2.7.4. + +- Issue #18071: C extension module builds on OS X could fail with TypeError + if the Xcode command line tools were not installed. + +- Issue #18113: Fixed a refcount leak in the curses.panel module's + set_userptr() method. Reported by Atsuo Ishimoto. + +- Issue #18849: Fixed a Windows-specific tempfile bug where collision with an + existing directory caused mkstemp and related APIs to fail instead of + retrying. Report and fix by Vlad Shcherbina. + +- Issue #19400: Prevent extension module build failures with Xcode 5 on OS X + 10.8+ when using a universal Python that included a PPC architecture, + such as with a python.org 32-bit-only binary installer. + +Tools/Demos +----------- + +- Issue #18873: 2to3 and the findnocoding.py script now detect Python source + code encoding only in comment lines. + +- Issue #18817: Fix a resource warning in Lib/aifc.py demo. + +- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS. + +- Issue #18448: Fix a typo in Demo/newmetaclasses/Eiffel.py. + +- Issue #12990: The "Python Launcher" on OSX could not launch python scripts + that have paths that include wide characters. + +Build +----- + +- Issue #16067: Add description into MSI file to replace installer's temporary name. + +- Issue #18256: Compilation fix for recent AIX releases. Patch by + David Edelsohn. + +- Issue #18098: The deprecated OS X Build Applet.app fails to build on + OS X 10.8 systems because the Apple-deprecated QuickDraw headers have + been removed from Xcode 4. Skip building it in this case. + +- Issue #1584: Provide options to override default search paths for + Tcl and Tk when building _tkinter. + +- Issue #15663: Tcl/Tk 8.5.15 is now included with the OS X 10.6+ + 64-bit/32-bit installer for 10.6+. It is no longer necessary + to install a third-party version of Tcl/Tk 8.5 to work around the + problems in the Apple-supplied Tcl/Tk 8.5 shipped in OS X 10.6 + and later releases. + +- Issue #19019: Change the OS X installer build script to use CFLAGS instead + of OPT for special build options. By setting OPT, some compiler-specific + options like -fwrapv were overridden and thus not used, which could result + in broken interpreters when building with clang. + +IDLE +---- + +- Issue #18873: IDLE now detects Python source code encoding only in comment + lines. + +- Issue #18988: The "Tab" key now works when a word is already autocompleted. + +- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster. + +- Issue #18429: Format / Format Paragraph, now works when comment blocks + are selected. As with text blocks, this works best when the selection + only includes complete lines. + +- Issue #18226: Add docstrings and unittests for FormatParagraph.py. + Original patches by Todd Rovito and Phil Webster. + +- Issue #18279: Format - Strip trailing whitespace no longer marks a file as + changed when it has not been changed. This fix followed the addition of a + test file originally written by Phil Webster (the issue's main goal). + +- Issue #18539: Calltips now work for float default arguments. + +- Issue #7136: In the Idle File menu, "New Window" is renamed "New File". + Patch by Tal Einat, Roget Serwy, and Todd Rovito. + +- Issue #8515: Set __file__ when run file in IDLE. + Initial patch by Bruce Frederiksen. + +- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition. + +- Issue #17511: Keep IDLE find dialog open after clicking "Find Next". + Original patch by Sarah K. + +- Issue #15392: Create a unittest framework for IDLE. + Preliminary patch by Rajagopalasarma Jayakrishnan + See Lib/idlelib/idle_test/README.txt for how to run Idle tests. + +- Issue #14146: Highlight source line while debugging on Windows. + +- Issue #17532: Always include Options menu for IDLE on OS X. + Patch by Guilherme Simões. + +Tests +----- + +- Issue #18919: Added tests for the sunau module. Unified and extended tests + for audio modules: aifc, sunau and wave. + +- Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as + possible, since "localhost" goes through a DNS lookup under recent Windows + versions. + +- Issue #18357: add tests for dictview set difference. + Patch by Fraser Tweedale. + +- Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé. + +- Issue #18094: test_uuid no more reports skipped tests as passed. + +- Issue #11995: test_pydoc doesn't import all sys.path modules anymore. + +Documentation +------------- + +- Issue #18758: Fixed and improved cross-references. + +- Issue #18718: datetime documentation contradictory on leap second support. + +- Issue #17701: Improving strftime documentation. + +- Issue #17844: Refactor a documentation of Python specific encodings. + Add links to encoders and decoders for binary-to-binary codecs. + + What's New in Python 2.7.5? =========================== diff --git a/README b/README index 014028d..691b818 100644 --- a/README +++ b/README @@ -166,6 +166,11 @@ rebuilt. In this case, you may have to run make again to correctly build your desired target. The interpreter executable is built in the top level directory. +If you need an optimized version of Python, you type "make profile-opt" +in the top level directory. This will rebuild the interpreter executable +using Profile Guided Optimization (PGO). For more details, see the +section below. + Once you have built a Python interpreter, see the subsections below on testing and installation. If you run into trouble, see the next section. @@ -178,6 +183,30 @@ guidance of the setup.py script, which is run by Make after the interpreter has been built. +Profile Guided Optimization +--------------------------- + +PGO takes advantage of recent versions of the GCC or Clang compilers. +If ran, the "profile-opt" rule will do several steps. + +First, the entire Python directory is cleaned of temporary files that +may resulted in a previous compilation. + +Then, an instrumented version of the interpreter is built, using suitable +compiler flags for each flavour. Note that this is just an intermediary +step and the binary resulted after this step is not good for real life +workloads, as it has profiling instructions embedded inside. + +After this instrumented version of the interpreter is built, the Makefile +will automatically run a training workload. This is necessary in order to +profile the interpreter execution. Note also that any output, both stdout +and stderr, that may appear at this step is supressed. + +Finally, the last step is to rebuild the interpreter, using the information +collected in the previous one. The end result will be a the Python binary +that is optimized and suitable for distribution or production installation. + + Troubleshooting --------------- diff --git a/configure b/configure index 60a3335..aeb8570 100755 --- a/configure +++ b/configure @@ -658,6 +658,20 @@ LDSHARED SO LIBTOOL_CRUFT OTHER_LIBTOOL_OPT +LLVM_PROF_FOUND +target_os +target_vendor +target_cpu +target +LLVM_PROFDATA +LLVM_PROF_ERR +LLVM_PROF_FILE +LLVM_PROF_MERGER +PGO_PROF_USE_FLAG +PGO_PROF_GEN_FLAG +LTOFLAGS +DEF_MAKE_RULE +DEF_MAKE_ALL_RULE UNIVERSAL_ARCH_FLAGS BASECFLAGS OPT @@ -786,6 +800,8 @@ with_suffix enable_shared enable_profiling with_pydebug +enable_optimizations +with_lto enable_toolbox_glue with_libs with_system_expat @@ -1421,6 +1437,7 @@ _ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi @@ -1440,6 +1457,8 @@ Optional Features: Build (MacOSX|Darwin) framework --enable-shared disable/enable building shared python library --enable-profiling enable C-level code profiling + --enable-optimizations Enable expensive optimizations (PGO, maybe LTO, + etc). Disabled by default. --enable-toolbox-glue disable/enable MacOSX glue code for extensions --enable-ipv6 Enable ipv6 (with ipv4) support --disable-ipv6 Disable ipv6 support @@ -1463,6 +1482,8 @@ Optional Packages: compiler --with-suffix=.exe set executable suffix --with-pydebug build with Py_DEBUG defined + --with-lto Enable Link Time Optimization in PGO builds. + Disabled by default. --with-libs='lib1 ...' link against additional libs --with-system-expat build pyexpat module using an installed expat library @@ -6307,6 +6328,308 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$save_CFLAGS fi + +# Enable optimization flags + + +Py_OPT='false' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-optimizations" >&5 +$as_echo_n "checking for --enable-optimizations... " >&6; } +# Check whether --enable-optimizations was given. +if test "${enable_optimizations+set}" = set; then : + enableval=$enable_optimizations; +if test "$enableval" != no +then + Py_OPT='true' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + Py_OPT='false' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; +fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test "$Py_OPT" = 'true' ; then + case $ac_sys_system in + Darwin*) + # At least on macOS El Capitan, LTO does not work with PGO. + Py_LTO='false' + ;; + esac + Py_LTO='true' + DEF_MAKE_ALL_RULE="profile-opt" + REQUIRE_PGO="yes" + DEF_MAKE_RULE="build_all" +else + DEF_MAKE_ALL_RULE="build_all" + REQUIRE_PGO="no" + DEF_MAKE_RULE="all" +fi + + +# Enable LTO flags + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 +$as_echo_n "checking for --with-lto... " >&6; } + +# Check whether --with-lto was given. +if test "${with_lto+set}" = set; then : + withval=$with_lto; +if test "$withval" != no +then + Py_LTO='true' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + Py_LTO='false' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; +fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test "$Py_LTO" = 'true' ; then + case $CC in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto" + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + LTOFLAGS="-flto" + ;; + *) + LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" + ;; + esac + ;; + esac +fi + + +# Enable PGO flags. + +# Make this work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +# Extract the first word of "$target_alias-llvm-profdata", so it can be a program name with args. +set dummy $target_alias-llvm-profdata; ac_word=$2 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LLVM_PROFDATA+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LLVM_PROFDATA in + [\\/]* | ?:[\\/]*) + ac_cv_path_LLVM_PROFDATA="$LLVM_PROFDATA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_PROFDATA="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + ;; +esac +fi +LLVM_PROFDATA=$ac_cv_path_LLVM_PROFDATA +if test -n "$LLVM_PROFDATA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_PROFDATA" >&5 +$as_echo "$LLVM_PROFDATA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test -z "$ac_cv_path_LLVM_PROFDATA"; then + if test "$build" = "$target"; then + ac_pt_LLVM_PROFDATA=$LLVM_PROFDATA + # Extract the first word of "llvm-profdata", so it can be a program name with args. +set dummy llvm-profdata; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_LLVM_PROFDATA+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_LLVM_PROFDATA in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_LLVM_PROFDATA="$ac_pt_LLVM_PROFDATA" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in ${llvm_path} +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_PROFDATA="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ac_pt_LLVM_PROFDATA" && ac_cv_path_ac_pt_LLVM_PROFDATA="''" + ;; +esac +fi +ac_pt_LLVM_PROFDATA=$ac_cv_path_ac_pt_LLVM_PROFDATA +if test -n "$ac_pt_LLVM_PROFDATA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_PROFDATA" >&5 +$as_echo "$ac_pt_LLVM_PROFDATA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + LLVM_PROFDATA=$ac_pt_LLVM_PROFDATA + else + LLVM_PROFDATA="''" + fi +else + LLVM_PROFDATA="$ac_cv_path_LLVM_PROFDATA" +fi + +if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}" +then + LLVM_PROF_FOUND="found" +else + LLVM_PROF_FOUND="not-found" +fi +if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found" +then + found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null` + if test -n "${found_llvm_profdata}" + then + # llvm-profdata isn't directly in $PATH in some cases. + # https://apple.stackexchange.com/questions/197053/ + LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata' + LLVM_PROF_FOUND=found + { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&5 +$as_echo "$as_me: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&6;} + fi +fi + +LLVM_PROF_ERR=no +case $CC in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test $LLVM_PROF_FOUND = not-found + then + LLVM_PROF_ERR=yes + if test "${REQUIRE_PGO}" = "yes" + then + as_fn_error $? "llvm-profdata is required for a --enable-optimizations build but could not be found." "$LINENO" 5 + fi + fi + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test "${LLVM_PROF_FOUND}" = "not-found" + then + LLVM_PROF_ERR=yes + if test "${REQUIRE_PGO}" = "yes" + then + as_fn_error $? "llvm-profdata is required for a --enable-optimizations build but could not be found." "$LINENO" 5 + fi + fi + ;; + *) + PGO_PROF_GEN_FLAG="-fprofile-generate" + PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction" + LLVM_PROF_MERGER="true" + LLVM_PROF_FILE="" + ;; + esac + ;; +esac + + # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). @@ -14613,7 +14936,7 @@ for dir in $SRCDIRS; do fi done - BEGIN_COMPUTED_GOTO +# BEGIN_COMPUTED_GOTO # Check for --with-computed-gotos { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5 $as_echo_n "checking for --with-computed-gotos... " >&6; } @@ -16031,3 +16354,12 @@ $as_echo "$as_me: WARNING: esac mv config.c Modules + +if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then + echo "" >&6 + echo "" >&6 + echo "If you want a release build with all optimizations active (LTO, PGO, etc)," + echo "please run ./configure --enable-optimizations" >&6 + echo "" >&6 + echo "" >&6 +fi diff --git a/configure.ac b/configure.ac index 74bb514..040fc69 100644 --- a/configure.ac +++ b/configure.ac @@ -1347,6 +1347,165 @@ then CFLAGS=$save_CFLAGS fi + +# Enable optimization flags +AC_SUBST(DEF_MAKE_ALL_RULE) +AC_SUBST(DEF_MAKE_RULE) +Py_OPT='false' +AC_MSG_CHECKING(for --enable-optimizations) +AC_ARG_ENABLE(optimizations, AS_HELP_STRING([--enable-optimizations], [Enable expensive optimizations (PGO, maybe LTO, etc). Disabled by default.]), +[ +if test "$enableval" != no +then + Py_OPT='true' + AC_MSG_RESULT(yes); +else + Py_OPT='false' + AC_MSG_RESULT(no); +fi], +[AC_MSG_RESULT(no)]) +if test "$Py_OPT" = 'true' ; then + case $ac_sys_system in + Darwin*) + # At least on macOS El Capitan, LTO does not work with PGO. + Py_LTO='false' + ;; + esac + Py_LTO='true' + DEF_MAKE_ALL_RULE="profile-opt" + REQUIRE_PGO="yes" + DEF_MAKE_RULE="build_all" +else + DEF_MAKE_ALL_RULE="build_all" + REQUIRE_PGO="no" + DEF_MAKE_RULE="all" +fi + + +# Enable LTO flags +AC_SUBST(LTOFLAGS) +AC_MSG_CHECKING(for --with-lto) +AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]), +[ +if test "$withval" != no +then + Py_LTO='true' + AC_MSG_RESULT(yes); +else + Py_LTO='false' + AC_MSG_RESULT(no); +fi], +[AC_MSG_RESULT(no)]) +if test "$Py_LTO" = 'true' ; then + case $CC in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + LTOFLAGS="-flto" + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + LTOFLAGS="-flto" + ;; + *) + LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" + ;; + esac + ;; + esac +fi + + +# Enable PGO flags. +AC_SUBST(PGO_PROF_GEN_FLAG) +AC_SUBST(PGO_PROF_USE_FLAG) +AC_SUBST(LLVM_PROF_MERGER) +AC_SUBST(LLVM_PROF_FILE) +AC_SUBST(LLVM_PROF_ERR) +# Make this work on systems where llvm tools are not installed with their +# normal names in the default $PATH (ie: Ubuntu). They exist under the +# non-suffixed name in their versioned llvm directory. +llvm_bin_dir='' +llvm_path="${PATH}" +if test "${CC}" = "clang" +then + clang_bin=`which clang` + # Some systems install clang elsewhere as a symlink to the real path + # which is where the related llvm tools are located. + if test -L "${clang_bin}" + then + clang_dir=`dirname "${clang_bin}"` + clang_bin=`readlink "${clang_bin}"` + llvm_bin_dir="${clang_dir}/"`dirname "${clang_bin}"` + llvm_path="${llvm_path}${PATH_SEPARATOR}${llvm_bin_dir}" + fi +fi +AC_SUBST(LLVM_PROFDATA) +AC_PATH_TARGET_TOOL(LLVM_PROFDATA, llvm-profdata, '', ${llvm_path}) +AC_SUBST(LLVM_PROF_FOUND) +if test -n "${LLVM_PROFDATA}" -a -x "${LLVM_PROFDATA}" +then + LLVM_PROF_FOUND="found" +else + LLVM_PROF_FOUND="not-found" +fi +if test "$ac_sys_system" = "Darwin" -a "${LLVM_PROF_FOUND}" = "not-found" +then + found_llvm_profdata=`/usr/bin/xcrun -find llvm-profdata 2>/dev/null` + if test -n "${found_llvm_profdata}" + then + # llvm-profdata isn't directly in $PATH in some cases. + # https://apple.stackexchange.com/questions/197053/ + LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata' + LLVM_PROF_FOUND=found + AC_MSG_NOTICE([llvm-profdata found via xcrun: ${LLVM_PROFDATA}]) + fi +fi + +LLVM_PROF_ERR=no +case $CC in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test $LLVM_PROF_FOUND = not-found + then + LLVM_PROF_ERR=yes + if test "${REQUIRE_PGO}" = "yes" + then + AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.]) + fi + fi + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="${LLVM_PROFDATA} merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test "${LLVM_PROF_FOUND}" = "not-found" + then + LLVM_PROF_ERR=yes + if test "${REQUIRE_PGO}" = "yes" + then + AC_MSG_ERROR([llvm-profdata is required for a --enable-optimizations build but could not be found.]) + fi + fi + ;; + *) + PGO_PROF_GEN_FLAG="-fprofile-generate" + PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction" + LLVM_PROF_MERGER="true" + LLVM_PROF_FILE="" + ;; + esac + ;; +esac + + # On some compilers, pthreads are available without further options # (e.g. MacOS X). On some of these systems, the compiler will not # complain if unaccepted options are passed (e.g. gcc on Mac OS X). @@ -4648,3 +4807,12 @@ BeOS) esac mv config.c Modules + +if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then + echo "" >&AS_MESSAGE_FD + echo "" >&AS_MESSAGE_FD + echo "If you want a release build with all optimizations active (LTO, PGO, etc)," + echo "please run ./configure --enable-optimizations" >&AS_MESSAGE_FD + echo "" >&AS_MESSAGE_FD + echo "" >&AS_MESSAGE_FD +fi -- 1.8.3.1