Core and Builtins ----------------- - Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional. - Remove the freelist scheme for setobjects. - Issue #18808: Thread.join() now waits for the underlying thread state to be destroyed before returning. This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running. - Issue #18954: Fix some typo in fileutils.c comments. - Issue #18942: Nerge 3.3 into default. - Issue #16826: Don't check for PYTHONCASEOK when using -E. - Instead of XORed indicies, switch to a hybrid of linear probing and open addressing. - Issue #18780: %-formatting now prints value for int subclasses with %d, %i, and %u codes. - Issue #18756: os.urandom() now uses a lazily-opened persistent file descriptor, so as to avoid using many file descriptors when run in parallel from multiple threads. - Tighten-up the lookkey() logic and beautify the code a bit. - pythonrun.c: use MAXPATHLEN instead of PATH_MAX. - Issue #18571: Implementation of the PEP 446: file descriptors and file handles are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable(). - Issue #11619: The parser and the import machinery do not encode Unicode filenames anymore on Windows. - Issue #18408: Restore changeset 5bd9db528aed (issue #18408). - Issue #18664: Issue #18664, #18408: Rewrite PyErr_WriteUnraisable() to handle errors. - Issue #18408: _PyObject_Dump() now saves/restores the current exception. - remove support for compiling on systems without getcwd(). - Issue #18408: Back out 5bd9db528aed (issue #18408). It caused unsolved buildbot failures. - Issue 18797: Remove unneeded refcount adjustments for dummy objects. - Issue 18772: Restore set dummy object back to unicode and restore the identity checks in lookkey(). - Use a known unique object for the dummy entry. - Issue #18701: Remove support of old CPython versions (<3.0) from C code. - Issue #18722: Remove uses of the "register" keyword in C code. - Issue #10241: Clear extension module dict copies at interpreter shutdown. Patch by Neil Schemenauer, minimally modified. - Issue #16400: Add command line option for isolated mode. - Replace outdated optimization with clearer code that compiles better. - Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles. - Issue #10241: Backout 62658d9d8926 (issue #10241): it causes a crash at shutdown when deallocating a Tkapp object. - Issue #18214: Improve finalization of Python modules to avoid setting their globals to None, in most cases. - Issue #18112: PEP 442 implementation (safe object finalization). - Issue #15893: Improve error handling in main() and Py_FrozenMain(). - Issue #18203: Replace PyMem_Malloc() with PyMem_RawMalloc() at Python initialization. - (Merge 3.3) According to the PEP 7, C code must "use 4-space indents". - Issue #18520: Fix initstdio(), handle PySys_SetObject() failure. - Issue #18520: Fix _PyDict_GetItemId(), suppress _PyUnicode_FromId() error. - Issue #18520: Fix PyFunction_NewWithQualName() error handling. - Issue #18520: initsite() is a little bit more verbose when import site fails. - Issue #18520: Fix _PySys_Init(), handle PyDict_SetItemString() errors. - Issue #18520: PyErr_NoMemory() now fails with a fatal error if it is called before PyExc_MemoryError has been initialized by _PyExc_Init(). - Issue #18520: Add a new PyStructSequence_InitType2() function, same than PyStructSequence_InitType() except that it has a return value (0 on success, -1 on error). - Issue #18520: Fix initsigs(), handle PyOS_InitInterrupts() error. - Issue #18327: Fix argument order in call to compatible_for_assignment(oldto, newto, attr). The fix only affects the error message of __class__ assignment. CID 983564. - Issue #18408: Fix list_ass_slice(), handle list_resize() failure. - Issue #18408: PyObject_Str(), PyObject_Repr() and type_call() now fail with an assertion error if they are called with an exception set (PyErr_Occurred()). - Issue #18408: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail with an assertion error if they are called with an exception set (PyErr_Occurred()). - Issue #18408: Fix dict_repr(), don't call PyObject_Repr() with an exception set. - Issue #18408: Rewrite NEGATE() macro in longobject.c to handle PyLong_FromLong() failure. - Issue #18408: Fix PyType_Ready(), handle _PyDict_SetItemId() failure. - Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure. - Issue #18408: Fix listpop(), handle list_ass_slice() failure. - Issue #18408: Fix PyErr_SetImportError(), handle PyDict_SetItemString() failure. - Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure. - Issue #18408: Fix ast_for_atom(), PyErr_Fetch(&type, &value, &tback) can set value to NULL. - Issue #18408: Fix structseq_reduce(), handle PyDict_SetItemString() failure. - Issue #18469: Replace PyDict_GetItemString() with _PyDict_GetItemId() in structseq.c. - Issue #18408: Handle PyArena_AddPyObject() failure in ast.c. - Issue #18408: Fix PyErr_NormalizeException(), handle PyObject_IsSubclass() failure. - Issue #18408: Fix Python-ast.c: handle init_types() failure (ex: MemoryError). - Cleanup type_call() to ease debug. - Issue #18408: handle PySys_GetObject() failure, raise a RuntimeError. - Issue #18408: Py_ReprLeave() now saves/restores the current exception, and ignores exceptions raised during the call. - Issue #18408: dict_new() now fails on new_keys_object() error. - Issue #18408: Fix PyDict_GetItemString(), suppress PyUnicode_FromString() error. - Issue #18408: Fix list.extend(), handle list_resize() failure. - Issue #18408: Fix show_warning(), clear also the exception raised by _Py_DisplaySourceLine(). - Issue #18408: add more assertions on PyErr_Occurred() in ceval.c to detect bugs earlier. - Issue #18408: Fix _Py_DisplaySourceLine(). - Issue #18408: Fix PyEval_EvalFrameEx() for MemoryError. - Issue #18408: type_new() and PyType_FromSpecWithBases() now raise MemoryError on memory allocation failure. - Issue #18408: Don't check unicode consistency in _PyUnicode_HAS_UTF8_MEMORY() and _PyUnicode_HAS_WSTR_MEMORY() macros. - Issue #18408: PyObject_Call() now fails with an assertion error in debug mode if the function called failed whereas no exception was raised, to detect bugs earlier. - Issue #18342: Use the repr of a module name for ``from ... import ...`` when an ImportError occurs. - Issue #18415: Normalize what type of quotes are used with string constants in importlib._bootstrap. Along the way clean up from string interpolation to use the repr explicitly. - Issue #18408: pmerge() help of mro_implementation() now raises MemoryError on memory allocation failure. - Issue #18408: errors.c: in debug mode, calling PyErr_BadInternalCall() now fails with an assertion error. - Issue #18408: ceval.c: in debug mode, convert the PyErr_Occurred() check on exception (when getting NULL) to an assertion to detect bugs earlier. - Issue #18408: normalizestring() now raises MemoryError on memory allocation failure. - Issue #18408: In debug mode, PyCFunction_Call() now checks if an exception was raised if the result is NULL to help to find bugs in C mode (get the error earlier than the SystemError in ceval.c). - Issue #18408: parsetok() must not write into stderr on memory allocation error. - Issue #18408: parsetok() must not write into stderr on memory allocation error. - Issue #18408: Fix compiler_import() to handle PyUnicode_Substring() failure properly. - Issue #18408: ste_new() initialize all attributes before handling error. - Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error. - Issue #18408: Fix call_exc_trace(): if the traceback is NULL, use None when building the tuple (type, value, traceback) passed to the callback. - Issue #18408: Fix _PyMem_DebugRealloc(). - Issue #18408: _PyUnicodeWriter_Finish() now clears its buffer attribute in all cases, so _PyUnicodeWriter_Dealloc() can be called after finish. - Issue #18408: Fix PyCode_Optimize(): raise a MemoryError on memory allocation failure. - Issue #18408: Fix _PyUnicodeWriter_Finish(): clear writer->buffer, so _PyUnicodeWriter_Dealloc() can be called on the writer after finish. - Issue #18408: Fix call_function() of ceval.c to handle PyTuple_New() failure (in load_args()), ex: MemoryError. - Issue #18408: Fix PyType_Ready() and type.__bases__ setter to handle PyWeakref_NewRef() failure (ex: MemoryError). - Issue #18408: Fix marshal reader for Unicode strings: handle PyUnicode_DecodeUTF8() failure (ex: MemoryError). - Issue #18408: Fix list.pop() to handle list_resize() failure (MemoryError). - Issue #18408: Fix PyDict_New() to handle correctly new_keys_object() failure (MemoryError). - Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup(). - Issue #18203: Fix _Py_DecodeUTF8_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar(). - Issue #18203: Replace malloc() with PyMem_Malloc() in _PySequence_BytesToCharpArray(). - Issue #18203: Replace malloc() with PyMem_Malloc() to allocate arena objects. - Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks. - Issue #18203: Fix decode_ascii_surrogateescape(), use PyMem_RawMalloc() as _Py_char2wchar(). - Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initialization. - Issue #18203: Fix Py_Finalize(): destroy the GIL after the last call to PyMem_Malloc() or PyObject_Malloc(). - Issue #3329: Fix _PyObject_ArenaVirtualFree(). - Issue #3329: Implement the PEP 445. - Issue #18364: Stop using the ImportError._not_found hack. - Issue #15767: back out 8a0ed9f63c6e, finishing the removal of ModuleNotFoundError. - Issue #15767: Revert 3a50025f1900 for ModuleNotFoundError. - Issue #1: Fix ref leak in error case of unicode index CID 983319 (#1 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to. - Issue #1: Fix resource leak in parser, free node ptr CID 1028068 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable n going out of scope leaks the storage it points to. - Issue #1: Fix memory leak in endswith CID 1040368 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to. - Issue #13483: Use VirtualAlloc in obmalloc on Windows. - Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index). - Issue #9566: pystrtod.c: Fix a compiler warnings on Windows x64. - Issue #9566: Fix a compiler warning on Windows x64. - Issue #9566: Fix a compiler warning in tupleiter_setstate() on Windows x64. - marshal: optimize parsing of empty Unicode strings. - Issue #13226: update references from ctypes/DLFCN modules to os module. - Issue #18076: Introduce imoportlib.util.decode_source(). - Issue #18115: Abstract out managing the cleanup of modules to use in loaders where C code provides the loaded module. - Issue #18058: Issues #18058, 18057: Make importlib._bootstrap.NamespaceLoader conform the the InspectLoader ABC. Perk of this is that runpy/-m can now work with namespace packages. - Issue #17907: touch up the code for imp.new_module(). - Issue #3329: Add new APIs to customize memory allocators. - Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document the deprecation of imp.get_magic(). - Issue #3329: Add new APIs to customize memory allocators. - Issue #15767: Touch up ModuleNotFoundError usage by import. - Issue #15767: Introduce ModuleNotFoundError, a subclass of ImportError. - Issue #9566: Fix compilater warnings on Windows 64-bit. - Issue #9566: Fix compiler warning on Windows 64-bit. - Issue #9566: Fix compiler warning on Windows 64-bit. - Issue #9566: Fix compiler warning on Windows 64-bit. - Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init(). - Issue #17932: Fix an integer overflow issue on Windows 64-bit in tuple iterators: change the C type of tupleiterobject.it_index from long to Py_ssize_t. - Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros. - Issue #17932: Fix an integer overflow issue on Windows 64-bit in iterators: change the C type of seqiterobject.it_index from long to Py_ssize_t. - Issue #18065: For frozen packages set __path__ to []. - Issue #18088: Issues #18088, 18089: Introduce importlib.abc.Loader.init_module_attrs() and implement importlib.abc.InspectLoader.load_module(). - Issue #9369: The types of `char*` arguments of PyObject_CallFunction() and PyObject_CallMethod() now changed to `const char*`. Based on patches by Jörg Müller and Lars Buitinck. - Issue #18070: importlib.util.module_for_loader() now sets __loader__ and __package__ unconditionally in order to do the right thing for reloading. - Introduce importlib.util.ModuleManager which is a context manager to handle providing (and cleaning up if needed) the module to be loaded. - Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant() when applicable. - Issue #17937: Try harder to collect cyclic garbage at shutdown. - Fix a compilater warning on Windows 64-bit. - Issue #12370: hide the __class__ closure from the class body (#12370). - Issue #17807: Generators can now be finalized even when they are part of a reference cycle). - Issue #17927: when an argument is a cell, set the local copy to NULL (see #17927). - Issue #17927: Keep frame from referencing cell-ified arguments. - Issue #17807: Generators can now be finalized even when they are part of a reference cycle. - Issue #1545463: At shutdown, defer finalization of codec modules so that stderr remains usable. - Use Py_intptr_t to store the difference between two pointers, instead of int. - Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown. - Issue #17094: Clear stale thread states after fork(). - Issue #17115: I hate you MS for not supporting C99. - Issue #17115: #17115,17116: Have modules initialize the __package__ and __loader__ attributes to None. - Issue #17853: check local class namespace before reaching for cells (closes #17853). - Issue #17832: fix a compilation warning about a function prototype. Also, make the private function static. - Issue #17413: make sure settrace funcs get passed exception instances for 'value'. - Partial revert of changeset 9744b2df134c. - Fix bug in Unicode decoders related to _PyUnicodeWriter. - Fix typo in unicode_decode_call_errorhandler_writer(). - Issue #17694: Add minimum length to _PyUnicodeWriter. - Cleanup PyUnicode_Contains(). - Cleanup PyUnicode_Append(). - Issue #17244: Don't mask exceptions raised during the creation of bytecode files in py_compile. - Issue #17722: properly lookup the __round__ special method (closes #17722). - Issue #15480: Remove the deprecated and unused TYPE_INT64 code from marshal. Initial patch by Daniel Riti. - Issue #16061: Speed up str.replace() for replacing 1-character strings. - Issue #17643: Add __callback__ attribute to weakref.ref. - Issue #17693: Rewrite CJK decoders to use the _PyUnicodeWriter API instead of the legacy Py_UNICODE API. - Issue #17615: On Windows (VS2010), Performances of wmemcmp() to compare Unicode strings are not convincing. For UCS2 (16-bit wchar_t type), use a dummy loop instead of wmemcmp(). The dummy loop is as fast, or a little bit faster. - Issue #17093: Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/return the default exception/value when called instead of raising/returning NotimplementedError/NotImplemented (except where appropriate). This should allow for the ABCs to act as the bottom/end of the MRO with expected default results. - Don't calls macros in PyUnicode_WRITE() parameters. - Fix _PyUnicode_XStrip(). - Optimize PyUnicode_DecodeCharmap(). - Optimize make_bloom_mask(), used by str.strip(), str.lstrip() and str.rstrip(). - Use PyUnicode_READ() instead of PyUnicode_READ_CHAR(). - Issue #17615: Comparing two Unicode strings now uses wmemcmp() when possible. - Issue #17615: Expand expensive PyUnicode_READ() macro in unicode_compare(): write specialized functions for each combination of Unicode kinds. - Issue #13126: "Simplify" FASTSEARCH() code to help the compiler to emit more efficient machine code. Patch written by Antoine Pitrou. - Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() when running on valgrind. - Issue #16757: Avoid calling the expensive _PyUnicode_FindMaxChar() function when possible. - Add _PyUnicodeWriter_WriteSubstring() function. - Issue #17591: Use lowercase filenames when including Windows header files. Patch by Roumen Petrov. - Issue #16475: Issue #16475 : Correctly handle the EOF when reading marshal streams. - Issue #16475: Simplify the interface to r_ref_allocate and improve comments. - Issue #15038: Issue #15038 : Fixing the condition broadcast and docs. - Issue #16475: Support object instancing, recursion and interned strings in marshal. - Issue #16795: unify some ast.argument's attrs; change Attribute column offset (closes #16795). - Issue #17434: reject non-docs strings between future imports (closes #17434). - Issue #17117: Have both import itself and importlib.util.set_loader() set __loader__ on a module when set to None. - Issue #17327: Add PyDict_SetDefault. (closes #17327). - Issue #17223: Fix PyUnicode_FromUnicode() on Windows (16-bit wchar_t type) to reject invalid UTF-16 surrogate. - Issue #17220: two fixes for changeset 2528e4aea338. - Issue #17220: Little cleanup of _bootstrap.py. - Issue #15022: Ensure all pickle protocols are supported. - Issue #16967: evaluate lambda keyword-only defaults after positional defaults (#16967 again). - Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter. - Issue #16772: in int(x, base), non-integer bases must have an __index__ method. - Issue #16672: revert #16672 for incorrect semantics. - Issue #15989: Fix several occurrences of integer overflow when result of PyLong_AsLong() narrowed to int without checks. - Issue #15031: Refactor some code in importlib pertaining to validating and compiling bytecode. - Issue #9685: Add a comment about *not* caching the hash value. Issue #9685 suggested to memorize the hash value, but the feature request was rejected because no speed ups were found. - Issue #16281: handle tailmatch() failure and remove useless comment. - Issue #15422: Fix compilation error for #15422. - Issue #16715: Replace IOError with OSError (#16715). - Issue #15422: get rid of PyCFunction_New macro. - Issue #16672: improve tracing performance when f_trace is NULL (closes #16672). - Issue #9856: Replace deprecation warinigs to raising TypeError in object.__format__. - Issue #16719: Get rid of WindowsError. Use OSError instead. - Issue #13390: Following issue #13390, fix compilation --without-pymalloc, and make sys.getallocatedblocks() return 0 in that situation. - Issue #16693: use error label instead of breaking eval loop (closes #16693). - Issue #16421: allow to load multiple modules from the same shared object. - Fix the internals of our hash functions to used unsigned values during hash computation as the overflow behavior of signed integers is undefined. - Issue #13390: New function :func:`sys.getallocatedblocks()` returns the number of memory blocks currently allocated. Also, the ``-R`` option to regrtest uses this function to guard against memory allocation leaks. - Issue #16602: When a weakref's target was part of a long deallocation chain, the object could remain reachable through its weakref even though its refcount had dropped to zero. - Issue #16495: remove extraneous NULL encoding check from bytes_decode(). - Issue #15627: This is simply an update to the name of a new method recently added to importlib.abc.SourceLoader. - Cleanup unicodeobject.c. - Issue #16562: Optimize dict equality testing. Patch by Serhiy Storchaka (reviewed by Martin and Raymond). - Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation failure. - Issue #16501: RISCOS support has been removed a long time ago. Remove last remains in sys.flags code. #16501 can be closed, too. - Issue #15627: Add the compile_source() method to importlib.abc.SourceLoader. - Issue #16451: Refactor to remove duplication between range and slice in slice index computations. - Issue #15894: Document why we don't worry about re-acquiring the global import lock after forking. - Issue #16290: __complex__ must now always return an instance of complex. - Issue #16416: Fix error handling in _Py_wchar2char() _Py_char2wchar() functions. - Issue #16416: OS data are now always encoded/decoded to/from UTF-8/surrogateescape, instead of the locale encoding (which may be ASCII if no locale environment variable is set), to avoid inconsistencies with os.fsencode() and os.fsdecode() functions which are already using UTF-8/surrogateescape. - Issue #14794: slice.indices no longer returns OverflowError for out-of-range start, stop, step or length. - Issue #15001: fix segfault on "del sys.module['__main__']". - Issue #16311: Use the _PyUnicodeWriter API in text decoders. - Issue #7317: Display full tracebacks when an error occurs asynchronously. - Issue #16218: Support non ascii characters in python launcher. - Issue #9566: Use the right type to fix a compiler warnings on Win64. - Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned. - Issue #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x faster. - Issue #16330: Use surrogate-related macros. - Issue #12805: Make bytes.join and bytearray.join faster when the separator is empty. Patch by Serhiy Storchaka. - Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified endianess detection and handling. - Issue #15958: bytes.join and bytearray.join now accept arbitrary buffer objects. - Issue #15833: don't raise an exception if importlib can't write byte-compiled files. - Issue #16191: ceval cleanup. - Issue #16148: Small improvements and cleanup. Added version information to docs. - Cleanup PyUnicode_FromFormatV() for zero padding. - Issue #16147: PyUnicode_FromFormatV() doesn't need anymore to allocate a buffer on the heap to format numbers. - Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument of '%c' is not in the range(0x110000). - Issue #16147: PyUnicode_FromFormatV() now detects integer overflow when parsing width and precision. - Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter API. - Issue #16135: Removal of OS/2 support. - Issue #16135: Removal of OS/2 support (I). - Enable also ptr==ptr optimization in PyUnicode_Compare(). - Issue #15609: Fix refleak introduced by my last optimization. - Issue #15766: Catch exceptions while raising the ImportError in imp.load_dynamic(). - Issue #15609: Optimize str%args for integer argument. C API ----- - Issue #18957: The PYTHONFAULTHANDLER environment variable now only enables the faulthandler module if the variable is non-empty. Same behaviour than other variables like PYTHONDONTWRITEBYTECODE. - 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. - Merge 3.3 into default. - Issue #18912: Fix indentation in docstring. - Get rid of signed/unsigned comparaison in _sre.c. - Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj argument. - Issue #18794: Add a fileno() method and a closed attribute to select.devpoll objects. - Issue #18774: Remove last bits of GNU PTH thread code, patch by Vajrasky Kok. - Issue #18701: Remove sqlitecompat.h. - Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel 3.11 or newer. It's only defined on system with 3.11 uapi headers, too. - Issue #8713: Support alternative start methods in multiprocessing on Unix. - Issue #15721: Fix refcounting issue with extension types in tkinter. (issue #15721). - Issue #18264: int- and float-derived enums now converted to int or float. - Issue #15651: PEP 3121 refactoring for _elementtree. - Issue #15301: Parsing fd, uid, and gid parameters for builtins in Modules/posixmodule.c is now far more robust. - Issue #4885: Add weakref support to mmap objects. Patch by Valerie Lambert. - Issue #17899: Fix rare file descriptor leak in os.listdir(). - Issue #18519: Fix test_sqlite on old versions of libsqlite3. - Issue #18609: Issue #18609, #18408: _ctypes_add_traceback() now clears the current exception while adding the traceback, because it may call indirectly a Python function and Python functions must not be called with an exception set. - Issue #18608: Avoid keeping a strong reference to the locale module inside the _io module. - Issue #18619: Fix atexit leaking callbacks registered from sub-interpreters, and make it GC-aware. - Issue #9035: os.path.ismount now recognises volumes mounted below a drive root on Windows. Original patch by Atsuo Ishimoto. - Issue #15699: The readline module now uses PEP 3121-style module initialization, so as to reclaim allocated resources (Python callbacks) at shutdown. Original patch by Robin Schreiber. - Restore the data block size to 62. - Issue #18519: the Python authorizer callback of sqlite3 must not raise Python exceptions. - Issue #18488: Fix _pysqlite_final_callback(). - Issue #18519: Issue #18519, #18408: Fix sqlite authorizer callback. - Issue #18501: Issue #18501, #18408: Fix expat handlers in pyexpat, don't call Python functions if a Python exception was raised. - Issue #18408: Fix _elementtree.c, don't call Python function from an expat handler if a Python exception is set. - Fix a compiler warning on FreeBSD. - Issue #18408: Fix PyInit__curses_panel(), handle import_curses() failure. - Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call type_call() with an exception set. - Issue #18488: _pysqlite_final_callback() should not clear the exception set by the last call to the step() method of a user function. - Issue #18408: Fix array_tolist(), handle PyList_SetItem() failure. - Issue #18408: Fix array_index(), handle getarrayitem() failure. - Issue #18408: Fix heapq.heappop(), handle PyList_SetSlice() failure. - Issue #18408: Fix time.tzset(), detect exception when calling PyInit_timezone(). - Issue #18408: Fix locale.localeconv(), handle PyDict_SetItemString() failure. - Issue #18408: Fix typo in build_node_tree() of the parser module. - Issue #18408: Fix cjkcodecs decoders, add a new MBERR_EXCEPTION constant to notify exceptions raised by the _PyUnicodeWriter API. - Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure. - Issue #18408: random_seed() now raises a MemoryError on memory allocation failure. - Issue #18408: Fix CJK decoders, raise MemoryError on memory allocation failure. - Issue #18408: Fix pyexpat.ParserCreate(). - Issue #18393: Remove use of deprecated API on OSX. - Issue #18408: Fix constructors of _elementtree.c. - Issue #18408: Fix create_extra() of _elementtree.c, raise MemoryError on memory allocation failure. - Issue #18408: parser module: fix error handling in node2tuple(). - Issue #18408: Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError on memory allocation failure. - Issue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation failures. - Issue #18408: _PyMemoTable_ResizeTable() now restores the old table if allocating a bigger table failed. - Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy the newly created pickler, and not PyObject_GC_Del(). - Issue #18408: Different fixes in _elementtree.c to handle correctly MemoryError. - Issue #18408: _elementtree.c now handles create_extra() failure. - Issue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize all attributes before handling errors. - Issue #18101: Tcl.split() now process strings nested in a tuple as it do with byte strings. - Issue #18338: `python --version` now prints version string to stdout, and not to stderr. Patch by Berker Peksag and Michael Dickens. - Issue #18408: Fix select.select() to handle PyList_New() failure (MemoryError) in set2list(). - Issue #18408: Fix usage of _PyBytes_Resize(). - Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure (MemoryError). - Issue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failure (MemoryError). - Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitems is negative. - Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. cElementTree uses the same approach since at least Python 2.6. - Issue #18227: "Free" function of bz2, lzma and zlib modules has no return value (void). - Issue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the password. - Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modules. - Fix a compiler warning in posix_sendfile() on FreeBSD:. - Issue #18203: Replace malloc() with PyMem_Malloc() in Python modules. - Use macros for marking and checking endpoints in the doubly-linked list of blocks. - Refactor deque_traverse(). - Speed-up deque indexing by changing the deque block length to a power of two. - Issue #1: Fix resource leak in pickle module CID 983309 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable unicode_str going out of scope leaks the storage it points to. - Issue #1: Fix NULL ptr dereferencing in local_timezone(). nameo can be NULL CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) var_deref_op: Dereferencing null pointer _py_decref_tmp. - Issue #1: Fix memory leak in pyexpat PyUnknownEncodingHandler CID 1040367 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable u going out of scope leaks the storage it points to. - Fix time.mktime() and datetime.datetime.timestamp() on AIX. - (Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999. - Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods of socket.socket objects now truncate the input buffer to INT_MAX bytes on Windows to avoid an integer overflow. - Issue #9566: _winapi.WriteFile() now truncates length to DWORD_MAX (4294967295). - Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning on Windows x64. - Issue #9566: _io: Use Py_SAFE_DOWNCAST for fix a compiler warning on Windows x64. - Misc improvements to collections.deque(). - Issue #11016: Don't define macros and constants that are already set by pyport.h. - Issue #11016: Detect integer conversion on conversion from Python int to C mode_t. - Issue #11016: Try to fix compilaton of the new _stat.c module on Windows. - Issue #11016: Add C implementation of the stat module as _stat. - Issue #18147: Add diagnostic functions to ssl.SSLContext(). - Issue #17269: (3.3->default) Ensure that the fix for #17269 also works on OSX 10.4. - Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store. - Issue #18143: Implement ssl.get_default_verify_paths() in order to debug the default locations for cafile and capath. - Issue #17931: Resolve confusion on Windows between pids and process handles. - Add reference implementation for PEP 443. - Issue #13772: Use syntax for literal wchar_t character. - Issue #13772: Mark helper functions as private (static). - Issue #13772: Fix a compiler warning on Windows. - Issue #13772: fix _check_dirA(): call *A() functions, not *W() functions. - Issue #13772: Fix compiler warnings on Windows. - Issue #9566: Fix compiler warning on Windows 64-bit in _bz2module.c. - Issue #17206: don't expand the operand to Py_XINCREF/XDECREF/CLEAR/DECREF multiple times (closes #17206). - Issue #13612: handle unknown encodings without a buffer overflow. - Fix compilation under MSVC: ssl_set_mode() is a macro, and the MSVC preprocessor doesn't process #ifdef's inside a macro argument list. - Issue #8240: Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag on SSL sockets. - Issue #17269: Workaround for a platform bug in getaddrinfo on OSX. - Issue #17683: socket module: return AF_UNIX addresses in Linux abstract namespace as string. - Issue #17914: We can now inline _bsd_cpu_count(). - Issue #17914: Remove OS-X special-case, and use the correct int type. - Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an initial patch by Trent Nelson. - _elementtree.XMLParser._setevents should support any sequence, not just tuples. - Issue #17901: fix TreeBuilder construction for an explicit element_factory=None. - Issue #17989: element_setattro returned incorrect error value. - Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity. - Issue #14596: The struct.Struct() objects now use more compact implementation. - Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function is long, not int. - Issue #5845: Enable tab-completion in the interactive interpreter by default, thanks to a new sys.__interactivehook__. - Issue #17804: New function ``struct.iter_unpack`` allows for streaming struct unpacking. - Issue #16694: Add a pure Python implementation of the operator module. Patch by Zachary Ware. - Make C and Python implementations of pickle load STRING opcodes the same way. - Issue #17693: CJK encoders now use the new Unicode API (PEP 393). - Issue #8109: Fix a crash when setting a servername callback on a SSL server socket and the client doesn't send a server name. Patch by Kazuhiro Yoshida. (originally issue #8109). - Issue #14439: Python now prints the traceback on runpy failure at startup. - Issue #15596: Faster pickling of unicode strings. - Issue #17581: Further compiling fixes (issue #17581). - Issue #15927: Fix cvs.reader parsing of escaped \r\n with quoting off. - Issue #8862: Fix curses cleanup with getchar is interrupted by a signal. - Issue #17223: Add another test to check that _PyUnicode_Ready() rejects code points bigger than U+10ffff. - Issue #17275: Fix class name in init errors in C bufferedio classes. - Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob. - Issue #17192: Import libffi-3.0.12. - Issue #13773: sqlite3.connect() gets a new `uri` parameter to pass the filename as a URI, allowing to pass custom options. - Issue #16686: Fixed a lot of bugs in audioop module. - Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by Brian Thorne. - Issue #13886: Fix input() to not strip out supposedly-invalid input bytes. - Issue #1602133: 'environ' is not really available with shared libraries on OSX (merge from 3.3). - Issue #16982: Fix --without-threads build failure. - Issue #16922: fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text. - Issue #16076: fix refleak in pickling of Element. - Issue #16876: Revert be8e6b81284e, which wasn't thread-safe: wait until a solution is found for poll(). - Issue #16398: Optimize deque.rotate(). - Issue #16076: make _elementtree.Element pickle-able in a way that is compatible with the Python version of the class. - Issue #16876: Optimize epoll.poll() by keeping a per-instance epoll events buffer instead of allocating a new one at each poll(). - Issue #8109: Fix returning uninitialized variable (issue #8109). Found by Christian with Coverity. - Issue #8109: The ssl module now has support for server-side SNI, thanks to a :meth:`SSLContext.set_servername_callback` method. Patch by Daniel Black. - The get() and iter() are now able to accept keyword arguments. - Issue #16828: Fix error incorrectly raised by bz2.compress(b'') and bz2.BZ2Compressor.compress(b''). - Issue #11939: Fix #11939. Set st_dev attribute on Windows to simplify os.path.samefile. - Issue #16443: Add docstrings to regular expression match objects. - Issue #16496: Simplify random_seed to use _PyLong_AsByteArray. Closes issue #16496. - Issue #16717: get rid of socket.error, replace with OSError. - Issue #16714: use 'raise' exceptions, don't 'throw'. - Issue #16488: epoll() objects now support the `with` statement. Patch by Serhiy Storchaka. - Issue #16421: Rename test module names for #16421 to don't clash with other tests. - 1 << 31 is invalid for signed integers, fix it by making 1 unsigned. - Issue #15677: Document that zlib and gzip accept a compression level of 0 to mean 'no compression'. - Issue #16411: Fix a bug where zlib.decompressobj().flush() might try to access previously-freed memory. - Issue #16350: Issue #16350, part 2: Set unused_data (and unconsumed_tail) correctly in decompressobj().flush(). - Issue #15478: Oops, fix regression in os.open() on Windows. - Issue #16350: Fix zlib decompressor handling of unused_data with multiple calls to decompress() after EOF. - Issue #16309: Make PYTHONPATH= behavior the same as if PYTHONPATH not set at all. - Issue #15478: Use source filename in OSError, not destination filename. - Issue #9566: Explicit downcast to fix compiler warnings on Win64. - Issue #16351: New function gc.get_stats() returns per-generation collection statistics. - Issue #16330: Fix compilation on Windows. - Issue #15478: Fix compilation on Windows. - Issue #15478: Raising an OSError doesn't decode or encode the filename anymore. - Issue #14897: Enhance error messages of struct.pack and struct.pack_into. - Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle. Patch by Atsuo Ishimoto. - Issue #16234: Modify sha3's block_size method to return NotImplemented. This makes the sha3 types unusable from the hmac module. HMAC-SHA3 hasn't been specified yet. - Issue #15721: make _tkinter module pep384 compatible. - Issue #16113: integrade SHA-3 (Keccak) patch from http://hg.python.org/sandbox/cheimes. - Issue #14446: Remove deprecated tkinter functions: Delete an unused function to avoid a warning. - Issue #14446: Remove deprecated tkinter functions: Delete an unused function to avoid a warning. - Issue #16135: Removal of OS/2 support (Modules/*). - Issue #16135: Removal of OS/2 support (posixmodule y platform dependent files). - Issue #14446: Remove deprecated tkinter functions. - Issue #15488: Closed files keep their buffer alive. - Issue #9650: List commonly used format codes in time.strftime and time.strptime docsttings. IDLE ---- - Merge 3.3 into default. - Issue #18081: Back out temporary changeset, 2a9e1eb3719c, to merge new patch. If buildbots run before next push, test_logging will (temporarily) fail. - Issue #18081: Workaround "./python -m test_idle test_logging" failure. - Issue #17719: fix incorrect version number in deprecation doc. - Issue #5066: Update IDLE docs. - Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE. - Issue #16511: Use default IDLE width and height if config param is not valid. - Issue #1207589: Add Cut/Copy/Paste items to IDLE right click Context Menu. - Issue #16123: IDLE - deprecate running without a subprocess. - Issue #14997: disable in idle shell window. Tests ----- - Issue #18945: Add tests for tempfile name collision handling. - Issue #17324: Fix http.server's request handling case on trailing '/'. - Get "stopped" back into repr(Thread) when appropriate. - Issue 18984: Remove ._stopped Event from Thread internals. - Issue #18904: test_os and test_socket use unittest.skipIf() to check if fcntl module is present (to record skipped tests). - Issue #18808: Issue #18808 again: fix the after-fork logic for not-yet-started or already-stopped threads. (AFAICT, in theory, we must reset all the locks, not just those in use). - Issue #18963: skip test_selectors.test_above_fd_setsize on older OS X versions. - Issue #18904: test_socket: add inheritance tests using fcntl and FD_CLOEXEC. - Issue #18904: Improve os.get/set_inheritable() tests. - Issue #18963: Fix test_selectors.test_above_fd_setsize on OS X, where the default RLIMIT_NOFILE hard limit can be RLIMIT_INFINITY. - Issue #18206: merge from 3.3. - Merge 3.3 into default. - Issue #18934: Relax test_multiprocessing.test_invalid_handles a bit: we just want to check that Connection.poll() doesn't crash. - Issue #18623: Factor out the _SuppressCoreFiles context manager into test.support. Patch by Valerie Lambert. - Issue #18924: Block naive attempts to change an Enum member. - Issue #18920: argparse's default version action (for -v, --version) should output to stdout, matching the 'python -v'. - Issue #16853: Add new selectors module. - Issue #18882: Add threading.main_thread() function. - Issue #18901: The sunau getparams method now returns a namedtuple rather than a plain tuple. Patch by Claudiu Popa. - Issue #17487: The result of the wave getparams method now is pickleable again. Patch by Claudiu Popa. - Remove unused --debug option of regrtest. - Refactor the main function of regrtest a bit. - Issue #18571: Merge duplicate test code. - Issue #11798: fix tests for regrtest -R :. - Issue #18720: Switch the AF_* and SOCK_* constants in the socket module to IntEnum. - Issue #18780: code cleanup. - Issue #17741: Rename IncrementalParser and its methods. - Issue #8713: Print dangling processes/threads, if any. - Issue #8713: Cleanup before saving process._dangling. - Issue #8713: Test should not print message about start method. - Issue #11798: Fix tests for #11798. - Issue #18786: Don't reinstall old SIGUSR1 handler prematurely. - test_posix.test_pipe2() now checks that the O_NONBLOCK flag is set. - 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 #18762: Print debug info on failure to create new forkserver process. - Issue #2537: Remove breaked check which prevented valid regular expressions. Patch by Meador Inge. - Issue #18585: Fix the default placeholder in textwrap.shorten() to be " [...]". For some reason I forgot to do it before committing the patch in issue #18585. - Issue #18698: ensure importlib.reload() returns the module out of sys.modules. - Issue #12015: The tempfile module now uses a suffix of 8 random characters instead of 6, to reduce the risk of filename collision. The entropy was reduced when uppercase letters were removed from the charset used to generate random characters. - merge from 3.3. - Issue #15301: skip new test method so Windows builtbots stop failing. - Issue #18693: __dir__ removed from Enum; help() now helpful. - Issue #18600: add policy to add_string, and as_bytes and __bytes__ methods. - Issue #18665: fix typos. Patch by Vajrasky Kok. - Issue #18666: improve test_frame a bit. Patch by Vajrasky Kok. - Issue #14323: Expanded the number of digits in the coefficients for the RGB -- YIQ conversions so that they match the FCC NTSC versions. - Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures. - Issue #18659: fix test_format test that wasn't being executed. Thanks Vajrasky Kok for the patch. - Issue #18635: Move class level private attribute from instance to class. - Issue #17616: Improve context manager tests, fix bugs in close method and mode docs. - Issue #17616: wave.open now supports the 'with' statement. - Issue #15494: test.support is now a package rather than a module. - Issue #13266: Add inspect.unwrap. - Issue #18545: now only executes member_type if no _value_ is assigned in __new__. - Issue #17818: aifc.getparams now returns a namedtuple. - Issue #18503: small cleanups in test_email. - Issue #9177: Calling read() or write() now raises ValueError, not AttributeError, on a closed SSL socket. Patch by Senko Rasic. - Change _names to _names_ since the latter is reserved for Enum use. - Issue #18508: Close #18508 -- fix _value2member_map to always have the member's value. - closes issue18042 -- a `unique` decorator is added to enum.py. - Issue #18393: Also remove a (broken) leaker test for the code removed in issue #18393. - test_io: check_interrupted_write() now cancels the alarm if ZeroDivisionError exception was not raised. - Issue #18116: getpass no longer always falls back to stdin. - Issue #18106: refactor tests to use subtests and proper assert methods. Patch by Vajrasky Kok. - Issue #15767: Excise the remaining instances of ModuleNotFoundError. - Issue #15767: Back out 8d28d44f3a9a related to ModuleNotFoundError. - (Merge 3.3) test_faulthandler: skip test_read_null() on AIX. - Issue #18038: Use non-deprecated assert names in tests. - Issue #17914: Use os.cpu_count() instead of multiprocessing.cpu_count() where applicable. - Issue #17206: Fix test_cmd_line and test_faulthandler for my previous change (test.regrtest and test.script_helper enable faulthandler module in subprocesses). - Issue #11390: fix test failures due to readline and windows lineneds. - Issue #11390: convert doctest CLI to argparse and add -o and -f options. - (Merge 3.3) test_faulthandler: use _sigsegv() instead of _read_null(). - Issue #18238: Skip test_signal.test_sigwaitinfo_interrupted() on AIX. - Issue #18228: Use locale.setlocale(name, None) instead of locale.getlocale(name) in test.regrtest.saved_test_environment. - Issue #18228: Fix locale test of test.regrtest.saved_test_environment. - Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds in ASN1_TIME fields. - Issue #18223: Refactor test_tarfile. - Issue #17177: The imp module is pending deprecation. - Issue #17177: stop using imp in test_importlib. - Issue #17177: Stop using imp in zipfile. - Issue #17177: Stop using imp in a bunch of tests. - Issue #17177: Stop using imp with py_compile. - Issue #17177: stop using imp for compileall. - Closes issue 17947. Adds PEP-0435 (Adding an Enum type to the Python standard library). - Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache. Patch by Mark Levitt. - Issue #18193: Add importlib.reload(), documenting (but not implementing in code) the deprecation of imp.reload(). - Remove a dead import line. - Issue #18048: Rename test_pep263.py to test_source_encoding.py. - Issue #15767: Add an explicit test for raising ModuleNotFoundError when None in sys.modules. - Issue #281857369: Partially revert changeset #281857369a78 to make sure threads are reaped in all situations. - Issue #18158: delete test_importhooks. Redundant in the face of test_importlib. - Issue #18150: duplicate test inside TestSingleDispatch. - Issue #7732: Move an imp.find_module test from test_import to test_imp. - Issue #11959: SMTPServer and SMTPChannel now take an optional map, use of which avoids affecting global state. - Issue #17403: merge from 3.3. - Issue #18072: Implement get_code() for importlib.abc.InspectLoader and ExecutionLoader. - Move importlib.abc.SourceLoader.source_to_code() to InspectLoader. - Issue #16832: Fix #16832 - expose cache validity checking support in ABCMeta. - Issue #18046: Simplified logging internals relating to levels and their names. Thanks to Alex Gaynor for the patch. - Issue #17272: Fix #17272 - Make Request.full_url and Request.get_full_url return same result under all circumstances. Document the change of Request.full_url to a property. - Issue #17900: Allowed pickling of recursive OrderedDicts. Decreased pickled size and pickling time. - Issue #17684: Fix some test_socket failures due to limited FD passing support on OS-X. Patch by Jeff Ramnani. - Add some testing to verify which module was imported in ET tests. - Issue #17988: remove unused alias for Element and rename the used one. - Undo the deprecation of _asdict(). - Issue #17999: reset __class__, so multiple runs don't fail (closes #17999). - Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't accidentally hang. - Issue #11816: Add missing test helper. - Issue #11816: switch test_peepholer to bytecode_helper. - Issue #11816: multiple improvements to the dis module. - Issue #15528: Add weakref.finalize to support finalization using weakref callbacks. - Issue #13721: SSLSocket.getpeercert() and SSLSocket.do_handshake() now raise an OSError with ENOTCONN, instead of an AttributeError, when the SSLSocket is not connected. - Issue #17646: refactor traceback.py to reduce code duplication (closes #17646). - 17830: preserve line endings of original file when updating keywords. - Issue #17244: Windows doesn't let you set permissions on directories. - Issue #17353: (3.3->default) Ensure that plistlib doesn't corrupt deeply nested datastructures. - Issue #16624: `subprocess.check_output` now accepts an `input` argument, allowing the subprocess's stdin to be provided as a (byte) string. Patch by Zack Weinberg. - Issue #17065: Use process-unique key for winreg test. - Issue #9607: restore keywords.kwlist after testing it. - Issue #9607: Add tests for the keyword module. - Issue #17741: Add ElementTree.IncrementalParser, an event-driven parser for non- blocking applications. - Issue #17713: Added failure diagnostics to test. - Issue #17341: Include name in re error message about invalid group name. - Issue #17713: additional tweak to test. - Issue #17713: Fixed bug in test_compute_rollover_weekly_attime. - Issue #17713: Test temporarily skipped while failure investigated. - Issue #13355: Raise ValueError on random.triangular call with invalid params. - Issue #16658: add missing return to HTTPConnection.send(). - Issue #9556: Allowed specifying a time-of-day for a TimedRotatingFileHandler to rotate. - Issue #17699: Fix the new getpass test failures on windows. - Issue #13056: Reenable test_multibytecodec.Test_StreamWriter tests. - Issue #5609: merge from 3.3. - Issue #17487: wave.getparams now returns a namedtuple. - Issue #17675: make socket repr() provide local and remote addresses (if any). - Issue #17648: #17648 - Clean up test_urllib2.py. Converted doctests to unittest for expansion. - Issue #17615: Add tests comparing Unicode strings of different kinds. - Issue #17484: Actually add the getpass tests this time. - Issue #17484: add tests for getpass. - Issue #6822: ftplib.FTP.storlines() expects a binary file, not a text file. - Issue #17492: Additional tests for random module. - Issue #14135: Let's try this again. - Issue #14135: Make sure tests don't leave the locale changed for any category. - Issue #17435: Don't use mutable default values in Timer. - Issue #17516: remove dead code. - Issue #17516: do not create useless tuple: remove dummy commas in tests. - Issue #17516: use comment syntax for comments, instead of multiline string. - Issue #17150: pprint now uses line continuations to wrap long string literals. - Issue #17472: add tests for a couple of untested methods in urllib.urlparse. - Issue #5713: Handle 421 error codes during sendmail by closing the socket. - Use a larger amount of data for tests such as the interrupted_write tests that depend on filling up an OS pipe so that they work properly on systems configured with large pipe buffers. - Issue #17485: Delete the Content-Length header if the data attribute is deleted. - Issue #17476: make allmethods actually return all methods. - Issue #17464: improve pydoc test coverage. - Issue #17474: #17474 - Remove the various deprecated methods of Request class. - Issue #5024: whichhdr now returns the frame count for WAV files. - Issue #17448: Make test_sax skip if there are no xml parsers. - Issue #1291: #1291 http.server's send_error takes an optional explain argument. - Issue #17099: Have importlib.find_loader() raise ValueError when __loader__ is not set on a module. This brings the exception in line with when __loader__ is None (which is equivalent to not having the attribute defined). - Issue #17395: wait for live children in test_multiprocessing. - Issue #15806: Add contextlib.ignored(). - Issue #17384: Consolidated cleanup operations in tests. - Issue #17223: the test is specific to 32-bit wchar_t type. - Issue #14645: Generator now emits correct linesep for all parts. - Issue #17312: unlink a file that test_aifc was leaving around. - Issue #16935: update test_crypt now that unittest discover understands SkipTest. - Issue #17313: Deleted test file created by test_logging. - Issue #17283: Share code between __main__.py and regrtest.py in Lib/test. - Issue #6623: Add explicit deprecation warning for ftplib.Netrc. - Issue #13700: Make imap.authenticate with authobject work. - Issue #17064: fix sporadic permission errors in test_mailbox on windows. - Issue #17107: Test client-side SNI support in urllib.request thanks to the new server-side SNI support in the ssl module. Initial patch by Daniel Black. - Issue #17122: Fix and cleanup test_functools.py. - Issue #17076: Make copying of xattrs more permissive of missing FS support. - Issue #9708: Fix support for iterparse(parser=...) argument per documentation. - Issue #12323: Strengthen error checking of the position XPath selectors. - Issue #12411: merge from 3.3. - Issue #14377: Add a new parameter to ElementTree.write and some module-level serialization functions - short_empty_elements. It controls how elements without contents are emitted. - Issue #16259: delete some no-longer-used code from regrtest. - Issue #15442: Expand the list of default directories ignored by filecmp.dircmp and expose it as a module attribute. - Issue #16613: Added optional mapping argument to ChainMap.new_child. - Issue #3583: mention that testing whether a bad address not triggering an OSError can mean a bad DNS server and not an actual bug. - Issue #16854: Fix regrtest.usage() regression introduced in 6e2e5adc0400. - Issue #16833: In http.client.HTTPConnection, do not concatenate the request headers and body when the payload exceeds 16 KB, since it can consume more memory for no benefit. Patch by Benno Leslie. - Issue #16486: Make aifc files work with 'with' as context managers. - Issue #15302: Switch regrtest from using getopt to using argparse. - Issue #16618: Make glob.glob match consistently across strings and bytes. - Issue #10646: Add tests for Issue #10646. - Issue #16720: Use OESeeror instead of os.error (#16720). - Issue #16045: add more unit tests for built-in int(). - Issue #16705: Get rig of EnvironmentError (#16705). - Issue #16705: Replace mmap.error with OSError, #16705. - Issue #16704: Get rid of select.error in stdlib. Use OSError instead. - Issue #16647: save socket error details in LMTP.connect(). - Issue #16664: Add regression tests for glob's behaviour concerning "."-entries. - Issue #11175: argparse.FileType now accepts encoding and errors arguments. - Issue #16049: add abc.ABC helper class. - Issue #15872: Some more Windows related tuning to shutil.rmtree tests. - Issue #15872: Be flexible with appending *.* in shutil.rmtree test case. - Issue #15872: More shutil test fixes for Windows. - Issue #15872: Fix 3.3 regression introduced by the new fd-based shutil.rmtree. - Issue #16616: Enable test in test_poll which was (accidentally?) disabled. - Issue #16444: test more bytes in support.TESTFN_UNDECODABLE to support more Windows code pages. - Issue #13120: Allow to call pdb.set_trace() from thread. - Issue #16333: use (",", ": ") as default separator when indent is specified to avoid trailing whitespace. Patch by Serhiy Storchaka. - Issue #16464: reset Request's Content-Length header on .data change. It will be recalculated on sending request to HTTP server. - Issue #16423: urllib.request now has support for ``data:`` URLs. Patch by Mathias Panzenböck. - Issue #4473: Add a POP3.stls() to switch a clear-text POP3 session into an encrypted POP3 session, on supported servers. Patch by Lorenzo Catucci. - Issue #4473: Add a POP3.capa() method to query the capabilities advertised by the POP3 server. Patch by Lorenzo Catucci. - Issue #16522: Add FAIL_FAST flag to doctest. - Issue #16501: Remove sys.platform == 'riscos' checks from some Python and test files. #16501. - Issue #10966: Remove the concept of unexpected skipped tests. - Issue #14631: Add a new :class:`weakref.WeakMethod` to simulate weak references to bound methods. - Issue #16469: Fraction(float('nan')) and Fraction(float('inf')) now raise ValueError and OverflowError (resp.), not TypeError. - Issue #12428: Add a pure Python implementation of functools.partial(). Patch by Brian Thorne. - Issue #15478: os.lchflags() is not always available when os.chflags() is available. - Issue #16140: The subprocess module no longer double closes its child subprocess.PIPE parent file descriptors on child error prior to exec(). - Issue #16444: disable undecodable characters in test_non_ascii() test until the FreeBSD issue is fixed. - Issue #16444: Issue #16444, #16218: Use TESTFN_UNDECODABLE on UNIX. - Issue #16414: Fix test_os on Windows, don't test os.listdir() with undecodable. - Issue #16414: Test more characters for support.FS_NONASCII. - Issue #16414: Fix typo in support.TESTFN_NONASCII (useless space). - Issue #16414: Fix support.TESTFN_UNDECODABLE and test_genericpath.test_nonascii_abspath(). - Issue #16414: Add support.FS_NONASCII and support.TESTFN_NONASCII. - Issue #15641: Clean up deprecated classes from importlib. - Issue #16218: Fix test for issue again. - Issue #15165: Fix test_email on Windows 64 bits. - Issue #15478: Fix test_pep277 on Windows. - Issue #16284: Prevent keeping unnecessary references to worker functions in concurrent.futures ThreadPoolExecutor. - Issue #16218: skip test if filesystem doesn't support required encoding. - Issue #16218: Fix broken test for supporting nonascii characters in python launcher. - Issue #16373: Prevent infinite recursion for ABC Set class operations. - Issue #15441: Issue #15441, #15478: Reenable test_nonascii_abspath() on Windows. - Issue #15478: Fix again to fix test_os on Windows. - Issue #16377: Fix bisect unittest. - Issue #12890: fix test on windows. - Issue #15478: Fix test_os on FreeBSD. - Issue #15478: Fix test_os on Windows (os.chown is missing). - Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions. - Issue #12890: skip tests which fail on windows until fixed or rewritten. - Issue #15889: make regrtest --start succeed in more cases. - Issue #12890: don't emit

