Original changes in python27/Makefile r1.62-r1.67
=================================================
Add an option for Python: x11
Fix dlopen(3) calls in _ctypes.so for X11BASE libraries
A Python code can dynamically load shared libraries and it's wrapped with
a plain dlopen(3) call. The holder of this interface (_ctypes module)
without rpath set to X11BASE cannot detect libs like 'GL'.
Fixing find_library() on POSIX-like (excluding Darwin) systems.
This isn't addressing Python's wrapper for dlopen(3).
This possibily addresses mostly NetBSD as other popular OSes have ldconfig.
Testing commands:
- before applying the patch
>>> from ctypes.util import find_library
>>> find_library("m")
'libm.so.0'
>>> find_library("crypto")
'libcrypto.so.11'
>>> find_library("GL")
>>> find_library("curl")
- after applying the patch
>>> from ctypes.util import find_library
>>> find_library("m")
'libm.so.0'
>>> find_library("crypto")
'libcrypto.so.11'
>>> find_library("GL")
'libGL.so.2'
>>> find_library("curl")
'libcurl.so.4'
This patch doesn't solve the case of custom dirs like $PREFIX/qt5/lib.
However it's solving most common cases of using this call.
A possible solution is to parse the output "pkg_info -La"... however it's
very slow. In other words a cache with libraries might be needed to handle
it efficiently.
Issue 27066: Fixed SystemError if a custom opener (for open()) returns a negative number without setting an exception.
Issue 20041: Fixed TypeError when frame.f_trace is set to None. Patch by Xavier de Gaye.
Issue 26168: Fixed possible refleaks in failing Py_BuildValue() with the “N” format unit.
Issue 26991: Fix possible refleak when creating a function with annotations.
Issue 27039: Fixed bytearray.remove() for values greater than 127. Patch by Joe Jevnik.
Issue 23640: int.from_bytes() no longer bypasses constructors for subclasses.
Issue 26811: gc.get_objects() no longer contains a broken tuple with NULL pointer.
Issue 20120: Use RawConfigParser for .pypirc parsing, removing support for interpolation unintentionally added with move to Python 3. Behavior no longer does any interpolation in .pypirc files, matching behavior in Python 2.7 and Setuptools 19.0.
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 25339: PYTHONIOENCODING now has priority over locale in setting the error handler for stdin and stdout.
Issue 26494: Fixed crash on iterating exhausting iterators. Affected classes are generic sequence iterators, iterators of str, bytes, bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding views and os.scandir() iterator.
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 26464: Fix str.translate() when string is ASCII and first replacements removes character, but next replacement uses a non-ASCII character or a string longer than 1 character. Regression introduced in Python 3.5.0.
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 26302: Correct behavior to reject comma as a legal character for cookie names.
Issue 4806: Avoid masking the original TypeError exception when using star (*) unpacking in function calls. Based on patch by Hagen Fürstenau and Daniel Urban.
Issue 27138: Fix the doc comment for FileFinder.find_spec().
Issue 26154: Add a new private _PyThreadState_UncheckedGet() function to get the current Python thread state, but don’t issue a fatal error if it is NULL. This new function must be used instead of accessing directly the _PyThreadState_Current variable. The variable is no more exposed since Python 3.5.1 to hide the exact implementation of atomic C types, to avoid compiler issues.
Issue 26194: Deque.insert() gave odd results for bounded deques that had reached their maximum size. Now an IndexError will be raised when attempting to insert into a full deque.
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] Comment out 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 25973: Fix segfault when an invalid nonlocal statement binds a name starting with two underscores.
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 25766: Special method __bytes__() now works in str subclasses.
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 25709: Fixed problem with in-place string concatenation and utf-8 cache.
Issue 27147: Mention PEP 420 in the importlib docs.
Issue 24097: Fixed crash in object.__reduce__() if slot name is freed inside __getattr__.
Issue 24731: Fixed crash on converting objects with special methods __bytes__, __trunc__, and __float__ returning instances of subclasses of bytes, int, and float to subclasses of bytes, int, 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().
Issue 25660: Fix TAB key behaviour in REPL with readline.
Issue 25887: Raise a RuntimeError when a coroutine object is awaited more than once.
Issue 27243: Update the __aiter__ protocol: instead of returning an awaitable that resolves to an asynchronous iterator, the asynchronous iterator should be returned directly. Doing the former will trigger a PendingDeprecationWarning.
more...
all platforms that use GNU ld. This is of course completely wrong. Some
platforms have always implemented the sane semantic for DT_RPATH already
and newer saw a reason for implementing the then-redundant DT_RUNPATH.
Unbreak them by trusting the compiler to actually know what the platform
default should be. Bump revision.
New syntax features:
* PEP 492, coroutines with async and await syntax.
* PEP 465, a new matrix multiplication operator: a @ b.
* PEP 448, additional unpacking generalizations.
New library modules:
* typing: PEP 484 – Type Hints.
* zipapp: PEP 441 Improving Python ZIP Application Support.
New built-in features:
* bytes % args, bytearray % args: PEP 461 – Adding % formatting to bytes and bytearray.
* New bytes.hex(), bytearray.hex() and memoryview.hex() methods. (Contributed by Arnon Yaari in issue 9951.)
* memoryview now supports tuple indexing (including multi-dimensional). (Contributed by Antoine Pitrou in issue 23632.)
* Generators have a new gi_yieldfrom attribute, which returns the object being iterated by yield from expressions. (Contributed by Benno Leslie and Yury Selivanov in issue 24450.)
* A new RecursionError exception is now raised when maximum recursion depth is reached. (Contributed by Georg Brandl in issue 19235.)
CPython implementation improvements:
* When the LC_TYPE locale is the POSIX locale (C locale), sys.stdin and sys.stdout now use the surrogateescape error handler, instead of the strict error handler. (Contributed by Victor Stinner in issue 19977.)
* .pyo files are no longer used and have been replaced by a more flexible scheme that includes the optimization level explicitly in .pyc name. (See PEP 488 overview.)
* Builtin and extension modules are now initialized in a multi-phase process, which is similar to how Python modules are loaded. (See PEP 489 overview.)
Significant improvements in the standard library:
* collections.OrderedDict is now implemented in C, which makes it 4 to 100 times faster.
* The ssl module gained support for Memory BIO, which decouples SSL protocol handling from network IO.
* The new os.scandir() function provides a better and significantly faster way of directory traversal.
* functools.lru_cache() has been mostly reimplemented in C, yielding much better performance.
* The new subprocess.run() function provides a streamlined way to run subprocesses.
* The traceback module has been significantly enhanced for improved performance and developer convenience.
Security improvements:
* SSLv3 is now disabled throughout the standard library. It can still be enabled by instantiating a ssl.SSLContext manually. (See issue 22638 for more details; this change was backported to CPython 3.4 and 2.7.)
* HTTP cookie parsing is now stricter, in order to protect against potential injection attacks. (Contributed by Antoine Pitrou in issue 22796.)
Windows improvements:
* A new installer for Windows has replaced the old MSI. See Using Python on Windows for more information.
* Windows builds now use Microsoft Visual C++ 14.0, and extension modules should use the same.