tags in text mode when logdir specified. - Issue #15043: Improve test_gdb support of gdb >= 7.4. - Issue #16301: Fix the ResourceWarning in test_urllib.py due changes made for #16301. Patch by Berker Peksag. - Issue #16301: Fix the localhost verification in urllib/request.py for file://. Modify tests to use localhost for local temp files, which could make Windows Buildbot (#16300) happy. - Issue #16250: Fix the invocations of URLError which had misplaced filename attribute for exception. - Issue #10836: Fix exception raised when file not found in urlretrieve. - Issue #12692: Fix resource leak in urllib.request. - Issue #16264: Try to fix issue #16264 (test_logging failure on some buildbots). - Issue #15776: pyvenv now works with existing directories. - Issue #16135: Removal of OS/2 support (distutils) (II). - Use setUpClass() and tearDownClass() in test_multiprocessing. - Issue #1492704: Make shutil.copyfile() raise a distinct SameFileError. - Issue #16025: Minor corrections to the zipfile documentation. - Issue #13896: Make shelf instances work with 'with' as context managers. - Issue #16135: Removal of OS/2 support (Python code partial cleanup). - Issue #16135: Removal of OS/2 support (Remove OS2 and OS/2 references). - Issue #15452: Added verify option for logging configuration socket listener. - Issue #2489: pty.spawn() now returns the child process status as returned by os.waitpid(). Addresses the remaining feature request from issue #2489. Library ------- - Removing the merge conflict markers. - Issue #14927: merge from 3.3. - Issue #18962: Optimize the single iterator case for heapq.merge(). - Another stab at the thread cleanup patch. - Backed out changeset 1f5a7853680c. - Minor cleanup of the new scheme for detecting thread termination. - Issue #18934: Use poll/select-based selectors for multiprocessing.Connection, to avoid one extra FD per Connection. - Issue #18438: merge from 3.3. - Issue 18808: blind attempt to repair some buildbot failures. - Issue #18852: Handle readline.__doc__ being None in site.py readline activation. - Issue #15350: merge from 3.3. - Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write their version strings to stdout, and not to sderr. - Issue #18901: Issues #18901, #18919: Fix a typo in the _sunau_params name. - Back out 868ad6fa8e68 - it left all the buildbots failing. - Issue #17974: Switch unittest from using getopt to using argparse. - Issue #11798: TestSuite now drops references to own tests after execution. - Issue #18865: PEP 446 makes multiprocessing.util.pipe() unnecessary. - Remove the obsolete XMLParser._start/_start_list duality. - Issue #18807: pyvenv now takes a --copies argument allowing copies instead of symlinks even where symlinks are available and the default. - Issue #18538: ``python -m dis`` now uses argparse. - Issue #17741: use composition, rather than inheritance, for xml.etree.iterparse's result class. Patch by Stefan Behnel. - Issue #18796: improve documentation of the file argument of dis.show_code. Initial patch by Vajrasky Kok. - Issue #18394: Explicitly close the file object cgi.FieldStorage caches. - Issue #18762: Fix EBADF error when using forkserver. - Issue #18647: Correctly bound calculated min/max width of a subexpression. - Issue #18598: Have the exception message for importlib.import_module() include the name of the module when the 'package' argument is missing but needed. - Issue #18671: Output more information when logging exceptions occur. - Issue #18621: Prevent the site module's patched builtins from keeping too many references alive for too long. - Issue #18479: Changed venv Activate.ps1 to make deactivate a function, and removed Deactivate.ps1. - Issue #18020: improve html.escape speed by an order of magnitude. Patch by Matt Bryant. - Issue #17860: (3.3->default) Cleanup of documentation change from #17860. - Improve imap error message in unusual failure mode. - Issue #11454: Reduce email module load time, improve surrogate check efficiency. - Issue #18179: document the local_hostname parameter. - Issue #17222: fix a mix-up in some exception messages. - Issue #17177: Stop using imp in sysconfig. - Issue #17177: switch from imp.new_module to types.ModuleType for runpy. - Issue #17177: Stop using imp in pydoc. - Issue #17177: Stop using imp in multiprocessing. - Issue #17177: Stop using imp in distutils. - Issue #18194: Introduce importlib.util.cache_from_source() and source_from_cache(), finishing the work introduced in changset 4134:9cacdb9d0c59. - Issue #18200: Update the stdlib (except tests) to use ModuleNotFoundError. - Issue #18157: stop using imp.load_module() in imp. - Issue #15528: Delay importing atexit until weakref.finalize() used. - Issue #17314: Stop using imp in multiprocessing.forking and move over to importlib. - Issue #17967: merge from 3.3. - merge from 3.3. - Issue #18066: remove vestigial code depending on the sgi module. - Issue #17967: merge from 3.3. - Issue #18011: Silence an unrelated noise introduced in changeset 1b5ef05d6ced. - Issue #5845: avoid an exception at startup on OS X if no .editrc file exists. - Issue #14679: add an __all__ (that contains only HTMLParser) to html.parser. - Issue #11182: remove the unused and undocumented pydoc.Scanner class. Patch by Martin Morrison. - Issue #2118: IOError is deprecated, use OSError. - Issue #16551: Closes #16551. Cleanup pickle.py. - Issue #16804: Fix 'python -S -m site' failure. - Issue #2118: Make SMTPException a subclass of IOError. - Do not raise exception on close() on account of socket attribute still being None:. - Issue #17678: Remove the use of a deprecated method http/cookiejar.py. Changing the usage of get_origin_req_host() to origin_req_host. - Process DEFAULT values in mock side_effect that returns iterator. - Issue #17489: Add explanatory comment that __getstate__ is not called. - Issue #17483: remove unreachable code in urlopen(). - Issue #17025: multiprocessing: Reduce Queue and SimpleQueue contention. - Issue #17025: Add dumps() and loads() to ForkingPickler. - Issue #17510: avoid using deprecated assertEquals method in test_program. Patch by Daniel Black. - Issue #13248: removed deprecated and undocumented difflib.isbjunk, isbpopular. - Issue #17443: Fix buffering in IMAP4_stream. - Issue #17460: Remove the strict argument of HTTPConnection and removing the DeprecationWarning being issued from 3.2 onwards. - Issue #16057: Clarify why the base method default is called in custom encoders. - Issue #17047: remove doubled words added in 3.4, as reported by Serhiy Storchaka and Matthew Barnett. - Issue #17385: Fix quadratic behavior in threading.Condition. - Issue #16954: Add docstrings for ElementTree. - Issue #16098: Update heapq.nsmallest to use the same algorithm as nlargest. - Issue #16935: unittest now counts the module as skipped if it raises SkipTest, instead of counting it as an error. Patch by Zachary Ware. - Issue #17197: profile/cProfile modules refactored so that code of run() and runctx() utility functions is not duplicated in both modules. - Issue #15132: Allow a list for the defaultTest argument of unittest.TestProgram. - Issue #15220: simplify and speed up feedparser's line splitting. - Issue #16996: webbrowser module now uses shutil.which() to find a web-browser on the executable search path. - Issue #17158: Add 'symbols' to help() welcome message; clarify 'modules spam' messages. - Issue #17165: fix a bare import in _strptime.py. Patch by Berker Peksag. - Issue #17015: When it has a spec, a Mock object now inspects its signature when matching calls, so that arguments can be matched positionally or by name. - Issue #16972: Have site.addpackage() consider known paths even when none are explicitly passed in. - Issue #15545: fix sqlite3.iterdump regression on unsortable row_factory objects. - Issue #16787: Increase asyncore and asynchat default output buffers size, to decrease CPU usage and increase throughput. - Issue #16640: Run less code under a lock in sched module. - Issue #16788: Fix #16788. Add samestat to Lib/ntpath.py. - Issue #14470: Fix #14470. Remove w9xpopen per PEP 11. - Issue #11797: add fixer for reload() -> imp.reload() (closes #11797)\n\nPatch by Laurie Clark-Michalek and Berker Peksag. - Issue #16477: Close tarfile internal handlers in case of exception. - Issue #16333: fix example in docstring. - Issue #4473: Fix missing import (followup to #4473). - Issue #4473: Ensure the socket is shutdown cleanly in POP3.close(). Patch by Lorenzo Catucci. - Issue #11981: remove duplicate line. Patch by Johan Euphrosine. - Remove the subprocess "bad exception data" warning (formerly a print!) all together and just include the repr of the data in the exception itself instead of the useless string "Unknown". - Issue #16366: Improve diagnostics from handleError(). Thanks to Antoine Pitrou for the suggestion. - Issue #13701: Fix decorator avoidance (due to desire for Python 2.3 compatibility) in decimal module. - Issue #14570: Document json sort_keys parameter properly. - Issue #16034: Issue #16034 follow-up: Apply optimizations to the lzma module. - Issue #16270: urllib may hang when used for retrieving files via FTP by using a context manager. - Issue #15298: ensure _sysconfigdata is generated in build directory, not source directory. - Issue #16135: Removal of OS/2 support (distutils). - Issue #16120: Use |yield from| in stdlib. - Issue #14900: Add aliases for sorting params for pstat to follow column names from pstat output. - Issue #14900: Distuguish call count and primitive call count in pstat output. - Issue #16120: Use |yield from| in stdlib. - Issue #15417: Add support for csh and fish in venv activation scripts. - Issue #16304: Further performance improvements for BZ2File. - Issue #16034: Fix performance regressions in the new BZ2File implementation. Build ----- - Issue #1584: Provide options to override default search paths for Tcl and Tk when building _tkinter. configure has two new options; if used, both must be specified:. - Issue #18257: Fix readlink usage in python-config. Install the python version again on Darwin. - Issue #18481: Add C coverage reporting with gcov and lcov. A new make target "coverage-report" creates an instrumented Python build, runs unit tests and creates a HTML. The report can be updated with "make coverage-lcov". - Issue #17845: Clarify the message setup.py prints upon successfully building Python but having some optional module which didn't build. - Issue #17931: Fix PyLong_FromPid() on Windows 64-bit: processes are identified by their HANDLE which is a pointer (and not a long, which is smaller). - Issue #18075: Fixed #18075 - Infinite recursion tests triggering a segfault on Mac OS X. - Issue #16235: Implement python-config as a shell script. - Issue #16320: Remove redundant Makefile dependencies for strings and bytes. - Issue #15422: Revert back PyCFunction_New macro. Keep PyCFunction_NewEx usage in python core modules (#15422). - Using 'long double' to force this structure to be worst case aligned is no longer required as of Python 2.5+ when the gc_refs changed from an int (4 bytes) to a Py_ssize_t (8 bytes) as the minimum size is 16 bytes. - Issue #6308: Try to fix the termios build failure on HP-UX. - Issue #15958: add join.h to Makefile dependencies for byte strings (thanks Serhiy). - Issue #15819: use standard autoconf preset output variables. - Issue #15819: additional fixes for out-of-tree builds from read-only src. - Issue #16135: Removal of OS/2 support (C code and Docs). Windows ------- - Issue #18491: Added script-wrapper functionality to launcher source (but not to executable). - Issue #17206: On Windows, increase the stack size from 2 MB to 4.2 MB to fix a stack overflow in the marshal module (fix a crash in test_marshal). Patch written by Jeremy Kloth. - Issue #17903: Added path search changes to launcher. - Issue #9566: Fix compiler warning on Windows 64-bit. - Issue #17028: Allowed Python arguments to be supplied to launcher. - Issue #16769: Fix #16769. Remove outdated Visual Studio project directories for VC6, VS7.1, and VS8. - Issue #16197: Fix several small errors in winreg documentation. - Issue #16133: add Windows project file for _sha3 module. I choose to build _sha3 as a sparat module as it's rather large (190k for AMD64). Documentation ------------- - Issue #18980: Enum doc fixes. Patch from Elazar Gershuni. - Issue #18908: Keep Enum docs in their own section. Patch by Elazar Gershuni. - Issue #18338: Update whatsnew/3.4 wrt. --version going to stdout. #18338, #18920, #18922. - Issue #16853: Mention the new selectors module in the select module. - Issue #16853: Mention the new selectors module in What's New in Python 3.4. - Issue #18730: Update whatsnew/3.4.rst wrt. the socket constants switch to IntEnum. - Issue #17741: Fix XMLPullParser documentation to say "non-blocking" instead of "asynchronous". The latter is more ambiguous. - Issue #18673: Add versionchanged to docs. - Issue #18680: Documenting that json.load may raise a ValueError. - Issue #18680: Documenting that json.load may raise a ValueError. - Issue #18680: Documenting that json.load may raise a ValueError. - Issue #18111: Add What's New entry for max/min default. - Issue #12716: reorganize docs for os module a bit. - Issue #17177: Update the programming FAQ to use importlib. - Issue #17907: Document types.ModuleType's constructor and attributes, allowing for documenting imp.new_module() as deprecated. - Issue #1554133: Document PyOS_InputHook, PyOS_ReadlineFunctionPointer. - Issue #17955: minor updates to Functional howto. - Issue #17135: mark imp as deprecated as of 3.4. - Issue #17093: What's new entry for issue #17093. - Issue #17586: fix typo in contextlib.rst. - Issue #16475: Add a whatsnew entry for 3.4. - Issue #17522: Minor documentation fix. - Issue #13248: NEWS and What's New items. - Issue #17176: Document that imp.NullImporter is no longer inserted into sys.path_importer_cache. - Issue #17222: Document that py_compile now uses importlib for its file writing and thus its semantics. - Issue #17327: fix spelling (#17327). - Issue #17327: say defaultobj is returned (#17327). - Issue #17327: remove useless words (#17327). - Issue #15132: Add a "Changed in version" to the docs for issue #15132. - Issue #16921: #16921 Since Win9x is no longer supported, CREATE_NEW_CONSOLE is no longer implied by shell=True. - Issue #9856: Add NEWS and docs for #9856. - Issue #16522: s/always 1/at most 1/. - Issue #16261: fix bare excepts in Doc/. - Merge: Remove already dropped function PySys_GetFile from documentation. - Issue #16135: Removal of OS/2 support (Docs). - Issue #16130: 3.3 -> 3.4 (closes #16130). Tools ----- - Issue #18445: update Tools/scripts/README. - Issue #18445: change permissions on some scripts to executable. - Issue #18569: The installer now adds .py to the PATHEXT variable when extensions are registered. Patch by Paul Moore. - Issue #17177: update checkpyc to stop using imp. - Issue #16245: add a script to generate the html.entities.html5 dict.