• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1+++++++++++
2Python News
3+++++++++++
4
5What's New in Python 3.11.4 final?
6==================================
7
8*Release date: 2023-06-06*
9
10Security
11--------
12
13- gh-issue-103142: The version of OpenSSL used in our binary builds has been
14  upgraded to 1.1.1u to address several CVEs.
15
16- gh-issue-99889: Fixed a security in flaw in :func:`uu.decode` that could
17  allow for directory traversal based on the input if no ``out_file`` was
18  specified.
19
20- gh-issue-104049: Do not expose the local on-disk location in directory
21  indexes produced by :class:`http.client.SimpleHTTPRequestHandler`.
22
23- gh-issue-102153: :func:`urllib.parse.urlsplit` now strips leading C0
24  control and space characters following the specification for URLs defined
25  by WHATWG in response to CVE-2023-24329. Patch by Illia Volochii.
26
27Core and Builtins
28-----------------
29
30- gh-issue-105164: Ensure annotations are set up correctly if the only
31  annotation in a block is within a :keyword:`match` block. Patch by Jelle
32  Zijlstra.
33
34- gh-issue-104615: Fix wrong ordering of assignments in code like ``a, a =
35  x, y``. Contributed by Carl Meyer.
36
37- gh-issue-104482: Fix three error handling bugs in ast.c's validation of
38  pattern matching statements.
39
40- gh-issue-102818: Do not add a frame to the traceback in the
41  ``sys.setprofile`` and ``sys.settrace`` trampoline functions. This ensures
42  that frames are not duplicated if an exception is raised in the callback
43  function, and ensures that frames are not omitted if a C callback is used
44  and that does not add the frame.
45
46- gh-issue-104405: Fix an issue where some :term:`bytecode` instructions
47  could ignore :pep:`523` when "inlining" calls.
48
49- gh-issue-104018: Disallow the "z" format specifier in %-format of bytes
50  objects.
51
52- gh-issue-103971: Fix an issue where incorrect locations numbers could be
53  assigned to code following ``case`` blocks.
54
55- gh-issue-102310: Change the error range for invalid bytes literals.
56
57- gh-issue-103590: Do not wrap a single exception raised from a
58  ``try-except*`` construct in an :exc:`ExceptionGroup`.
59
60- gh-issue-101517: Fix bug in line numbers of instructions emitted for
61  :keyword:`except* <except_star>`.
62
63- gh-issue-103242: Migrate :meth:`~ssl.SSLContext.set_ecdh_curve` method not
64  to use deprecated OpenSSL APIs. Patch by Dong-hee Na.
65
66- gh-issue-102700: Allow built-in modules to be submodules. This allows
67  submodules to be statically linked into a CPython binary.
68
69- gh-issue-101857: Fix xattr support detection on Linux systems by widening
70  the check to linux, not just glibc. This fixes support for musl.
71
72- gh-issue-99184: Bypass instance attribute access of ``__name__`` in
73  ``repr`` of :class:`weakref.ref`.
74
75- gh-issue-96670: The parser now raises :exc:`SyntaxError` when parsing
76  source code containing null bytes. Backported from ``aab01e3``. Patch by
77  Pablo Galindo
78
79- bpo-31821: Fix :func:`!pause_reading` to work when called from
80  :func:`!connection_made` in :mod:`asyncio`.
81
82Library
83-------
84
85- gh-issue-105080: Fixed inconsistent signature on derived classes for
86  :func:`inspect.signature`
87
88- gh-issue-104874: Document the ``__name__`` and ``__supertype__``
89  attributes of :class:`typing.NewType`. Patch by Jelle Zijlstra.
90
91- gh-issue-104340: When an ``asyncio`` pipe protocol loses its connection
92  due to an error, and the caller doesn't await ``wait_closed()`` on the
93  corresponding ``StreamWriter``, don't log a warning about an exception
94  that was never retrieved. After all, according to the
95  ``StreamWriter.close()`` docs, the ``wait_closed()`` call is optional
96  ("not mandatory").
97
98- gh-issue-104372: Refactored the ``_posixsubprocess`` internals to avoid
99  Python C API usage between fork and exec when marking ``pass_fds=`` file
100  descriptors inheritable.
101
102- gh-issue-75367: Fix data descriptor detection in
103  :func:`inspect.getattr_static`.
104
105- gh-issue-104536: Fix a race condition in the internal
106  :mod:`multiprocessing.process` cleanup logic that could manifest as an
107  unintended ``AttributeError`` when calling ``process.close()``.
108
109- gh-issue-104399: Prepare the ``_tkinter`` module for building with Tcl 9.0
110  and future libtommath by replacing usage of deprecated functions
111  :c:func:`mp_to_unsigned_bin_n` and :c:func:`mp_unsigned_bin_size` when
112  necessary.
113
114- gh-issue-104307: :func:`socket.getnameinfo` now releases the GIL while
115  contacting the DNS server
116
117- gh-issue-87695: Fix issue where :meth:`pathlib.Path.glob` raised
118  :exc:`OSError` when it encountered a symlink to an overly long path.
119
120- gh-issue-104265: Prevent possible crash by disallowing instantiation of
121  the :class:`!_csv.Reader` and :class:`!_csv.Writer` types. The regression
122  was introduced in 3.10.0a4 with PR 23224 (:issue:`14935`). Patch by
123  Radislav Chugunov.
124
125- gh-issue-104035: Do not ignore user-defined ``__getstate__`` and
126  ``__setstate__`` methods for slotted frozen dataclasses.
127
128- gh-issue-103987: In :mod:`mmap`, fix several bugs that could lead to
129  access to memory-mapped files after they have been invalidated.
130
131- gh-issue-103935: Use :func:`io.open_code` for files to be executed instead
132  of raw :func:`open`
133
134- gh-issue-100370: Fix potential :exc:`OverflowError` in
135  :meth:`sqlite3.Connection.blobopen` for 32-bit builds. Patch by Erlend E.
136  Aasland.
137
138- gh-issue-103848: Add checks to ensure that ``[`` bracketed ``]`` hosts
139  found by :func:`urllib.parse.urlsplit` are of IPv6 or IPvFuture format.
140
141- gh-issue-103872: Update the bundled copy of pip to version 23.1.2.
142
143- gh-issue-103861: Fix ``zipfile.Zipfile`` creating invalid zip files when
144  ``force_zip64`` was used to add files to them. Patch by Carey Metcalfe.
145
146- gh-issue-103685: Prepare :meth:`tkinter.Menu.index` for Tk 8.7 so that it
147  does not raise ``TclError: expected integer but got ""`` when it should
148  return ``None``.
149
150- gh-issue-81403: :class:`urllib.request.CacheFTPHandler` no longer raises
151  :class:`URLError` if a cached FTP instance is reused. ftplib's endtransfer
152  method calls voidresp to drain the connection to handle FTP instance reuse
153  properly.
154
155- gh-issue-103578: Fixed a bug where :mod:`pdb` crashes when reading source
156  file with different encoding by replacing :func:`io.open` with
157  :func:`io.open_code`. The new method would also call into the hook set by
158  :func:`PyFile_SetOpenCodeHook`.
159
160- gh-issue-103556: Now creating :class:`inspect.Signature` objects with
161  positional-only parameter with a default followed by a
162  positional-or-keyword parameter without one is impossible.
163
164- gh-issue-103559: Update the bundled copy of pip to version 23.1.1.
165
166- gh-issue-103365: Set default Flag boundary to ``STRICT`` and fix bitwise
167  operations.
168
169- gh-issue-103472: Avoid a potential :exc:`ResourceWarning` in
170  :class:`http.client.HTTPConnection` by closing the proxy / tunnel's
171  CONNECT response explicitly.
172
173- gh-issue-103449: Fix a bug in doc string generation in
174  :func:`dataclasses.dataclass`.
175
176- gh-issue-103256: Fixed a bug that caused :mod:`hmac` to raise an exception
177  when the requested hash algorithm was not available in OpenSSL despite
178  being available separately as part of ``hashlib`` itself.  It now falls
179  back properly to the built-in. This could happen when, for example, your
180  OpenSSL does not include SHA3 support and you want to compute
181  ``hmac.digest(b'K', b'M', 'sha3_256')``.
182
183- gh-issue-103225: Fix a bug in :mod:`pdb` when displaying line numbers of
184  module-level source code.
185
186- gh-issue-93910: Remove deprecation of enum ``memmber.member`` access.
187
188- gh-issue-102978: Fixes :func:`unittest.mock.patch` not enforcing function
189  signatures for methods decorated with ``@classmethod`` or
190  ``@staticmethod`` when patch is called with ``autospec=True``.
191
192- gh-issue-103204: Fixes :mod:`http.server` accepting HTTP requests with
193  HTTP version numbers preceded by '+', or '-', or with digit-separating '_'
194  characters.  The length of the version numbers is also constrained.
195
196- gh-issue-102953: The extraction methods in :mod:`tarfile`, and
197  :func:`shutil.unpack_archive`, have a new a *filter* argument that allows
198  limiting tar features than may be surprising or dangerous, such as
199  creating files outside the destination directory. See
200  :ref:`tarfile-extraction-filter` for details.
201
202- gh-issue-101640: :class:`argparse.ArgumentParser` now catches errors when
203  writing messages, such as when :data:`sys.stderr` is ``None``. Patch by
204  Oleg Iarygin.
205
206- gh-issue-96522: Fix potential deadlock in pty.spawn()
207
208- gh-issue-87474: Fix potential file descriptor leaks in
209  :class:`subprocess.Popen`.
210
211Documentation
212-------------
213
214- gh-issue-89455: Add missing documentation for the ``max_group_depth`` and
215  ``max_group_width`` parameters and the ``exceptions`` attribute of the
216  :class:`traceback.TracebackException` class.
217
218- gh-issue-89412: Add missing documentation for the ``end_lineno`` and
219  ``end_offset`` attributes of the :class:`traceback.TracebackException`
220  class.
221
222- gh-issue-104943: Remove mentions of old Python versions in
223  :class:`typing.NamedTuple`.
224
225- gh-issue-67056: Document that the effect of registering or unregistering
226  an :mod:`atexit` cleanup function from within a registered cleanup
227  function is undefined.
228
229- gh-issue-48241: Clarifying documentation about the url parameter to
230  urllib.request.urlopen and urllib.request.Requst needing to be encoded
231  properly.
232
233Tests
234-----
235
236- gh-issue-104494: Update ``test_pack_configure_in`` and
237  ``test_place_configure_in`` for changes to error message formatting in Tk
238  8.7.
239
240- gh-issue-104461: Run test_configure_screen on X11 only, since the
241  ``DISPLAY`` environment variable and ``-screen`` option for toplevels are
242  not useful on Tk for Win32 or Aqua.
243
244- gh-issue-103329: Regression tests for the behaviour of
245  ``unittest.mock.PropertyMock`` were added.
246
247- gh-issue-85984: Utilize new "winsize" functions from termios in pty tests.
248
249- gh-issue-75729: Fix the :func:`os.spawn* <os.spawnl>` tests failing on
250  Windows when the working directory or interpreter path contains spaces.
251
252Build
253-----
254
255- gh-issue-90005: Fix a regression in :file:`configure` where we could end
256  up unintentionally linking with ``libbsd``.
257
258- gh-issue-104106: Add gcc fallback of mkfifoat/mknodat for macOS. Patch by
259  Dong-hee Na.
260
261- gh-issue-99069: Extended workaround defining ``static_assert`` when
262  missing from the libc headers to all clang and gcc builds. In particular,
263  this fixes building on macOS <= 10.10.
264
265Windows
266-------
267
268- gh-issue-105146: Updated the links at the end of the installer to point to
269  Discourse rather than the mailing lists.
270
271- gh-issue-104623: Update Windows installer to use SQLite 3.42.0.
272
273- gh-issue-102997: Update Windows installer to use SQLite 3.41.2.
274
275- gh-issue-88013: Fixed a bug where :exc:`TypeError` was raised when calling
276  :func:`ntpath.realpath` with a bytes parameter in some cases.
277
278macOS
279-----
280
281- gh-issue-103142: Update macOS installer to use OpenSSL 1.1.1u.
282
283- gh-issue-104623: Update macOS installer to SQLite 3.42.0.
284
285- gh-issue-102997: Update macOS installer to SQLite 3.41.2.
286
287IDLE
288----
289
290- gh-issue-104719: Remove IDLE's modification of tokenize.tabsize and test
291  other uses of tokenize data and methods.
292
293- gh-issue-104499: Fix completions for Tk Aqua 8.7 (currently blank).
294
295- gh-issue-104496: About prints both tcl and tk versions if different
296  (expected someday).
297
298- gh-issue-88496: Fix IDLE test hang on macOS.
299
300
301What's New in Python 3.11.3 final?
302==================================
303
304*Release date: 2023-04-04*
305
306Security
307--------
308
309- gh-issue-101727: Updated the OpenSSL version used in Windows and macOS
310  binary release builds to 1.1.1t to address CVE-2023-0286, CVE-2022-4303,
311  and CVE-2022-4303 per `the OpenSSL 2023-02-07 security advisory
312  <https://www.openssl.org/news/secadv/20230207.txt>`_.
313
314- gh-issue-101283: :class:`subprocess.Popen` now uses a safer approach to
315  find ``cmd.exe`` when launching with ``shell=True``. Patch by Eryk Sun,
316  based on a patch by Oleg Iarygin.
317
318Core and Builtins
319-----------------
320
321- gh-issue-101975: Fixed ``stacktop`` value on tracing entries to avoid
322  corruption on garbage collection.
323
324- gh-issue-102701: Fix overflow when creating very large dict.
325
326- gh-issue-102416: Do not memoize incorrectly automatically generated loop
327  rules in the parser. Patch by Pablo Galindo.
328
329- gh-issue-102356: Fix a bug that caused a crash when deallocating deeply
330  nested filter objects. Patch by Marta Gómez Macías.
331
332- gh-issue-102397: Fix segfault from race condition in signal handling
333  during garbage collection. Patch by Kumar Aditya.
334
335- gh-issue-102281: Fix potential nullptr dereference and use of
336  uninitialized memory in fileutils. Patch by Max Bachmann.
337
338- gh-issue-102126: Fix deadlock at shutdown when clearing thread states if
339  any finalizer tries to acquire the runtime head lock. Patch by Kumar
340  Aditya.
341
342- gh-issue-102027: Fix SSE2 and SSE3 detection in ``_blake2`` internal
343  module. Patch by Max Bachmann.
344
345- gh-issue-101967: Fix possible segfault in
346  ``positional_only_passed_as_keyword`` function, when new list created.
347
348- gh-issue-101765: Fix SystemError / segmentation fault in iter
349  ``__reduce__`` when internal access of ``builtins.__dict__`` keys mutates
350  the iter object.
351
352- gh-issue-101696: Invalidate type version tag in ``_PyStaticType_Dealloc``
353  for static types, avoiding bug where a false cache hit could crash the
354  interpreter. Patch by Kumar Aditya.
355
356Library
357-------
358
359- gh-issue-102549: Don't ignore exceptions in member type creation.
360
361- gh-issue-102947: Improve traceback when :func:`dataclasses.fields` is
362  called on a non-dataclass. Patch by Alex Waygood
363
364- gh-issue-102780: The :class:`asyncio.Timeout` context manager now works
365  reliably even when performing cleanup due to task cancellation.
366  Previously it could raise a :exc:`~asyncio.CancelledError` instead of an
367  :exc:`~asyncio.TimeoutError` in such cases.
368
369- gh-issue-88965: typing: Fix a bug relating to substitution in custom
370  classes generic over a :class:`~typing.ParamSpec`. Previously, if the
371  ``ParamSpec`` was substituted with a parameters list that itself contained
372  a :class:`~typing.TypeVar`, the ``TypeVar`` in the parameters list could
373  not be subsequently substituted. This is now fixed.
374
375  Patch by Nikita Sobolev.
376
377- gh-issue-101979: Fix a bug where parentheses in the ``metavar`` argument
378  to :meth:`argparse.ArgumentParser.add_argument` were dropped. Patch by
379  Yeojin Kim.
380
381- gh-issue-102179: Fix :func:`os.dup2` error message for negative fds.
382
383- gh-issue-101961: For the binary mode, :func:`fileinput.hookcompressed`
384  doesn't set the ``encoding`` value even if the value is ``None``. Patch by
385  Gihwan Kim.
386
387- gh-issue-101936: The default value of ``fp`` becomes :class:`io.BytesIO`
388  if :exc:`~urllib.error.HTTPError` is initialized without a designated
389  ``fp`` parameter. Patch by Long Vo.
390
391- gh-issue-102069: Fix ``__weakref__`` descriptor generation for custom
392  dataclasses.
393
394- gh-issue-101566: In zipfile, apply fix for extractall on the underlying
395  zipfile after being wrapped in ``Path``.
396
397- gh-issue-101892: Callable iterators no longer raise :class:`SystemError`
398  when the callable object exhausts the iterator but forgets to either
399  return a sentinel value or raise :class:`StopIteration`.
400
401- gh-issue-97786: Fix potential undefined behaviour in corner cases of
402  floating-point-to-time conversions.
403
404- gh-issue-101517: Fixed bug where :mod:`bdb` looks up the source line with
405  :mod:`linecache` with a ``lineno=None``, which causes it to fail with an
406  unhandled exception.
407
408- gh-issue-101673: Fix a :mod:`pdb` bug where ``ll`` clears the changes to
409  local variables.
410
411- gh-issue-96931: Fix incorrect results from
412  :meth:`ssl.SSLSocket.shared_ciphers`
413
414- gh-issue-88233: Correctly preserve "extra" fields in ``zipfile``
415  regardless of their ordering relative to a zip64 "extra."
416
417- gh-issue-96127: ``inspect.signature`` was raising ``TypeError`` on call
418  with mock objects. Now it correctly returns ``(*args, **kwargs)`` as
419  infered signature.
420
421- gh-issue-95495: When built against OpenSSL 3.0, the :mod:`ssl` module had
422  a bug where it reported unauthenticated EOFs (i.e. without close_notify)
423  as a clean TLS-level EOF. It now raises :exc:`~ssl.SSLEOFError`, matching
424  the behavior in previous versions of OpenSSL. The
425  :attr:`~ssl.SSLContext.options` attribute on :class:`~ssl.SSLContext` also
426  no longer includes :data:`~ssl.OP_IGNORE_UNEXPECTED_EOF` by default. This
427  option may be set to specify the previous OpenSSL 3.0 behavior.
428
429- gh-issue-94440: Fix a :mod:`concurrent.futures.process` bug where
430  ``ProcessPoolExecutor`` shutdown could hang after a future has been
431  quickly submitted and canceled.
432
433Documentation
434-------------
435
436- gh-issue-103112: Add docstring to :meth:`http.client.HTTPResponse.read` to
437  fix ``pydoc`` output.
438
439- gh-issue-85417: Update :mod:`cmath` documentation to clarify behaviour on
440  branch cuts.
441
442- gh-issue-97725: Fix :meth:`asyncio.Task.print_stack` description for
443  ``file=None``. Patch by Oleg Iarygin.
444
445Tests
446-----
447
448- gh-issue-102980: Improve test coverage on :mod:`pdb`.
449
450- gh-issue-102537: Adjust the error handling strategy in
451  ``test_zoneinfo.TzPathTest.python_tzpath_context``. Patch by Paul Ganssle.
452
453- gh-issue-89792: ``test_tools`` now copies up to 10x less source data to a
454  temporary directory during the ``freeze`` test by ignoring git metadata
455  and other artifacts.  It also limits its python build parallelism based on
456  os.cpu_count instead of hard coding it as 8 cores.
457
458- gh-issue-101377: Improved test_locale_calendar_formatweekday of calendar.
459
460Build
461-----
462
463- gh-issue-102711: Fix ``-Wstrict-prototypes`` compiler warnings.
464
465Windows
466-------
467
468- gh-issue-101849: Ensures installer will correctly upgrade existing
469  ``py.exe`` launcher installs.
470
471- gh-issue-101763: Updates copy of libffi bundled with Windows installs to
472  3.4.4.
473
474- gh-issue-101759: Update Windows installer to SQLite 3.40.1.
475
476- gh-issue-101614: Correctly handle extensions built against debug binaries
477  that reference ``python3_d.dll``.
478
479macOS
480-----
481
482- gh-issue-103207: Add instructions to the macOS installer welcome display
483  on how to workaround the macOS 13 Ventura “The installer encountered an
484  error” failure.
485
486- gh-issue-101759: Update macOS installer to SQLite 3.40.1.
487
488
489What's New in Python 3.11.2 final?
490==================================
491
492*Release date: 2023-02-07*
493
494Core and Builtins
495-----------------
496
497- gh-issue-92173: Fix the ``defs`` and ``kwdefs`` arguments to
498  :c:func:`PyEval_EvalCodeEx` and a reference leak in that function.
499
500- gh-issue-101400: Fix wrong lineno in exception message on
501  :keyword:`continue` or :keyword:`break` which are not in a loop. Patch by
502  Dong-hee Na.
503
504- gh-issue-101372: Fix :func:`~unicodedata.is_normalized` to properly handle
505  the UCD 3.2.0 cases. Patch by Dong-hee Na.
506
507- gh-issue-101046: Fix a possible memory leak in the parser when raising
508  :exc:`MemoryError`. Patch by Pablo Galindo
509
510- gh-issue-101037: Fix potential memory underallocation issue for instances
511  of :class:`int` subclasses with value zero.
512
513- gh-issue-100942: Fixed segfault in property.getter/setter/deleter that
514  occurred when a property subclass overrode the ``__new__`` method to
515  return a non-property instance.
516
517- gh-issue-100892: Fix race while iterating over thread states in clearing
518  :class:`threading.local`. Patch by Kumar Aditya.
519
520- gh-issue-100776: Fix misleading default value in :func:`input`'s
521  ``__text_signature__``.
522
523- gh-issue-100637: Fix :func:`int.__sizeof__` calculation to include the 1
524  element ob_digit array for 0 and False.
525
526- gh-issue-100649: Update the native_thread_id field of PyThreadState after
527  fork.
528
529- gh-issue-100374: Fix incorrect result and delay in :func:`socket.getfqdn`.
530  Patch by Dominic Socular.
531
532- gh-issue-99110: Initialize frame->previous in frameobject.c to fix a
533  segmentation fault when accessing frames created by :c:func:`PyFrame_New`.
534
535- gh-issue-100050: Honor existing errors obtained when searching for
536  mismatching parentheses in the tokenizer. Patch by Pablo Galindo
537
538- bpo-32782: ``ctypes`` arrays of length 0 now report a correct itemsize
539  when a ``memoryview`` is constructed from them, rather than always giving
540  a value of 0.
541
542Library
543-------
544
545- gh-issue-101541: [Enum] - fix psuedo-flag creation
546
547- gh-issue-101326: Fix regression when passing ``None`` as second or third
548  argument to ``FutureIter.throw``.
549
550- gh-issue-100795: Avoid potential unexpected ``freeaddrinfo`` call (double
551  free) in :mod:`socket` when when a libc ``getaddrinfo()`` implementation
552  leaves garbage in an output pointer when returning an error. Original
553  patch by Sergey G. Brester.
554
555- gh-issue-101143: Remove unused references to :class:`~asyncio.TimerHandle`
556  in ``asyncio.base_events.BaseEventLoop._add_callback``.
557
558- gh-issue-101144: Make :func:`zipfile.Path.open` and
559  :func:`zipfile.Path.read_text` also accept ``encoding`` as a positional
560  argument. This was the behavior in Python 3.9 and earlier.  3.10
561  introduced a regression where supplying it as a positional argument would
562  lead to a :exc:`TypeError`.
563
564- gh-issue-101015: Fix :func:`typing.get_type_hints` on ``'*tuple[...]'``
565  and ``*tuple[...]``. It must not drop the ``Unpack`` part.
566
567- gh-issue-100573: Fix a Windows :mod:`asyncio` bug with named pipes where a
568  client doing ``os.stat()`` on the pipe would cause an error in the server
569  that disabled serving future requests.
570
571- gh-issue-100805: Modify :func:`random.choice` implementation to once again
572  work with NumPy arrays.
573
574- gh-issue-90104: Avoid RecursionError on ``repr`` if a dataclass field
575  definition has a cyclic reference.
576
577- gh-issue-100750: pass encoding kwarg to subprocess in platform
578
579- gh-issue-100689: Fix crash in :mod:`pyexpat` by statically allocating
580  ``PyExpat_CAPI`` capsule.
581
582- gh-issue-100740: Fix ``unittest.mock.Mock`` not respecting the spec for
583  attribute names prefixed with ``assert``.
584
585- gh-issue-86508: Fix :func:`asyncio.open_connection` to skip binding to
586  local addresses of different family. Patch by Kumar Aditya.
587
588- gh-issue-100287: Fix the interaction of :func:`unittest.mock.seal` with
589  :class:`unittest.mock.AsyncMock`.
590
591- gh-issue-100474: :mod:`http.server` now checks that an index page is
592  actually a regular file before trying to serve it.  This avoids issues
593  with directories named ``index.html``.
594
595- gh-issue-100160: Remove any deprecation warnings in
596  :func:`asyncio.get_event_loop`. They are deferred to Python 3.12.
597
598- gh-issue-96290: Fix handling of partial and invalid UNC drives in
599  ``ntpath.splitdrive()``, and in ``ntpath.normpath()`` on non-Windows
600  systems. Paths such as '\\server' and '\\' are now considered by
601  ``splitdrive()`` to contain only a drive, and consequently are not
602  modified by ``normpath()`` on non-Windows systems. The behaviour of
603  ``normpath()`` on Windows systems is unaffected, as native OS APIs are
604  used. Patch by Eryk Sun, with contributions by Barney Gale.
605
606- gh-issue-78878: Fix crash when creating an instance of
607  :class:`!_ctypes.CField`.
608
609- gh-issue-99952: Fix a reference undercounting issue in
610  :class:`ctypes.Structure` with ``from_param()`` results larger than a C
611  pointer.
612
613- gh-issue-100133: Fix regression in :mod:`asyncio` where a subprocess would
614  sometimes lose data received from pipe.
615
616- gh-issue-100098: Fix ``tuple`` subclasses being cast to ``tuple`` when
617  used as enum values.
618
619- gh-issue-98778: Update :exc:`~urllib.error.HTTPError` to be initialized
620  properly, even if the ``fp`` is ``None``. Patch by Dong-hee Na.
621
622- gh-issue-83035: Fix :func:`inspect.getsource` handling of decorator calls
623  with nested parentheses.
624
625- gh-issue-99576: Fix ``.save()`` method for ``LWPCookieJar`` and
626  ``MozillaCookieJar``: saved file was not truncated on repeated save.
627
628- gh-issue-99433: Fix :mod:`doctest` failure on
629  :class:`types.MethodWrapperType` in modules.
630
631- gh-issue-99240: Fix double-free bug in Argument Clinic ``str_converter``
632  by extracting memory clean up to a new ``post_parsing`` section.
633
634- gh-issue-64490: Fix refcount error when arguments are packed to tuple in
635  Argument Clinic.
636
637- gh-issue-85267: Several improvements to :func:`inspect.signature`'s
638  handling of ``__text_signature``. - Fixes a case where
639  :func:`inspect.signature` dropped parameters - Fixes a case where
640  :func:`inspect.signature` raised :exc:`tokenize.TokenError` - Allows
641  :func:`inspect.signature` to understand defaults involving binary
642  operations of constants - :func:`inspect.signature` is documented as only
643  raising :exc:`TypeError` or :exc:`ValueError`, but sometimes raised
644  :exc:`RuntimeError`. These cases now raise :exc:`ValueError` - Removed a
645  dead code path
646
647- gh-issue-95882: Fix a 3.11 regression in
648  :func:`~contextlib.asynccontextmanager`, which caused it to propagate
649  exceptions with incorrect tracebacks and fix a 3.11 regression in
650  :func:`~contextlib.contextmanager`, which caused it to propagate
651  exceptions with incorrect tracebacks for :exc:`StopIteration`.
652
653- bpo-44817: Ignore WinError 53 (ERROR_BAD_NETPATH), 65
654  (ERROR_NETWORK_ACCESS_DENIED) and 161 (ERROR_BAD_PATHNAME) when using
655  ntpath.realpath().
656
657- bpo-40447: Accept :class:`os.PathLike` (such as :class:`pathlib.Path`) in
658  the ``stripdir`` arguments of :meth:`compileall.compile_file` and
659  :meth:`compileall.compile_dir`.
660
661- bpo-36880: Fix a reference counting issue when a :mod:`ctypes` callback
662  with return type :class:`~ctypes.py_object` returns ``None``, which could
663  cause crashes.
664
665Documentation
666-------------
667
668- gh-issue-100616: Document existing ``attr`` parameter to
669  :func:`curses.window.vline` function in :mod:`curses`.
670
671- gh-issue-100472: Remove claim in documentation that the ``stripdir``,
672  ``prependdir`` and ``limit_sl_dest`` parameters of
673  :func:`compileall.compile_dir` and :func:`compileall.compile_file` could
674  be :class:`bytes`.
675
676- gh-issue-99931: Use `sphinxext-opengraph
677  <https://sphinxext-opengraph.readthedocs.io/>`__ to generate `OpenGraph
678  metadata <https://ogp.me/>`__.
679
680Tests
681-----
682
683- gh-issue-101334: ``test_tarfile`` has been updated to pass when run as a
684  high UID.
685
686- gh-issue-100454: Start running SSL tests with OpenSSL 3.1.0-beta1.
687
688- gh-issue-96002: Add functional test for Argument Clinic.
689
690Build
691-----
692
693- gh-issue-101522: Allow overriding Windows dependencies versions and paths
694  using MSBuild properties.
695
696Windows
697-------
698
699- gh-issue-101543: Ensure the install path in the registry is only used when
700  the standard library hasn't been located in any other way.
701
702- gh-issue-101467: The ``py.exe`` launcher now correctly filters when only a
703  single runtime is installed. It also correctly handles prefix matches on
704  tags so that ``-3.1`` does not match ``3.11``, but would still match
705  ``3.1-32``.
706
707- gh-issue-101135: Restore ability to launch older 32-bit versions from the
708  :file:`py.exe` launcher when both 32-bit and 64-bit installs of the same
709  version are available.
710
711- gh-issue-82052: Fixed an issue where writing more than 32K of Unicode
712  output to the console screen in one go can result in mojibake.
713
714- gh-issue-100320: Ensures the ``PythonPath`` registry key from an install
715  is used when launching from a different copy of Python that relies on an
716  existing install to provide a copy of its modules and standard library.
717
718- gh-issue-100247: Restores support for the :file:`py.exe` launcher finding
719  shebang commands in its configuration file using the full command name.
720
721- gh-issue-100180: Update Windows installer to OpenSSL 1.1.1s
722
723- bpo-43984: :meth:`winreg.SetValueEx` now leaves the target value untouched
724  in the case of conversion errors. Previously, ``-1`` would be written in
725  case of such errors.
726
727macOS
728-----
729
730- gh-issue-100180: Update macOS installer to OpenSSL 1.1.1s
731
732Tools/Demos
733-----------
734
735- bpo-45256: Fix a bug that caused an :exc:`AttributeError` to be raised in
736  ``python-gdb.py`` when ``py-locals`` is used without a frame.
737
738- gh-issue-100342: Add missing ``NULL`` check for possible allocation
739  failure in ``*args`` parsing in Argument Clinic.
740
741- gh-issue-64490: Argument Clinic varargs bugfixes
742
743  * Fix out-of-bounds error in :c:func:`!_PyArg_UnpackKeywordsWithVararg`.
744  * Fix incorrect check which allowed more than one varargs in clinic.py.
745  * Fix miscalculation of ``noptargs`` in generated code.
746  * Do not generate ``noptargs`` when there is a vararg argument and no optional argument.
747
748C API
749-----
750
751- gh-issue-99240: In argument parsing, after deallocating newly allocated
752  memory, reset its pointer to NULL.
753
754
755What's New in Python 3.11.1 final?
756==================================
757
758*Release date: 2022-12-06*
759
760Security
761--------
762
763- gh-issue-100001: ``python -m http.server`` no longer allows terminal
764  control characters sent within a garbage request to be printed to the
765  stderr server log.
766
767  This is done by changing the :mod:`http.server`
768  :class:`BaseHTTPRequestHandler` ``.log_message`` method to replace control
769  characters with a ``\xHH`` hex escape before printing.
770
771- gh-issue-87604: Avoid publishing list of active per-interpreter audit
772  hooks via the :mod:`gc` module
773
774- gh-issue-98433: The IDNA codec decoder used on DNS hostnames by
775  :mod:`socket` or :mod:`asyncio` related name resolution functions no
776  longer involves a quadratic algorithm. This prevents a potential CPU
777  denial of service if an out-of-spec excessive length hostname involving
778  bidirectional characters were decoded. Some protocols such as
779  :mod:`urllib` http ``3xx`` redirects potentially allow for an attacker to
780  supply such a name.
781
782- gh-issue-98739: Update bundled libexpat to 2.5.0
783
784- gh-issue-97612: Fix a shell code injection vulnerability in the
785  ``get-remote-certificate.py`` example script. The script no longer uses a
786  shell to run ``openssl`` commands. Issue reported and initial fix by Caleb
787  Shortt. Patch by Victor Stinner.
788
789Core and Builtins
790-----------------
791
792- gh-issue-99886: Fix a crash when an object which does not have a
793  dictionary frees its instance values.
794
795- gh-issue-99891: Fix a bug in the tokenizer that could cause infinite
796  recursion when showing syntax warnings that happen in the first line of
797  the source. Patch by Pablo Galindo
798
799- gh-issue-99729: Fix an issue that could cause frames to be visible to
800  Python code as they are being torn down, possibly leading to memory
801  corruption or hard crashes of the interpreter.
802
803- gh-issue-99578: Fix a reference bug in :func:`_imp.create_builtin()` after
804  the creation of the first sub-interpreter for modules ``builtins`` and
805  ``sys``. Patch by Victor Stinner.
806
807- gh-issue-99581: Fixed a bug that was causing a buffer overflow if the
808  tokenizer copies a line missing the newline caracter from a file that is
809  as long as the available tokenizer buffer. Patch by Pablo galindo
810
811- gh-issue-99553: Fix bug where an :exc:`ExceptionGroup` subclass can wrap a
812  :exc:`BaseException`.
813
814- gh-issue-99370: Fix zip path for venv created from a non-installed python
815  on POSIX platforms.
816
817- gh-issue-99298: Fix an issue that could potentially cause incorrect error
818  handling for some bytecode instructions.
819
820- gh-issue-99205: Fix an issue that prevented :c:type:`PyThreadState` and
821  :c:type:`PyInterpreterState` memory from being freed properly.
822
823- gh-issue-99181: Fix failure in :keyword:`except* <except_star>` with
824  unhashable exceptions.
825
826- gh-issue-99204: Fix calculation of :data:`sys._base_executable` when
827  inside a POSIX virtual environment using copies of the python binary when
828  the base installation does not provide the executable name used by the
829  venv. Calculation will fall back to alternative names ("python<MAJOR>",
830  "python<MAJOR>.<MINOR>").
831
832- gh-issue-96055: Update :mod:`faulthandler` to emit an error message with
833  the proper unexpected signal number. Patch by Dong-hee Na.
834
835- gh-issue-99153: Fix location of :exc:`SyntaxError` for a :keyword:`try`
836  block with both :keyword:`except` and :keyword:`except* <except_star>`.
837
838- gh-issue-99103: Fix the error reporting positions of specialized traceback
839  anchors when the source line contains Unicode characters.
840
841- gh-issue-98852: Fix subscription of type aliases containing bare generic
842  types or types like :class:`~typing.TypeVar`: for example ``tuple[A,
843  T][int]`` and ``tuple[TypeVar, T][int]``, where ``A`` is a generic type,
844  and ``T`` is a type variable.
845
846- gh-issue-98925: Lower the recursion depth for marshal on WASI to support
847  wasmtime 2.0/main.
848
849- gh-issue-98783: Fix multiple crashes in debug mode when ``str`` subclasses
850  are used instead of ``str`` itself.
851
852- gh-issue-99257: Fix an issue where member descriptors (such as those for
853  :attr:`~object.__slots__`) could behave incorrectly or crash instead of
854  raising a :exc:`TypeError` when accessed via an instance of an invalid
855  type.
856
857- gh-issue-98374: Suppress ImportError for invalid query for help() command.
858  Patch by Dong-hee Na.
859
860- gh-issue-98415: Fix detection of MAC addresses for :mod:`uuid` on certain
861  OSs. Patch by Chaim Sanders
862
863- gh-issue-92119: Print exception class name instead of its string
864  representation when raising errors from :mod:`ctypes` calls.
865
866- gh-issue-96078: :func:`os.sched_yield` now release the GIL while calling
867  sched_yield(2). Patch by Dong-hee Na.
868
869- gh-issue-93354: Fix an issue that could delay the specialization of
870  :opcode:`PRECALL` instructions.
871
872- gh-issue-97943: Bugfix: :func:`PyFunction_GetAnnotations` should return a
873  borrowed reference. It was returning a new reference.
874
875- gh-issue-97779: Ensure that all Python frame objects are backed by
876  "complete" frames.
877
878- gh-issue-97591: Fixed a missing incref/decref pair in
879  ``Exception.__setstate__()``. Patch by Ofey Chan.
880
881- gh-issue-94526: Fix the Python path configuration used to initialized
882  :data:`sys.path` at Python startup. Paths are no longer encoded to
883  UTF-8/strict to avoid encoding errors if it contains surrogate characters
884  (bytes paths are decoded with the surrogateescape error handler). Patch by
885  Victor Stinner.
886
887- gh-issue-95921: Fix overly-broad source position information for chained
888  comparisons used as branching conditions.
889
890- gh-issue-96387: At Python exit, sometimes a thread holding the GIL can
891  wait forever for a thread (usually a daemon thread) which requested to
892  drop the GIL, whereas the thread already exited. To fix the race
893  condition, the thread which requested the GIL drop now resets its request
894  before exiting. Issue discovered and analyzed by Mingliang ZHAO. Patch by
895  Victor Stinner.
896
897- gh-issue-96864: Fix a possible assertion failure, fatal error, or
898  :exc:`SystemError` if a line tracing event raises an exception while
899  opcode tracing is enabled.
900
901- gh-issue-96678: Fix undefined behaviour in C code of null pointer
902  arithmetic.
903
904- gh-issue-96754: Make sure that all frame objects created are created from
905  valid interpreter frames. Prevents the possibility of invalid frames in
906  backtraces and signal handlers.
907
908- gh-issue-95196: Disable incorrect pickling of the C implemented
909  classmethod descriptors.
910
911- gh-issue-96005: On WASI :data:`~errno.ENOTCAPABLE` is now mapped to
912  :exc:`PermissionError`. The :mod:`errno` modules exposes the new error
913  number. ``getpath.py`` now ignores :exc:`PermissionError` when it cannot
914  open landmark files ``pybuilddir.txt`` and ``pyenv.cfg``.
915
916- gh-issue-93696: Allow :mod:`pdb` to locate source for frozen modules in
917  the standard library.
918
919- bpo-31718: Raise :exc:`ValueError` instead of :exc:`SystemError` when
920  methods of uninitialized :class:`io.IncrementalNewlineDecoder` objects are
921  called. Patch by Oren Milman.
922
923- bpo-38031: Fix a possible assertion failure in :class:`io.FileIO` when the
924  opener returns an invalid file descriptor.
925
926Library
927-------
928
929- gh-issue-100001: Also \ escape \s in the http.server
930  BaseHTTPRequestHandler.log_message so that it is technically possible to
931  parse the line and reconstruct what the original data was.  Without this a
932  \xHH is ambiguious as to if it is a hex replacement we put in or the
933  characters r"\x" came through in the original request line.
934
935- gh-issue-93453: :func:`asyncio.get_event_loop` now only emits a
936  deprecation warning when a new event loop was created implicitly. It no
937  longer emits a deprecation warning if the current event loop was set.
938
939- gh-issue-51524: Fix bug when calling trace.CoverageResults with valid
940  infile.
941
942- gh-issue-99645: Fix a bug in handling class cleanups in
943  :class:`unittest.TestCase`.  Now ``addClassCleanup()`` uses separate lists
944  for different ``TestCase`` subclasses, and ``doClassCleanups()`` only
945  cleans up the particular class.
946
947- gh-issue-97001: Release the GIL when calling termios APIs to avoid
948  blocking threads.
949
950- gh-issue-99341: Fix :func:`ast.increment_lineno` to also cover
951  :class:`ast.TypeIgnore` when changing line numbers.
952
953- gh-issue-99418: Fix bug in :func:`urllib.parse.urlparse` that causes URL
954  schemes that begin with a digit, a plus sign, or a minus sign to be parsed
955  incorrectly.
956
957- gh-issue-99382: Check the number of arguments in substitution in user
958  generics containing a :class:`~typing.TypeVarTuple` and one or more
959  :class:`~typing.TypeVar`.
960
961- gh-issue-99379: Fix substitution of :class:`~typing.ParamSpec` followed by
962  :class:`~typing.TypeVarTuple` in generic aliases.
963
964- gh-issue-99344: Fix substitution of :class:`~typing.TypeVarTuple` and
965  :class:`~typing.ParamSpec` together in user generics.
966
967- gh-issue-74044: Fixed bug where :func:`inspect.signature` reported
968  incorrect arguments for decorated methods.
969
970- gh-issue-99275: Fix ``SystemError`` in :mod:`ctypes` when exception was
971  not set during ``__initsubclass__``.
972
973- gh-issue-99277: Remove older version of
974  ``_SSLProtocolTransport.get_write_buffer_limits`` in
975  :mod:`!asyncio.sslproto`
976
977- gh-issue-99248: fix negative numbers failing in verify()
978
979- gh-issue-99155: Fix :class:`statistics.NormalDist` pickle with ``0`` and
980  ``1`` protocols.
981
982- gh-issue-93464: ``enum.auto()`` is now correctly activated when combined
983  with other assignment values.  E.g. ``ONE = auto(), 'some text'`` will now
984  evaluate as ``(1, 'some text')``.
985
986- gh-issue-99134: Update the bundled copy of pip to version 22.3.1.
987
988- gh-issue-83004: Clean up refleak on failed module initialisation in
989  :mod:`_zoneinfo`
990
991- gh-issue-83004: Clean up refleaks on failed module initialisation in in
992  :mod:`_pickle`
993
994- gh-issue-83004: Clean up refleak on failed module initialisation in
995  :mod:`_io`.
996
997- gh-issue-98897: Fix memory leak in :func:`math.dist` when both points
998  don't have the same dimension. Patch by Kumar Aditya.
999
1000- gh-issue-98706: [3.11] Applied changes from importlib_metadata `4.11.4
1001  through 4.13
1002  <https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-13-0>`_,
1003  including compatibility and robustness fixes for ``Distribution`` objects
1004  without ``_normalized_name``, disallowing invalid inputs to
1005  ``Distribution.from_name``, and refined behaviors in
1006  ``PathDistribution._name_from_stem`` and
1007  ``PathDistribution._normalized_name``.
1008
1009- gh-issue-98793: Fix argument typechecks in :func:`!_overlapped.WSAConnect`
1010  and :func:`!_overlapped.Overlapped.WSASendTo` functions.
1011
1012- gh-issue-98744: Prevent crashing in :mod:`traceback` when retrieving the
1013  byte-offset for some source files that contain certain unicode characters.
1014
1015- gh-issue-98740: Fix internal error in the :mod:`re` module which in very
1016  rare circumstances prevented compilation of a regular expression
1017  containing a :ref:`conditional expression <re-conditional-expression>`
1018  without the "else" branch.
1019
1020- gh-issue-98703: Fix :meth:`asyncio.StreamWriter.drain` to call
1021  ``protocol.connection_lost`` callback only once on Windows.
1022
1023- gh-issue-98624: Add a mutex to unittest.mock.NonCallableMock to protect
1024  concurrent access to mock attributes.
1025
1026- gh-issue-89237: Fix hang on Windows in ``subprocess.wait_closed()`` in
1027  :mod:`asyncio` with :class:`~asyncio.ProactorEventLoop`. Patch by Kumar
1028  Aditya.
1029
1030- gh-issue-98458: Fix infinite loop in unittest when a self-referencing
1031  chained exception is raised
1032
1033- gh-issue-97928: :meth:`tkinter.Text.count` raises now an exception for
1034  options starting with "-" instead of silently ignoring them.
1035
1036- gh-issue-97966: On ``uname_result``, restored expectation that ``_fields``
1037  and ``_asdict`` would include all six properties including ``processor``.
1038
1039- gh-issue-98307: A :meth:`~logging.handlers.SysLogHandler.createSocket`
1040  method was added to :class:`~logging.handlers.SysLogHandler`.
1041
1042- gh-issue-96035: Fix bug in :func:`urllib.parse.urlparse` that causes
1043  certain port numbers containing whitespace, underscores, plus and minus
1044  signs, or non-ASCII digits to be incorrectly accepted.
1045
1046- gh-issue-98251: Allow :mod:`venv` to pass along :envvar:`PYTHON*`
1047  variables to ``ensurepip`` and ``pip`` when they do not impact path
1048  resolution
1049
1050- gh-issue-98178: On macOS, fix a crash in :func:`syslog.syslog` in
1051  multi-threaded applications. On macOS, the libc ``syslog()`` function is
1052  not thread-safe, so :func:`syslog.syslog` no longer releases the GIL to
1053  call it. Patch by Victor Stinner.
1054
1055- gh-issue-96151: Allow ``BUILTINS`` to be a valid field name for frozen
1056  dataclasses.
1057
1058- gh-issue-87730: Wrap network errors consistently in urllib FTP support, so
1059  the test suite doesn't fail when a network is available but the public
1060  internet is not reachable.
1061
1062- gh-issue-98086: Make sure ``patch.dict()`` can be applied on async
1063  functions.
1064
1065- gh-issue-90985: Earlier in 3.11 we deprecated
1066  ``asyncio.Task.cancel("message")``. We realized we were too harsh, and
1067  have undeprecated it.
1068
1069- gh-issue-97837: Change deprecate warning message in :mod:`unittest` from
1070
1071  ``It is deprecated to return a value!=None``
1072
1073  to
1074
1075  ``It is deprecated to return a value that is not None from a test case``
1076
1077- gh-issue-97825: Fixes :exc:`AttributeError` when
1078  :meth:`subprocess.check_output` is used with argument ``input=None`` and
1079  either of the arguments *encoding* or *errors* are used.
1080
1081- gh-issue-82836: Fix :attr:`~ipaddress.IPv4Address.is_private` properties
1082  in the :mod:`ipaddress` module. Previously non-private networks
1083  (0.0.0.0/0) would return True from this method; now they correctly return
1084  False.
1085
1086- gh-issue-96827: Avoid spurious tracebacks from :mod:`asyncio` when default
1087  executor cleanup is delayed until after the event loop is closed (e.g. as
1088  the result of a keyboard interrupt).
1089
1090- gh-issue-97592: Avoid a crash in the C version of
1091  :meth:`asyncio.Future.remove_done_callback` when an evil argument is
1092  passed.
1093
1094- gh-issue-97639: Remove ``tokenize.NL`` check from :mod:`tabnanny`.
1095
1096- gh-issue-73588: Fix generation of the default name of
1097  :class:`tkinter.Checkbutton`. Previously, checkbuttons in different parent
1098  widgets could have the same short name and share the same state if
1099  arguments "name" and "variable" are not specified. Now they are globally
1100  unique.
1101
1102- gh-issue-97005: Update bundled libexpat to 2.4.9
1103
1104- gh-issue-85760: Fix race condition in :mod:`asyncio` where
1105  :meth:`~asyncio.SubprocessProtocol.process_exited` called before the
1106  :meth:`~asyncio.SubprocessProtocol.pipe_data_received` leading to
1107  inconsistent output. Patch by Kumar Aditya.
1108
1109- gh-issue-96819: Fixed check in :mod:`multiprocessing.resource_tracker`
1110  that guarantees that the length of a write to a pipe is not greater than
1111  ``PIPE_BUF``.
1112
1113- gh-issue-96741: Corrected type annotation for dataclass attribute
1114  ``pstats.FunctionProfile.ncalls`` to be ``str``.
1115
1116- gh-issue-95987: Fix ``repr`` of ``Any`` subclasses.
1117
1118- gh-issue-96388: Work around missing socket functions in
1119  :class:`~socket.socket`'s ``__repr__``.
1120
1121- gh-issue-96073: In :mod:`inspect`, fix overeager replacement of
1122  "``typing.``" in formatting annotations.
1123
1124- gh-issue-96192: Fix handling of ``bytes`` :term:`path-like objects
1125  <path-like object>` in :func:`os.ismount()`.
1126
1127- gh-issue-96052: Fix handling compiler warnings (SyntaxWarning and
1128  DeprecationWarning) in :func:`codeop.compile_command` when checking for
1129  incomplete input. Previously it emitted warnings and raised a SyntaxError.
1130  Now it always returns ``None`` for incomplete input without emitting any
1131  warnings.
1132
1133- gh-issue-88863: To avoid apparent memory leaks when
1134  :func:`asyncio.open_connection` raises, break reference cycles generated
1135  by local exception and future instances (which has exception instance as
1136  its member var). Patch by Dong Uk, Kang.
1137
1138- gh-issue-91212: Fixed flickering of the turtle window when the tracer is
1139  turned off. Patch by Shin-myoung-serp.
1140
1141- gh-issue-88050: Fix :mod:`asyncio` subprocess transport to kill process
1142  cleanly when process is blocked and avoid ``RuntimeError`` when loop is
1143  closed. Patch by Kumar Aditya.
1144
1145- gh-issue-93858: Prevent error when activating venv in nested fish
1146  instances.
1147
1148- gh-issue-91078: :meth:`TarFile.next` now returns ``None`` when called on
1149  an empty tarfile.
1150
1151- bpo-47220: Document the optional *callback* parameter of
1152  :class:`WeakMethod`. Patch by Géry Ogam.
1153
1154- bpo-46364: Restrict use of sockets instead of pipes for stdin of
1155  subprocesses created by :mod:`asyncio` to AIX platform only.
1156
1157- bpo-38523: :func:`shutil.copytree` now applies the
1158  *ignore_dangling_symlinks* argument recursively.
1159
1160- bpo-36267: Fix IndexError in :class:`argparse.ArgumentParser` when a
1161  ``store_true`` action is given an explicit argument.
1162
1163Documentation
1164-------------
1165
1166- gh-issue-92892: Document that calling variadic functions with ctypes
1167  requires special care on macOS/arm64 (and possibly other platforms).
1168
1169- gh-issue-85525: Remove extra row
1170
1171- gh-issue-95588: Clarified the conflicting advice given in the :mod:`ast`
1172  documentation about :func:`ast.literal_eval` being "safe" for use on
1173  untrusted input while at the same time warning that it can crash the
1174  process. The latter statement is true and is deemed unfixable without a
1175  large amount of work unsuitable for a bugfix. So we keep the warning and
1176  no longer claim that ``literal_eval`` is safe.
1177
1178- bpo-41825: Restructured the documentation for the :func:`os.wait*
1179  <os.wait>` family of functions, and improved the docs for
1180  :func:`os.waitid` with more explanation of the possible argument
1181  constants.
1182
1183Tests
1184-----
1185
1186- gh-issue-99892: Skip test_normalization() of test_unicodedata if it fails
1187  to download NormalizationTest.txt file from pythontest.net. Patch by
1188  Victor Stinner.
1189
1190- gh-issue-99934: Correct test_marsh on (32 bit) x86: test_deterministic
1191  sets was failing.
1192
1193- gh-issue-99659: Optional big memory tests in ``test_sqlite3`` now catch
1194  the correct :exc:`sqlite.DataError` exception type in case of too large
1195  strings and/or blobs passed.
1196
1197- gh-issue-98713: Fix a bug in the :mod:`typing` tests where a test relying
1198  on CPython-specific implementation details was not decorated with
1199  ``@cpython_only`` and was not skipped on other implementations.
1200
1201- gh-issue-87390: Add tests for star-unpacking with PEP 646, and some other
1202  miscellaneous PEP 646 tests.
1203
1204- gh-issue-96853: Added explicit coverage of ``Py_Initialize`` (and hence
1205  ``Py_InitializeEx``) back to the embedding tests (all other embedding
1206  tests migrated to ``Py_InitializeFromConfig`` in Python 3.11)
1207
1208- bpo-34272: Some C API tests were moved into the new Lib/test/test_capi/
1209  directory.
1210
1211Build
1212-----
1213
1214- gh-issue-99086: Fix ``-Wimplicit-int``, ``-Wstrict-prototypes``, and
1215  ``-Wimplicit-function-declaration`` compiler warnings in
1216  :program:`configure` checks.
1217
1218- gh-issue-99337: Fix a compilation issue with GCC 12 on macOS.
1219
1220- gh-issue-99086: Fix ``-Wimplicit-int`` compiler warning in
1221  :program:`configure` check for ``PTHREAD_SCOPE_SYSTEM``.
1222
1223- gh-issue-98872: Fix a possible fd leak in ``Programs/_freeze_module.c``
1224  introduced in Python 3.11.
1225
1226- gh-issue-99016: Fix build with ``PYTHON_FOR_REGEN=python3.8``.
1227
1228- gh-issue-97731: Specify the full path to the source location for ``make
1229  docclean`` (needed for cross-builds).
1230
1231- gh-issue-98707: Don't use vendored ``libmpdec`` headers if
1232  :option:`--with-system-libmpdec` is passed to :program:`configure`. Don't
1233  use vendored ``libexpat`` headers if :option:`--with-system-expat` is
1234  passed to :program:`!configure`.
1235
1236- gh-issue-96761: Fix the build process of clang compiler for
1237  :program:`_bootstrap_python` if LTO optimization is applied. Patch by
1238  Matthias Görgens and Dong-hee Na.
1239
1240- gh-issue-96883: ``wasm32-emscripten`` builds for browsers now include
1241  :mod:`concurrent.futures` for :mod:`asyncio` and :mod:`unittest.mock`.
1242
1243- gh-issue-84461: ``wasm32-emscripten`` platform no longer builds
1244  :mod:`resource` module, :func:`~os.getresuid`, :func:`~os.getresgid`, and
1245  their setters. The APIs are stubs and not functional.
1246
1247- gh-issue-94280: Updated pegen regeneration script on Windows to find and
1248  use Python 3.9 or higher.  Prior to this, pegen regeneration already
1249  required 3.9 or higher, but the script may have used lower versions of
1250  Python.
1251
1252Windows
1253-------
1254
1255- gh-issue-99345: Use faster initialization functions to detect install
1256  location for Windows Store package
1257
1258- gh-issue-98629: Fix initialization of :data:`sys.version` and ``sys._git``
1259  on Windows
1260
1261- gh-issue-99442: Fix handling in :ref:`launcher` when ``argv[0]`` does not
1262  include a file extension.
1263
1264- gh-issue-98689: Update Windows builds to zlib v1.2.13.  v1.2.12 has
1265  CVE-2022-37434, but the vulnerable ``inflateGetHeader`` API is not used by
1266  Python.
1267
1268- gh-issue-98790: Assumes that a missing ``DLLs`` directory means that
1269  standard extension modules are in the executable's directory.
1270
1271- gh-issue-98745: Update :file:`py.exe` launcher to install 3.11 by default
1272  and 3.12 on request.
1273
1274- gh-issue-98692: Fix the :ref:`launcher` ignoring unrecognized shebang
1275  lines instead of treating them as local paths
1276
1277- gh-issue-94328: Update Windows installer to use SQLite 3.39.4.
1278
1279- gh-issue-97728: Fix possible crashes caused by the use of uninitialized
1280  variables when pass invalid arguments in :func:`os.system` on Windows and
1281  in Windows-specific modules (like ``winreg``).
1282
1283- gh-issue-96965: Update libffi to 3.4.3
1284
1285- gh-issue-94781: Fix :file:`pcbuild.proj` to clean previous instances of
1286  ouput files in ``Python\deepfreeze`` and ``Python\frozen_modules``
1287  directories on Windows. Patch by Charlie Zhao.
1288
1289- bpo-40882: Fix a memory leak in
1290  :class:`multiprocessing.shared_memory.SharedMemory` on Windows.
1291
1292macOS
1293-----
1294
1295- gh-issue-87235: On macOS ``python3 /dev/fd/9 9</path/to/script.py`` failed
1296  for any script longer than a couple of bytes.
1297
1298- gh-issue-98940: Fix ``Mac/Extras.install.py`` file filter bug.
1299
1300- gh-issue-94328: Update macOS installer to SQLite 3.39.4.
1301
1302IDLE
1303----
1304
1305- gh-issue-97527: Fix a bug in the previous bugfix that caused IDLE to not
1306  start when run with 3.10.8, 3.12.0a1, and at least Microsoft Python
1307  3.10.2288.0 installed without the Lib/test package.  3.11.0 was never
1308  affected.
1309
1310Tools/Demos
1311-----------
1312
1313- gh-issue-95853: The ``wasm_build.py`` script now pre-builds Emscripten
1314  ports, checks for broken EMSDK versions, and warns about pkg-config env
1315  vars.
1316
1317- gh-issue-95853: The new tool ``Tools/wasm/wasm_builder.py`` automates
1318  configure, compile, and test steps for building CPython on WebAssembly
1319  platforms.
1320
1321- gh-issue-95731: Fix handling of module docstrings in
1322  :file:`Tools/i18n/pygettext.py`.
1323
1324C API
1325-----
1326
1327- gh-issue-98680: ``PyBUF_*`` constants were marked as part of Limited API
1328  of Python 3.11+. These were available in 3.11.0 with
1329  :c:macro:`Py_LIMITED_API` defined for 3.11, and are necessary to use the
1330  buffer API.
1331
1332- gh-issue-98978: Fix use-after-free in ``Py_SetPythonHome(NULL)``,
1333  ``Py_SetProgramName(NULL)`` and ``_Py_SetProgramFullPath(NULL)`` function
1334  calls. Issue reported by Benedikt Reinartz. Patch by Victor Stinner.
1335
1336- gh-issue-96853: ``Py_InitializeEx`` now correctly calls ``PyConfig_Clear``
1337  after initializing the interpreter (the omission didn't cause a memory
1338  leak only because none of the dynamically allocated config fields are
1339  populated by the wrapper function)
1340
1341
1342What's New in Python 3.11.0 final?
1343==================================
1344
1345*Release date: 2022-10-24*
1346
1347Security
1348--------
1349
1350- gh-issue-97616: Fix multiplying a list by an integer (``list *= int``):
1351  detect the integer overflow when the new allocated length is close to the
1352  maximum size. Issue reported by Jordan Limor.  Patch by Victor Stinner.
1353
1354- gh-issue-97514: On Linux the :mod:`multiprocessing` module returns to
1355  using filesystem backed unix domain sockets for communication with the
1356  *forkserver* process instead of the Linux abstract socket namespace.  Only
1357  code that chooses to use the :ref:`"forkserver" start method
1358  <multiprocessing-start-methods>` is affected.
1359
1360  Abstract sockets have no permissions and could allow any user on the
1361  system in the same `network namespace
1362  <https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often
1363  the whole system) to inject code into the multiprocessing *forkserver*
1364  process. This was a potential privilege escalation. Filesystem based
1365  socket permissions restrict this to the *forkserver* process user as was
1366  the default in Python 3.8 and earlier.
1367
1368  This prevents Linux `CVE-2022-42919
1369  <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42919>`_.
1370
1371Core and Builtins
1372-----------------
1373
1374- gh-issue-97002: Fix an issue where several frame objects could be backed
1375  by the same interpreter frame, possibly leading to corrupted memory and
1376  hard crashes of the interpreter.
1377
1378- gh-issue-97752: Fix possible data corruption or crashes when accessing the
1379  ``f_back`` member of newly-created generator or coroutine frames.
1380
1381- gh-issue-96975: Fix a crash occurring when :c:func:`PyEval_GetFrame` is
1382  called while the topmost Python frame is in a partially-initialized state.
1383
1384- gh-issue-96848: Fix command line parsing: reject :option:`-X
1385  int_max_str_digits <-X>` option with no value (invalid) when the
1386  :envvar:`PYTHONINTMAXSTRDIGITS` environment variable is set to a valid
1387  limit. Patch by Victor Stinner.
1388
1389- gh-issue-96821: Fix undefined behaviour in ``_testcapimodule.c``.
1390
1391- gh-issue-95778: When :exc:`ValueError` is raised if an integer is larger
1392  than the limit, mention the :func:`sys.set_int_max_str_digits` function in
1393  the error message. Patch by Victor Stinner.
1394
1395- gh-issue-96587: Correctly raise ``SyntaxError`` on exception groups
1396  (:pep:`654`) on python versions prior to 3.11
1397
1398- bpo-42316: Document some places where an assignment expression needs
1399  parentheses.
1400
1401Library
1402-------
1403
1404- gh-issue-98331: Update the bundled copies of pip and setuptools to
1405  versions 22.3 and 65.5.0 respectively.
1406
1407- gh-issue-90985: Earlier in 3.11 we deprecated
1408  ``asyncio.Task.cancel("message")``. We realized we were too harsh, and
1409  have undeprecated it.
1410
1411- gh-issue-97545: Make Semaphore run faster.
1412
1413- gh-issue-96865: fix Flag to use boundary CONFORM
1414
1415  This restores previous Flag behavior of allowing flags with non-sequential
1416  values to be combined; e.g.
1417
1418  class Skip(Flag):         TWO = 2         EIGHT = 8
1419
1420  Skip.TWO | Skip.EIGHT -> <Skip.TWO|EIGHT: 10>
1421
1422- gh-issue-90155: Fix broken :class:`asyncio.Semaphore` when acquire is
1423  cancelled.
1424
1425Documentation
1426-------------
1427
1428- gh-issue-97741: Fix ``!`` in c domain ref target syntax via a ``conf.py``
1429  patch, so it works as intended to disable ref target resolution.
1430
1431- gh-issue-93031: Update tutorial introduction output to use 3.10+
1432  SyntaxError invalid range.
1433
1434Tests
1435-----
1436
1437- gh-issue-95027: On Windows, when the Python test suite is run with the
1438  ``-jN`` option, the ANSI code page is now used as the encoding for the
1439  stdout temporary file, rather than using UTF-8 which can lead to decoding
1440  errors. Patch by Victor Stinner.
1441
1442Build
1443-----
1444
1445- gh-issue-96729: Ensure that Windows releases built with
1446  ``Tools\msi\buildrelease.bat`` are upgradable to and from official Python
1447  releases.
1448
1449Windows
1450-------
1451
1452- gh-issue-98360: Fixes :mod:`multiprocessing` spawning child processes on
1453  Windows from a virtual environment to ensure that child processes that
1454  also use :mod:`multiprocessing` to spawn more children will recognize that
1455  they are in a virtual environment.
1456
1457- gh-issue-98414: Fix :file:`py.exe` launcher handling of ``-V:<company>/``
1458  option when default preferences have been set in environment variables or
1459  configuration files.
1460
1461- gh-issue-90989: Clarify some text in the Windows installer.
1462
1463macOS
1464-----
1465
1466- gh-issue-97897: The macOS 13 SDK includes support for the ``mkfifoat`` and
1467  ``mknodat`` system calls. Using the ``dir_fd`` option with either
1468  :func:`os.mkfifo` or :func:`os.mknod` could result in a segfault if
1469  cpython is built with the macOS 13 SDK but run on an earlier version of
1470  macOS. Prevent this by adding runtime support for detection of these
1471  system calls ("weaklinking") as is done for other newer syscalls on macOS.
1472
1473
1474What's New in Python 3.11.0 release candidate 2?
1475================================================
1476
1477*Release date: 2022-09-11*
1478
1479Security
1480--------
1481
1482- gh-issue-95778: Converting between :class:`int` and :class:`str` in bases
1483  other than 2 (binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base
1484  10 (decimal) now raises a :exc:`ValueError` if the number of digits in
1485  string form is above a limit to avoid potential denial of service attacks
1486  due to the algorithmic complexity. This is a mitigation for
1487  `CVE-2020-10735
1488  <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735>`_.
1489
1490  This new limit can be configured or disabled by environment variable,
1491  command line flag, or :mod:`sys` APIs. See the :ref:`integer string
1492  conversion length limitation <int_max_str_digits>` documentation.  The
1493  default limit is 4300 digits in string form.
1494
1495  Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with
1496  feedback from Victor Stinner, Thomas Wouters, Steve Dower, Ned Deily, and
1497  Mark Dickinson.
1498
1499Core and Builtins
1500-----------------
1501
1502- gh-issue-96678: Fix case of undefined behavior in ceval.c
1503
1504- gh-issue-96641: Do not expose ``KeyWrapper`` in :mod:`_functools`.
1505
1506- gh-issue-96636: Ensure that tracing, ``sys.setrace()``, is turned on
1507  immediately. In pre-release versions of 3.11, some tracing events might
1508  have been lost when turning on tracing in a ``__del__`` method or
1509  interrupt.
1510
1511- gh-issue-96572: Fix use after free in trace refs build mode. Patch by
1512  Kumar Aditya.
1513
1514- gh-issue-96611: When loading a file with invalid UTF-8 inside a multi-line
1515  string, a correct SyntaxError is emitted.
1516
1517- gh-issue-96612: Make sure that incomplete frames do not show up in
1518  tracemalloc traces.
1519
1520- gh-issue-96569: Remove two cases of undefined behavior, by adding NULL
1521  checks.
1522
1523- gh-issue-96582: Fix possible ``NULL`` pointer dereference in
1524  ``_PyThread_CurrentFrames``. Patch by Kumar Aditya.
1525
1526- gh-issue-96352: Fix :exc:`AttributeError` missing ``name`` and ``obj``
1527  attributes in :meth:`object.__getattribute__`. Patch by Philip Georgi.
1528
1529- gh-issue-96268: Loading a file with invalid UTF-8 will now report the
1530  broken character at the correct location.
1531
1532- gh-issue-96187: Fixed a bug that caused ``_PyCode_GetExtra`` to return
1533  garbage for negative indexes. Patch by Pablo Galindo
1534
1535- gh-issue-96071: Fix a deadlock in :c:func:`PyGILState_Ensure` when
1536  allocating new thread state. Patch by Kumar Aditya.
1537
1538- gh-issue-96046: :c:func:`PyType_Ready` now initializes ``ht_cached_keys``
1539  and performs additional checks to ensure that type objects are properly
1540  configured. This avoids crashes in 3rd party packages that don't use
1541  regular API to create new types.
1542
1543- gh-issue-95818: Skip over incomplete frames in
1544  :c:func:`PyThreadState_GetFrame`.
1545
1546- gh-issue-95876: Fix format string in
1547  ``_PyPegen_raise_error_known_location`` that can lead to memory corruption
1548  on some 64bit systems. The function was building a tuple with ``i`` (int)
1549  instead of ``n`` (Py_ssize_t) for Py_ssize_t arguments.
1550
1551- gh-issue-95605: Fix misleading contents of error message when converting
1552  an all-whitespace string to :class:`float`.
1553
1554- gh-issue-94996: :func:`ast.parse` will no longer parse function
1555  definitions with positional-only params when passed ``feature_version``
1556  less than ``(3, 8)``. Patch by Shantanu Jain.
1557
1558Library
1559-------
1560
1561- gh-issue-96700: Fix incorrect error message in the :mod:`io` module.
1562
1563- gh-issue-96652: Fix the faulthandler implementation of
1564  ``faulthandler.register(signal, chain=True)`` if the ``sigaction()``
1565  function is not available: don't call the previous signal handler if it's
1566  NULL. Patch by Victor Stinner.
1567
1568- gh-issue-68163: Correct conversion of :class:`numbers.Rational`'s to
1569  :class:`float`.
1570
1571- gh-issue-96385: Fix ``TypeVarTuple.__typing_prepare_subst__``.
1572  ``TypeError`` was not raised when using more than one ``TypeVarTuple``,
1573  like ``[*T, *V]`` in type alias substitutions.
1574
1575- gh-issue-90467: Fix :class:`asyncio.streams.StreamReaderProtocol` to keep
1576  a strong reference to the created task, so that it's not garbage collected
1577
1578- gh-issue-96159: Fix a performance regression in logging
1579  TimedRotatingFileHandler. Only check for special files when the rollover
1580  time has passed.
1581
1582- gh-issue-96175: Fix unused ``localName`` parameter in the ``Attr`` class
1583  in :mod:`xml.dom.minidom`.
1584
1585- gh-issue-96125: Fix incorrect condition that causes
1586  ``sys.thread_info.name`` to be wrong on pthread platforms.
1587
1588- gh-issue-95463: Remove an incompatible change from :issue:`28080` that
1589  caused a regression that ignored the utf8 in ``ZipInfo.flag_bits``. Patch
1590  by Pablo Galindo.
1591
1592- gh-issue-95899: Fix :class:`asyncio.Runner` to call
1593  :func:`asyncio.set_event_loop` only once to avoid calling
1594  :meth:`~asyncio.AbstractChildWatcher.attach_loop` multiple times on child
1595  watchers. Patch by Kumar Aditya.
1596
1597- gh-issue-95736: Fix :class:`unittest.IsolatedAsyncioTestCase` to set event
1598  loop before calling setup functions. Patch by Kumar Aditya.
1599
1600- gh-issue-95704: When a task catches :exc:`asyncio.CancelledError` and
1601  raises some other error, the other error should generally not silently be
1602  suppressed.
1603
1604- gh-issue-95231: Fail gracefully if :data:`~errno.EPERM` or
1605  :data:`~errno.ENOSYS` is raised when loading :mod:`crypt` methods. This
1606  may happen when trying to load ``MD5`` on a Linux kernel with :abbr:`FIPS
1607  (Federal Information Processing Standard)` enabled.
1608
1609- gh-issue-74116: Allow :meth:`asyncio.StreamWriter.drain` to be awaited
1610  concurrently by multiple tasks. Patch by Kumar Aditya.
1611
1612- gh-issue-92986: Fix :func:`ast.unparse` when ``ImportFrom.level`` is None
1613
1614Documentation
1615-------------
1616
1617- gh-issue-96098: Improve discoverability of the higher level
1618  concurrent.futures module by providing clearer links from the lower level
1619  threading and multiprocessing modules.
1620
1621- gh-issue-95957: What's New 3.11 now has instructions for how to provide
1622  compiler and linker flags for Tcl/Tk and OpenSSL on RHEL 7 and CentOS 7.
1623
1624Tests
1625-----
1626
1627- gh-issue-95243: Mitigate the inherent race condition from using
1628  find_unused_port() in testSockName() by trying to find an unused port a
1629  few times before failing. Patch by Ross Burton.
1630
1631Build
1632-----
1633
1634- gh-issue-94682: Build and test with OpenSSL 1.1.1q
1635
1636Windows
1637-------
1638
1639- gh-issue-96577: Fixes a potential buffer overrun in :mod:`msilib`.
1640
1641- gh-issue-96559: Fixes the Windows launcher not using the compatible
1642  interpretation of default tags found in configuration files when no tag
1643  was passed to the command.
1644
1645
1646What's New in Python 3.11.0 release candidate 1?
1647================================================
1648
1649*Release date: 2022-08-05*
1650
1651Core and Builtins
1652-----------------
1653
1654- gh-issue-95150: Update code object hashing and equality to consider all
1655  debugging and exception handling tables. This fixes an issue where certain
1656  non-identical code objects could be "deduplicated" during compilation.
1657
1658- gh-issue-95355: ``_PyPegen_Parser_New`` now properly detects token memory
1659  allocation errors. Patch by Honglin Zhu.
1660
1661- gh-issue-90081: Run Python code in tracer/profiler function at full speed.
1662  Fixes slowdown in earlier versions of 3.11.
1663
1664- gh-issue-95324: Emit a warning in debug mode if an object does not call
1665  :c:func:`PyObject_GC_UnTrack` before deallocation. Patch by Pablo Galindo.
1666
1667- gh-issue-95185: Prevented crashes in the AST constructor when compiling
1668  some absurdly long expressions like ``"+0"*1000000``.
1669  :exc:`RecursionError` is now raised instead. Patch by Pablo Galindo
1670
1671- gh-issue-93351: :class:`ast.AST` node positions are now validated when
1672  provided to :func:`compile` and other related functions. If invalid
1673  positions are detected, a :exc:`ValueError` will be raised.
1674
1675- gh-issue-94938: Fix error detection in some builtin functions when keyword
1676  argument name is an instance of a str subclass with overloaded ``__eq__``
1677  and ``__hash__``. Previously it could cause SystemError or other undesired
1678  behavior.
1679
1680Library
1681-------
1682
1683- gh-issue-95609: Update bundled pip to 22.2.2.
1684
1685- gh-issue-95289: Fix :class:`asyncio.TaskGroup` to propagate exception when
1686  :exc:`asyncio.CancelledError` was replaced with another exception by a
1687  context manger. Patch by Kumar Aditya and Guido van Rossum.
1688
1689- gh-issue-95339: Update bundled pip to 22.2.1.
1690
1691- gh-issue-95045: Fix GC crash when deallocating ``_lsprof.Profiler`` by
1692  untracking it before calling any callbacks. Patch by Kumar Aditya.
1693
1694- gh-issue-95097: Fix :func:`asyncio.run` for :class:`asyncio.Task`
1695  implementations without :meth:`~asyncio.Task.uncancel` method. Patch by
1696  Kumar Aditya.
1697
1698- gh-issue-93899: Fix check for existence of :data:`os.EFD_CLOEXEC`,
1699  :data:`os.EFD_NONBLOCK` and :data:`os.EFD_SEMAPHORE` flags on older kernel
1700  versions where these flags are not present. Patch by Kumar Aditya.
1701
1702- gh-issue-95166: Fix :meth:`concurrent.futures.Executor.map` to cancel the
1703  currently waiting on future on an error - e.g. TimeoutError or
1704  KeyboardInterrupt.
1705
1706- gh-issue-95109: Ensure that timeouts scheduled with
1707  :class:`asyncio.Timeout` that have already expired are delivered promptly.
1708
1709- gh-issue-91810: Suppress writing an XML declaration in open files in
1710  ``ElementTree.write()`` with ``encoding='unicode'`` and
1711  ``xml_declaration=None``.
1712
1713- gh-issue-91447: Fix findtext in the xml module to only give an empty
1714  string when the text attribute is set to None.
1715
1716Documentation
1717-------------
1718
1719- gh-issue-91207: Fix stylesheet not working in Windows CHM htmlhelp docs
1720  and add warning that they are deprecated. Contributed by C.A.M. Gerlach.
1721
1722- gh-issue-95451: Update library documentation with :ref:`availability
1723  information <wasm-availability>` on WebAssembly platforms
1724  ``wasm32-emscripten`` and ``wasm32-wasi``.
1725
1726- gh-issue-95415: Use consistent syntax for platform availability. The
1727  directive now supports a content body and emits a warning when it
1728  encounters an unknown platform.
1729
1730- gh-issue-86128: Document a limitation in ThreadPoolExecutor where its exit
1731  handler is executed before any handlers in atexit.
1732
1733Tests
1734-----
1735
1736- gh-issue-95573: :source:`Lib/test/test_asyncio/test_ssl.py` exposed a bug
1737  in the macOS kernel where intense concurrent load on non-blocking sockets
1738  occasionally causes :const:`errno.ENOBUFS` ("No buffer space available")
1739  to be emitted. FB11063974 filed with Apple, in the mean time as a
1740  workaround buffer size used in tests on macOS is decreased to avoid
1741  intermittent failures.  Patch by Fantix King.
1742
1743- gh-issue-95280: Fix problem with ``test_ssl`` ``test_get_ciphers`` on
1744  systems that require perfect forward secrecy (PFS) ciphers.
1745
1746- gh-issue-94675: Add a regression test for :mod:`re` exponentional slowdown
1747  when using rjsmin.
1748
1749Build
1750-----
1751
1752- gh-issue-94801: Fix a regression in ``configure`` script that caused some
1753  header checks to ignore custom ``CPPFLAGS``. The regression was introduced
1754  in :gh:`94802`.
1755
1756- gh-issue-95145: wasm32-wasi builds no longer depend on WASIX's pthread
1757  stubs. Python now has its own stubbed pthread API.
1758
1759- gh-issue-95174: Python now detects missing ``dup`` function in WASI and
1760  works around some missing :mod:`errno`, :mod:`select`, and :mod:`socket`
1761  constants.
1762
1763- gh-issue-95174: Python now skips missing :mod:`socket` functions and
1764  methods on WASI. WASI can only create sockets from existing fd / accept
1765  and has no netdb.
1766
1767- gh-issue-95085: Platforms ``wasm32-unknown-emscripten`` and
1768  ``wasm32-unknown-wasi`` have been promoted to :pep:`11` tier 3 platform
1769  support.
1770
1771Windows
1772-------
1773
1774- gh-issue-95656: Enable the
1775  :meth:`~sqlite3.Connection.enable_load_extension` :mod:`sqlite3` API.
1776
1777- gh-issue-95587: Fixes some issues where the Windows installer would
1778  incorrectly detect certain features of an existing install when upgrading.
1779
1780- gh-issue-94399: Restores the behaviour of :ref:`launcher` for
1781  ``/usr/bin/env`` shebang lines, which will now search :envvar:`PATH` for
1782  an executable matching the given command. If none is found, the usual
1783  search process is used.
1784
1785- gh-issue-95445: Fixes the unsuccessful removal of the HTML document
1786  directory when uninstalling with Windows msi.
1787
1788- gh-issue-95359: Fix :ref:`launcher` handling of :file:`py.ini` commands
1789  (it was incorrectly expecting a ``py_`` prefix on keys) and crashes when
1790  reading per-user configuration file.
1791
1792- gh-issue-95285: Fix :ref:`launcher` handling of command lines where it is
1793  only passed a short executable name.
1794
1795IDLE
1796----
1797
1798- gh-issue-65802: Document handling of extensions in Save As dialogs.
1799
1800- gh-issue-95191: Include prompts when saving Shell (interactive input and
1801  output).
1802
1803- gh-issue-95511: Fix the Shell context menu copy-with-prompts bug of
1804  copying an extra line when one selects whole lines.
1805
1806- gh-issue-95471: In the Edit menu, move ``Select All`` and add a new
1807  separator.
1808
1809- gh-issue-95411: Enable using IDLE's module browser with .pyw files.
1810
1811- gh-issue-89610: Add .pyi as a recognized extension for IDLE on macOS.
1812  This allows opening stub files by double clicking on them in the Finder.
1813
1814C API
1815-----
1816
1817- gh-issue-92678: Restore the 3.10 behavior for multiple inheritance of C
1818  extension classes that store their dictionary at the end of the struct.
1819
1820- gh-issue-94936: Added :c:func:`PyCode_GetVarnames`,
1821  :c:func:`PyCode_GetCellvars` and :c:func:`PyCode_GetFreevars` for
1822  accessing ``co_varnames``, ``co_cellvars`` and ``co_freevars``
1823  respectively via the C API.
1824
1825
1826What's New in Python 3.11.0 beta 5?
1827===================================
1828
1829*Release date: 2022-07-25*
1830
1831Core and Builtins
1832-----------------
1833
1834- gh-issue-93351: :class:`ast.AST` node positions are now validated when
1835  provided to :func:`compile` and other related functions. If invalid
1836  positions are detected, a :exc:`ValueError` will be raised.
1837
1838- gh-issue-94438: Fix an issue that caused extended opcode arguments and
1839  some conditional pops to be ignored when calculating valid jump targets
1840  for assignments to the ``f_lineno`` attribute of frame objects. In some
1841  cases, this could cause inconsistent internal state, resulting in a hard
1842  crash of the interpreter.
1843
1844- gh-issue-95060: Undocumented ``PyCode_Addr2Location`` function now
1845  properly returns when ``addrq`` argument is less than zero.
1846
1847- gh-issue-95113: Replace all ``EXTENDED_ARG_QUICK`` instructions with basic
1848  :opcode:`EXTENDED_ARG` instructions in unquickened code. Consumers of
1849  non-adaptive bytecode should be able to handle extended arguments the same
1850  way they were handled in CPython 3.10 and older.
1851
1852- gh-issue-91409: Fix incorrect source location info caused by certain
1853  optimizations in the bytecode compiler.
1854
1855- gh-issue-94036: Fix incorrect source location info for some multi-line
1856  attribute accesses and method calls.
1857
1858- gh-issue-94739: Allow jumping within, out of, and across exception
1859  handlers in the debugger.
1860
1861- gh-issue-94949: :func:`ast.parse` will no longer parse parenthesized
1862  context managers when passed ``feature_version`` less than ``(3, 9)``.
1863  Patch by Shantanu Jain.
1864
1865- gh-issue-94947: :func:`ast.parse` will no longer parse assignment
1866  expressions when passed ``feature_version`` less than ``(3, 8)``. Patch by
1867  Shantanu Jain.
1868
1869- gh-issue-91256: Ensures the program name is known for help text during
1870  interpreter startup.
1871
1872- gh-issue-94869: Fix the column offsets for some expressions in multi-line
1873  f-strings :mod:`ast` nodes. Patch by Pablo Galindo.
1874
1875- gh-issue-94822: Fix an issue where lookups of metaclass descriptors may be
1876  ignored when an identically-named attribute also exists on the class
1877  itself.
1878
1879- gh-issue-91153: Fix an issue where a :class:`bytearray` item assignment
1880  could crash if it's resized by the new value's :meth:`__index__` method.
1881
1882- gh-issue-90699: Fix reference counting bug in :meth:`bool.__repr__`. Patch
1883  by Kumar Aditya.
1884
1885Library
1886-------
1887
1888- gh-issue-95087: Fix IndexError in parsing invalid date in the :mod:`email`
1889  module.
1890
1891- gh-issue-95199: Upgrade bundled setuptools to 63.2.0.
1892
1893- gh-issue-95194: Upgrade bundled pip to 22.2.
1894
1895- gh-issue-95132: Fix a :mod:`sqlite3` regression where ``*args`` and
1896  ``**kwds`` were incorrectly relayed from :py:func:`~sqlite3.connect` to
1897  the :class:`~sqlite3.Connection` factory. The regression was introduced in
1898  3.11a1 with PR 24421 (:gh:`85128`). Patch by Erlend E. Aasland.`
1899
1900- gh-issue-93157: Fix :mod:`fileinput` module didn't support ``errors``
1901  option when ``inplace`` is true.
1902
1903- gh-issue-95105: :meth:`wsgiref.types.InputStream.__iter__` should return
1904  ``Iterator[bytes]``, not ``Iterable[bytes]``. Patch by Shantanu Jain.
1905
1906- gh-issue-94857: Fix refleak in ``_io.TextIOWrapper.reconfigure``. Patch by
1907  Kumar Aditya.
1908
1909- gh-issue-94821: Fix binding of unix socket to empty address on Linux to
1910  use an available address from the abstract namespace, instead of "\0".
1911
1912- gh-issue-89988: Fix memory leak in :class:`pickle.Pickler` when looking up
1913  :attr:`dispatch_table`. Patch by Kumar Aditya.
1914
1915- bpo-47025: Drop support for :class:`bytes` on :attr:`sys.path`.
1916
1917Tests
1918-----
1919
1920- gh-issue-95212: Make multiprocessing test case
1921  ``test_shared_memory_recreate`` parallel-safe.
1922
1923Build
1924-----
1925
1926- gh-issue-94847: Fixed ``_decimal`` module build issue on GCC when
1927  compiling with LTO and pydebug. Debug builds no longer force inlining of
1928  functions.
1929
1930- gh-issue-94841: Fix the possible performance regression of
1931  :c:func:`PyObject_Free` compiled with MSVC version 1932.
1932
1933- gh-issue-94801: ``configure`` now uses custom flags like ``ZLIB_CFLAGS``
1934  and ``ZLIB_LIBS`` when searching for headers and libraries.
1935
1936- gh-issue-94773: ``deepfreeze.py`` now supports code object with frozensets
1937  that contain incompatible, unsortable types.
1938
1939Windows
1940-------
1941
1942- gh-issue-90844: Allow virtual environments to correctly launch when they
1943  have spaces in the path.
1944
1945- gh-issue-94772: Fix incorrect handling of shebang lines in py.exe launcher
1946
1947C API
1948-----
1949
1950- gh-issue-92678: Adds unstable C-API functions
1951  ``_PyObject_VisitManagedDict`` and ``_PyObject_ClearManagedDict`` to allow
1952  C extensions to allow the VM to manage their object's dictionaries.
1953
1954- gh-issue-94930: Fix ``SystemError`` raised when
1955  :c:func:`PyArg_ParseTupleAndKeywords` is used with ``#`` in ``(...)`` but
1956  without ``PY_SSIZE_T_CLEAN`` defined.
1957
1958- gh-issue-94864: Fix ``PyArg_Parse*`` with deprecated format units "u" and
1959  "Z". It returned 1 (success) when warnings are turned into exceptions.
1960
1961- gh-issue-94731: Python again uses C-style casts for most casting
1962  operations when compiled with C++. This may trigger compiler warnings, if
1963  they are enabled with e.g. ``-Wold-style-cast `` or
1964  ``-Wzero-as-null-pointer-constant`` options for ``g++``.
1965
1966
1967What's New in Python 3.11.0 beta 4?
1968===================================
1969
1970*Release date: 2022-07-11*
1971
1972Security
1973--------
1974
1975- gh-issue-87389: :mod:`http.server`: Fix an open redirection vulnerability
1976  in the HTTP server when an URI path starts with ``//``.  Vulnerability
1977  discovered, and initial fix proposed, by Hamza Avvan.
1978
1979- gh-issue-79096: LWPCookieJar and MozillaCookieJar create files with file
1980  mode 600 instead of 644 (Microsoft Windows is not affected)
1981
1982- gh-issue-92888: Fix ``memoryview`` use after free when accessing the
1983  backing buffer in certain cases.
1984
1985- gh-issue-68966: The deprecated mailcap module now refuses to inject unsafe
1986  text (filenames, MIME types, parameters) into shell commands. Instead of
1987  using such text, it will warn and act as if a match was not found (or for
1988  test commands, as if the test failed).
1989
1990Core and Builtins
1991-----------------
1992
1993- gh-issue-94694: Fix an issue that could cause code with multi-line method
1994  lookups to have misleading or incorrect column offset information. In some
1995  cases (when compiling a hand-built AST) this could have resulted in a hard
1996  crash of the interpreter.
1997
1998- gh-issue-93252: Fix an issue that caused internal frames to outlive failed
1999  Python function calls, possibly resulting in memory leaks or hard
2000  interpreter crashes.
2001
2002- gh-issue-94215: Fix an issue where exceptions raised by line-tracing
2003  events would cause frames to be left in an invalid state, possibly
2004  resulting in a hard crash of the interpreter.
2005
2006- gh-issue-92228: Disable the compiler's inline-small-exit-blocks
2007  optimization for exit blocks that are associated with source code lines.
2008  This fixes a bug where the debugger cannot tell where an exception handler
2009  ends and the following code block begins.
2010
2011- gh-issue-94485: Line number of a module's ``RESUME`` instruction is set to
2012  0 as specified in :pep:`626`.
2013
2014- gh-issue-94438: Account for instructions that can push NULL to the stack
2015  when setting line number in a frame. Prevents some (unlikely) crashes.
2016
2017- gh-issue-91719: Reload ``opcode`` when raising ``unknown opcode error`` in
2018  the interpreter main loop, for C compilers to generate dispatching code
2019  independently.
2020
2021- gh-issue-94329: Compile and run code with unpacking of extremely large
2022  sequences (1000s of elements). Such code failed to compile. It now
2023  compiles and runs correctly.
2024
2025- gh-issue-94360: Fixed a tokenizer crash when reading encoded files with
2026  syntax errors from ``stdin`` with non utf-8 encoded text. Patch by Pablo
2027  Galindo
2028
2029- gh-issue-88116: Fix an issue when reading line numbers from code objects
2030  if the encoded line numbers are close to ``INT_MIN``. Patch by Pablo
2031  Galindo
2032
2033- gh-issue-94262: Don't create frame objects for incomplete frames. Prevents
2034  the creation of generators and closures from being observable to Python
2035  and C extensions, restoring the behavior of 3.10 and earlier.
2036
2037- gh-issue-94192: Fix error for dictionary literals with invalid expression
2038  as value.
2039
2040- gh-issue-93883: Revise the display strategy of traceback enhanced error
2041  locations.  The indicators are only shown when the location doesn't span
2042  the whole line.
2043
2044- gh-issue-94021: Fix unreachable code warning in ``Python/specialize.c``.
2045
2046- gh-issue-93516: Store offset of first traceable instruction in code object
2047  to avoid having to recompute it for each instruction when tracing.
2048
2049- gh-issue-93516: Lazily create a table mapping bytecode offsets to line
2050  numbers to speed up calculation of line numbers when tracing.
2051
2052- gh-issue-89828: :class:`types.GenericAlias` no longer relays the
2053  ``__class__`` attribute. For example, ``isinstance(list[int], type)`` no
2054  longer returns ``True``.
2055
2056- gh-issue-93671: Fix some exponential backtrace case happening with deeply
2057  nested sequence patterns in match statements. Patch by Pablo Galindo
2058
2059- gh-issue-93662: Make sure that the end column offsets are correct in
2060  multi-line method calls. Previously, the end column could precede the
2061  column offset.
2062
2063- gh-issue-93461: :func:`importlib.invalidate_caches` now drops entries from
2064  :data:`sys.path_importer_cache` with a relative path as name. This solves
2065  a caching issue when a process changes its current working directory.
2066
2067  ``FileFinder`` no longer inserts a dot in the path, e.g. ``/egg/./spam``
2068  is now ``/egg/spam``.
2069
2070- gh-issue-93418: Fixed an assert where an f-string has an equal sign '='
2071  following an expression, but there's no trailing brace. For example,
2072  f"{i=".
2073
2074- gh-issue-93382: Cache the result of :c:func:`PyCode_GetCode` function to
2075  restore the O(1) lookup of the :attr:`~types.CodeType.co_code` attribute.
2076
2077- gh-issue-93354: Use exponential backoff for specialization counters in the
2078  interpreter. Can reduce the number of failed specializations significantly
2079  and avoid slowdown for those parts of a program that are not suitable for
2080  specialization.
2081
2082- gh-issue-93021: Fix the :attr:`__text_signature__` for :meth:`__get__`
2083  methods implemented in C. Patch by Jelle Zijlstra.
2084
2085- gh-issue-92930: Fixed a crash in ``_pickle.c`` from mutating collections
2086  during ``__reduce__`` or ``persistent_id``.
2087
2088- gh-issue-92914: Always round the allocated size for lists up to the
2089  nearest even number.
2090
2091- gh-issue-92858: Improve error message for some suites with syntax error
2092  before ':'
2093
2094- bpo-46142: Make ``--help`` output shorter by moving some info to the new
2095  ``--help-env`` and ``--help-xoptions`` command-line options. Also add
2096  ``--help-all`` option to print complete usage.
2097
2098Library
2099-------
2100
2101- gh-issue-94736: Fix crash when deallocating an instance of a subclass of
2102  ``_multiprocessing.SemLock``. Patch by Kumar Aditya.
2103
2104- gh-issue-94637: :meth:`SSLContext.set_default_verify_paths` now releases
2105  the GIL around ``SSL_CTX_set_default_verify_paths`` call. The function
2106  call performs I/O and CPU intensive work.
2107
2108- gh-issue-94607: Fix subclassing complex generics with type variables in
2109  :mod:`typing`. Previously an error message saying ``Some type variables
2110  ... are not listed in Generic[...]`` was shown. :mod:`typing` no longer
2111  populates ``__parameters__`` with the ``__parameters__`` of a Python
2112  class.
2113
2114- gh-issue-93910: The ability to access the other values of an enum on an
2115  enum (e.g. ``Color.RED.BLUE``) has been restored in order to fix a
2116  performance regression.
2117
2118- gh-issue-93896: Fix :func:`asyncio.run` and
2119  :class:`unittest.IsolatedAsyncioTestCase` to always the set event loop as
2120  it was done in Python 3.10 and earlier. Patch by Kumar Aditya.
2121
2122- gh-issue-94510: Re-entrant calls to :func:`sys.setprofile` and
2123  :func:`sys.settrace` now raise :exc:`RuntimeError`. Patch by Pablo
2124  Galindo.
2125
2126- gh-issue-92336: Fix bug where :meth:`linecache.getline` fails on bad files
2127  with :exc:`UnicodeDecodeError` or :exc:`SyntaxError`. It now returns an
2128  empty string as per the documentation.
2129
2130- gh-issue-94398: Once a :class:`asyncio.TaskGroup` has started shutting
2131  down (i.e., at least one task has failed and the task group has started
2132  cancelling the remaining tasks), it should not be possible to add new
2133  tasks to the task group.
2134
2135- gh-issue-94254: Fixed types of :mod:`struct` module to be immutable. Patch
2136  by Kumar Aditya.
2137
2138- gh-issue-94207: Made :class:`_struct.Struct` GC-tracked in order to fix a
2139  reference leak in the :mod:`_struct` module.
2140
2141- gh-issue-91742: Fix :mod:`pdb` crash after jump caused by a null pointer
2142  dereference. Patch by Kumar Aditya.
2143
2144- gh-issue-94101: Manual instantiation of :class:`ssl.SSLSession` objects is
2145  no longer allowed as it lead to misconfigured instances that crashed the
2146  interpreter when attributes where accessed on them.
2147
2148- gh-issue-84753: :func:`inspect.iscoroutinefunction`,
2149  :func:`inspect.isgeneratorfunction`, and
2150  :func:`inspect.isasyncgenfunction` now properly return ``True`` for
2151  duck-typed function-like objects like instances of
2152  :class:`unittest.mock.AsyncMock`.
2153
2154  This makes :func:`inspect.iscoroutinefunction` consistent with the
2155  behavior of :func:`asyncio.iscoroutinefunction`.  Patch by Mehdi ABAAKOUK.
2156
2157- gh-issue-94028: Fix a regression in the :mod:`sqlite3` where statement
2158  objects were not properly cleared and reset after use in cursor iters. The
2159  regression was introduced by PR 27884 in Python 3.11a1. Patch by Erlend E.
2160  Aasland.
2161
2162- gh-issue-93820: Pickle :class:`enum.Flag` by name.
2163
2164- gh-issue-93847: Fix repr of enum of generic aliases.
2165
2166- gh-issue-91404: Revert the :mod:`re` memory leak when a match is
2167  terminated by a signal or memory allocation failure as the implemented fix
2168  caused a major performance regression.
2169
2170- gh-issue-83499: Fix double closing of file description in :mod:`tempfile`.
2171
2172- gh-issue-93820: Fixed a regression when :func:`copy.copy`-ing
2173  :class:`enum.Flag` with multiple flag members.
2174
2175- gh-issue-79512: Fixed names and ``__module__`` value of :mod:`weakref`
2176  classes :class:`~weakref.ReferenceType`, :class:`~weakref.ProxyType`,
2177  :class:`~weakref.CallableProxyType`. It makes them pickleable.
2178
2179- gh-issue-91389: Fix an issue where :mod:`dis` utilities could report
2180  missing or incorrect position information in the presence of ``CACHE``
2181  entries.
2182
2183- gh-issue-93626: Set ``__future__.annotations`` to have a ``None``
2184  mandatoryRelease to indicate that it is currently 'TBD'.
2185
2186- gh-issue-90473: Emscripten and WASI have no home directory and cannot
2187  provide :pep:`370` user site directory.
2188
2189- gh-issue-90494: :func:`copy.copy` and :func:`copy.deepcopy` now always
2190  raise a TypeError if ``__reduce__()`` returns a tuple with length 6
2191  instead of silently ignore the 6th item or produce incorrect result.
2192
2193- gh-issue-90549: Fix a multiprocessing bug where a global named resource
2194  (such as a semaphore) could leak when a child process is spawned (as
2195  opposed to forked).
2196
2197- gh-issue-93521: Fixed a case where dataclasses would try to add
2198  ``__weakref__`` into the ``__slots__`` for a dataclass that specified
2199  ``weakref_slot=True`` when it was already defined in one of its bases.
2200  This resulted in a ``TypeError`` upon the new class being created.
2201
2202- gh-issue-79579: :mod:`sqlite3` now correctly detects DML queries with
2203  leading comments. Patch by Erlend E. Aasland.
2204
2205- gh-issue-93421: Update :data:`sqlite3.Cursor.rowcount` when a DML
2206  statement has run to completion. This fixes the row count for SQL queries
2207  like ``UPDATE ... RETURNING``. Patch by Erlend E. Aasland.
2208
2209- gh-issue-91162: Support splitting of unpacked arbitrary-length tuple over
2210  ``TypeVar`` and ``TypeVarTuple`` parameters. For example:
2211
2212  * ``A[T, *Ts][*tuple[int, ...]]`` -> ``A[int, *tuple[int, ...]]``
2213  * ``A[*Ts, T][*tuple[int, ...]]`` -> ``A[*tuple[int, ...], int]``
2214
2215- gh-issue-93353: Fix the :func:`importlib.resources.as_file` context
2216  manager to remove the temporary file if destroyed late during Python
2217  finalization: keep a local reference to the :func:`os.remove` function.
2218  Patch by Victor Stinner.
2219
2220- gh-issue-83658: Make :class:`multiprocessing.Pool` raise an exception if
2221  ``maxtasksperchild`` is not ``None`` or a positive int.
2222
2223- gh-issue-93156: Accessing the :attr:`pathlib.PurePath.parents` sequence of
2224  an absolute path using negative index values produced incorrect results.
2225
2226- gh-issue-74696: :func:`shutil.make_archive` no longer temporarily changes
2227  the current working directory during creation of standard ``.zip`` or tar
2228  archives.
2229
2230- gh-issue-89973: Fix :exc:`re.error` raised in :mod:`fnmatch` if the
2231  pattern contains a character range with upper bound lower than lower bound
2232  (e.g. ``[c-a]``). Now such ranges are interpreted as empty ranges.
2233
2234- gh-issue-92932: Now :func:`~dis.dis` and :func:`~dis.get_instructions`
2235  handle operand values for instructions prefixed by ``EXTENDED_ARG_QUICK``.
2236  Patch by Sam Gross and Dong-hee Na.
2237
2238- gh-issue-91577: Move imports in :class:`~multiprocessing.SharedMemory`
2239  methods to module level so that they can be executed late in python
2240  finalization.
2241
2242- gh-issue-91456: Deprecate current default auto() behavior:  In 3.13 the
2243  default will be for for auto() to always return the largest member value
2244  incremented by 1, and to raise if incompatible value types are used.
2245
2246- bpo-47231: Fixed an issue with inconsistent trailing slashes in tarfile
2247  longname directories.
2248
2249- bpo-46755: In :class:`QueueHandler`, clear ``stack_info`` from
2250  :class:`LogRecord` to prevent stack trace from being written twice.
2251
2252- bpo-46197: Fix :mod:`ensurepip` environment isolation for subprocess
2253  running ``pip``.
2254
2255- bpo-45924: Fix :mod:`asyncio` incorrect traceback when future's exception
2256  is raised multiple times. Patch by Kumar Aditya.
2257
2258- bpo-34828: :meth:`sqlite3.Connection.iterdump` now handles databases that
2259  use ``AUTOINCREMENT`` in one or more tables.
2260
2261Documentation
2262-------------
2263
2264- gh-issue-94321: Document the :pep:`246` style protocol type
2265  :class:`sqlite3.PrepareProtocol`.
2266
2267- gh-issue-61162: Clarify :mod:`sqlite3` behavior when
2268  :ref:`sqlite3-connection-context-manager`.
2269
2270- gh-issue-87260: Align :mod:`sqlite3` argument specs with the actual
2271  implementation.
2272
2273- gh-issue-86986: The minimum Sphinx version required to build the
2274  documentation is now 3.2.
2275
2276- gh-issue-88831: Augmented documentation of asyncio.create_task().
2277  Clarified the need to keep strong references to tasks and added a code
2278  snippet detailing how to to this.
2279
2280- bpo-47161: Document that :class:`pathlib.PurePath` does not collapse
2281  initial double slashes because they denote UNC paths.
2282
2283Tests
2284-----
2285
2286- gh-issue-91330: Added more tests for :mod:`dataclasses` to cover behavior
2287  with data descriptor-based fields.
2288
2289- gh-issue-94208: ``test_ssl`` is now checking for supported TLS version and
2290  protocols in more tests.
2291
2292- gh-issue-94315: Tests now check for DAC override capability instead of
2293  relying on :func:`os.geteuid`.
2294
2295- gh-issue-93951: In test_bdb.StateTestCase.test_skip, avoid including
2296  auxiliary importers.
2297
2298- gh-issue-93957: Provide nicer error reporting from subprocesses in
2299  test_venv.EnsurePipTest.test_with_pip.
2300
2301- gh-issue-84461: ``run_tests.py`` now handles cross compiling env vars
2302  correctly and pass ``HOSTRUNNER`` to regression tests.
2303
2304- gh-issue-93616: ``test_modulefinder`` now creates a temporary directory in
2305  ``ModuleFinderTest.setUp()`` instead of module scope.
2306
2307- gh-issue-93575: Fix issue with test_unicode test_raiseMemError. The test
2308  case now use ``test.support.calcobjsize`` to calculate size of PyUnicode
2309  structs. :func:`sys.getsizeof` may return different size when string has
2310  UTF-8 memory.
2311
2312- gh-issue-90473: WASI does not have a ``chmod(2)`` syscall.
2313  :func:`os.chmod` is now a dummy function on WASI. Skip all tests that
2314  depend on working :func:`os.chmod`.
2315
2316- gh-issue-90473: Skip tests on WASI that require symlinks with absolute
2317  paths.
2318
2319- gh-issue-57539: Increase calendar test coverage for
2320  :meth:`calendar.LocaleTextCalendar.formatweekday`.
2321
2322- gh-issue-90473: Skip symlink tests on WASI. wasmtime uses ``openat2(2)``
2323  with ``RESOLVE_BENEATH`` flag, which prevents symlinks with absolute
2324  paths.
2325
2326- gh-issue-89858: Fix ``test_embed`` for out-of-tree builds. Patch by Kumar
2327  Aditya.
2328
2329- gh-issue-92886: Fixing tests that fail when running with optimizations
2330  (``-O``) in ``test_imaplib.py``.
2331
2332- gh-issue-92886: Fixing tests that fail when running with optimizations
2333  (``-O``) in ``test_zipimport.py``
2334
2335- bpo-47016: Create a GitHub Actions workflow for verifying bundled pip and
2336  setuptools. Patch by Illia Volochii and Adam Turner.
2337
2338Build
2339-----
2340
2341- gh-issue-94404: ``makesetup`` now works around an issue with sed on macOS
2342  and uses correct CFLAGS for object files that end up in a shared
2343  extension. Module CFLAGS are used before PY_STDMODULE_CFLAGS to avoid
2344  clashes with system headers.
2345
2346- gh-issue-93584: Address race condition in ``Makefile`` when installing a
2347  PGO build. All ``test`` and ``install`` targets now depend on ``all``
2348  target.
2349
2350- gh-issue-93491: ``configure`` now detects and reports :pep:`11` support
2351  tiers.
2352
2353Windows
2354-------
2355
2356- gh-issue-93824: Drag and drop of files onto Python files in Windows
2357  Explorer has been enabled for Windows ARM64.
2358
2359- bpo-42658: Support native Windows case-insensitive path comparisons by
2360  using ``LCMapStringEx`` instead of :func:`str.lower` in
2361  :func:`ntpath.normcase`. Add ``LCMapStringEx`` to the :mod:`_winapi`
2362  module.
2363
2364Tools/Demos
2365-----------
2366
2367- gh-issue-94538: Fix Argument Clinic output to custom file destinations.
2368  Patch by Erlend E. Aasland.
2369
2370- gh-issue-94430: Allow parameters named ``module`` and ``self`` with custom
2371  C names in Argument Clinic. Patch by Erlend E. Aasland
2372
2373C API
2374-----
2375
2376- gh-issue-93937: The following frame functions and type are now directly
2377  available with ``#include <Python.h>``, it's no longer needed to add
2378  ``#include <frameobject.h>``:
2379
2380  * :c:func:`PyFrame_Check`
2381  * :c:func:`PyFrame_GetBack`
2382  * :c:func:`PyFrame_GetBuiltins`
2383  * :c:func:`PyFrame_GetGenerator`
2384  * :c:func:`PyFrame_GetGlobals`
2385  * :c:func:`PyFrame_GetLasti`
2386  * :c:func:`PyFrame_GetLocals`
2387  * :c:type:`PyFrame_Type`
2388
2389  Patch by Victor Stinner.
2390
2391- gh-issue-91321: Fix the compatibility of the Python C API with C++ older
2392  than C++11. Patch by Victor Stinner.
2393
2394- gh-issue-91731: Avoid defining the ``static_assert`` when compiling with
2395  C++ 11, where this is a keyword and redefining it can lead to undefined
2396  behavior. Patch by Pablo Galindo
2397
2398- gh-issue-93442: Add C++ overloads for _Py_CAST_impl() to handle 0/NULL.
2399  This will allow C++ extensions that pass 0 or NULL to macros using
2400  _Py_CAST() to continue to compile.
2401
2402
2403What's New in Python 3.11.0 beta 3?
2404===================================
2405
2406*Release date: 2022-06-01*
2407
2408Core and Builtins
2409-----------------
2410
2411- gh-issue-93359: Ensure that custom :mod:`ast` nodes without explicit end
2412  positions can be compiled. Patch by Pablo Galindo.
2413
2414- gh-issue-93345: Fix a crash in substitution of a ``TypeVar`` in nested
2415  generic alias after ``TypeVarTuple``.
2416
2417Build
2418-----
2419
2420- gh-issue-69093: Fix ``Modules/Setup.stdlib.in`` rule for ``_sqlite3``
2421  extension.
2422
2423
2424What's New in Python 3.11.0 beta 2?
2425===================================
2426
2427*Release date: 2022-05-30*
2428
2429Core and Builtins
2430-----------------
2431
2432- gh-issue-84694: The ``--experimental-isolated-subinterpreters`` configure
2433  option and ``EXPERIMENTAL_ISOLATED_SUBINTERPRETERS`` macro have been
2434  removed.
2435
2436- gh-issue-91924: Fix ``__lltrace__`` debug feature if the stdout encoding
2437  is not UTF-8. Patch by Victor Stinner.
2438
2439- gh-issue-93061: Backward jumps after ``async for`` loops are no longer
2440  given dubious line numbers.
2441
2442- gh-issue-93065: Fix contextvars HAMT implementation to handle iteration
2443  over deep trees.
2444
2445  The bug was discovered and fixed by Eli Libman. See
2446  `MagicStack/immutables#84
2447  <https://github.com/MagicStack/immutables/issues/84>`_ for more details.
2448
2449- gh-issue-90473: Decrease default recursion limit on WASI to address
2450  limited call stack size.
2451
2452- gh-issue-92804: Fix memory leak in ``memoryview`` iterator as it was not
2453  finalized at exit. Patch by Kumar Aditya.
2454
2455- gh-issue-92236: Remove spurious "LINE" event when starting a generator or
2456  coroutine, visible tracing functions implemented in C.
2457
2458- gh-issue-92619: Make the compiler duplicate an exit block only if none of
2459  its instructions have a lineno (previously only the first instruction in
2460  the block was checked, leading to unnecessarily duplicated blocks).
2461
2462- gh-issue-92261: Fix hang when trying to iterate over a ``typing.Union``.
2463
2464Library
2465-------
2466
2467- gh-issue-93297: Make asyncio task groups prevent child tasks from being
2468  GCed
2469
2470- gh-issue-90817: The :func:`locale.resetlocale` function is deprecated and
2471  will be removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL,
2472  "")`` instead. Patch by Victor Stinner.
2473
2474- gh-issue-92728: The :func:`re.template` function and the corresponding
2475  :const:`re.TEMPLATE` and :const:`re.T` flags are restored after they were
2476  removed in 3.11.0b1, but they are now deprecated, so they might be removed
2477  from Python 3.13.
2478
2479- gh-issue-93044: No longer convert the database argument of
2480  :func:`sqlite3.connect` to bytes before passing it to the factory.
2481
2482- gh-issue-93010: In a very special case, the email package tried to append
2483  the nonexistent ``InvalidHeaderError`` to the defect list. It should have
2484  been ``InvalidHeaderDefect``.
2485
2486- gh-issue-92675: Fix :func:`venv.ensure_directories` to accept
2487  :class:`pathlib.Path` arguments in addition to :class:`str` paths. Patch
2488  by David Foster.
2489
2490- gh-issue-87901: Removed the ``encoding`` argument from :func:`os.popen`
2491  that was added in 3.11b1.
2492
2493- gh-issue-91922: Fix function :func:`sqlite.connect` and the
2494  :class:`sqlite.Connection` constructor on non-UTF-8 locales. Also, they
2495  now support bytes paths non-decodable with the current FS encoding.
2496
2497- gh-issue-92839: Fixed crash resulting from calling bisect.insort() or
2498  bisect.insort_left() with the key argument not equal to None.
2499
2500- gh-issue-90473: :mod:`subprocess` now fails early on Emscripten and WASI
2501  platforms to work around missing :func:`os.pipe` on WASI.
2502
2503- gh-issue-92671: Fixed :func:`ast.unparse` for empty tuples in the
2504  assignment target context.
2505
2506- gh-issue-91581: :meth:`~datetime.datetime.utcfromtimestamp` no longer
2507  attempts to resolve ``fold`` in the pure Python implementation, since the
2508  fold is never 1 in UTC. In addition to being slightly faster in the common
2509  case, this also prevents some errors when the timestamp is close to
2510  :attr:`datetime.min <datetime.datetime.min>`.  Patch by Paul Ganssle.
2511
2512- gh-issue-92550: Fix :meth:`pathlib.Path.rglob` for empty pattern.
2513
2514- gh-issue-92530: Fix an issue that occurred after interrupting
2515  :func:`threading.Condition.notify`.
2516
2517- gh-issue-92531: The statistics.median_grouped() function now always return
2518  a float. Formerly, it did not convert the input type when for sequences of
2519  length one.
2520
2521- gh-issue-91810: :class:`~xml.etree.ElementTree.ElementTree` method
2522  :meth:`~xml.etree.ElementTree.ElementTree.write` and function
2523  :func:`~xml.etree.ElementTree.tostring` now use the text file's encoding
2524  ("UTF-8" if not available) instead of locale encoding in XML declaration
2525  when ``encoding="unicode"`` is specified.
2526
2527- gh-issue-90622: Worker processes for
2528  :class:`concurrent.futures.ProcessPoolExecutor` are no longer spawned on
2529  demand (a feature added in 3.9) when the multiprocessing context start
2530  method is ``"fork"`` as that can lead to deadlocks in the child processes
2531  due to a fork happening while threads are running.
2532
2533- gh-issue-91581: Remove an unhandled error case in the C implementation of
2534  calls to :meth:`datetime.fromtimestamp <datetime.datetime.fromtimestamp>`
2535  with no time zone (i.e. getting a local time from an epoch timestamp).
2536  This should have no user-facing effect other than giving a possibly more
2537  accurate error message when called with timestamps that fall on
2538  10000-01-01 in the local time. Patch by Paul Ganssle.
2539
2540- bpo-39064: :class:`zipfile.ZipFile` now raises :exc:`zipfile.BadZipFile`
2541  instead of ``ValueError`` when reading a corrupt zip file in which the
2542  central directory offset is negative.
2543
2544- bpo-45393: Fix the formatting for ``await x`` and ``not x`` in the
2545  operator precedence table when using the :func:`help` system.
2546
2547- bpo-28249: Set :attr:`doctest.DocTest.lineno` to ``None`` when object does
2548  not have :attr:`__doc__`.
2549
2550- bpo-45046: Add support of context managers in :mod:`unittest`: methods
2551  :meth:`~unittest.TestCase.enterContext` and
2552  :meth:`~unittest.TestCase.enterClassContext` of class
2553  :class:`~unittest.TestCase`, method
2554  :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of class
2555  :class:`~unittest.IsolatedAsyncioTestCase` and function
2556  :func:`unittest.enterModuleContext`.
2557
2558- bpo-42627: Fix incorrect parsing of Windows registry proxy settings
2559
2560Documentation
2561-------------
2562
2563- gh-issue-86438: Clarify that :option:`-W` and :envvar:`PYTHONWARNINGS` are
2564  matched literally and case-insensitively, rather than as regular
2565  expressions, in :mod:`warnings`.
2566
2567- gh-issue-92240: Added release dates for "What's New in Python 3.X" for
2568  3.0, 3.1, 3.2, 3.8 and 3.10
2569
2570- bpo-40838: Document that :func:`inspect.getdoc`,
2571  :func:`inspect.getmodule`, and :func:`inspect.getsourcefile` might return
2572  ``None``.
2573
2574- bpo-38056: Overhaul the :ref:`error-handlers` documentation in
2575  :mod:`codecs`.
2576
2577- bpo-13553: Document tkinter.Tk args.
2578
2579Tests
2580-----
2581
2582- gh-issue-92670: Skip
2583  ``test_shutil.TestCopy.test_copyfile_nonexistent_dir`` test on AIX as the
2584  test uses a trailing slash to force the OS consider the path as a
2585  directory, but on AIX the trailing slash has no effect and is considered
2586  as a file.
2587
2588Build
2589-----
2590
2591- gh-issue-90473: Disable pymalloc and increase stack size on
2592  ``wasm32-wasi``.
2593
2594- bpo-34449: Drop invalid compiler switch ``-fPIC`` for HP aCC on HP-UX.
2595  Patch by Michael Osipov.
2596
2597Windows
2598-------
2599
2600- gh-issue-92817: Ensures that :file:`py.exe` will prefer an active virtual
2601  environment over default tags specified with environment variables or
2602  through a :file:`py.ini` file.
2603
2604- gh-issue-92984: Explicitly disable incremental linking for non-Debug
2605  builds
2606
2607- gh-issue-92841: :mod:`asyncio` no longer throws ``RuntimeError: Event loop
2608  is closed`` on interpreter exit after asynchronous socket activity. Patch
2609  by Oleg Iarygin.
2610
2611- bpo-46907: Update Windows installer to use SQLite 3.38.4.
2612
2613C API
2614-----
2615
2616- gh-issue-92898: Fix C++ compiler warnings when casting function arguments
2617  to ``PyObject*``. Patch by Serge Guelton.
2618
2619- gh-issue-92913: Ensures changes to
2620  :c:member:`PyConfig.module_search_paths` are ignored unless
2621  :c:member:`PyConfig.module_search_paths_set` is set
2622
2623- gh-issue-92781: Avoid mixing declarations and code in the C API to fix the
2624  compiler warning: "ISO C90 forbids mixed declarations and code"
2625  [-Werror=declaration-after-statement]. Patch by Victor Stinner.
2626
2627
2628What's New in Python 3.11.0 beta 1?
2629===================================
2630
2631*Release date: 2022-05-06*
2632
2633Security
2634--------
2635
2636- gh-issue-57684: Add the :option:`-P` command line option and the
2637  :envvar:`PYTHONSAFEPATH` environment variable to not prepend a potentially
2638  unsafe path to :data:`sys.path`. Patch by Victor Stinner.
2639
2640Core and Builtins
2641-----------------
2642
2643- gh-issue-89519: Chaining classmethod descriptors (introduced in bpo-19072)
2644  is deprecated. It can no longer be used to wrap other descriptors such as
2645  property().  The core design of this feature was flawed, and it caused a
2646  number of downstream problems.
2647
2648- gh-issue-92345: ``pymain_run_python()`` now imports ``readline`` and
2649  ``rlcompleter`` before sys.path is extended to include the current working
2650  directory of an interactive interpreter. Non-interactive interpreters are
2651  not affected.
2652
2653- bpo-43857: Improve the :exc:`AttributeError` message when deleting a
2654  missing attribute. Patch by Géry Ogam.
2655
2656- gh-issue-92245: Make sure that PEP 523 is respected in all cases. In
2657  3.11a7, specialization may have prevented Python-to-Python calls
2658  respecting PEP 523.
2659
2660- gh-issue-92203: Add a closure keyword-only parameter to exec(). It can
2661  only be specified when exec-ing a code object that uses free variables.
2662  When specified, it must be a tuple, with exactly the number of cell
2663  variables referenced by the code object. closure has a default value of
2664  None, and it must be None if the code object doesn't refer to any free
2665  variables.
2666
2667- gh-issue-91173: Disable frozen modules in debug builds. Patch by Kumar
2668  Aditya.
2669
2670- gh-issue-92114: Improve error message when subscript a type with
2671  ``__class_getitem__`` set to ``None``.
2672
2673- gh-issue-92112: Fix crash triggered by an evil custom ``mro()`` on a
2674  metaclass.
2675
2676- gh-issue-92063: The ``PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS``
2677  instruction now ensures methods are called only on objects of the correct
2678  type.
2679
2680- gh-issue-92031: Deoptimize statically allocated code objects during
2681  ``Py_FINALIZE()`` so that future ``_PyCode_Quicken`` calls always start
2682  with unquickened code.
2683
2684- gh-issue-92036: Fix a crash in subinterpreters related to the garbage
2685  collector. When a subinterpreter is deleted, untrack all objects tracked
2686  by its GC. To prevent a crash in deallocator functions expecting objects
2687  to be tracked by the GC, leak a strong reference to these objects on
2688  purpose, so they are never deleted and their deallocator functions are not
2689  called. Patch by Victor Stinner.
2690
2691- gh-issue-92032: The interpreter can now autocomplete soft keywords, as of
2692  now ``match``, ``case``, and ``_`` (wildcard pattern) from :pep:`634`.
2693
2694- gh-issue-87999: The warning emitted by the Python parser for a numeric
2695  literal immediately followed by keyword has been changed from deprecation
2696  warning to syntax warning.
2697
2698- gh-issue-91869: Fix an issue where specialized opcodes with extended
2699  arguments could produce incorrect tracing output or lead to assertion
2700  failures.
2701
2702- gh-issue-91603: Speed up :class:`types.UnionType` instantiation. Based on
2703  patch provided by Yurii Karabas.
2704
2705- gh-issue-89373: If Python is built in debug mode, Python now ensures that
2706  deallocator functions leave the current exception unchanged. Patch by
2707  Victor Stinner.
2708
2709- gh-issue-91632: Fix a minor memory leak at exit: release the memory of the
2710  :class:`generic_alias_iterator` type. Patch by Dong-hee Na.
2711
2712- gh-issue-81548: Octal escapes with value larger than ``0o377`` now produce
2713  a :exc:`DeprecationWarning`. In a future Python version they will be a
2714  :exc:`SyntaxWarning` and eventually a :exc:`SyntaxError`.
2715
2716- bpo-43950: Use a single compact table for line starts, ends and column
2717  offsets. Reduces memory consumption for location info by half
2718
2719- gh-issue-91102: Use Argument Clinic for :class:`EncodingMap`.  Patch by
2720  Oleg Iarygin.
2721
2722- gh-issue-91636: Fixed a crash in a garbage-collection edge-case, in which
2723  a ``PyFunction_Type.tp_clear`` function could leave a python function
2724  object in an inconsistent state.
2725
2726- gh-issue-91603: Speed up :func:`isinstance` and :func:`issubclass` checks
2727  for :class:`types.UnionType`. Patch by Yurii Karabas.
2728
2729- gh-issue-91625: Fixed a bug in which adaptive opcodes ignored any
2730  preceding ``EXTENDED_ARG``\ s on specialization failure.
2731
2732- gh-issue-78607: The LLTRACE special build now looks for the name
2733  ``__lltrace__`` defined in module globals, rather than the name
2734  ``__ltrace__``, which had been introduced as a typo.
2735
2736- gh-issue-91576: Speed up iteration of ascii strings by 50%. Patch by Kumar
2737  Aditya.
2738
2739- gh-issue-89279: Improve interpreter performance on Windows by inlining a
2740  few specific macros.
2741
2742- gh-issue-91502: Add a new :c:func:`_PyFrame_IsEntryFrame` API function, to
2743  check if a :c:type:`PyFrameObject` is an entry frame. Patch by Pablo
2744  Galindo.
2745
2746- gh-issue-91266: Refactor the ``bytearray`` strip methods ``strip``,
2747  ``lstrip`` and ``rstrip`` to use a common implementation.
2748
2749- gh-issue-91479: Replaced the ``__note__`` field of :exc:`BaseException`
2750  (added in an earlier version of 3.11) with the final design of :pep:`678`.
2751  Namely, :exc:`BaseException` gets an :meth:`add_note` method, and its
2752  ``__notes__`` field is created when necessary.
2753
2754- gh-issue-46055: Speed up right shift of negative integers, by removing
2755  unnecessary creation of temporaries. Original patch by Xinhang Xu,
2756  reworked by Mark Dickinson.
2757
2758- gh-issue-91462: Make the interpreter's low-level tracing (lltrace) feature
2759  output more readable by displaying opcode names (rather than just
2760  numbers), and by displaying stack contents before each opcode.
2761
2762- gh-issue-89455: Fixed an uninitialized bool value in the traceback
2763  printing code path that was introduced by the initial bpo-45292 exception
2764  groups work.
2765
2766- gh-issue-91421: Fix a potential integer overflow in _Py_DecodeUTF8Ex.
2767
2768- gh-issue-91428: Add ``static const char *const _PyOpcode_OpName[256] =
2769  {...};`` to ``opcode.h`` for debug builds to assist in debugging the
2770  Python interpreter. It is now more convenient to make various forms of
2771  debugging output more human-readable by including opcode names rather than
2772  just the corresponding decimal digits.
2773
2774- bpo-47120: Make :opcode:`POP_JUMP_IF_TRUE`, :opcode:`POP_JUMP_IF_FALSE`,
2775  :opcode:`POP_JUMP_IF_NONE` and :opcode:`POP_JUMP_IF_NOT_NONE` virtual,
2776  mapping to new relative jump opcodes.
2777
2778- bpo-45317: Add internal documentation explaining design of new (for 3.11)
2779  frame stack.
2780
2781- bpo-47197: ctypes used to mishandle ``void`` return types, so that for
2782  instance a function declared like ``ctypes.CFUNCTYPE(None, ctypes.c_int)``
2783  would be called with signature ``int f(int)`` instead of ``void f(int)``.
2784  Wasm targets require function pointers to be called with the correct
2785  signatures so this led to crashes. The problem is now fixed.
2786
2787- bpo-47120: Make opcodes :opcode:`JUMP_IF_TRUE_OR_POP` and
2788  :opcode:`JUMP_IF_FALSE_OR_POP` relative rather than absolute.
2789
2790- bpo-47177: Replace the ``f_lasti`` member of the internal
2791  ``_PyInterpreterFrame`` structure with a ``prev_instr`` pointer, which
2792  reduces overhead in the main interpreter loop. The ``f_lasti`` attribute
2793  of Python-layer frame objects is preserved for backward-compatibility.
2794
2795- bpo-46961: Integer mod/remainder operations, including the three-argument
2796  form of :func:`pow`, now consistently return ints from the global small
2797  integer cache when applicable.
2798
2799- bpo-46962: Classes and functions that unconditionally declared their
2800  docstrings ignoring the `--without-doc-strings` compilation flag no longer
2801  do so.
2802
2803  The classes affected are :class:`ctypes.UnionType`,
2804  :class:`pickle.PickleBuffer`, :class:`testcapi.RecursingInfinitelyError`,
2805  and :class:`types.GenericAlias`.
2806
2807  The functions affected are 24 methods in :mod:`ctypes`.
2808
2809  Patch by Oleg Iarygin.
2810
2811- bpo-46942: Use Argument Clinic for the :class:`types.MethodType`
2812  constructor.  Patch by Oleg Iarygin.
2813
2814- bpo-46764: Fix wrapping bound methods with @classmethod
2815
2816- bpo-43464: Optimize :meth:`set.intersection` for non-set arguments.
2817
2818- bpo-46721: Optimize :meth:`set.issuperset` for non-set argument.
2819
2820- bpo-46509: Add type-specialized versions of the ``Py_DECREF()``, and use
2821  them for ``float``, ``int``, ``str``, ``bool``, and ``None`` to avoid
2822  pointer-chasing at runtime where types are known at C compile time.
2823
2824- bpo-46045: Do not use POSIX semaphores on NetBSD
2825
2826- bpo-36819: Fix crashes in built-in encoders with error handlers that
2827  return position less or equal than the starting position of non-encodable
2828  characters.
2829
2830- bpo-34093: ``marshal.dumps()`` uses ``FLAG_REF`` for all interned strings.
2831  This makes output more deterministic and helps reproducible build.
2832
2833- bpo-26579: Added ``object.__getstate__`` which provides the default
2834  implementation of the ``__getstate__()`` method.
2835
2836  Copying and pickling instances of subclasses of builtin types bytearray,
2837  set, frozenset, collections.OrderedDict, collections.deque,
2838  weakref.WeakSet, and datetime.tzinfo now copies and pickles instance
2839  attributes implemented as slots.
2840
2841Library
2842-------
2843
2844- gh-issue-87901: Add the *encoding* parameter to :func:`os.popen`.
2845
2846- gh-issue-90997: Fix an issue where :mod:`dis` utilities may interpret
2847  populated inline cache entries as valid instructions.
2848
2849- gh-issue-92332: Deprecate :class:`typing.Text` (removal of the class is
2850  currently not planned). Patch by Alex Waygood.
2851
2852- Deprecate nested classes in enum definitions becoming members -- in 3.13
2853  they will be normal classes; add `member` and `nonmember` functions to
2854  allow control over results now.
2855
2856- gh-issue-92356: Fixed a performance regression in ctypes function calls.
2857
2858- gh-issue-90997: Show the actual named values stored in inline caches when
2859  ``show_caches=True`` is passed to :mod:`dis` utilities.
2860
2861- gh-issue-92301: Prefer ``close_range()`` to iterating over procfs for file
2862  descriptor closing in :mod:`subprocess` for better performance.
2863
2864- gh-issue-67248: Sort the miscellaneous topics in Cmd.do_help()
2865
2866- gh-issue-92210: Port ``socket.__init__`` to Argument Clinic. Patch by
2867  Cinder.
2868
2869- gh-issue-80010: Add support for generalized ISO 8601 parsing to
2870  :meth:`datetime.datetime.fromisoformat`,
2871  :meth:`datetime.date.fromisoformat` and
2872  :meth:`datetime.time.fromisoformat`. Patch by Paul Ganssle.
2873
2874- gh-issue-92118: Fix a 3.11 regression in
2875  :func:`~contextlib.contextmanager`, which caused it to propagate
2876  exceptions with incorrect tracebacks.
2877
2878- gh-issue-90887: Adding ``COPYFILE_STAT``, ``COPYFILE_ACL`` and
2879  ``COPYFILE_XATTR`` constants for :func:`os.fcopyfile` available in macOs.
2880
2881- gh-issue-91215: For @dataclass, add weakref_slot. Default is False. If
2882  True, and if slots=True, add a slot named "__weakref__", which will allow
2883  instances to be weakref'd. Contributed by Eric V. Smith
2884
2885- gh-issue-85984: New function os.login_tty() for Unix.
2886
2887- gh-issue-92128: Add :meth:`~object.__class_getitem__` to
2888  :class:`logging.LoggerAdapter` and :class:`logging.StreamHandler`,
2889  allowing them to be parameterized at runtime. Patch by Alex Waygood.
2890
2891- gh-issue-92049: Forbid pickling constants ``re._constants.SUCCESS`` etc.
2892  Previously, pickling did not fail, but the result could not be unpickled.
2893
2894- gh-issue-92062: :class:`inspect.Parameter` now raises :exc:`ValueError` if
2895  ``name`` is a keyword, in addition to the existing check that it is an
2896  identifier.
2897
2898- gh-issue-87390: Add an ``__unpacked__`` attribute to
2899  :class:`types.GenericAlias`. Patch by Jelle Zijlstra.
2900
2901- gh-issue-88089: Add support for generic :class:`typing.NamedTuple`.
2902
2903- gh-issue-91996: New http.HTTPMethod enum to represent all the available
2904  HTTP request methods in a convenient way
2905
2906- gh-issue-91984: Modified test strings in test_argparse.py to not contain
2907  trailing spaces before end of line.
2908
2909- gh-issue-91952: Add ``encoding="locale"`` support to
2910  :meth:`TextIOWrapper.reconfigure`.
2911
2912- gh-issue-91954: Add *encoding* and *errors* arguments to
2913  :func:`subprocess.getoutput` and :func:`subprocess.getstatusoutput`.
2914
2915- bpo-47029: Always close the read end of the pipe used by
2916  :class:`multiprocessing.Queue` *after* the last write of buffered data to
2917  the write end of the pipe to avoid :exc:`BrokenPipeError` at garbage
2918  collection and at :meth:`multiprocessing.Queue.close` calls. Patch by Géry
2919  Ogam.
2920
2921- gh-issue-91928: Add `datetime.UTC` alias for `datetime.timezone.utc`.
2922
2923  Patch by Kabir Kwatra.
2924
2925- gh-issue-68966: The :mod:`mailcap` module is now deprecated and will be
2926  removed in Python 3.13. See :pep:`594` for the rationale and the
2927  :mod:`mimetypes` module for an alternative. Patch by Victor Stinner.
2928
2929- gh-issue-91401: Provide a way to disable :mod:`subprocess` use of
2930  ``vfork()`` just in case it is ever needed and document the existing
2931  mechanism for ``posix_spawn()``.
2932
2933- gh-issue-64783: Fix :data:`signal.NSIG` value on FreeBSD to accept signal
2934  numbers greater than 32, like :data:`signal.SIGRTMIN` and
2935  :data:`signal.SIGRTMAX`. Patch by Victor Stinner.
2936
2937- gh-issue-91910: Add missing f prefix to f-strings in error messages from
2938  the :mod:`multiprocessing` and :mod:`asyncio` modules.
2939
2940- gh-issue-91860: Add :func:`typing.dataclass_transform`, implementing
2941  :pep:`681`. Patch by Jelle Zijlstra.
2942
2943- gh-issue-91832: Add ``required`` attribute to :class:`argparse.Action`
2944  repr output.
2945
2946- gh-issue-91827: In the :mod:`tkinter` module add method
2947  ``info_patchlevel()`` which returns the exact version of the Tcl library
2948  as a named tuple similar to :data:`sys.version_info`.
2949
2950- gh-issue-84461: Add :option:`--enable-wasm-pthreads` to enable pthreads
2951  support for WASM builds. ``Emscripten/node`` no longer has threading
2952  enabled by default. Include additional file systems.
2953
2954- gh-issue-91821: Fix unstable ``test_from_tuple`` test in
2955  ``test_decimal.py``.
2956
2957- gh-issue-91217: Deprecate the xdrlib module.
2958
2959- gh-issue-91217: Deprecate the uu module.
2960
2961- gh-issue-91760: More strict rules will be applied for numerical group
2962  references and group names in regular expressions. For now, a deprecation
2963  warning is emitted for group references and group names which will be
2964  errors in future Python versions.
2965
2966- gh-issue-84461: Add provisional :data:`sys._emscripten_info` named tuple
2967  with build-time and run-time information about Emscripten platform.
2968
2969- gh-issue-90623: :func:`signal.raise_signal` and :func:`os.kill` now check
2970  immediately for pending signals. Patch by Victor Stinner.
2971
2972- gh-issue-91734: Fix OSS audio support on Solaris.
2973
2974- gh-issue-90633: Include the passed value in the exception thrown by
2975  :func:`typing.assert_never`. Patch by Jelle Zijlstra.
2976
2977- gh-issue-91700: Compilation of regular expression containing a conditional
2978  expression ``(?(group)...)`` now raises an appropriate :exc:`re.error` if
2979  the group number refers to not defined group. Previously an internal
2980  RuntimeError was raised.
2981
2982- gh-issue-91231: Add an optional keyword *shutdown_timeout* parameter to
2983  the :class:`multiprocessing.BaseManager` constructor. Kill the process if
2984  terminate() takes longer than the timeout. Patch by Victor Stinner.
2985
2986- gh-issue-91621: Fix :func:`typing.get_type_hints` for
2987  :class:`collections.abc.Callable`. Patch by Shantanu Jain.
2988
2989- gh-issue-90568: Parsing ``\N`` escapes of Unicode Named Character
2990  Sequences in a :mod:`regular expression <re>` raises now :exc:`re.error`
2991  instead of ``TypeError``.
2992
2993- gh-issue-91670: Remove deprecated ``SO`` config variable in
2994  :mod:`sysconfig`.
2995
2996- gh-issue-91217: Deprecate the telnetlib module.
2997
2998- gh-issue-91217: Deprecate the sunau module.
2999
3000- gh-issue-91217: Deprecate the spwd module.
3001
3002- gh-issue-91217: Deprecate the sndhdr module, as well as inline needed
3003  functionality for ``email.mime.MIMEAudio``.
3004
3005- gh-issue-91616: :mod:`re` module, fix :meth:`~re.Pattern.fullmatch`
3006  mismatch when using Atomic Grouping or Possessive Quantifiers.
3007
3008- gh-issue-91217: Deprecate the 'pipes' module.
3009
3010- gh-issue-91217: Deprecate the ossaudiodev module.
3011
3012- bpo-47256: :mod:`re` module, limit the maximum capturing group to
3013  1,073,741,823 in 64-bit build, this increases the depth of backtracking.
3014
3015- gh-issue-91217: Deprecate the nis module.
3016
3017- gh-issue-91595: Fix the comparison of character and integer inside
3018  :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.
3019
3020- gh-issue-74166: Add option to raise all errors from
3021  :meth:`~socket.create_connection` in an :exc:`ExceptionGroup` when it
3022  fails to create a connection. The default remains to raise only the last
3023  error that had occurred when multiple addresses were tried.
3024
3025- gh-issue-91487: Optimize asyncio UDP speed, over 100 times faster when
3026  transferring a large file.
3027
3028- gh-issue-91575: Update case-insensitive matching in the :mod:`re` module
3029  to the latest Unicode version.
3030
3031- gh-issue-90622: In ``concurrent.futures.process.ProcessPoolExecutor``
3032  disallow the "fork" multiprocessing start method when the new
3033  ``max_tasks_per_child`` feature is used as the mix of threads+fork can
3034  hang the child processes. Default to using the safe "spawn" start method
3035  in that circumstance if no ``mp_context`` was supplied.
3036
3037- gh-issue-89022: In :mod:`sqlite3`, ``SQLITE_MISUSE`` result codes are now
3038  mapped to :exc:`~sqlite3.InterfaceError` instead of
3039  :exc:`~sqlite3.ProgrammingError`. Also, more accurate exceptions are
3040  raised when binding parameters fail. Patch by Erlend E. Aasland.
3041
3042- gh-issue-91526: Stop calling ``os.device_encoding(file.fileno())`` in
3043  :class:`TextIOWrapper`. It was complex, never documented, and didn't work
3044  for most cases. (Patch by Inada Naoki.)
3045
3046- gh-issue-88116: Change the frame-related functions in the :mod:`inspect`
3047  module to return a regular object (that is backwards compatible with the
3048  old tuple-like interface) that include the extended :pep:`657` position
3049  information (end line number, column and end column). The affected
3050  functions are: :func:`inspect.getframeinfo`,
3051  :func:`inspect.getouterframes`, :func:`inspect.getinnerframes`,
3052  :func:`inspect.stack` and :func:`inspect.trace`. Patch by Pablo Galindo.
3053
3054- gh-issue-69093: Add indexing and slicing support to :class:`sqlite3.Blob`.
3055  Patch by Aviv Palivoda and Erlend E. Aasland.
3056
3057- gh-issue-69093: Add :term:`context manager` support to
3058  :class:`sqlite3.Blob`. Patch by Aviv Palivoda and Erlend E. Aasland.
3059
3060- gh-issue-91217: Deprecate nntplib.
3061
3062- gh-issue-91217: Deprecate msilib.
3063
3064- gh-issue-91404: Improve the performance of :mod:`re` matching by using
3065  computed gotos (or "threaded code") on supported platforms and removing
3066  expensive pointer indirections.
3067
3068- gh-issue-91217: Deprecate the imghdr module.
3069
3070- gh-issue-91217: Deprecate the crypt module.
3071
3072- gh-issue-91276: Make space for longer opcodes in :mod:`dis` output.
3073
3074- bpo-47000: Make :class:`TextIOWrapper` uses locale encoding when
3075  ``encoding="locale"`` is specified even in UTF-8 mode.
3076
3077- gh-issue-91230: :func:`warnings.catch_warnings` now accepts arguments for
3078  :func:`warnings.simplefilter`, providing a more concise way to locally
3079  ignore warnings or convert them to errors.
3080
3081- gh-issue-91217: Deprecate the chunk module.
3082
3083- Add the ``TCP_CONNECTION_INFO`` option (available on macOS) to
3084  :mod:`socket`.
3085
3086- bpo-47260: Fix ``os.closerange()`` potentially being a no-op in a Linux
3087  seccomp sandbox.
3088
3089- bpo-47087: Implement ``typing.Required`` and ``typing.NotRequired``
3090  (:pep:`655`). Patch by David Foster and Jelle Zijlstra.
3091
3092- bpo-47061: Deprecate cgi and cgitb.
3093
3094- bpo-47061: Deprecate audioop.
3095
3096- bpo-47000: Add :func:`locale.getencoding` to get the current locale
3097  encoding. It is similar to ``locale.getpreferredencoding(False)`` but
3098  ignores the :ref:`Python UTF-8 Mode <utf8-mode>`.
3099
3100- bpo-42012: Add :mod:`wsgiref.types`, containing WSGI-specific types for
3101  static type checking.
3102
3103- bpo-47227: Suppress expression chaining for more :mod:`re` parsing errors.
3104
3105- bpo-47211: Remove undocumented and never working function
3106  ``re.template()`` and flag ``re.TEMPLATE``. This was later reverted in
3107  3.11.0b2 and deprecated instead.
3108
3109- bpo-47135: :meth:`decimal.localcontext` now accepts context attributes via
3110  keyword arguments
3111
3112- bpo-43323: Fix errors in the :mod:`email` module if the charset itself
3113  contains undecodable/unencodable characters.
3114
3115- bpo-46841: Disassembly of quickened code.
3116
3117- bpo-46681: Forward gzip.compress() compresslevel to zlib.
3118
3119- bpo-45100: Add :func:`typing.get_overloads` and
3120  :func:`typing.clear_overloads`. Patch by Jelle Zijlstra.
3121
3122- bpo-44807: :class:`typing.Protocol` no longer silently replaces
3123  :meth:`__init__` methods defined on subclasses. Patch by Adrian Garcia
3124  Badaracco.
3125
3126- bpo-46787: Fix :class:`concurrent.futures.ProcessPoolExecutor` exception
3127  memory leak
3128
3129- bpo-46720: Add support for path-like objects to
3130  :func:`multiprocessing.set_executable` for Windows to be on a par with
3131  Unix-like systems. Patch by Géry Ogam.
3132
3133- bpo-46696: Add ``SO_INCOMING_CPU`` constant to :mod:`socket`.
3134
3135- bpo-46053: Fix OSS audio support on NetBSD.
3136
3137- bpo-45639: ``image/avif`` and ``image/webp`` were added to
3138  :mod:`mimetypes`.
3139
3140- bpo-46285: Add command-line option ``-p``/``--protocol`` to module
3141  :mod:`http.server` which specifies the HTTP version to which the server is
3142  conformant (HTTP/1.1 conformant servers can now be run from the
3143  command-line interface of module :mod:`http.server`). Patch by Géry Ogam.
3144
3145- bpo-44791: Accept ellipsis as the last argument of
3146  :data:`typing.Concatenate`.
3147
3148- bpo-46547: Remove variables leaking into ``pydoc.Helper`` class namespace.
3149
3150- bpo-46415: Fix ipaddress.ip_{address,interface,network} raising TypeError
3151  instead of ValueError if given invalid tuple as address parameter.
3152
3153- bpo-46075: ``CookieJar`` with ``DefaultCookiePolicy`` now can process
3154  cookies from localhost with domain=localhost explicitly specified in
3155  Set-Cookie header.
3156
3157- bpo-45995: Add a "z" option to the string formatting specification that
3158  coerces negative zero floating-point values to positive zero after
3159  rounding to the format precision.  Contributed by John Belmonte.
3160
3161- bpo-26175: Fully implement the :class:`io.BufferedIOBase` or
3162  :class:`io.TextIOBase` interface for
3163  :class:`tempfile.SpooledTemporaryFile` objects. This lets them work
3164  correctly with higher-level layers (like compression modules). Patch by
3165  Carey Metcalfe.
3166
3167- bpo-45138: Fix a regression in the :mod:`sqlite3` trace callback where
3168  bound parameters were not expanded in the passed statement string. The
3169  regression was introduced in Python 3.10 by :issue:`40318`. Patch by
3170  Erlend E. Aasland.
3171
3172- bpo-44863: Allow :class:`~typing.TypedDict` subclasses to also include
3173  :class:`~typing.Generic` as a base class in class based syntax. Thereby
3174  allowing the user to define a generic ``TypedDict``, just like a
3175  user-defined generic but with ``TypedDict`` semantics.
3176
3177- bpo-44587: Fix BooleanOptionalAction to not automatically add a default
3178  string.  If a default string is desired, use a formatter to add it.
3179
3180- bpo-43827: All positional-or-keyword parameters to ``ABCMeta.__new__`` are
3181  now positional-only to avoid conflicts with keyword arguments to be passed
3182  to :meth:`__init_subclass__`.
3183
3184- bpo-43218: Prevent creation of a venv whose path contains the PATH
3185  separator. This could affect the usage of the activate script. Patch by
3186  Dustin Rodrigues.
3187
3188- bpo-38435: Add a ``process_group`` parameter to :class:`subprocess.Popen`
3189  to help move more things off of the unsafe ``preexec_fn`` parameter.
3190
3191- bpo-42066: Fix cookies getting sorted in :func:`CookieJar.__iter__` which
3192  is an extra behavior and not mentioned in RFC 2965 or Netscape cookie
3193  protocol. Now the cookies in ``CookieJar`` follows the order of the
3194  ``Set-Cookie`` header. Patch by Iman Kermani.
3195
3196- bpo-40617: Add :meth:`~sqlite3.Connection.create_window_function` to
3197  :class:`sqlite3.Connection` for creating aggregate window functions. Patch
3198  by Erlend E. Aasland.
3199
3200- bpo-40676: Convert :mod:`csv` to use Argument Clinic for
3201  :func:`csv.field_size_limit`, :func:`csv.get_dialect`,
3202  :func:`csv.unregister_dialect` and :func:`csv.list_dialects`.
3203
3204- bpo-39716: Raise an ArgumentError when the same subparser name is added
3205  twice to an `argparse.ArgumentParser`.  This is consistent with the
3206  (default) behavior when the same option string is added twice to an
3207  ArgumentParser.
3208
3209- bpo-36073: Raise :exc:`~sqlite3.ProgrammingError` instead of segfaulting
3210  on recursive usage of cursors in :mod:`sqlite3` converters. Patch by
3211  Sergey Fedoseev.
3212
3213- bpo-34975: Adds a ``start_tls()`` method to
3214  :class:`~asyncio.streams.StreamWriter`, which upgrades the connection with
3215  TLS using the given :class:`~ssl.SSLContext`.
3216
3217- bpo-22276: :class:`~pathlib.Path` methods :meth:`~pathlib.Path.glob` and
3218  :meth:`~pathlib.Path.rglob` return only directories if *pattern* ends with
3219  a pathname components separator (``/`` or :data:`~os.sep`). Patch by
3220  Eisuke Kawashima.
3221
3222- bpo-24905: Add :meth:`~sqlite3.Connection.blobopen` to
3223  :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O
3224  operations on blobs. Patch by Aviv Palivoda and Erlend E. Aasland.
3225
3226Documentation
3227-------------
3228
3229- gh-issue-91888: Add a new `gh` role to the documentation to link to GitHub
3230  issues.
3231
3232- gh-issue-91783: Document security issues concerning the use of the
3233  function :meth:`shutil.unpack_archive`
3234
3235- gh-issue-91547: Remove "Undocumented modules" page.
3236
3237- gh-issue-91298: In ``importlib.resources.abc``, refined the documentation
3238  of the Traversable Protocol, applying changes from importlib_resources
3239  5.7.1.
3240
3241- bpo-44347: Clarify the meaning of *dirs_exist_ok*, a kwarg of
3242  :func:`shutil.copytree`.
3243
3244- bpo-36329: Remove 'make -C Doc serve' in favour of 'make -C Doc htmlview'
3245
3246- bpo-47189: Add a What's New in Python 3.11 entry for the Faster CPython
3247  project. Documentation by Ken Jin and Kumar Aditya.
3248
3249- bpo-38668: Update the introduction to documentation for :mod:`os.path` to
3250  remove warnings that became irrelevant after the implementations of
3251  :pep:`383` and :pep:`529`.
3252
3253- bpo-47115: The documentation now lists which members of C structs are part
3254  of the :ref:`Limited API/Stable ABI <stable>`.
3255
3256- bpo-46962: All docstrings in code snippets are now wrapped into
3257  :func:`PyDoc_STR` to follow the guideline of `PEP 7's Documentation
3258  Strings paragraph
3259  <https://www.python.org/dev/peps/pep-0007/#documentation-strings>`_. Patch
3260  by Oleg Iarygin.
3261
3262- bpo-26792: Improve the docstrings of :func:`runpy.run_module` and
3263  :func:`runpy.run_path`. Original patch by Andrew Brezovsky.
3264
3265Tests
3266-----
3267
3268- gh-issue-92169: Use ``warnings_helper.import_deprecated()`` to import
3269  deprecated modules uniformly in tests. Patch by Hugo van Kemenade.
3270
3271- gh-issue-84461: When multiprocessing is enabled, libregrtest can now use a
3272  Python executable other than :code:`sys.executable` via the ``--python``
3273  flag.
3274
3275- gh-issue-91904: Fix initialization of
3276  :envvar:`PYTHONREGRTEST_UNICODE_GUARD` which prevented running regression
3277  tests on non-UTF-8 locale.
3278
3279- gh-issue-91752: Added @requires_zlib to
3280  test.test_tools.test_freeze.TestFreeze.
3281
3282- gh-issue-91607: Fix ``test_concurrent_futures`` to test the correct
3283  multiprocessing start method context in several cases where the test logic
3284  mixed this up.
3285
3286- bpo-40280: Threading tests are now skipped on WASM targets without pthread
3287  support.
3288
3289- bpo-47109: Test for :mod:`ctypes.macholib.dyld`,
3290  :mod:`ctypes.macholib.dylib`, and :mod:`ctypes.macholib.framework` are
3291  brought from manual pre-:mod:`unittest` times to :mod:`ctypes.test`
3292  location and structure. Patch by Oleg Iarygin.
3293
3294- bpo-29890: Add tests for :class:`ipaddress.IPv4Interface` and
3295  :class:`ipaddress.IPv6Interface` construction with tuple arguments.
3296  Original patch and tests by louisom.
3297
3298Build
3299-----
3300
3301- gh-issue-89452: gdbm-compat is now preferred over ndbm if both are
3302  available on the system. This allows avoiding the problematic ndbm.h on
3303  macOS.
3304
3305- gh-issue-91731: Python is now built with ``-std=c11`` compiler option,
3306  rather than ``-std=c99``. Patch by Victor Stinner.
3307
3308- bpo-47152: Add script and make target for generating ``sre_constants.h``.
3309
3310- bpo-47103: Windows ``PGInstrument`` builds now copy a required DLL into
3311  the output directory, making it easier to run the profile stage of a PGO
3312  build.
3313
3314Windows
3315-------
3316
3317- bpo-46907: Update Windows installer to use SQLite 3.38.3.
3318
3319- bpo-47239: Fixed --list and --list-paths output for :ref:`launcher` when
3320  used in an active virtual environment.
3321
3322- bpo-46907: Update Windows installer to use SQLite 3.38.2.
3323
3324- bpo-46785: Fix race condition between :func:`os.stat` and unlinking a file
3325  on Windows, by using errors codes returned by ``FindFirstFileW()`` when
3326  appropriate in ``win32_xstat_impl``.
3327
3328- bpo-40859: Update Windows build to use xz-5.2.5
3329
3330macOS
3331-----
3332
3333- bpo-46907: Update macOS installer to SQLite 3.38.4.
3334
3335Tools/Demos
3336-----------
3337
3338- gh-issue-91583: Fix regression in the code generated by Argument Clinic
3339  for functions with the ``defining_class`` parameter.
3340
3341- gh-issue-91575: Add script ``Tools/scripts/generate_re_casefix.py`` and
3342  the make target ``regen-re`` for generating additional data for
3343  case-insensitive matching according to the current Unicode version.
3344
3345- gh-issue-91551: Remove the ancient Pynche color editor.  It has moved to
3346  https://gitlab.com/warsaw/pynche
3347
3348C API
3349-----
3350
3351- gh-issue-88279: Deprecate the C functions: :c:func:`PySys_SetArgv`,
3352  :c:func:`PySys_SetArgvEx`, :c:func:`PySys_SetPath`. Patch by Victor
3353  Stinner.
3354
3355- gh-issue-92154: Added the :c:func:`PyCode_GetCode` function. This function
3356  does the equivalent of the Python code ``getattr(code_object,
3357  'co_code')``.
3358
3359- gh-issue-92173: Fix the ``closure`` argument to
3360  :c:func:`PyEval_EvalCodeEx`.
3361
3362- gh-issue-91320: Fix C++ compiler warnings about "old-style cast" (``g++
3363  -Wold-style-cast``) in the Python C API. Use C++ ``reinterpret_cast<>``
3364  and ``static_cast<>`` casts when the Python C API is used in C++. Patch by
3365  Victor Stinner.
3366
3367- gh-issue-80527: Mark functions as deprecated by :pep:`623`:
3368  :c:func:`PyUnicode_AS_DATA`, :c:func:`PyUnicode_AS_UNICODE`,
3369  :c:func:`PyUnicode_GET_DATA_SIZE`, :c:func:`PyUnicode_GET_SIZE`. Patch by
3370  Victor Stinner.
3371
3372- gh-issue-91768: :c:func:`Py_REFCNT`, :c:func:`Py_TYPE`, :c:func:`Py_SIZE`
3373  and :c:func:`Py_IS_TYPE` functions argument type is now ``PyObject*``,
3374  rather than ``const PyObject*``. Patch by Victor Stinner.
3375
3376- gh-issue-91020: Add ``PyBytes_Type.tp_alloc`` to initialize
3377  ``PyBytesObject.ob_shash`` for bytes subclasses.
3378
3379- bpo-40421: Add ``PyFrame_GetLasti`` C-API function to access frame
3380  object's ``f_lasti`` attribute safely from C code.
3381
3382- bpo-35134: Remove the ``Include/code.h`` header file. C extensions should
3383  only include the main ``<Python.h>`` header file. Patch by Victor Stinner.
3384
3385- bpo-47169: :c:func:`PyOS_CheckStack` is now exported in the Stable ABI on
3386  Windows.
3387
3388- bpo-47169: :c:func:`PyThread_get_thread_native_id` is excluded from the
3389  stable ABI on platforms where it doesn't exist (like Solaris).
3390
3391- bpo-46343: Added :c:func:`PyErr_GetHandledException` and
3392  :c:func:`PyErr_SetHandledException` as simpler alternatives to
3393  :c:func:`PyErr_GetExcInfo` and :c:func:`PyErr_SetExcInfo`.
3394
3395  They are included in the stable ABI.
3396
3397
3398What's New in Python 3.11.0 alpha 7?
3399====================================
3400
3401*Release date: 2022-04-05*
3402
3403Core and Builtins
3404-----------------
3405
3406- bpo-47212: Raise :exc:`IndentationError` instead of :exc:`SyntaxError` for
3407  a bare ``except`` with no following indent. Improve :exc:`SyntaxError`
3408  locations for an un-parenthesized generator used as arguments. Patch by
3409  Matthieu Dartiailh.
3410
3411- bpo-47186: Replace :opcode:`JUMP_IF_NOT_EG_MATCH` by
3412  :opcode:`CHECK_EG_MATCH` + jump.
3413
3414- bpo-47176: Emscripten builds cannot handle signals in the usual way due to
3415  platform limitations. Python can now handle signals. To use, set
3416  Module.Py_EmscriptenSignalBuffer to be a single byte SharedArrayBuffer and
3417  set Py_EMSCRIPTEN_SIGNAL_HANDLING to 1. Writing a number into the
3418  SharedArrayBuffer will cause the corresponding signal to be raised into
3419  the Python thread.
3420
3421- bpo-47186: Replace :opcode:`JUMP_IF_NOT_EXC_MATCH` by
3422  :opcode:`CHECK_EXC_MATCH` + jump.
3423
3424- bpo-47120: Replace the absolute jump opcode :opcode:`JUMP_NO_INTERRUPT` by
3425  the relative :opcode:`JUMP_BACKWARD_NO_INTERRUPT`.
3426
3427- bpo-46841: Avoid unnecessary allocations when comparing code objects.
3428
3429- bpo-47182: Fix a crash when using a named unicode character like
3430  ``"\N{digit nine}"`` after the main interpreter has been initialized a
3431  second time.
3432
3433- bpo-47162: WebAssembly cannot deal with bad function pointer casts
3434  (different count or types of arguments). Python can now use call
3435  trampolines to mitigate the problem. Define :c:macro:`PY_CALL_TRAMPOLINE`
3436  to enable call trampolines.
3437
3438- bpo-46775: Some Windows system error codes(>= 10000) are now mapped into
3439  the correct errno and may now raise a subclass of :exc:`OSError`. Patch by
3440  Dong-hee Na.
3441
3442- bpo-47129: Improve error messages in f-string syntax errors concerning
3443  empty expressions.
3444
3445- bpo-47117: Fix a crash if we fail to decode characters in interactive mode
3446  if the tokenizer buffers are uninitialized. Patch by Pablo Galindo.
3447
3448- bpo-47127: Speed up calls to c functions with keyword arguments by 25%
3449  with specialization. Patch by Kumar Aditya.
3450
3451- bpo-47120: Replaced :opcode:`JUMP_ABSOLUTE` by the relative jump
3452  :opcode:`JUMP_BACKWARD`.
3453
3454- bpo-42197: :c:func:`PyFrame_FastToLocalsWithError` and
3455  :c:func:`PyFrame_LocalsToFast` are no longer called during profiling nor
3456  tracing. C code can access the ``f_locals`` attribute of
3457  :c:type:`PyFrameObject` by calling :c:func:`PyFrame_GetLocals`.
3458
3459- bpo-47070: Improve performance of ``array_inplace_repeat`` by reducing the
3460  number of invocations of ``memcpy``. Refactor the ``repeat`` and inplace
3461  ``repeat`` methods of ``array``, ``bytes``, ``bytearray`` and
3462  ``unicodeobject`` to use the common ``_PyBytes_Repeat``.
3463
3464- bpo-47053: Reduce de-optimization in the specialized
3465  ``BINARY_OP_INPLACE_ADD_UNICODE`` opcode.
3466
3467- bpo-47045: Remove the ``f_state`` field from the _PyInterpreterFrame
3468  struct. Add the ``owner`` field to the _PyInterpreterFrame struct to make
3469  ownership explicit to simplify clearing and deallocing frames and
3470  generators.
3471
3472- bpo-46968: Check for the existence of the "sys/auxv.h" header in
3473  :mod:`faulthandler` to avoid compilation problems in systems where this
3474  header doesn't exist. Patch by Pablo Galindo
3475
3476- bpo-46329: Use low bit of ``LOAD_GLOBAL`` to indicate whether to push a
3477  ``NULL`` before the global. Helps streamline the call sequence a bit.
3478
3479- bpo-46841: Quicken bytecode in-place by storing it as part of the
3480  corresponding ``PyCodeObject``.
3481
3482- bpo-47012: Speed up iteration of :class:`bytes` and :class:`bytearray` by
3483  30%. Patch by Kumar Aditya.
3484
3485- bpo-47009: Improved the performance of :meth:`list.append()` and list
3486  comprehensions by optimizing for the common case, where no resize is
3487  needed. Patch by Dennis Sweeney.
3488
3489- bpo-47005: Improve performance of ``bytearray_repeat`` and
3490  ``bytearray_irepeat`` by reducing the number of invocations of ``memcpy``.
3491
3492- bpo-46829: Deprecate passing a message into :meth:`asyncio.Future.cancel`
3493  and :meth:`asyncio.Task.cancel`
3494
3495- bpo-46993: Speed up :class:`bytearray` creation from :class:`list` and
3496  :class:`tuple` by 40%. Patch by Kumar Aditya.
3497
3498- bpo-39829: Removed the ``__len__()`` call when initializing a list and
3499  moved initializing to ``list_extend``. Patch by Jeremiah Pascual.
3500
3501- bpo-46944: Speed up throwing exception in generator with
3502  :const:`METH_FASTCALL` calling convention. Patch by Kumar Aditya.
3503
3504- bpo-46841: Modify :opcode:`STORE_SUBSCR` to use an inline cache entry
3505  (rather than its oparg) as an adaptive counter.
3506
3507- bpo-46841: Use inline caching for :opcode:`PRECALL` and :opcode:`CALL`,
3508  and remove the internal machinery for managing the (now unused) non-inline
3509  caches.
3510
3511- bpo-46881: Statically allocate and initialize the latin1 characters.
3512
3513- bpo-46838: Improve syntax errors for incorrect function definitions. Patch
3514  by Pablo Galindo
3515
3516- bpo-43721: Fix docstrings of :attr:`~property.getter`,
3517  :attr:`~property.setter`, and :attr:`~property.deleter` to clarify that
3518  they create a new copy of the property.
3519
3520- bpo-43224: Make grammar changes required for PEP 646.
3521
3522Library
3523-------
3524
3525- bpo-47208: Allow vendors to override :const:`CTYPES_MAX_ARGCOUNT`.
3526
3527- bpo-23689: :mod:`re` module: fix memory leak when a match is terminated by
3528  a signal or memory allocation failure. Patch by Ma Lin.
3529
3530- bpo-47167: Allow overriding a future compliance check in
3531  :class:`asyncio.Task`.
3532
3533- bpo-47151: When subprocess tries to use vfork, it now falls back to fork
3534  if vfork returns an error. This allows use in situations where vfork isn't
3535  allowed by the OS kernel.
3536
3537- bpo-47152: Convert the :mod:`re` module into a package. Deprecate modules
3538  ``sre_compile``, ``sre_constants`` and ``sre_parse``.
3539
3540- bpo-4833: Add :meth:`ZipFile.mkdir`
3541
3542- bpo-27929: Fix :meth:`asyncio.loop.sock_connect` to only resolve names for
3543  :const:`socket.AF_INET` or :const:`socket.AF_INET6` families. Resolution
3544  may not make sense for other families, like :const:`socket.AF_BLUETOOTH`
3545  and :const:`socket.AF_UNIX`.
3546
3547- bpo-14265: Adds the fully qualified test name to unittest output
3548
3549- bpo-47061: Deprecate the aifc module.
3550
3551- bpo-39622: Handle Ctrl+C in asyncio programs to interrupt the main task.
3552
3553- bpo-47101: :const:`hashlib.algorithms_available` now lists only algorithms
3554  that are provided by activated crypto providers on OpenSSL 3.0. Legacy
3555  algorithms are not listed unless the legacy provider has been loaded into
3556  the default OSSL context.
3557
3558- bpo-47099: All :exc:`URLError` exception messages raised in
3559  :class:`urllib.request.URLopener` now contain a colon between ``ftp
3560  error`` and the rest of the message. Previously,
3561  :func:`~urllib.request.URLopener.open_ftp` missed the colon. Patch by Oleg
3562  Iarygin.
3563
3564- bpo-47099: Exception chaining is changed from
3565  :func:`Exception.with_traceback`/:func:`sys.exc_info` to :pep:`3134`.
3566  Patch by Oleg Iarygin.
3567
3568- bpo-47095: :mod:`hashlib`'s internal ``_blake2`` module now prefers
3569  ``libb2`` from https://www.blake2.net/ over Python's vendored copy of
3570  blake2.
3571
3572- bpo-47098: The Keccak Code Package for :mod:`hashlib`'s internal ``_sha3``
3573  module has been replaced with tiny_sha3. The module is used as fallback
3574  when Python is built without OpenSSL.
3575
3576- bpo-47088: Implement :data:`typing.LiteralString`, part of :pep:`675`.
3577  Patch by Jelle Zijlstra.
3578
3579- bpo-42885: Optimize :func:`re.search`, :func:`re.split`,
3580  :func:`re.findall`, :func:`re.finditer` and :func:`re.sub` for regular
3581  expressions starting with ``\A`` or ``^``.
3582
3583- bpo-23691: Protect the :func:`re.finditer` iterator from re-entering.
3584
3585- bpo-47067: Optimize calling ``GenericAlias`` objects by using :pep:`590`
3586  ``vectorcall`` and by replacing ``PyObject_SetAttrString`` with
3587  ``PyObject_SetAttr``.
3588
3589- bpo-28080: Add the *metadata_encoding* parameter in the
3590  :class:`zipfile.ZipFile` constructor and the ``--metadata-encoding``
3591  option in the :mod:`zipfile` CLI to allow reading zipfiles using
3592  non-standard codecs to encode the filenames within the archive.
3593
3594- bpo-47000: Make :func:`io.text_encoding` returns "utf-8" when UTF-8 mode
3595  is enabled.
3596
3597- bpo-42369: Fix thread safety of :meth:`zipfile._SharedFile.tell` to avoid
3598  a "zipfile.BadZipFile: Bad CRC-32 for file" exception when reading a
3599  :class:`ZipFile` from multiple threads.
3600
3601- bpo-38256: Fix :func:`binascii.crc32` when it is compiled to use zlib'c
3602  crc32 to work properly on inputs 4+GiB in length instead of returning the
3603  wrong result. The workaround prior to this was to always feed the function
3604  data in increments smaller than 4GiB or to just call the zlib module
3605  function.
3606
3607  We also have :func:`binascii.crc32` release the GIL when computing on
3608  larger inputs as :func:`zlib.crc32` and :mod:`hashlib` do.
3609
3610  This also boosts performance on Windows as it now uses the zlib crc32
3611  implementation for :func:`binascii.crc32` for a 2-3x speedup.
3612
3613  That the stdlib has a crc32 API in two modules is a known historical
3614  oddity. This moves us closer to a single implementation behind them.
3615
3616- bpo-47066: Global inline flags (e.g. ``(?i)``) can now only be used at the
3617  start of the regular expressions.  Using them not at the start of
3618  expression was deprecated since Python 3.6.
3619
3620- bpo-39394: A warning about inline flags not at the start of the regular
3621  expression now contains the position of the flag.
3622
3623- bpo-433030: Add support of atomic grouping (``(?>...)``) and possessive
3624  quantifiers (``*+``, ``++``, ``?+``, ``{m,n}+``) in :mod:`regular
3625  expressions <re>`.
3626
3627- bpo-47062: Implement :class:`asyncio.Runner` context manager.
3628
3629- bpo-46382: :func:`~dataclasses.dataclass` ``slots=True`` now correctly
3630  omits slots already defined in base classes. Patch by Arie Bovenberg.
3631
3632- bpo-47057: Use FASTCALL convention for ``FutureIter.throw()``
3633
3634- bpo-47061: Deprecate the various modules listed by :pep:`594`:
3635
3636  aifc, asynchat, asyncore, audioop, cgi, cgitb, chunk, crypt, imghdr,
3637  msilib, nntplib, nis, ossaudiodev, pipes, smtpd, sndhdr, spwd, sunau,
3638  telnetlib, uu, xdrlib
3639
3640- bpo-34790: Remove passing coroutine objects to :func:`asyncio.wait`.
3641
3642- bpo-47039: Normalize ``repr()`` of asyncio future and task objects.
3643
3644- bpo-2604: Fix bug where doctests using globals would fail when run
3645  multiple times.
3646
3647- bpo-45150: Add :func:`hashlib.file_digest` helper for efficient hashing of
3648  file object.
3649
3650- bpo-34861: Made cumtime the default sorting key for cProfile
3651
3652- bpo-45997: Fix :class:`asyncio.Semaphore` re-aquiring FIFO order.
3653
3654- bpo-47022: The :mod:`asynchat`, :mod:`asyncore` and  :mod:`smtpd` modules
3655  have been deprecated since at least Python 3.6. Their documentation and
3656  deprecation warnings and have now been updated to note they will removed
3657  in Python 3.12 (:pep:`594`).
3658
3659- bpo-43253: Fix a crash when closing transports where the underlying socket
3660  handle is already invalid on the Proactor event loop.
3661
3662- bpo-40280: :func:`select.select` now passes ``NULL`` to ``select`` for
3663  each empty fdset.
3664
3665- bpo-47004: Apply bugfixes from importlib_metadata 4.11.3, including bugfix
3666  for EntryPoint.extras, which was returning match objects and not the
3667  extras strings.
3668
3669- bpo-46998: Allow subclassing of :class:`typing.Any`. Patch by Shantanu
3670  Jain.
3671
3672- bpo-46995: Deprecate missing :meth:`asyncio.Task.set_name` for third-party
3673  task implementations, schedule making it mandatory in Python 3.13.
3674
3675- bpo-46994: Accept explicit contextvars.Context in
3676  :func:`asyncio.create_task` and :meth:`asyncio.loop.create_task`.
3677
3678- bpo-46981: ``typing.get_args(typing.Tuple[()])`` now returns ``()``
3679  instead of ``((),)``.
3680
3681- bpo-46968: Add ``os.sysconf_names['SC_MINSIGSTKSZ']``.
3682
3683- bpo-46985: Upgrade pip wheel bundled with ensurepip (pip 22.0.4)
3684
3685- bpo-46968: :mod:`faulthandler`: On Linux 5.14 and newer, dynamically
3686  determine size of signal handler stack size CPython allocates using
3687  ``getauxval(AT_MINSIGSTKSZ)``. This changes allows for Python extension's
3688  request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids
3689  Xeon processor to succeed, unblocking use of the ISA in frameworks.
3690
3691- bpo-46917: The :data:`math.nan` value is now always available. Patch by
3692  Victor Stinner.
3693
3694- bpo-46955: Expose :class:`asyncio.base_events.Server` as
3695  :class:`asyncio.Server`. Patch by Stefan Zabka.
3696
3697- bpo-23325: The :mod:`signal` module no longer assumes that
3698  :const:`~signal.SIG_IGN` and :const:`~signal.SIG_DFL` are small int
3699  singletons.
3700
3701- bpo-46932: Update bundled libexpat to 2.4.7
3702
3703- bpo-46933: The :mod:`pwd` module is now optional.
3704  :func:`os.path.expanduser` returns the path when the :mod:`pwd` module is
3705  not available.
3706
3707- bpo-40059: :pep:`680`, the :mod:`tomllib` module. Adds support for parsing
3708  TOML.
3709
3710- bpo-464471: :func:`asyncio.timeout` and :func:`asyncio.timeout_at` context
3711  managers added. Patch by Tin Tvrtković and Andrew Svetlov.
3712
3713- bpo-46805: Added raw datagram socket functions for asyncio:
3714  :meth:`~asyncio.AbstractEventLoop.sock_sendto`,
3715  :meth:`~asyncio.AbstractEventLoop.sock_recvfrom` and
3716  :meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
3717
3718- bpo-46644: No longer require valid typeforms to be callable. This allows
3719  :data:`typing.Annotated` to wrap :data:`typing.ParamSpecArgs` and
3720  :data:`dataclasses.InitVar`. Patch by Gregory Beauregard.
3721
3722- bpo-46581: Brings :class:`ParamSpec` propagation for :class:`GenericAlias`
3723  in line with :class:`Concatenate` (and others).
3724
3725- bpo-45413: Define *posix_venv* and *nt_venv* :ref:`sysconfig installation
3726  schemes <installation_paths>` to be used for bootstrapping new virtual
3727  environments. Add *venv* sysconfig installation scheme to get the
3728  appropriate one of the above. The schemes are identical to the
3729  pre-existing *posix_prefix* and *nt* install schemes. The :mod:`venv`
3730  module now uses the *venv* scheme to create new virtual environments
3731  instead of hardcoding the paths depending only on the platform. Downstream
3732  Python distributors customizing the *posix_prefix* or *nt* install scheme
3733  in a way that is not compatible with the install scheme used in virtual
3734  environments are encouraged not to customize the *venv* schemes. When
3735  Python itself runs in a virtual environment,
3736  :func:`sysconfig.get_default_scheme` and
3737  :func:`sysconfig.get_preferred_scheme` with ``key="prefix"`` returns
3738  *venv*.
3739
3740- bpo-43224: Implement support for PEP 646 in typing.py.
3741
3742- bpo-43224: Allow unpacking types.GenericAlias objects, e.g. ``*tuple[int,
3743  str]``.
3744
3745- bpo-46557: Warnings captured by the logging module are now logged without
3746  a format string to prevent systems that group logs by the msg argument
3747  from grouping captured warnings together.
3748
3749- bpo-41370: :func:`typing.get_type_hints` now supports evaluating strings
3750  as forward references in :ref:`PEP 585 generic aliases
3751  <types-genericalias>`.
3752
3753- bpo-46607: Add :exc:`DeprecationWarning` to :class:`LegacyInterpolation`,
3754  deprecated in the docstring since Python 3.2. Will be removed in Python
3755  3.13. Use :class:`BasicInterpolation` or :class:`ExtendedInterpolation`
3756  instead.
3757
3758- bpo-26120: :mod:`pydoc` now excludes __future__ imports from the module's
3759  data items.
3760
3761- bpo-46480: Add :func:`typing.assert_type`. Patch by Jelle Zijlstra.
3762
3763- bpo-46421: Fix a unittest issue where if the command was invoked as
3764  ``python -m unittest`` and the filename(s) began with a dot (.), a
3765  ``ValueError`` is returned.
3766
3767- bpo-46245: Add optional parameter *dir_fd* in :func:`shutil.rmtree`.
3768
3769- bpo-22859: :meth:`~unittest.TestProgram.usageExit` is marked deprecated,
3770  to be removed in 3.13.
3771
3772- bpo-46170: Improve the error message when you try to subclass an instance
3773  of :class:`typing.NewType`.
3774
3775- bpo-40296: Fix supporting generic aliases in :mod:`pydoc`.
3776
3777- bpo-20392: Fix inconsistency with uppercase file extensions in
3778  :meth:`MimeTypes.guess_type`. Patch by Kumar Aditya.
3779
3780- bpo-46030: Add ``LOCAL_CREDS``, ``LOCAL_CREDS_PERSISTENT`` and
3781  ``SCM_CREDS2`` FreeBSD constants to the socket module.
3782
3783- bpo-44439: Fix ``.write()`` method of a member file in ``ZipFile``, when
3784  the input data is an object that supports the buffer protocol, the file
3785  length may be wrong.
3786
3787- bpo-45171: Fix handling of the ``stacklevel`` argument to logging
3788  functions in the :mod:`logging` module so that it is consistent across all
3789  logging functions and, as advertised, similar to the ``stacklevel``
3790  argument used in :meth:`~warnings.warn`.
3791
3792- bpo-24959: Fix bug where :mod:`unittest` sometimes drops frames from
3793  tracebacks of exceptions raised in tests.
3794
3795- bpo-44859: Raise more accurate and :pep:`249` compatible exceptions in
3796  :mod:`sqlite3`.
3797
3798  * Raise :exc:`~sqlite3.InterfaceError` instead of
3799    :exc:`~sqlite3.ProgrammingError` for ``SQLITE_MISUSE`` errors.
3800  * Don't overwrite :exc:`BufferError` with :exc:`ValueError` when conversion to
3801    BLOB fails.
3802  * Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`~sqlite3.Warning` if
3803    user tries to :meth:`~sqlite3.Cursor.execute()` more than one SQL statement.
3804  * Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`ValueError` if an SQL
3805    query contains null characters.
3806
3807- bpo-44493: Add missing terminated NUL in sockaddr_un's length
3808
3809  This was potentially observable when using non-abstract AF_UNIX datagram
3810  sockets to processes written in another programming language.
3811
3812- bpo-41930: Add :meth:`~sqlite3.Connection.serialize` and
3813  :meth:`~sqlite3.Connection.deserialize` support to :mod:`sqlite3`. Patch
3814  by Erlend E. Aasland.
3815
3816- bpo-33178: Added :class:`ctypes.BigEndianUnion` and
3817  :class:`ctypes.LittleEndianUnion` classes, as originally documented in the
3818  library docs but not yet implemented.
3819
3820- bpo-43352: Add an Barrier object in synchronization primitives of
3821  *asyncio* Lib in order to be consistant with Barrier from *threading* and
3822  *multiprocessing* libs*
3823
3824- bpo-35859: :mod:`re` module, fix a few bugs about capturing group. In rare
3825  cases, capturing group gets an incorrect string. Patch by Ma Lin.
3826
3827Documentation
3828-------------
3829
3830- bpo-45099: Document internal :mod:`asyncio` API.
3831
3832- bpo-47126: Update PEP URLs to :pep:`676`'s new canonical form.
3833
3834- bpo-47040: Clarified the old Python versions compatiblity note of
3835  :func:`binascii.crc32` / :func:`zlib.adler32` / :func:`zlib.crc32`
3836  functions.
3837
3838- bpo-46033: Clarify ``for`` statement execution in its doc.
3839
3840- bpo-45790: Adjust inaccurate phrasing in
3841  :doc:`../extending/newtypes_tutorial` about the ``ob_base`` field and the
3842  macros used to access its contents.
3843
3844- bpo-42340: Document that in some circumstances :exc:`KeyboardInterrupt`
3845  may cause the code to enter an inconsistent state. Provided a sample
3846  workaround to avoid it if needed.
3847
3848- bpo-41233: Link the errnos referenced in ``Doc/library/exceptions.rst`` to
3849  their respective section in ``Doc/library/errno.rst``, and vice versa.
3850  Previously this was only done for EINTR and InterruptedError. Patch by Yan
3851  "yyyyyyyan" Orestes.
3852
3853Tests
3854-----
3855
3856- bpo-47205: Skip test for :func:`~os.sched_getaffinity` and
3857  :func:`~os.sched_setaffinity` error case on FreeBSD.
3858
3859- bpo-46126: Restore 'descriptions' when running tests internally.
3860
3861- bpo-47104: Rewrite :func:`asyncio.to_thread` tests to use
3862  :class:`unittest.IsolatedAsyncioTestCase`.
3863
3864- bpo-40280: The test suite is now passing on the Emscripten platform. All
3865  fork, socket, and subprocess-based tests are skipped.
3866
3867- bpo-47037: Skip ``strftime("%4Y")`` feature test on Windows. It can cause
3868  an assertion error in debug builds.
3869
3870- bpo-46587: Skip tests if platform's ``strftime`` does not support
3871  non-portable glibc extensions.
3872
3873- bpo-47015: A test case for :func:`os.sendfile` is converted from
3874  deprecated :mod:`asyncore` (see :pep:`594`) to :mod:`asyncio`. Patch by
3875  Oleg Iarygin.
3876
3877Build
3878-----
3879
3880- bpo-40280: Add configure option :option:`--enable-wasm-dynamic-linking` to
3881  enable ``dlopen`` and MAIN_MODULE / SIDE_MODULE on ``wasm32-emscripten``.
3882
3883- bpo-46023: ``makesetup`` now detects and skips all duplicated module
3884  definitions. The first entry wins.
3885
3886- bpo-40280: Add SOABI ``wasm32-emscripten`` for Emscripten and
3887  ``wasm32-wasi`` for WASI on 32bit WASM as well as ``wasm64`` counter
3888  parts.
3889
3890- bpo-47032: Ensure Windows install builds fail correctly with a non-zero
3891  exit code when part of the build fails.
3892
3893- bpo-47024: Update OpenSSL to 1.1.1n for macOS installers and all Windows
3894  builds.
3895
3896- bpo-46996: The :mod:`tkinter` package now requires Tcl/Tk version 8.5.12
3897  or newer.
3898
3899- bpo-46973: Add ``regen-configure`` make target to regenerate configure
3900  script with Christian's container image
3901  ``quay.io/tiran/cpython_autoconf:269``.
3902
3903- bpo-46917: Building Python now requires support of IEEE 754 floating point
3904  numbers. Patch by Victor Stinner.
3905
3906- bpo-45774: ``configure`` now verifies that all SQLite C APIs needed for
3907  the :mod:`sqlite3` extension module are found.
3908
3909Windows
3910-------
3911
3912- bpo-47194: Update ``zlib`` to v1.2.12 to resolve CVE-2018-25032.
3913
3914- bpo-47171: Enables installing the :file:`py.exe` launcher on Windows
3915  ARM64.
3916
3917- bpo-46566: Upgraded :ref:`launcher` to support a new ``-V:company/tag``
3918  argument for full :pep:`514` support and to detect ARM64 installs. The
3919  ``-64`` suffix on arguments is deprecated, but still selects any
3920  non-32-bit install. Setting :envvar:`PYLAUNCHER_ALLOW_INSTALL` and
3921  specifying a version that is not installed will attempt to install the
3922  requested version from the Microsoft Store.
3923
3924- bpo-47086: The installer for Windows now includes documentation as loose
3925  HTML files rather than a single compiled :file:`.chm` file.
3926
3927- bpo-46907: Update Windows installer to use SQLite 3.38.1.
3928
3929- bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate
3930  CVE-2016-3189 and CVE-2019-12900
3931
3932- bpo-46948: Prevent CVE-2022-26488 by ensuring the Add to PATH option in
3933  the Windows installer uses the correct path when being repaired.
3934
3935macOS
3936-----
3937
3938- bpo-46890: Fix a regression in the setting of ``sys._base_executable`` in
3939  framework builds, and thereby fix a regression in :mod:`venv` virtual
3940  environments with such builds.
3941
3942- bpo-46907: Update macOS installer to SQLite 3.38.1.
3943
3944Tools/Demos
3945-----------
3946
3947- bpo-40280: Replace Emscripten's limited shell with Katie Bell's browser-ui
3948  REPL from python-wasm project.
3949
3950C API
3951-----
3952
3953- bpo-40421: Add ``PyFrame_GetBuiltins``, ``PyFrame_GetGenerator`` and
3954  ``PyFrame_GetGlobals`` C-API functions to access frame object attributes
3955  safely from C code.
3956
3957- bpo-46850: Move the private ``_PyFrameEvalFunction`` type, and private
3958  ``_PyInterpreterState_GetEvalFrameFunc()`` and
3959  ``_PyInterpreterState_SetEvalFrameFunc()`` functions to the internal C
3960  API. The ``_PyFrameEvalFunction`` callback function type now uses the
3961  ``_PyInterpreterFrame`` type which is part of the internal C API. Patch by
3962  Victor Stinner.
3963
3964- bpo-46850: Move the private undocumented ``_PyEval_EvalFrameDefault()``
3965  function to the internal C API. The function now uses the
3966  ``_PyInterpreterFrame`` type which is part of the internal C API. Patch by
3967  Victor Stinner.
3968
3969- bpo-46850: Remove the private undocumented function
3970  ``_PyEval_CallTracing()`` from the C API. Call the public
3971  :func:`sys.call_tracing` function instead. Patch by Victor Stinner.
3972
3973- bpo-46850: Remove the private undocumented function
3974  ``_PyEval_GetCoroutineOriginTrackingDepth()`` from the C API. Call the
3975  public :func:`sys.get_coroutine_origin_tracking_depth` function instead.
3976  Patch by Victor Stinner.
3977
3978- bpo-46850: Remove the following private undocumented functions from the C
3979  API:
3980
3981  * ``_PyEval_GetAsyncGenFirstiter()``
3982  * ``_PyEval_GetAsyncGenFinalizer()``
3983  * ``_PyEval_SetAsyncGenFirstiter()``
3984  * ``_PyEval_SetAsyncGenFinalizer()``
3985
3986  Call the public :func:`sys.get_asyncgen_hooks` and
3987  :func:`sys.set_asyncgen_hooks` functions instead. Patch by Victor Stinner.
3988
3989- bpo-46987: Remove private functions ``_PySys_GetObjectId()`` and
3990  ``_PySys_SetObjectId()``. Patch by Dong-hee Na.
3991
3992- bpo-46906: Add new functions to pack and unpack C double (serialize and
3993  deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`,
3994  :c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`,
3995  :c:func:`PyFloat_Unpack4` and :c:func:`PyFloat_Unpack8`. Patch by Victor
3996  Stinner.
3997
3998
3999What's New in Python 3.11.0 alpha 6?
4000====================================
4001
4002*Release date: 2022-03-07*
4003
4004Core and Builtins
4005-----------------
4006
4007- bpo-46940: Avoid overriding :exc:`AttributeError` metadata information for
4008  nested attribute access calls. Patch by Pablo Galindo.
4009
4010- bpo-46927: Include the type's name in the error message for subscripting
4011  non-generic types.
4012
4013- bpo-46921: Support vectorcall for ``super()``. Patch by Ken Jin.
4014
4015- bpo-46841: Fix incorrect handling of inline cache entries when
4016  specializing :opcode:`BINARY_OP`.
4017
4018- bpo-46841: Use an oparg to simplify the construction of helpful error
4019  messages in :opcode:`GET_AWAITABLE`.
4020
4021- bpo-46903: Make sure that str subclasses can be used as attribute names
4022  for instances with virtual dictionaries. Fixes regression in 3.11alpha
4023
4024- bpo-46841: Add more detailed specialization failure stats for
4025  :opcode:`COMPARE_OP` followed by :opcode:`EXTENDED_ARG`.
4026
4027- bpo-46891: Fix bug introduced during 3.11alpha where subclasses of
4028  ``types.ModuleType`` with ``__slots__`` were not initialized correctly,
4029  resulting in an interpreter crash.
4030
4031- bpo-46841: Use inline caching for :opcode:`LOAD_ATTR`,
4032  :opcode:`LOAD_METHOD`, and :opcode:`STORE_ATTR`.
4033
4034- bpo-46841: Use inline cache for :opcode:`BINARY_SUBSCR`.
4035
4036- bpo-46841: Use inline caching for :opcode:`COMPARE_OP`.
4037
4038- bpo-46864: Deprecate ``PyBytesObject.ob_shash``. It will be removed in
4039  Python 3.13.
4040
4041- bpo-46841: Use inline caching for :opcode:`UNPACK_SEQUENCE`.
4042
4043- bpo-46845: Reduces dict size by removing hash value from hash table when
4044  all inserted keys are Unicode. For example,
4045  ``sys.getsizeof(dict.fromkeys("abcdefg"))`` becomes 272 bytes from 352
4046  bytes on 64bit platform.
4047
4048- bpo-46841: Use inline cache for :opcode:`LOAD_GLOBAL`.
4049
4050- bpo-46852: Rename the private undocumented ``float.__set_format__()``
4051  method to ``float.__setformat__()`` to fix a typo introduced in Python
4052  3.7. The method is only used by test_float. Patch by Victor Stinner.
4053
4054- bpo-46852: Remove the undocumented private ``float.__set_format__()``
4055  method, previously known as ``float.__setformat__()`` in Python 3.7. Its
4056  docstring said: "You probably don't want to use this function. It exists
4057  mainly to be used in Python's test suite." Patch by Victor Stinner.
4058
4059- bpo-40116: Fix regression that dict.update(other) may don't respect
4060  iterate order of other when other is key sharing dict.
4061
4062- bpo-46712: Share global string identifiers in deep-frozen modules.
4063
4064- bpo-46430: Fix memory leak in interned strings of deep-frozen modules.
4065
4066- bpo-46841: Store :opcode:`BINARY_OP` caches inline using a new
4067  :opcode:`CACHE` instruction.
4068
4069- bpo-45107: Specialize ``LOAD_METHOD`` for instances with a dict.
4070
4071- bpo-44337: Reduce the memory usage of specialized :opcode:`LOAD_ATTR` and
4072  :opcode:`STORE_ATTR` instructions.
4073
4074- bpo-46729: Add number of sub-exceptions to :meth:`BaseException.__str__`.
4075
4076- bpo-45885: Don't un-adapt :opcode:`COMPARE_OP` when collecting
4077  specialization stats.
4078
4079- bpo-46329: Fix specialization stats gathering for :opcode:`PRECALL`
4080  instructions.
4081
4082- bpo-46794: Bump up the libexpat version into 2.4.6
4083
4084- bpo-46823: Implement a specialized combined opcode
4085  ``LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE``.  Patch by Dennis Sweeney.
4086
4087- bpo-46820: Fix parsing a numeric literal immediately (without spaces)
4088  followed by "not in" keywords, like in ``1not in x``. Now the parser only
4089  emits a warning, not a syntax error.
4090
4091- bpo-46329: Move ``KW_NAMES`` before ``PRECALL`` instruction in call
4092  sequence. Change ``operand`` of ``CALL`` to match ``PRECALL`` for easier
4093  specialization.
4094
4095- bpo-46808: Remove the ``NEXT_BLOCK`` macro from compile.c, and make the
4096  compiler automatically generate implicit blocks when they are needed.
4097
4098- bpo-46329: Add ``PUSH_NULL`` instruction. This is used as a prefix when
4099  evaluating a callable, so that the stack has the same shape for methods
4100  and other calls. ``PRECALL_FUNCTION`` and ``PRECALL_METHOD`` are merged
4101  into a single ``PRECALL`` instruction.
4102
4103  There is no change in semantics.
4104
4105- bpo-46762: Fix an assert failure in debug builds when a '<', '>', or '='
4106  is the last character in an f-string that's missing a closing right brace.
4107
4108- bpo-46730: Message of AttributeError caused by getting, setting or
4109  deleting a property without the corresponding function now mentions that
4110  the attribute is in fact a property and also specifies type of the class
4111  that it belongs to.
4112
4113- bpo-46724: Make sure that all backwards jumps use the ``JUMP_ABSOLUTE``
4114  instruction, rather than ``JUMP_FORWARD`` with an argument of
4115  ``(2**32)+offset``.
4116
4117- bpo-46732: Correct the docstring for the :meth:`__bool__` method. Patch by
4118  Jelle Zijlstra.
4119
4120- bpo-46072: Add more detailed specialization failure statistics for
4121  :opcode:`BINARY_OP`.
4122
4123- bpo-46707: Avoid potential exponential backtracking when producing some
4124  syntax errors involving lots of brackets. Patch by Pablo Galindo.
4125
4126- bpo-46323: :mod:`ctypes` now allocates memory on the stack instead of on
4127  the heap to pass arguments while calling a Python callback function. Patch
4128  by Dong-hee Na.
4129
4130- bpo-45923: Add a quickened form of :opcode:`RESUME` that skips quickening
4131  checks.
4132
4133- bpo-46702: Specialize :opcode:`UNPACK_SEQUENCE` for :class:`tuple` and
4134  :class:`list` unpackings.
4135
4136- bpo-46072: Opcode pair stats are now gathered with ``--enable-pystats``.
4137  Defining ``DYNAMIC_EXECUTION_PROFILE`` or  ``DXPAIRS`` no longer has any
4138  effect.
4139
4140- bpo-46675: Allow more than 16 items in a split dict before it is combined.
4141  The limit is now 254.
4142
4143- bpo-40479: Add a missing call to ``va_end()`` in
4144  ``Modules/_hashopenssl.c``.
4145
4146- bpo-46323: Use :c:func:`PyObject_Vectorcall` while calling ctypes callback
4147  function. Patch by Dong-hee Na.
4148
4149- bpo-46615: When iterating over sets internally in ``setobject.c``, acquire
4150  strong references to the resulting items from the set.  This prevents
4151  crashes in corner-cases of various set operations where the set gets
4152  mutated.
4153
4154- bpo-45828: The bytecode compiler now attempts to apply runtime stack
4155  manipulations at compile-time (whenever it is feasible to do so).
4156
4157- bpo-30496: Fixed a minor portability issue in the implementation of
4158  :c:func:`PyLong_FromLong`, and added a fast path for single-digit integers
4159  to :c:func:`PyLong_FromLongLong`.
4160
4161Library
4162-------
4163
4164- bpo-25707: Fixed a file leak in :func:`xml.etree.ElementTree.iterparse`
4165  when the iterator is not exhausted. Patch by Jacob Walls.
4166
4167- bpo-46877: Export :func:`unittest.doModuleCleanups` in :mod:`unittest`.
4168  Patch by Kumar Aditya.
4169
4170- bpo-46848: For performance, use the optimized string-searching
4171  implementations from :meth:`~bytes.find` and :meth:`~bytes.rfind` for
4172  :meth:`~mmap.find` and :meth:`~mmap.rfind`.
4173
4174- bpo-46736: :class:`~http.server.SimpleHTTPRequestHandler` now uses HTML5
4175  grammar. Patch by Dong-hee Na.
4176
4177- bpo-44886: Inherit asyncio proactor datagram transport from
4178  :class:`asyncio.DatagramTransport`.
4179
4180- bpo-46827: Support UDP sockets in  :meth:`asyncio.loop.sock_connect` for
4181  selector-based event loops.  Patch by Thomas Grainger.
4182
4183- bpo-46811: Make test suite support Expat >=2.4.5
4184
4185- bpo-46252: Raise :exc:`TypeError` if :class:`ssl.SSLSocket` is passed to
4186  transport-based APIs.
4187
4188- bpo-46784: Fix libexpat symbols collisions with user dynamically loaded or
4189  statically linked libexpat in embedded Python.
4190
4191- bpo-46786: The HTML serialisation in xml.etree.ElementTree now writes
4192  ``embed``, ``source``, ``track`` and ``wbr`` as empty tags, as defined in
4193  HTML 5.
4194
4195- bpo-39327: :func:`shutil.rmtree` can now work with VirtualBox shared
4196  folders when running from the guest operating-system.
4197
4198- bpo-45390: Propagate :exc:`asyncio.CancelledError` message from inner task
4199  to outer awaiter.
4200
4201- bpo-46756: Fix a bug in
4202  :meth:`urllib.request.HTTPPasswordMgr.find_user_password` and
4203  :meth:`urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated` which
4204  allowed to bypass authorization. For example, access to URI
4205  ``example.org/foobar`` was allowed if the user was authorized for URI
4206  ``example.org/foo``.
4207
4208- bpo-46737: :func:`random.gauss` and :func:`random.normalvariate` now have
4209  default arguments.
4210
4211- bpo-46752: Add task groups to asyncio (structured concurrency, inspired by
4212  Trio's nurseries). This also introduces a change to task cancellation,
4213  where a cancelled task can't be cancelled again until it calls
4214  .uncancel().
4215
4216- bpo-46724: Fix :mod:`dis` behavior on negative jump offsets.
4217
4218- bpo-46333: The :meth:`__repr__` method of :class:`typing.ForwardRef` now
4219  includes the ``module`` parameter of :class:`typing.ForwardRef` when it is
4220  set.
4221
4222- bpo-46643: In :func:`typing.get_type_hints`, support evaluating
4223  stringified ``ParamSpecArgs`` and ``ParamSpecKwargs`` annotations. Patch
4224  by Gregory Beauregard.
4225
4226- bpo-45863: When the :mod:`tarfile` module creates a pax format archive, it
4227  will put an integer representation of timestamps in the ustar header (if
4228  possible) for the benefit of older unarchivers, in addition to the
4229  existing full-precision timestamps in the pax extended header.
4230
4231- bpo-46066: Deprecate kwargs-based syntax for :class:`typing.TypedDict`
4232  definitions. It had confusing semantics when specifying totality, and was
4233  largely unused. Patch by Jingchen Ye.
4234
4235- bpo-46676: Make :data:`typing.ParamSpec` args and kwargs equal to
4236  themselves. Patch by Gregory Beauregard.
4237
4238- bpo-46323: ``ctypes.CFUNCTYPE()`` and ``ctypes.WINFUNCTYPE()`` now fail to
4239  create the type if its ``_argtypes_`` member contains too many arguments.
4240  Previously, the error was only raised when calling a function. Patch by
4241  Victor Stinner.
4242
4243- bpo-46672: Fix ``NameError`` in :func:`asyncio.gather` when initial type
4244  check fails.
4245
4246- bpo-46659: The :class:`calendar.LocaleTextCalendar` and
4247  :class:`calendar.LocaleHTMLCalendar` classes now use
4248  :func:`locale.getlocale`, instead of using
4249  :func:`locale.getdefaultlocale`, if no locale is specified. Patch by
4250  Victor Stinner.
4251
4252- bpo-46659: The :func:`locale.getdefaultlocale` function is deprecated and
4253  will be removed in Python 3.13. Use :func:`locale.setlocale`,
4254  :func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`
4255  and :func:`locale.getlocale` functions instead.  Patch by Victor Stinner.
4256
4257- bpo-46655: In :func:`typing.get_type_hints`, support evaluating bare
4258  stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.
4259
4260- bpo-45948: Fixed a discrepancy in the C implementation of the
4261  :mod:`xml.etree.ElementTree` module. Now, instantiating an
4262  :class:`xml.etree.ElementTree.XMLParser` with a ``target=None`` keyword
4263  provides a default :class:`xml.etree.ElementTree.TreeBuilder` target as
4264  the Python implementation does.
4265
4266- bpo-46626: Expose Linux's ``IP_BIND_ADDRESS_NO_PORT`` option in
4267  :mod:`socket`.
4268
4269- bpo-46521: Fix a bug in the :mod:`codeop` module that was incorrectly
4270  identifying invalid code involving string quotes as valid code.
4271
4272- bpo-46571: Improve :func:`typing.no_type_check`.
4273
4274  Now it does not modify external classes and functions. We also now
4275  correctly mark classmethods as not to be type checked.
4276
4277- bpo-46400: expat: Update libexpat from 2.4.1 to 2.4.4
4278
4279- bpo-46556: Deprecate undocumented support for using a
4280  :class:`pathlib.Path` object as a context manager.
4281
4282- bpo-46534: Implement :pep:`673` :class:`typing.Self`. Patch by James
4283  Hilton-Balfe.
4284
4285- bpo-46522: Make various module ``__getattr__`` AttributeErrors more
4286  closely match a typical AttributeError
4287
4288- bpo-46475: Add :data:`typing.Never` and :func:`typing.assert_never`. Patch
4289  by Jelle Zijlstra.
4290
4291- bpo-46333: The :meth:`__eq__` and :meth:`__hash__` methods of
4292  :class:`typing.ForwardRef` now honor the ``module`` parameter of
4293  :class:`typing.ForwardRef`. Forward references from different modules are
4294  now differentiated.
4295
4296- bpo-46246: Add missing ``__slots__`` to
4297  ``importlib.metadata.DeprecatedList``. Patch by Arie Bovenberg.
4298
4299- bpo-46232: The :mod:`ssl` module now handles certificates with bit strings
4300  in DN correctly.
4301
4302- bpo-46195: :func:`typing.get_type_hints` no longer adds ``Optional`` to
4303  parameters with ``None`` as a default. This aligns to changes to PEP 484
4304  in https://github.com/python/peps/pull/689
4305
4306- bpo-31369: Add :class:`~re.RegexFlag` to ``re.__all__`` and documented it.
4307  Add :data:`~re.RegexFlag.NOFLAG` to indicate no flags being set.
4308
4309- bpo-45898: :mod:`ctypes` no longer defines ``ffi_type_*`` symbols in
4310  ``cfield.c``. The symbols have been provided by libffi for over a decade.
4311
4312- bpo-44953: Calling ``operator.itemgetter`` objects and
4313  ``operator.attrgetter`` objects is now faster due to use of the vectorcall
4314  calling convention.
4315
4316- bpo-44289: Fix an issue with :meth:`~tarfile.is_tarfile` method when using
4317  *fileobj* argument: position in the *fileobj* was advanced forward which
4318  made it unreadable with :meth:`tarfile.TarFile.open`.
4319
4320- bpo-44011: Reimplement SSL/TLS support in asyncio, borrow the
4321  implementation from uvloop library.
4322
4323- bpo-41086: Make the :class:`configparser.ConfigParser` constructor raise
4324  :exc:`TypeError` if the ``interpolation`` parameter is not of type
4325  :class:`configparser.Interpolation`
4326
4327- bpo-29418: Implement :func:`inspect.ismethodwrapper` and fix
4328  :func:`inspect.isroutine` for cases where methodwrapper is given. Patch by
4329  Hakan Çelik.
4330
4331- bpo-14156: argparse.FileType now supports an argument of '-' in binary
4332  mode, returning the .buffer attribute of sys.stdin/sys.stdout as
4333  appropriate. Modes including 'x' and 'a' are treated equivalently to 'w'
4334  when argument is '-'. Patch contributed by Josh Rosenberg
4335
4336Documentation
4337-------------
4338
4339- bpo-42238: ``Doc/tools/rstlint.py`` has moved to its own repository and is
4340  now packaged on PyPI as ``sphinx-lint``.
4341
4342Tests
4343-----
4344
4345- bpo-46913: Fix test_faulthandler.test_sigfpe() if Python is built with
4346  undefined behavior sanitizer (UBSAN): disable UBSAN on the
4347  faulthandler_sigfpe() function. Patch by Victor Stinner.
4348
4349- bpo-46760: Remove bytecode offsets from expected values in test.test_dis
4350  module. Reduces the obstacles to modifying the VM or compiler.
4351
4352- bpo-46708: Prevent default asyncio event loop policy modification warning
4353  after ``test_asyncio`` execution.
4354
4355- bpo-46678: The function ``make_legacy_pyc`` in
4356  ``Lib/test/support/import_helper.py`` no longer fails when
4357  ``PYTHONPYCACHEPREFIX`` is set to a directory on a different device from
4358  where tempfiles are stored.
4359
4360- bpo-46623: Skip test_pair() and test_speech128() of test_zlib on s390x
4361  since they fail if zlib uses the s390x hardware accelerator. Patch by
4362  Victor Stinner.
4363
4364Build
4365-----
4366
4367- bpo-46860: Respect `--with-suffix` when building on case-insensitive file
4368  systems.
4369
4370- bpo-46656: Building Python now requires a C11 compiler. Optional C11
4371  features are not required. Patch by Victor Stinner.
4372
4373- bpo-46656: Building Python now requires support for floating point
4374  Not-a-Number (NaN): remove the ``Py_NO_NAN`` macro. Patch by Victor
4375  Stinner.
4376
4377- bpo-46640: Building Python now requires a C99 ``<math.h>`` header file
4378  providing a ``NAN`` constant, or the ``__builtin_nan()`` built-in
4379  function. Patch by Victor Stinner.
4380
4381- bpo-46608: Exclude marshalled-frozen data if deep-freezing to save 300 KB
4382  disk space. This includes adding a new ``is_package`` field to
4383  :c:struct:`_frozen`. Patch by Kumar Aditya.
4384
4385- bpo-40280: Fix wasm32-emscripten test failures and platform issues. -
4386  Disable syscalls that are not supported or don't work, e.g.   wait,
4387  getrusage, prlimit, mkfifo, mknod, setres[gu]id, setgroups. - Use fd_count
4388  to cound open fds. - Add more checks for subprocess and fork. - Add
4389  workarounds for missing _multiprocessing and failing socket.accept(). -
4390  Enable bzip2. - Disable large file support. - Disable signal.alarm.
4391
4392- bpo-46430: Intern strings in deep-frozen modules. Patch by Kumar Aditya.
4393
4394Windows
4395-------
4396
4397- bpo-46744: The default all users install directory for ARM64 is now under
4398  the native ``Program Files`` folder, rather than ``Program Files (Arm)``
4399  which is intended for ARM (32-bit) files.
4400
4401- bpo-46567: Adds Tcl and Tk support for Windows ARM64. This also adds IDLE
4402  to the installation.
4403
4404- bpo-46638: Ensures registry virtualization is consistently disabled. For
4405  3.10 and earlier, it remains enabled (some registry writes are protected),
4406  while for 3.11 and later it is disabled (registry modifications affect all
4407  applications).
4408
4409IDLE
4410----
4411
4412- bpo-46630: Make query dialogs on Windows start with a cursor in the entry
4413  box.
4414
4415- bpo-45447: Apply IDLE syntax highlighting to `.pyi` files. Patch by Alex
4416  Waygood and Terry Jan Reedy.
4417
4418C API
4419-----
4420
4421- bpo-46748: Python's public headers no longer import ``<stdbool.h>``,
4422  leaving code that embedd/extends Python free to define ``bool``, ``true``
4423  and ``false``.
4424
4425- bpo-46836: Move the :c:type:`PyFrameObject` type definition (``struct
4426  _frame``) to the internal C API ``pycore_frame.h`` header file. Patch by
4427  Victor Stinner.
4428
4429- bpo-45459: Rename ``Include/buffer.h`` header file to
4430  ``Include/pybuffer.h`` to avoid conflits with projects having an existing
4431  ``buffer.h`` header file. Patch by Victor Stinner.
4432
4433- bpo-45412: Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the
4434  internal C API). Patch by Victor Stinner.
4435
4436- bpo-46613: Added function :c:func:`PyType_GetModuleByDef`, which allows
4437  accesss to module state when a method's defining class is not available.
4438
4439
4440What's New in Python 3.11.0 alpha 5?
4441====================================
4442
4443*Release date: 2022-02-03*
4444
4445Core and Builtins
4446-----------------
4447
4448- bpo-45773: Remove two invalid "peephole" optimizations from the bytecode
4449  compiler.
4450
4451- bpo-46564: Do not create frame objects when creating :class:`super`
4452  object. Patch by Kumar Aditya.
4453
4454- bpo-45885: Added more fined-grained specialization failure stats regarding
4455  the ``COMPARE_OP`` bytecode.
4456
4457- bpo-44977: The delegation of :func:`int` to :meth:`__trunc__` is now
4458  deprecated. Calling ``int(a)`` when ``type(a)`` implements
4459  :meth:`__trunc__` but not :meth:`__int__` or :meth:`__index__` now raises
4460  a :exc:`DeprecationWarning`.
4461
4462- bpo-46458: Reorder code emitted by the compiler for a
4463  :keyword:`try`-:keyword:`except` block so that the :keyword:`else` block's
4464  code immediately follows the :keyword:`try` body (without a jump). This is
4465  more optimal for the happy path.
4466
4467- bpo-46527: Allow passing ``iterable`` as a keyword argument to
4468  :func:`enumerate` again. Patch by Jelle Zijlstra.
4469
4470- bpo-46528: Replace several stack manipulation instructions (``DUP_TOP``,
4471  ``DUP_TOP_TWO``, ``ROT_TWO``, ``ROT_THREE``, ``ROT_FOUR``, and ``ROT_N``)
4472  with new :opcode:`COPY` and :opcode:`SWAP` instructions.
4473
4474- bpo-46329: Use two or three bytecodes to implement most calls.
4475
4476  Calls without named arguments are implemented as a sequence of two
4477  instructions: ``PRECALL; CALL``. Calls with named arguments are
4478  implemented as a sequence of three instructions: ``PRECALL; KW_NAMES;
4479  CALL``. There are two different ``PRECALL`` instructions:
4480  ``PRECALL_FUNTION`` and ``PRECALL_METHOD``. The latter pairs with
4481  ``LOAD_METHOD``.
4482
4483  This partition into pre-call and call allows better specialization, and
4484  thus better performance ultimately.
4485
4486  There is no change in semantics.
4487
4488- bpo-46503: Fix an assert when parsing some invalid \N escape sequences in
4489  f-strings.
4490
4491- bpo-46431: Improve error message on invalid calls to
4492  :meth:`BaseExceptionGroup.__new__`.
4493
4494- bpo-46476: Fix memory leak in code objects generated by deepfreeze. Patch
4495  by Kumar Aditya.
4496
4497- bpo-46481: Speed up calls to :meth:`weakref.ref.__call__` by using the
4498  :pep:`590` ``vectorcall`` calling convention. Patch by Dong-hee Na.
4499
4500- bpo-46417: Fix a race condition on setting a type ``__bases__`` attribute:
4501  the internal function ``add_subclass()`` now gets the
4502  ``PyTypeObject.tp_subclasses`` member after calling
4503  :c:func:`PyWeakref_NewRef` which can trigger a garbage collection which
4504  can indirectly modify ``PyTypeObject.tp_subclasses``. Patch by Victor
4505  Stinner.
4506
4507- bpo-46417: ``python -X showrefcount`` now shows the total reference count
4508  after clearing and destroyed the main Python interpreter. Previously, it
4509  was shown before. Patch by Victor Stinner.
4510
4511- bpo-43683: Add ASYNC_GEN_WRAP opcode to wrap the value to be yielded in
4512  async generators. Removes the need to special case async generators in the
4513  ``YIELD_VALUE`` instruction.
4514
4515- bpo-46407: Optimize some modulo operations in ``Objects/longobject.c``.
4516  Patch by Jeremiah Vivian.
4517
4518- bpo-46409: Add new ``RETURN_GENERATOR`` bytecode to make generators.
4519  Simplifies calling Python functions in the VM, as they no longer any need
4520  to special case generator functions.
4521
4522  Also add ``JUMP_NO_INTERRUPT`` bytecode that acts like ``JUMP_ABSOLUTE``,
4523  but does not check for interrupts.
4524
4525- bpo-46406: The integer division ``//`` implementation has been optimized
4526  to better let the compiler understand its constraints. It can be 20%
4527  faster on the amd64 platform when dividing an int by a value smaller than
4528  ``2**30``.
4529
4530- bpo-46383: Fix invalid signature of ``_zoneinfo``'s ``module_free``
4531  function to resolve a crash on wasm32-emscripten platform.
4532
4533- bpo-46361: Ensure that "small" integers created by :meth:`int.from_bytes`
4534  and :class:`decimal.Decimal` are properly cached.
4535
4536- bpo-46161: Fix the class building error when the arguments are constants
4537  and CALL_FUNCTION_EX is used.
4538
4539- bpo-46028: Fixes calculation of :data:`sys._base_executable` when inside a
4540  virtual environment that uses symlinks with different binary names than
4541  the base environment provides.
4542
4543- bpo-46091: Correctly calculate indentation levels for lines with
4544  whitespace character that are ended by line continuation characters. Patch
4545  by Pablo Galindo
4546
4547- bpo-30512: Add CAN Socket support for NetBSD.
4548
4549- bpo-46045: Do not use POSIX semaphores on NetBSD
4550
4551- bpo-44024: Improve the exc:`TypeError` message for non-string second
4552  arguments passed to the built-in functions :func:`getattr` and
4553  :func:`hasattr`. Patch by Géry Ogam.
4554
4555Library
4556-------
4557
4558- bpo-46624: Restore support for non-integer arguments of
4559  :func:`random.randrange` and :func:`random.randint`.
4560
4561- bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable.
4562
4563- bpo-46565: Remove loop variables that are leaking into modules'
4564  namespaces.
4565
4566- bpo-46553: In :func:`typing.get_type_hints`, support evaluating bare
4567  stringified ``ClassVar`` annotations. Patch by Gregory Beauregard.
4568
4569- bpo-46544: Don't leak ``x`` & ``uspace`` intermediate vars in
4570  :class:`textwrap.TextWrapper`.
4571
4572- bpo-46487: Add the ``get_write_buffer_limits`` method to
4573  :class:`asyncio.transports.WriteTransport` and to the SSL transport.
4574
4575- bpo-45173: Note the configparser deprecations will be removed in Python
4576  3.12.
4577
4578- bpo-45162: The deprecated :mod:`unittest` APIs removed in 3.11a1 have been
4579  temporarily restored to be removed in 3.12 while cleanups in external
4580  projects go in.
4581
4582- bpo-46539: In :func:`typing.get_type_hints`, support evaluating
4583  stringified ``ClassVar`` and ``Final`` annotations inside ``Annotated``.
4584  Patch by Gregory Beauregard.
4585
4586- bpo-46510: Add missing test for :class:`types.TracebackType` and
4587  :class:`types.FrameType`. Calculate them directly from the caught
4588  exception without calling :func:`sys.exc_info`.
4589
4590- bpo-46491: Allow :data:`typing.Annotated` to wrap :data:`typing.Final` and
4591  :data:`typing.ClassVar`. Patch by Gregory Beauregard.
4592
4593- bpo-46483: Remove :meth:`~object.__class_getitem__` from
4594  :class:`pathlib.PurePath` as this class was not supposed to be generic.
4595
4596- bpo-46436: Fix command-line option ``-d``/``--directory`` in module
4597  :mod:`http.server` which is ignored when combined with command-line option
4598  ``--cgi``. Patch by Géry Ogam.
4599
4600- bpo-41403: Make :meth:`mock.patch` raise a :exc:`TypeError` with a
4601  relevant error message on invalid arg. Previously it allowed a cryptic
4602  :exc:`AttributeError` to escape.
4603
4604- bpo-46474: In ``importlib.metadata.EntryPoint.pattern``, avoid potential
4605  REDoS by limiting ambiguity in consecutive whitespace.
4606
4607- bpo-46474: Removed private method from ``importlib.metadata.Path``. Sync
4608  with importlib_metadata 4.10.0.
4609
4610- bpo-46470: Remove unused branch from ``typing._remove_dups_flatten``
4611
4612- bpo-46469: :mod:`asyncio` generic classes now return
4613  :class:`types.GenericAlias` in ``__class_getitem__`` instead of the same
4614  class.
4615
4616- bpo-41906: Support passing filter instances in the ``filters`` values of
4617  ``handlers`` and ``loggers`` in the dictionary passed to
4618  :func:`logging.config.dictConfig`.
4619
4620- bpo-46422: Use ``dis.Positions`` in ``dis.Instruction`` instead of a
4621  regular ``tuple``.
4622
4623- bpo-46434: :mod:`pdb` now gracefully handles ``help`` when :attr:`__doc__`
4624  is missing, for example when run with pregenerated optimized ``.pyc``
4625  files.
4626
4627- bpo-43869: Python uses the same time Epoch on all platforms. Add an
4628  explicit unit test to ensure that it's the case. Patch by Victor Stinner.
4629
4630- bpo-46414: Add :func:`typing.reveal_type`. Patch by Jelle Zijlstra.
4631
4632- bpo-40280: :mod:`subprocess` now imports Windows-specific imports when
4633  ``msvcrt`` module is available, and POSIX-specific imports on all other
4634  platforms. This gives a clean exception when ``_posixsubprocess`` is not
4635  available (e.g. Emscripten browser target).
4636
4637- bpo-40066: ``IntEnum``, ``IntFlag``, and ``StrEnum`` use the mixed-in type
4638  for their ``str()`` and ``format()`` output.
4639
4640- bpo-46316: Optimize :meth:`pathlib.Path.iterdir` by removing an
4641  unnecessary check for special entries.
4642
4643- bpo-29688: Document :meth:`pathlib.Path.absolute` (which has always
4644  existed).
4645
4646- bpo-43012: The pathlib module's obsolete and internal ``_Accessor`` class
4647  has been removed to prepare the terrain for upcoming enhancements to the
4648  module.
4649
4650- bpo-46258: Speed up :func:`math.isqrt` for small positive integers by
4651  replacing two division steps with a lookup table.
4652
4653- bpo-46242: Improve error message when creating a new :class:`enum.Enum`
4654  type subclassing an existing ``Enum`` with ``_member_names_`` using
4655  :meth:`enum.Enum.__call__`.
4656
4657- bpo-43118: Fix a bug in :func:`inspect.signature` that was causing it to
4658  fail on some subclasses of classes with a ``__text_signature__``
4659  referencing module globals. Patch by Weipeng Hong.
4660
4661- bpo-26552: Fixed case where failing :func:`asyncio.ensure_future` did not
4662  close the coroutine. Patch by Kumar Aditya.
4663
4664- bpo-21987: Fix an issue with :meth:`tarfile.TarFile.getmember` getting a
4665  directory name with a trailing slash.
4666
4667- bpo-46124: Update :mod:`zoneinfo` to rely on importlib.resources
4668  traversable API.
4669
4670- bpo-46103: Now :func:`inspect.getmembers` only gets :attr:`__bases__`
4671  attribute from class type. Patch by Weipeng Hong.
4672
4673- bpo-46080: Fix exception in argparse help text generation if a
4674  :class:`argparse.BooleanOptionalAction` argument's default is
4675  ``argparse.SUPPRESS`` and it has ``help`` specified.  Patch by Felix
4676  Fontein.
4677
4678- bpo-44791: Fix substitution of :class:`~typing.ParamSpec` in
4679  :data:`~typing.Concatenate` with different parameter expressions.
4680  Substitution with a list of types returns now a tuple of types.
4681  Substitution with ``Concatenate`` returns now a ``Concatenate`` with
4682  concatenated lists of arguments.
4683
4684Documentation
4685-------------
4686
4687- bpo-46463: Fixes :file:`escape4chm.py` script used when building the CHM
4688  documentation file
4689
4690Tests
4691-----
4692
4693- bpo-43478: Mocks can no longer be provided as the specs for other Mocks.
4694  As a result, an already-mocked object cannot be passed to `mock.Mock()`.
4695  This can uncover bugs in tests since these Mock-derived Mocks will always
4696  pass certain tests (e.g. isinstance) and builtin assert functions (e.g.
4697  assert_called_once_with) will unconditionally pass.
4698
4699- bpo-46616: Ensures ``test_importlib.test_windows`` cleans up registry keys
4700  after completion.
4701
4702- bpo-44359: test_ftplib now silently ignores socket errors to prevent
4703  logging unhandled threading exceptions. Patch by Victor Stinner.
4704
4705- bpo-46600: Fix test_gdb.test_pycfunction() for Python built with ``clang
4706  -Og``. Tolerate inlined functions in the gdb traceback. Patch by Victor
4707  Stinner.
4708
4709- bpo-46542: Fix a Python crash in test_lib2to3 when using Python built in
4710  debug mode: limit the recursion limit. Patch by Victor Stinner.
4711
4712- bpo-46576: test_peg_generator now disables compiler optimization when
4713  testing compilation of its own C extensions to significantly speed up the
4714  testing on non-debug builds of CPython.
4715
4716- bpo-46542: Fix ``test_json`` tests checking for :exc:`RecursionError`:
4717  modify these tests to use ``support.infinite_recursion()``. Patch by
4718  Victor Stinner.
4719
4720- bpo-13886: Skip test_builtin PTY tests on non-ASCII characters if the
4721  readline module is loaded. The readline module changes input() behavior,
4722  but test_builtin is not intented to test the readline module. Patch by
4723  Victor Stinner.
4724
4725- bpo-40280: Add :func:`test.support.requires_fork` decorators to mark tests
4726  that require a working :func:`os.fork`.
4727
4728- bpo-40280: Add :func:`test.support.requires_subprocess` decorator to mark
4729  tests which require working :mod:`subprocess` module or ``os.spawn*``. The
4730  wasm32-emscripten platform has no support for processes.
4731
4732- bpo-46126: Disable 'descriptions' when running tests internally.
4733
4734Build
4735-----
4736
4737- bpo-46602: Tidied up configure.ac so that conftest.c is truncated rather
4738  than appended. This assists in the case where the 'rm' of conftest.c fails
4739  to happen between tests.  Downstream issues such as a clobbered SOABI can
4740  result.
4741
4742- bpo-46600: Fix the test checking if the C compiler supports ``-Og`` option
4743  in the ``./configure`` script to also use ``-Og`` on clang which supports
4744  it. Patch by Victor Stinner.
4745
4746- bpo-38472: Fix GCC detection in setup.py when cross-compiling. The C
4747  compiler is now run with LC_ALL=C. Previously, the detection failed with a
4748  German locale.
4749
4750- bpo-46513: :program:`configure` no longer uses ``AC_C_CHAR_UNSIGNED``
4751  macro and ``pyconfig.h`` no longer defines reserved symbol
4752  ``__CHAR_UNSIGNED__``.
4753
4754- bpo-46471: Use global singletons for single byte bytes objects in
4755  deepfreeze.
4756
4757- bpo-46443: Deepfreeze now uses cached small integers as it saves some
4758  space for common small integers.
4759
4760- bpo-46429: Merge all deep-frozen files into one for space savings. Patch
4761  by Kumar Aditya.
4762
4763- bpo-45569: The build now defaults to using 30-bit digits for Python
4764  integers. Previously either 15-bit or 30-bit digits would be selected,
4765  depending on the platform. 15-bit digits may still be selected using the
4766  ``--enable-big-digits=15`` option to the ``configure`` script, or by
4767  defining ``PYLONG_BITS_IN_DIGIT`` in ``pyconfig.h``.
4768
4769- bpo-45925: Update Windows installer to use SQLite 3.37.2.
4770
4771- bpo-43112: Detect musl libc as a separate SOABI (tagged as
4772  ``linux-musl``).
4773
4774Windows
4775-------
4776
4777- bpo-33125: The traditional EXE/MSI based installer for Windows is now
4778  available for ARM64
4779
4780- bpo-46362: os.path.abspath("C:\CON") is now fixed to return "\\.\CON", not
4781  the same path. The regression was true of all legacy DOS devices such as
4782  COM1, LPT1, or NUL.
4783
4784- bpo-44934: The installer now offers a command-line only option to add the
4785  installation directory to the end of :envvar:`PATH` instead of at the
4786  start.
4787
4788macOS
4789-----
4790
4791- bpo-45925: Update macOS installer to SQLite 3.37.2.
4792
4793IDLE
4794----
4795
4796- bpo-45296: Clarify close, quit, and exit in IDLE.  In the File menu,
4797  'Close' and 'Exit' are now 'Close Window' (the current one) and 'Exit' is
4798  now 'Exit IDLE' (by closing all windows).  In Shell, 'quit()' and 'exit()'
4799  mean 'close Shell'. If there are no other windows, this also exits IDLE.
4800
4801C API
4802-----
4803
4804- bpo-40170: Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed
4805  in the public C API by mistake, it must only be used by Python internally.
4806  Use the ``PyTypeObject.tp_members`` member instead. Patch by Victor
4807  Stinner.
4808
4809- bpo-40170: Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats()
4810  private functions to the internal C API. Patch by Victor Stinner.
4811
4812- bpo-46433: The internal function _PyType_GetModuleByDef now correctly
4813  handles inheritance patterns involving static types.
4814
4815- bpo-45459: :c:type:`Py_buffer` and various ``Py_buffer`` related functions
4816  are now part of the limited API and stable ABI.
4817
4818- bpo-14916: Fixed bug in the tokenizer that prevented
4819  ``PyRun_InteractiveOne`` from parsing from the provided FD.
4820
4821
4822What's New in Python 3.11.0 alpha 4?
4823====================================
4824
4825*Release date: 2022-01-13*
4826
4827Core and Builtins
4828-----------------
4829
4830- bpo-46070: :c:func:`Py_EndInterpreter` now explicitly untracks all objects
4831  currently tracked by the GC. Previously, if an object was used later by
4832  another interpreter, calling :c:func:`PyObject_GC_UnTrack` on the object
4833  crashed if the previous or the next object of the :c:type:`PyGC_Head`
4834  structure became a dangling pointer. Patch by Victor Stinner.
4835
4836- bpo-46347: Fix memory leak in PyEval_EvalCodeEx.
4837
4838- bpo-46339: Fix a crash in the parser when retrieving the error text for
4839  multi-line f-strings expressions that do not start in the first line of
4840  the string. Patch by Pablo Galindo
4841
4842- bpo-46331: Do not set line number of instruction storing doc-string. Fixes
4843  regression introduced in 3.11 alpha.
4844
4845- bpo-46314: Remove spurious "call" event when creating a lambda function
4846  that was accidentally introduced in 3.11a4.
4847
4848- bpo-46289: ASDL declaration of ``FormattedValue`` has changed to reflect
4849  ``conversion`` field is not optional.
4850
4851- bpo-46297: Fixed an interpreter crash on bootup with multiple PythonPaths
4852  set in the Windows registry. Patch by Derzsi Dániel.
4853
4854- bpo-46237: Fix the line number of tokenizer errors inside f-strings. Patch
4855  by Pablo Galindo.
4856
4857- bpo-46263: We always expect the "use_frozen_modules" config to be set, now
4858  that getpath.c was rewritten in pure Python and the logic improved.
4859
4860- bpo-46006: Fix a regression when a type method like ``__init__()`` is
4861  modified in a subinterpreter. Fix a regression in
4862  ``_PyUnicode_EqualToASCIIId()`` and type ``update_slot()``. Revert the
4863  change which made the Unicode dictionary of interned strings compatible
4864  with subinterpreters: the internal interned dictionary is shared again by
4865  all interpreters. Patch by Victor Stinner.
4866
4867- bpo-45923: Add RESUME opcode. This is a logical no-op. It is emitted by
4868  the compiler anywhere a Python function can be entered. It is used by the
4869  interpreter to perform tracing and optimizer checks.
4870
4871- bpo-46208: Fix the regression of os.path.normpath("A/../../B") not
4872  returning expected "../B" but "B".
4873
4874- bpo-46240: Correct the error message for unclosed parentheses when the
4875  tokenizer doesn't reach the end of the source when the error is reported.
4876  Patch by Pablo Galindo
4877
4878- bpo-46009: Remove the ``GEN_START`` opcode.
4879
4880- bpo-46235: Certain sequence multiplication operations like ``[0] * 1_000``
4881  are now faster due to reference-counting optimizations. Patch by Dennis
4882  Sweeney.
4883
4884- bpo-46221: :opcode:`PREP_RERAISE_STAR` no longer pushes ``lasti`` to the
4885  stack.
4886
4887- bpo-46202: Remove :opcode:`POP_EXCEPT_AND_RERAISE` and replace it by an
4888  equivalent sequence of other opcodes.
4889
4890- bpo-46085: Fix iterator cache mechanism of :class:`OrderedDict`.
4891
4892- bpo-46055: Speed up shifting operation involving integers less than
4893  :c:macro:`PyLong_BASE`. Patch by Xinhang Xu.
4894
4895- bpo-46110: Add a maximum recursion check to the PEG parser to avoid stack
4896  overflow. Patch by Pablo Galindo
4897
4898- bpo-46107: Fix bug where :meth:`ExceptionGroup.split` and
4899  :meth:`ExceptionGroup.subgroup` did not copy the exception group's
4900  ``__note__`` field to the parts.
4901
4902- bpo-45711: The interpreter state's representation of handled exceptions
4903  (a.k.a exc_info, or _PyErr_StackItem) now has only the ``exc_value``
4904  field, ``exc_type`` and ``exc_traceback`` have been removed as their
4905  values can be derived from ``exc_value``.
4906
4907- bpo-44525: Replace the four call bytecode instructions which one pre-call
4908  instruction and two call instructions.
4909
4910  Removes ``CALL_FUNCTION``, ``CALL_FUNCTION_KW``, ``CALL_METHOD`` and
4911  ``CALL_METHOD_KW``.
4912
4913  Adds ``CALL_NO_KW`` and ``CALL_KW`` call instructions, and
4914  ``PRECALL_METHOD`` prefix for pairing with ``LOAD_METHOD``.
4915
4916- bpo-46039: Remove the ``YIELD_FROM`` instruction and replace it with the
4917  ``SEND`` instruction which performs the same operation, but without the
4918  loop.
4919
4920- bpo-45635: The code called from :c:func:`_PyErr_Display` was refactored to
4921  improve error handling. It now exits immediately upon an unrecoverable
4922  error.
4923
4924- bpo-46054: Fix parser error when parsing non-utf8 characters in source
4925  files. Patch by Pablo Galindo.
4926
4927- bpo-46042: Improve the location of the caret in :exc:`SyntaxError`
4928  exceptions emitted by the symbol table. Patch by Pablo Galindo.
4929
4930- bpo-46049: Ensure :file:`._pth` files work as intended on platforms other
4931  than Windows.
4932
4933- bpo-46048: Fixes parsing of :file:`._pth` files on startup so that
4934  single-character paths are correctly read.
4935
4936- bpo-37971: Fix a bug where the line numbers given in a traceback when a
4937  decorator application raised an exception were wrong.
4938
4939- bpo-46031: Add :opcode:`POP_JUMP_IF_NOT_NONE` and
4940  :opcode:`POP_JUMP_IF_NONE` opcodes to speed up conditional jumps.
4941
4942- bpo-45654: Deepfreeze :mod:`runpy`, patch by Kumar Aditya.
4943
4944- bpo-46025: Fix a crash in the :mod:`atexit` module involving functions
4945  that unregister themselves before raising exceptions. Patch by Pablo
4946  Galindo.
4947
4948- bpo-46000: Improve compatibility of the :mod:`curses` module with NetBSD
4949  curses.
4950
4951- bpo-44525: Specialize the CALL_FUNCTION instruction for calls to builtin
4952  types with a single argument. Speeds up ``range(x)``, ``list(x)``, and
4953  specifically ``type(obj)``.
4954
4955- bpo-42918: Fix bug where the built-in :func:`compile` function did not
4956  always raise a :exc:`SyntaxError` when passed multiple statements in
4957  'single' mode. Patch by Weipeng Hong.
4958
4959- bpo-45953: The main interpreter in _PyRuntimeState.interpreters is now
4960  statically allocated (as part of _PyRuntime).  Likewise for the initial
4961  thread state of each interpreter.  This means less allocation during
4962  runtime init, as well as better memory locality for these key state
4963  objects.
4964
4965- bpo-45292: Complete the :pep:`654` implementation: add ``except*``.
4966
4967- bpo-43413: Revert changes in ``set.__init__``. Subclass of :class:`set`
4968  needs to define a ``__init__()`` method if it defines a ``__new__()``
4969  method with additional keyword parameters.
4970
4971- bpo-43931: Added the :c:data:`Py_Version` constant which bears the same
4972  value as :c:macro:`PY_VERSION_HEX`. Patch by Gabriele N. Tornetta.
4973
4974Library
4975-------
4976
4977- bpo-46342: The ``@typing.final`` decorator now sets the ``__final__``
4978  attribute on the decorated object to allow runtime introspection. Patch by
4979  Jelle Zijlstra.
4980
4981- bpo-46328: Added the :meth:`sys.exception` method which returns the active
4982  exception instance.
4983
4984- bpo-46307: Add :meth:`string.Template.is_valid` and
4985  :meth:`string.Template.get_identifiers` methods.
4986
4987- bpo-46306: Assume that :class:`types.CodeType` always has
4988  :attr:`types.CodeType.co_firstlineno` in :mod:`doctest`.
4989
4990- bpo-40479: Fix :mod:`hashlib` *usedforsecurity* option to work correctly
4991  with OpenSSL 3.0.0 in FIPS mode.
4992
4993- bpo-46070: Fix possible segfault when importing the :mod:`asyncio` module
4994  from different sub-interpreters in parallel. Patch by Erlend E. Aasland.
4995
4996- bpo-46244: Removed ``__slots__`` from :class:`typing.ParamSpec` and
4997  :class:`typing.TypeVar`. They served no purpose. Patch by Arie Bovenberg.
4998
4999- bpo-46278: Reflect ``context`` argument in ``AbstractEventLoop.call_*()``
5000  methods. Loop implementations already support it.
5001
5002- bpo-46269: Remove special-casing of ``__new__`` in
5003  :meth:`enum.Enum.__dir__`.
5004
5005- bpo-46266: Improve day constants in :mod:`calendar`.
5006
5007  Now all constants (`MONDAY` ... `SUNDAY`) are documented, tested, and
5008  added to ``__all__``.
5009
5010- bpo-46257: Optimized the mean, variance, and stdev functions in the
5011  statistics module. If the input is an iterator, it is consumed in a single
5012  pass rather than eating memory by conversion to a list.  The single pass
5013  algorithm is about twice as fast as the previous two pass code.
5014
5015- bpo-41011: Added two new variables to *pyvenv.cfg* which is generated by
5016  :mod:`venv` module: *executable* for the executable and *command* for the
5017  command line used to create the environment.
5018
5019- bpo-46239: Improve error message when importing
5020  :mod:`asyncio.windows_events` on non-Windows.
5021
5022- bpo-46238: Reuse ``_winapi`` constants in ``asyncio.windows_events``.
5023
5024- bpo-46222: Adding ``SF_NOCACHE`` sendfile constant for FreeBSD for the
5025  posixmodule.
5026
5027- bpo-37295: Add fast path for ``0 <= k <= n <= 67`` for :func:`math.comb`.
5028
5029- bpo-46176: Adding the ``MAP_STACK`` constant for the mmap module.
5030
5031- bpo-43424: Deprecate :attr:`webbrowser.MacOSXOSAScript._name` and use
5032  ``name`` instead.
5033
5034- bpo-45321: Added missing error codes to module
5035  ``xml.parsers.expat.errors``.
5036
5037- bpo-46125: Refactor tests to test traversable API directly. Includes
5038  changes from importlib 5.4.0.
5039
5040- bpo-46118: Moved importlib.resources and its related functionality to a
5041  package.
5042
5043- bpo-37578: Add *include_hidden* parameter to :func:`~glob.glob` and
5044  :func:`~glob.iglob` to match hidden files and directories when using
5045  special characters like ``*``, ``**``, ``?`` and ``[]``.
5046
5047- bpo-20369: :func:`concurrent.futures.wait` no longer blocks forever when
5048  given duplicate Futures. Patch by Kumar Aditya.
5049
5050- bpo-46105: Honor spec when generating requirement specs with urls and
5051  extras (importlib_metadata 4.8.3).
5052
5053- bpo-44893: EntryPoint objects are no longer tuples. Recommended means to
5054  access is by attribute ('.name', '.group') or accessor ('.load()'). Access
5055  by index is deprecated and will raise deprecation warning.
5056
5057- bpo-22815: Print unexpected successes together with failures and errors in
5058  summary in :class:`unittest.TextTestResult`.
5059
5060- bpo-22047: Calling :meth:`add_argument_group` on an argument group is
5061  deprecated. Calling :meth:`add_argument_group` or
5062  :meth:`add_mutually_exclusive_group` on a mutually exclusive group is
5063  deprecated.
5064
5065  These features were never supported and do not always work correctly. The
5066  functions exist on the API by accident through inheritance and will be
5067  removed in the future.
5068
5069- bpo-26952: :mod:`argparse` raises :exc:`ValueError` with clear message
5070  when trying to render usage for an empty mutually exclusive group.
5071  Previously it raised a cryptic :exc:`IndexError`.
5072
5073- bpo-45615: Functions in the :mod:`traceback` module raise :exc:`TypeError`
5074  rather than :exc:`AttributeError` when an exception argument is not of
5075  type :exc:`BaseException`.
5076
5077- bpo-16594: Add allow allow_reuse_port flag in socketserver.
5078
5079- bpo-27718: Fix help for the :mod:`signal` module. Some functions (e.g.
5080  ``signal()`` and ``getsignal()``) were omitted.
5081
5082- bpo-46032: The ``registry()`` method of :func:`functools.singledispatch`
5083  functions checks now the first argument or the first parameter annotation
5084  and raises a TypeError if it is not supported. Previously unsupported
5085  "types" were ignored (e.g. ``typing.List[int]``) or caused an error at
5086  calling time (e.g. ``list[int]``).
5087
5088- bpo-46014: Add ability to use ``typing.Union`` and ``types.UnionType`` as
5089  dispatch argument to ``functools.singledispatch``. Patch provided by Yurii
5090  Karabas.
5091
5092- bpo-27062: Add :attr:`__all__` to :mod:`inspect`, patch by Kumar Aditya.
5093
5094- bpo-46018: Ensure that :func:`math.expm1` does not raise on underflow.
5095
5096- bpo-46016: Adding :attr:`F_DUP2FD` and :attr:`F_DUP2FD_CLOEXEC` constants
5097  from FreeBSD into the fcntl module.
5098
5099- bpo-45755: :mod:`typing` generic aliases now reveal the class attributes
5100  of the original generic class when passed to ``dir()``. This was the
5101  behavior up to Python 3.6, but was changed in 3.7-3.9.
5102
5103- bpo-45874: The empty query string, consisting of no query arguments, is
5104  now handled correctly in ``urllib.parse.parse_qsl``. This caused problems
5105  before when strict parsing was enabled.
5106
5107- bpo-44674: Change how dataclasses disallows mutable default values.  It
5108  used to use a list of known types (list, dict, set).  Now it disallows
5109  unhashable objects to be defaults.  It's using unhashability as a proxy
5110  for mutability.  Patch by Eric V. Smith, idea by Raymond Hettinger.
5111
5112- bpo-23882: Remove namespace package (PEP 420) support from unittest
5113  discovery. It was introduced in Python 3.4 but has been broken since
5114  Python 3.7.
5115
5116- bpo-25066: Added a :meth:`__repr__` method to
5117  :class:`multiprocessing.Event` objects, patch by Kumar Aditya.
5118
5119- bpo-45643: Added :data:`signal.SIGSTKFLT` on platforms where this signal
5120  is defined.
5121
5122- bpo-44092: Fetch across rollback no longer raises
5123  :exc:`~sqlite3.InterfaceError`. Instead we leave it to the SQLite library
5124  to handle these cases. Patch by Erlend E. Aasland.
5125
5126- bpo-42413: Replace ``concurrent.futures.TimeoutError`` and
5127  ``asyncio.TimeoutError`` with builtin :exc:`TimeoutError`, keep these
5128  names as deprecated aliases.
5129
5130Documentation
5131-------------
5132
5133- bpo-46196: Document method :meth:`cmd.Cmd.columnize`.
5134
5135- bpo-46120: State that ``|`` is preferred for readability over ``Union`` in
5136  the :mod:`typing` docs.
5137
5138- bpo-46109: Extracted ``importlib.resources`` and
5139  ``importlib.resources.abc`` documentation into separate files.
5140
5141- bpo-19737: Update the documentation for the :func:`globals` function.
5142
5143Tests
5144-----
5145
5146- bpo-46296: Add a test case for :mod:`enum` with ``_use_args_ == True`` and
5147  ``_member_type_ == object``.
5148
5149- bpo-46205: Fix hang in runtest_mp due to race condition
5150
5151- bpo-46263: Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill
5152  freed memory with junk byte.
5153
5154- bpo-46262: Cover ``ValueError`` path in tests for
5155  :meth:`enum.Flag._missing_`.
5156
5157- bpo-46150: Now ``fakename`` in
5158  ``test_pathlib.PosixPathTest.test_expanduser`` is checked to be
5159  non-existent.
5160
5161- bpo-46129: Rewrite ``asyncio.locks`` tests with
5162  :class:`unittest.IsolatedAsyncioTestCase` usage.
5163
5164- bpo-23819: Fixed :mod:`asyncio` tests in python optimized mode. Patch by
5165  Kumar Aditya.
5166
5167- bpo-46114: Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses
5168  ``0xMNN00PP0L``.
5169
5170Build
5171-----
5172
5173- bpo-44133: When Python is configured with
5174  :option:`--without-static-libpython`, the Python static library
5175  (libpython.a) is no longer built. Patch by Victor Stinner.
5176
5177- bpo-44133: When Python is built without :option:`--enable-shared`, the
5178  ``python`` program is now linked to object files, rather than being linked
5179  to the Python static library (libpython.a), to make sure that all symbols
5180  are exported. Previously, the linker omitted some symbols like the
5181  :c:func:`Py_FrozenMain` function. Patch by Victor Stinner.
5182
5183- bpo-40280: The ``configure`` script has a new option
5184  ``--with-emscripten-target`` to select browser or node as Emscripten build
5185  target.
5186
5187- bpo-46315: Added and fixed ``#ifdef HAVE_FEATURE`` checks for
5188  functionality that is not available on WASI platform.
5189
5190- bpo-45723: Fixed a regression in ``configure`` check for
5191  :func:`select.epoll`.
5192
5193- bpo-46263: ``configure`` no longer sets ``MULTIARCH`` on FreeBSD
5194  platforms.
5195
5196- bpo-46106: Updated OpenSSL to 1.1.1m in Windows builds, macOS installer
5197  builds, and CI. Patch by Kumar Aditya.
5198
5199- bpo-46088: Automatically detect or install bootstrap Python runtime when
5200  building from Visual Studio.
5201
5202- bpo-46072: Add a --with-pystats configure option to turn on internal
5203  statistics gathering.
5204
5205- bpo-40280: A new directory ``Tools/wasm`` contains WebAssembly-related
5206  helpers like ``config.site`` override for wasm32-emscripten, wasm assets
5207  generator to bundle the stdlib, and a README.
5208
5209- bpo-46023: :program:`makesetup` no longer builds extensions that have been
5210  marked as *disabled*. This allows users to disable modules in
5211  ``Modules/Setup.local``.
5212
5213- bpo-45949: Use pure Python ``freeze_module`` for all but importlib
5214  bootstrap files. ``--with-freeze-module`` :program:`configure` option is
5215  no longer needed for cross builds.
5216
5217Windows
5218-------
5219
5220- bpo-46217: Removed parameter that is unsupported on Windows 8.1 and early
5221  Windows 10 and may have caused build or runtime failures.
5222
5223macOS
5224-----
5225
5226- bpo-40477: The Python Launcher app for macOS now properly launches scripts
5227  and, if necessary, the Terminal app when running on recent macOS releases.
5228
5229C API
5230-----
5231
5232- bpo-46236: Fix a bug in :c:func:`PyFunction_GetAnnotations` that caused it
5233  to return a ``tuple`` instead of a ``dict``.
5234
5235- bpo-46140: :c:func:`PyBuffer_GetPointer`,
5236  :c:func:`PyBuffer_FromContiguous`, :c:func:`PyBuffer_ToContiguous` and
5237  :c:func:`PyMemoryView_FromBuffer` now take buffer info by ``const
5238  Py_buffer *`` instead of ``Py_buffer *``, as they do not need mutability.
5239  :c:func:`PyBuffer_FromContiguous` also now takes the source buffer as
5240  ``const void *``, and similarly :c:func:`PyBuffer_GetPointer` takes the
5241  strides as ``const Py_ssize_t *``.
5242
5243- bpo-45855: Document that the *no_block* argument to
5244  :c:func:`PyCapsule_Import` is a no-op now.
5245
5246- bpo-45855: Replaced deprecated usage of
5247  :c:func:`PyImport_ImportModuleNoBlock` with
5248  :c:func:`PyImport_ImportModule` in stdlib modules. Patch by Kumar Aditya.
5249
5250- bpo-46007: The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded
5251  from the limited C API. It was never usable there, because it used
5252  internal structures which are not available in the limited C API. Patch by
5253  Victor Stinner.
5254
5255
5256What's New in Python 3.11.0 alpha 3?
5257====================================
5258
5259*Release date: 2021-12-08*
5260
5261Core and Builtins
5262-----------------
5263
5264- bpo-46009: Restore behavior from 3.9 and earlier when sending non-None to
5265  newly started generator. In 3.9 this did not affect the state of the
5266  generator. In 3.10.0 and 3.10.1 ``gen_func().send(0)`` is equivalent to
5267  ``gen_func().throw(TypeError(...)`` which exhausts the generator. In
5268  3.10.2 onward, the behavior has been reverted to that of 3.9.
5269
5270- bpo-46004: Fix the :exc:`SyntaxError` location for errors involving for
5271  loops with invalid targets. Patch by Pablo Galindo
5272
5273- bpo-45711: :c:func:`_PyErr_ChainStackItem` no longer normalizes
5274  ``exc_info`` (including setting the traceback on the exception instance)
5275  because ``exc_info`` is always normalized.
5276
5277- bpo-45607: The ``__note__`` field was added to :exc:`BaseException`. It is
5278  ``None`` by default but can be set to a string which is added to the
5279  exception's traceback.
5280
5281- bpo-45947: Place pointers to dict and values immediately before GC header.
5282  This reduces number of dependent memory loads to access either dict or
5283  values from 3 to 1.
5284
5285- bpo-45915: ``is_valid_fd`` now uses faster ``fcntl(fd, F_GETFD)`` on
5286  Linux, macOS, and Windows.
5287
5288- bpo-44530: Reverts a change to the ``code.__new__`` :ref:`audit event
5289  <audit-events>` from an earlier prerelease.
5290
5291- bpo-42268: Fail the configure step if the selected compiler doesn't
5292  support memory sanitizer. Patch by Pablo Galindo
5293
5294- bpo-45711: The three values of ``exc_info`` are now always consistent with
5295  each other. In particular, the ``type`` and ``traceback`` fields are now
5296  derived from the exception instance. This impacts the return values of
5297  :func:`sys.exc_info` and :c:func:`PyErr_GetExcInfo()` if the exception
5298  instance is modified while the exception is handled, as well as
5299  :c:func:`PyErr_SetExcInfo()`, which now ignores the ``type`` and
5300  ``traceback`` arguments provided to it.
5301
5302- bpo-45727: Refine the custom syntax error that suggests that a comma may
5303  be missing to trigger only when the expressions are detected between
5304  parentheses or brackets. Patch by Pablo Galindo
5305
5306- bpo-45885: Specialized the ``COMPARE_OP`` opcode using the PEP 659
5307  machinery.
5308
5309- bpo-45786: Allocate space for the interpreter frame in the frame object,
5310  to avoid an additional allocation when the frame object outlives the frame
5311  activation.
5312
5313- bpo-45614: Fix :mod:`traceback` display for exceptions with invalid module
5314  name.
5315
5316- bpo-45813: Fix crash when calling coro.cr_frame.clear() after coroutine
5317  has been freed.
5318
5319- bpo-45811: Improve the tokenizer errors when encountering invisible
5320  control characters in the parser. Patch by Pablo Galindo
5321
5322- bpo-45848: Allow the parser to obtain error lines directly from encoded
5323  files. Patch by Pablo Galindo
5324
5325- bpo-45709: Restore behavior from 3.10 when tracing an exception raised
5326  within a with statement.
5327
5328- bpo-44525: Adds new :opcode:`COPY_FREE_VARS` opcode, to make copying of
5329  free variables from function to frame explicit. Helps optimization of
5330  calls to Python function.
5331
5332- bpo-45829: Specialize :opcode:`BINARY_SUBSCR` for classes with a
5333  ``__getitem__`` method implemented in Python
5334
5335- bpo-45826: Fixed a crash when calling ``.with_traceback(None)`` on
5336  ``NameError``. This occurs internally in
5337  ``unittest.TestCase.assertRaises()``.
5338
5339- bpo-45822: Fixed a bug in the parser that was causing it to not respect
5340  :pep:`263` coding cookies when no flags are provided. Patch by Pablo
5341  Galindo
5342
5343- bpo-45820: Fix a segfault when the parser fails without reading any input.
5344  Patch by Pablo Galindo
5345
5346- bpo-45636: Simplify the implementation of :opcode:`BINARY_OP` by indexing
5347  into an array of function pointers (rather than switching on the oparg).
5348
5349- bpo-42540: Fix crash when :func:`os.fork` is called with an active
5350  non-default memory allocator.
5351
5352- bpo-45738: Fix computation of error location for invalid continuation
5353  characters in the parser. Patch by Pablo Galindo.
5354
5355- bpo-45636: Remove an existing "fast path" for old-style string formatting,
5356  since it no longer appears to have any measurable impact.
5357
5358- bpo-45753: Make recursion checks a bit more efficient by tracking amount
5359  of calls left before overflow.
5360
5361- bpo-45773: Fix a compiler hang when attempting to optimize certain jump
5362  patterns.
5363
5364- bpo-45764: The parser now gives a better error message when leaving out
5365  the opening parenthesis ``(`` after a ``def``-statement::
5366
5367      >>> def f:
5368        File "<stdin>", line 1
5369          def f:
5370               ^
5371      SyntaxError: expected '('
5372
5373- bpo-45609: Specialized the ``STORE_SUBSCR`` opcode using the PEP 659
5374  machinery.
5375
5376- bpo-45636: Replace all numeric ``BINARY_*`` and ``INPLACE_*`` instructions
5377  with a single :opcode:`BINARY_OP` implementation.
5378
5379- bpo-45582: Path calculation (known as ``getpath``) has been reimplemented
5380  as a frozen Python module. This should have no visible impact, but may
5381  affect calculation of all paths referenced in :mod:`sys` and
5382  :mod:`sysconfig`.
5383
5384- bpo-45450: Improve the syntax error message for parenthesized arguments.
5385  Patch by Pablo Galindo.
5386
5387Library
5388-------
5389
5390- bpo-27946: Fix possible crash when getting an attribute of
5391  class:`xml.etree.ElementTree.Element` simultaneously with replacing the
5392  ``attrib`` dict.
5393
5394- bpo-45711: Make :mod:`asyncio` normalize exceptions as soon as they are
5395  captured with :c:func:`PyErr_Fetch`, and before they are stored as an
5396  exc_info triplet. This brings :mod:`asyncio` in line with the rest of the
5397  codebase, where an exc_info triplet is always normalized.
5398
5399- bpo-23819: Replaced asserts with exceptions in asyncio, patch by Kumar
5400  Aditya.
5401
5402- bpo-13236: :class:`unittest.TextTestResult` and
5403  :class:`unittest.TextTestRunner` flush now the output stream more often.
5404
5405- bpo-45917: Added :func:`math.exp2`:, which returns 2 raised to the power
5406  of x.
5407
5408- bpo-37658: Fix issue when on certain conditions ``asyncio.wait_for()`` may
5409  allow a coroutine to complete successfully, but fail to return the result,
5410  potentially causing memory leaks or other issues.
5411
5412- bpo-45876: Improve the accuracy of stdev() and pstdev() in the statistics
5413  module.  When the inputs are floats or fractions, the output is a
5414  correctly rounded float
5415
5416- bpo-44649: Handle dataclass(slots=True) with a field that has default a
5417  default value, but for which init=False.
5418
5419- bpo-45803: Added missing kw_only parameter to
5420  dataclasses.make_dataclass().
5421
5422- bpo-45837: The :meth:`turtle.RawTurtle.settiltangle` is deprecated since
5423  Python 3.1, it now emits a deprecation warning and will be removed in
5424  Python 3.13.
5425
5426  Use :meth:`turtle.RawTurtle.tiltangle` instead.
5427
5428  :meth:`turtle.RawTurtle.tiltangle` was earlier incorrectly marked as
5429  deprecated, its docstring has been corrected.
5430
5431  Patch by Hugo van Kemenade.
5432
5433- bpo-45831: :mod:`faulthandler` can now write ASCII-only strings (like
5434  filenames and function names) with a single write() syscall when dumping a
5435  traceback. It reduces the risk of getting an unreadable dump when two
5436  threads or two processes dump a traceback to the same file (like stderr)
5437  at the same time. Patch by Victor Stinner.
5438
5439- bpo-45828: :mod:`sqlite` C callbacks now use unraisable exceptions if
5440  callback tracebacks are enabled. Patch by Erlend E. Aasland.
5441
5442- bpo-41735: Fix thread lock in ``zlib.Decompress.flush()`` method before
5443  ``PyObject_GetBuffer``.
5444
5445- bpo-45235: Reverted an argparse bugfix that caused regression in the
5446  handling of default arguments for subparsers.  This prevented leaf level
5447  arguments from taking precedence over root level arguments.
5448
5449- bpo-45754: Fix a regression in Python 3.11a1 and 3.11a2 where
5450  :mod:`sqlite3` incorrectly would use ``SQLITE_LIMIT_LENGTH`` when checking
5451  SQL statement lengths. Now, ``SQLITE_LIMIT_SQL_LENGTH`` is used. Patch by
5452  Erlend E. Aasland.
5453
5454- bpo-45766: Added *proportional* option to
5455  :meth:`statistics.linear_regression`.
5456
5457- bpo-45765: In importlib.metadata, fix distribution discovery for an empty
5458  path.
5459
5460- bpo-45757: Fix bug where :mod:`dis` produced an incorrect oparg when
5461  :opcode:`EXTENDED_ARG` is followed by an opcode that does not use its
5462  argument.
5463
5464- bpo-45644: In-place JSON file formatting using ``python3 -m json.tool
5465  infile infile`` now works correctly, previously it left the file empty.
5466  Patch by Chris Wesseling.
5467
5468- bpo-45703: When a namespace package is imported before another module from
5469  the same namespace is created/installed in a different :data:`sys.path`
5470  location while the program is running, calling the
5471  :func:`importlib.invalidate_caches` function will now also guarantee the
5472  new module is noticed.
5473
5474- bpo-45535: Improve output of ``dir()`` with Enums.
5475
5476- bpo-45664: Fix :func:`types.resolve_bases` and :func:`types.new_class` for
5477  :class:`types.GenericAlias` instance as a base.
5478
5479- bpo-45663: Fix :func:`dataclasses.is_dataclass` for dataclasses which are
5480  subclasses of :class:`types.GenericAlias`.
5481
5482- bpo-45662: Fix the repr of :data:`dataclasses.InitVar` with a type alias
5483  to the built-in class, e.g. ``InitVar[list[int]]``.
5484
5485- bpo-43137: Launch GNOME web browsers via gio tool instead of obsolete
5486  gvfs-open
5487
5488- bpo-45429: On Windows, :func:`time.sleep` now uses a waitable timer which
5489  supports high-resolution timers. Patch by Dong-hee Na and Eryk Sun.
5490
5491- bpo-37295: Optimize :func:`math.comb` and :func:`math.perm`.
5492
5493- bpo-45514: Deprecated legacy functions in :mod:`importlib.resources`.
5494
5495- bpo-45507: Add tests for truncated/missing trailers in gzip.decompress
5496  implementation.
5497
5498- bpo-45359: Implement :pep:`585` for :class:`graphlib.TopologicalSorter`.
5499
5500- bpo-44733: Add ``max_tasks_per_child`` to
5501  :class:`concurrent.futures.ProcessPoolExecutor`. This allows users to
5502  specify the maximum number of tasks a single process should execute before
5503  the process needs to be restarted.
5504
5505- bpo-28806: Improve netrc library. netrc file no longer needs to contain
5506  all tokens. And if the login name is anonymous, security check is no
5507  longer need.
5508
5509- bpo-43498: Avoid a possible *"RuntimeError: dictionary changed size during
5510  iteration"* when adjusting the process count of
5511  :class:`ProcessPoolExecutor`.
5512
5513- bpo-42158: Add MIME types for N-quads, N-triples, Notation3 and TriG to
5514  ``mimetypes``.
5515
5516- bpo-30533: Add :func:`inspect.getmembers_static` , it return all members
5517  without triggering dynamic lookup via the descriptor protocol. Patch by
5518  Weipeng Hong.
5519
5520Documentation
5521-------------
5522
5523- bpo-42238: ``make -C Doc suspicious`` will be removed soon in favor of
5524  ``make -C Doc check``, mark it as deprecated.
5525
5526- bpo-45840: Improve cross-references in the documentation for the data
5527  model.
5528
5529- bpo-45640: Properly marked-up grammar tokens in the documentation are now
5530  clickable and take you to the definition of a given piece of grammar.
5531  Patch by Arthur Milchior.
5532
5533- bpo-45788: Link doc for sys.prefix to sysconfig doc on installation paths.
5534
5535- bpo-45772: ``socket.socket`` documentation is corrected to a class from a
5536  function.
5537
5538- bpo-45392: Update the docstring of the :class:`type` built-in to remove a
5539  redundant line and to mention keyword arguments for the constructor.
5540
5541- bpo-45250: Update the documentation to note that CPython does not
5542  consistently require iterators to define ``__iter__``.
5543
5544- bpo-25381: In the extending chapter of the extending doc, update a
5545  paragraph about the global variables containing exception information.
5546
5547- bpo-43905: Expanded :func:`~dataclasses.astuple` and
5548  :func:`~dataclasses.asdict` docs, warning about deepcopy being applied and
5549  providing a workaround.
5550
5551Tests
5552-----
5553
5554- bpo-45695: Out-of-tree builds with a read-only source directory are now
5555  tested by CI.
5556
5557- bpo-19460: Add new Test for
5558  ``Lib/email/mime/nonmultipart.py::MIMENonMultipart``.
5559
5560- bpo-45835: Fix race condition in test_queue tests with multiple "feeder"
5561  threads.
5562
5563- bpo-45783: The test for the freeze tool now handles file moves and
5564  deletions.
5565
5566- bpo-45745: Remove the ``--findleaks`` command line option of regrtest: use
5567  the ``--fail-env-changed`` option instead. Since Python 3.7, it was a
5568  deprecated alias to the ``--fail-env-changed`` option.
5569
5570- bpo-45701: Add tests with ``tuple`` type with :func:`functools.lru_cache`
5571  to ``test_functools``.
5572
5573Build
5574-----
5575
5576- bpo-44035: CI now verifies that autoconf files have been regenerated with
5577  a current and unpatched autoconf package.
5578
5579- bpo-45950: The build system now uses a :program:`_bootstrap_python`
5580  interpreter for freezing and deepfreezing again. To speed up build process
5581  the build tools :program:`_bootstrap_python` and :program:`_freeze_module`
5582  are no longer build with LTO.
5583
5584- bpo-45881: The :program:`configure` script now accepts
5585  ``--with-build-python`` and ``--with-freeze-module`` options to make cross
5586  compiling easier.
5587
5588- bpo-40280: Emscripten platform now uses ``.wasm`` suffix by default.
5589
5590- bpo-40280: Disable unusable core extension modules on WASM/Emscripten
5591  targets.
5592
5593- bpo-40280: ``configure`` now checks for socket ``shutdown`` function. The
5594  check makes it possible to disable ``SYS_shutdown`` with
5595  ``ac_cv_func_shutdown=no`` in CONFIG_SITE.
5596
5597- bpo-40280: ``configure`` now checks for functions ``fork1, getegid,
5598  geteuid, getgid, getppid, getuid, opendir, pipe, system, wait, ttyname``.
5599
5600- bpo-33393: Update ``config.guess`` to 2021-06-03 and ``config.sub`` to
5601  2021-08-14. ``Makefile`` now has an ``update-config`` target to make
5602  updating more convenient.
5603
5604- bpo-45866: ``make regen-all`` now produces the same output when run from a
5605  directory other than the source tree: when building Python out of the
5606  source tree. pegen now strips directory of the "generated by pygen from
5607  <FILENAME>" header Patch by Victor Stinner.
5608
5609- bpo-40280: ``configure`` now accepts machine ``wasm32`` or ``wasm64`` and
5610  OS ``wasi`` or ``emscripten`` for cross building, e.g.
5611  ``wasm32-unknown-emscripten``, ``wasm32-wasi``, or
5612  ``wasm32-unknown-wasi``.
5613
5614- bpo-41498: Python now compiles on platforms without ``sigset_t``. Several
5615  functions in :mod:`signal` are not available when ``sigset_t`` is missing.
5616
5617  Based on patch by Roman Yurchak for pyodide.
5618
5619- bpo-45881: ``setup.py`` now uses ``CC`` from environment first to discover
5620  multiarch and cross compile paths.
5621
5622- bpo-45886: The ``_freeze_module`` program path can now be overridden on
5623  the command line, e.g. ``make
5624  FREEZE_MODULE=../x86_64/Program/_freeze_module``.
5625
5626- bpo-45873: Get rid of the ``_bootstrap_python`` build step. The
5627  deepfreeze.py script is now run using ``$(PYTHON_FOR_REGEN)`` which can be
5628  Python 3.7 or newer (on Windows, 3.8 or newer).
5629
5630- bpo-45847: Port builtin hashlib extensions to ``PY_STDLIB_MOD`` macro and
5631  ``addext()``.
5632
5633- bpo-45723: Add ``autoconf`` helpers for saving and restoring environment
5634  variables:
5635
5636  * ``SAVE_ENV``: Save ``$CFLAGS``, ``$LDFLAGS``, ``$LIBS``, and
5637    ``$CPPFLAGS``.
5638  * ``RESTORE_ENV``: Restore ``$CFLAGS``, ``$LDFLAGS``, ``$LIBS``, and
5639    ``$CPPFLAGS``.
5640  * ``WITH_SAVE_ENV([SCRIPT])``: Run ``SCRIPT`` wrapped with ``SAVE_ENV`` and
5641    ``RESTORE_ENV``.
5642
5643  Patch by Erlend E. Aasland.
5644
5645- bpo-45573: Mandatory core modules, that are required to bootstrap Python,
5646  are now in ``Modules/Setup.bootstrap``.
5647
5648- bpo-45573: ``configure`` now creates ``Modules/Setup.stdlib`` with
5649  conditionally enabled/disabled extension module lines. The file is not
5650  used, yet.
5651
5652- bpo-45573: ``configure`` now uses a unified format to set state, compiler
5653  flags, and linker flags in Makefile. The new macro ``PY_STDLIB_MOD`` sets
5654  three variables that are consumed by ``Modules/Setup`` and ``setup.py``.
5655
5656- bpo-45816: Python now supports building with Visual Studio 2022 (MSVC
5657  v143, VS Version 17.0). Patch by Jeremiah Vivian.
5658
5659- bpo-45800: Settings for :mod:`pyexpat` C extension are now detected by
5660  ``configure``. The bundled ``expat`` library is built in ``Makefile``.
5661
5662- bpo-45798: Settings for :mod:`decimal` internal C extension are now
5663  detected by ``configure``. The bundled ``libmpdec`` library is built in
5664  ``Makefile``.
5665
5666- bpo-45723: :program:`configure` has a new option ``--with-pkg-config`` to
5667  disable or require pkg-config.
5668
5669- bpo-45774: The build dependencies for :mod:`sqlite3` are now detected by
5670  ``configure`` and ``pkg-config``. Patch by Erlend E. Aasland.
5671
5672- bpo-45763: The build dependencies for :mod:`zlib`, :mod:`bz2`, and
5673  :mod:`lzma` are now detected by ``configure``.
5674
5675- bpo-45747: gdbm and dbm build dependencies are now detected by
5676  ``configure``.
5677
5678- bpo-45743: On macOS, the build system no longer passes
5679  ``search_paths_first`` to the linker. The flag has been the default since
5680  Xcode 4 / macOS 10.6.
5681
5682- bpo-45723: ``configure.ac`` is now compatible with autoconf 2.71.
5683  Deprecated checks ``STDC_HEADERS`` and ``AC_HEADER_TIME`` have been
5684  removed.
5685
5686- bpo-45723: ``configure`` now prints a warning when pkg-config is missing.
5687
5688- bpo-45731: ``configure --enable-loadable-sqlite-extensions`` is now
5689  handled by new ``PY_SQLITE_ENABLE_LOAD_EXTENSION`` macro instead of logic
5690  in setup.py.
5691
5692- bpo-45723: configure.ac now uses custom helper macros and
5693  ``AC_CACHE_CHECK`` to simplify and speed up configure runs.
5694
5695- bpo-45696: Skip the marshal step for frozen modules by generating C code
5696  that produces a set of ready-to-use code objects. This speeds up startup
5697  time by another 10% or more.
5698
5699- bpo-45561: Run smelly.py tool from $(srcdir).
5700
5701Windows
5702-------
5703
5704- bpo-46105: Fixed calculation of :data:`sys.path` in a venv on Windows.
5705
5706- bpo-45901: When installed through the Microsoft Store and set as the
5707  default app for :file:`*.py` files, command line arguments will now be
5708  passed to Python when invoking a script without explicitly launching
5709  Python (that is, ``script.py args`` rather than ``python script.py
5710  args``).
5711
5712- bpo-45616: Fix Python Launcher's ability to distinguish between versions
5713  3.1 and 3.10 when either one is explicitly requested.  Previously, 3.1
5714  would be used if 3.10 was requested but not installed, and 3.10 would be
5715  used if 3.1 was requested but 3.10 was installed.
5716
5717- bpo-45850: Implement changes to build with deep-frozen modules on Windows.
5718  Note that we now require Python 3.10 as the "bootstrap" or "host" Python.
5719
5720- bpo-45732: Updates bundled Tcl/Tk to 8.6.12.
5721
5722- bpo-45720: Internal reference to :file:`shlwapi.dll` was dropped to help
5723  improve startup time. This DLL will no longer be loaded at the start of
5724  every Python process.
5725
5726macOS
5727-----
5728
5729- bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12.
5730
5731C API
5732-----
5733
5734- bpo-39026: Fix Python.h to build C extensions with Xcode: remove a
5735  relative include from ``Include/cpython/pystate.h``.
5736
5737
5738What's New in Python 3.11.0 alpha 2?
5739====================================
5740
5741*Release date: 2021-11-05*
5742
5743Core and Builtins
5744-----------------
5745
5746- bpo-45716: Improve the :exc:`SyntaxError` message when using ``True``,
5747  ``None`` or ``False`` as keywords in a function call. Patch by Pablo
5748  Galindo.
5749
5750- bpo-45688: :data:`sys.stdlib_module_names` now contains the macOS-specific
5751  module :mod:`_scproxy`.
5752
5753- bpo-45379: Clarify :exc:`ImportError` message when we try to explicitly
5754  import a frozen module but frozen modules are disabled.
5755
5756- bpo-44525: Specialize simple calls to Python functions (no starargs,
5757  keyowrd dict, or closure)
5758
5759- bpo-45530: Cases of sorting using tuples as keys may now be significantly
5760  faster in some cases. Patch by Tim Peters.
5761
5762  The order of the result may differ from earlier releases if the tuple
5763  elements don't define a total ordering (see
5764  :ref:`expressions-value-comparisons` for information on total ordering).
5765  It's generally true that the result of sorting simply isn't well-defined
5766  in the absence of a total ordering on list elements.
5767
5768- bpo-45526: In obmalloc, set ADDRESS_BITS to not ignore any bits (ignored
5769  16 before). That is safer in the case that the kernel gives user-space
5770  virtual addresses that span a range greater than 48 bits.
5771
5772- bpo-30570: Fixed a crash in ``issubclass()`` from infinite recursion when
5773  searching pathological ``__bases__`` tuples.
5774
5775- bpo-45521: Fix a bug in the obmalloc radix tree code.  On 64-bit machines,
5776  the bug causes the tree to hold 46-bits of virtual addresses, rather than
5777  the intended 48-bits.
5778
5779- bpo-45494: Fix parser crash when reporting errors involving invalid
5780  continuation characters. Patch by Pablo Galindo.
5781
5782- bpo-45445: Python now fails to initialize if it finds an invalid
5783  :option:`-X` option in the command line. Patch by Pablo Galindo.
5784
5785- bpo-45340: Object attributes are held in an array instead of a dictionary.
5786  An object's dictionary are created lazily, only when needed. Reduces the
5787  memory consumption of a typical Python object by about 30%. Patch by Mark
5788  Shannon.
5789
5790- bpo-45408: Fix a crash in the parser when reporting tokenizer errors that
5791  occur at the same time unclosed parentheses are detected. Patch by Pablo
5792  Galindo.
5793
5794- bpo-29410: Add SipHash13 for string hash algorithm and use it by default.
5795
5796- bpo-45385: Fix reference leak from descr_check. Patch by Dong-hee Na.
5797
5798- bpo-45367: Specialized the ``BINARY_MULTIPLY`` opcode to
5799  ``BINARY_MULTIPLY_INT`` and ``BINARY_MULTIPLY_FLOAT`` using the PEP 659
5800  machinery.
5801
5802- bpo-21736: Frozen stdlib modules now have ``__file__`` to the .py file
5803  they would otherwise be loaded from, if possible.  For packages,
5804  ``__path__`` now has the correct entry instead of being an empty list,
5805  which allows unfrozen submodules to be imported.  These are set only if
5806  the stdlib directory is known when the runtime is initialized.  Note that
5807  the file at ``__file__`` is not guaranteed to exist.  None of this affects
5808  non-stdlib frozen modules nor, for now, frozen modules imported using
5809  ``PyImport_ImportFrozenModule()``.  Also, at the moment ``co_filename`` is
5810  not updated for the module.
5811
5812- bpo-45020: For frozen stdlib modules, record the original module name as
5813  ``module.__spec__.loader_state.origname``.  If the value is different than
5814  ``module.__spec__.name`` then the module was defined as an alias in
5815  Tools/scripts/freeze_modules.py.  If it is ``None`` then the module comes
5816  from a source file outside the stdlib.
5817
5818- bpo-45324: In FrozenImporter.find_spec(), we now preserve the information
5819  needed in exec_module() to load the module.  This change mostly impacts
5820  internal details, rather than changing the importer's behavior.
5821
5822- bpo-45292: Implement :pep:`654`. Add :class:`ExceptionGroup` and
5823  :class:`BaseExceptionGroup`. Update traceback display code.
5824
5825- bpo-40116: Change to the implementation of split dictionaries. Classes
5826  where the instances differ either in the exact set of attributes, or in
5827  the order in which those attributes are set, can still share keys. This
5828  should have no observable effect on users of Python or the C-API. Patch by
5829  Mark Shannon.
5830
5831- bpo-44050: Extensions that indicate they use global state (by setting
5832  ``m_size`` to -1) can again be used in multiple interpreters. This reverts
5833  to behavior of Python 3.8.
5834
5835- bpo-44525: Setup initial specialization infrastructure for the
5836  ``CALL_FUNCTION`` opcode. Implemented initial specializations for C
5837  function calls:
5838
5839  * ``CALL_FUNCTION_BUILTIN_O`` for ``METH_O`` flag.
5840
5841  * ``CALL_FUNCTION_BUILTIN_FAST`` for ``METH_FASTCALL`` flag without keywords.
5842
5843  * ``CALL_FUNCTION_LEN`` for ``len(o)``.
5844
5845  * ``CALL_FUNCTION_ISINSTANCE`` for ``isinstance(o, t)``.
5846
5847- bpo-44511: Improve the generated bytecode for class and mapping patterns.
5848
5849- bpo-43706: Speed up calls to ``enumerate()`` by using the :pep:`590`
5850  ``vectorcall`` calling convention. Patch by Dong-hee Na.
5851
5852Library
5853-------
5854
5855- bpo-45679: Fix caching of multi-value :data:`typing.Literal`.
5856  ``Literal[True, 2]`` is no longer equal to ``Literal[1, 2]``.
5857
5858- bpo-42064: Convert :mod:`sqlite3` to multi-phase initialisation (PEP 489).
5859  Patches by Erlend E. Aasland.
5860
5861- bpo-45438: Fix typing.Signature string representation for generic builtin
5862  types.
5863
5864- bpo-45613: :mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on
5865  the default threading mode the underlying SQLite library has been compiled
5866  with. Patch by Erlend E. Aasland.
5867
5868- bpo-45574: Fix warning about ``print_escape`` being unused.
5869
5870- bpo-45581: :meth:`sqlite3.connect` now correctly raises :exc:`MemoryError`
5871  if the underlying SQLite API signals memory error. Patch by Erlend E.
5872  Aasland.
5873
5874- bpo-45557: pprint.pprint() now handles underscore_numbers correctly.
5875  Previously it was always setting it to False.
5876
5877- bpo-44019: Add :func:`operator.call` to ``operator.__all__``. Patch by
5878  Kreusada.
5879
5880- bpo-42174: :meth:`shutil.get_terminal_size` now falls back to sane values
5881  if the column or line count are 0.
5882
5883- bpo-35673: Improve the introspectability of the ``__loader__`` attribute
5884  for namespace packages.  :class:`importlib.machinery.NamespaceLoader` is
5885  now public, and implements the :class:`importlib.abc.InspectLoader`
5886  interface. ``_NamespaceLoader`` is kept for backward compatibility.
5887
5888- bpo-45515: Add references to :mod:`zoneinfo` in the :mod:`datetime`
5889  documentation, mostly replacing outdated references to ``dateutil.tz``.
5890  Change by Paul Ganssle.
5891
5892- bpo-45475: Reverted optimization of iterating :class:`gzip.GzipFile`,
5893  :class:`bz2.BZ2File`, and :class:`lzma.LZMAFile` (see bpo-43787) because
5894  it caused regression when user iterate them without having reference of
5895  them. Patch by Inada Naoki.
5896
5897- bpo-45489: Update :class:`~typing.ForwardRef` to support ``|`` operator.
5898  Patch by Dong-hee Na.
5899
5900- bpo-42222: Removed deprecated support for float arguments in
5901  *randrange()*.
5902
5903- bpo-45428: Fix a regression in py_compile when reading filenames from
5904  standard input.
5905
5906- bpo-45467: Fix incremental decoder and stream reader in the
5907  "raw-unicode-escape" codec. Previously they failed if the escape sequence
5908  was split.
5909
5910- bpo-45461: Fix incremental decoder and stream reader in the
5911  "unicode-escape" codec. Previously they failed if the escape sequence was
5912  split.
5913
5914- bpo-45239: Fixed :func:`email.utils.parsedate_tz` crashing with
5915  :exc:`UnboundLocalError` on certain invalid input instead of returning
5916  ``None``. Patch by Ben Hoyt.
5917
5918- bpo-45417: Fix quadratic behaviour in the enum module: Creation of enum
5919  classes with a lot of entries was quadratic.
5920
5921- bpo-45249: Fix the behaviour of :func:`traceback.print_exc` when
5922  displaying the caret when the ``end_offset`` in the exception is set to 0.
5923  Patch by Pablo Galindo
5924
5925- bpo-45416: Fix use of :class:`asyncio.Condition` with explicit
5926  :class:`asyncio.Lock` objects, which was a regression due to removal of
5927  explicit loop arguments. Patch by Joongi Kim.
5928
5929- bpo-20028: Empty escapechar/quotechar is not allowed when initializing
5930  :class:`csv.Dialect`. Patch by Vajrasky Kok and Dong-hee Na.
5931
5932- bpo-44904: Fix bug in the :mod:`doctest` module that caused it to fail if
5933  a docstring included an example with a ``classmethod`` ``property``. Patch
5934  by Alex Waygood.
5935
5936- bpo-45406: Make :func:`inspect.getmodule` catch ``FileNotFoundError``
5937  raised by :'func:`inspect.getabsfile`, and return ``None`` to indicate
5938  that the module could not be determined.
5939
5940- bpo-45411: Add extensions for files containing subtitles - .srt & .vtt -
5941  to the mimetypes.py module.
5942
5943- bpo-10716: Migrated pydoc to HTML5 (without changing the look of it). Side
5944  effect is to update xmlrpc's ``ServerHTMLDoc`` which now uses the CSS too.
5945  cgitb now relies less on pydoc (as it can't use the CSS file).
5946
5947- bpo-27580: Add support of null characters in :mod:`csv`.
5948
5949- bpo-45262: Prevent use-after-free in asyncio. Make sure the cached running
5950  loop holder gets cleared on dealloc to prevent use-after-free in
5951  get_running_loop
5952
5953- bpo-45386: Make :mod:`xmlrpc.client` more robust to C runtimes where the
5954  underlying C ``strftime`` function results in a ``ValueError`` when
5955  testing for year formatting options.
5956
5957- bpo-20028: Improve error message of :class:`csv.Dialect` when
5958  initializing. Patch by Vajrasky Kok and Dong-hee Na.
5959
5960- bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0
5961
5962- bpo-45328: Fixed :class:`http.client.HTTPConnection` to work properly in
5963  OSs that don't support the ``TCP_NODELAY`` socket option.
5964
5965- bpo-45243: Add :meth:`~sqlite3.Connection.setlimit` and
5966  :meth:`~sqlite3.Connection.getlimit` to :class:`sqlite3.Connection` for
5967  setting and getting SQLite limits by connection basis. Patch by Erlend E.
5968  Aasland.
5969
5970- bpo-45320: Removed from the :mod:`inspect` module:
5971
5972  * the ``getargspec`` function, deprecated since Python 3.0;
5973      use :func:`inspect.signature` or :func:`inspect.getfullargspec` instead.
5974
5975  * the ``formatargspec`` function, deprecated since Python 3.5;
5976    use the :func:`inspect.signature` function and :class:`Signature` object
5977    directly.
5978
5979  * the undocumented ``Signature.from_callable`` and ``Signature.from_function``
5980    functions, deprecated since Python 3.5; use the
5981    :meth:`Signature.from_callable() <inspect.Signature.from_callable>` method
5982    instead.
5983
5984  Patch by Hugo van Kemenade.
5985
5986- bpo-45192: Fix the ``tempfile._infer_return_type`` function so that the
5987  ``dir`` argument of the :mod:`tempfile` functions accepts an object
5988  implementing the ``os.PathLike`` protocol.
5989
5990  Patch by Kyungmin Lee.
5991
5992- bpo-45160: When tracing a tkinter variable used by a ttk OptionMenu,
5993  callbacks are no longer made twice.
5994
5995- bpo-25625: Added non parallel-safe :func:`~contextlib.chdir` context
5996  manager to change the current working directory and then restore it on
5997  exit. Simple wrapper around :func:`~os.chdir`.
5998
5999- bpo-24139: Add support for SQLite extended result codes in
6000  :exc:`sqlite3.Error`. Patch by Erlend E. Aasland.
6001
6002- bpo-24444: Fixed an error raised in :mod:`argparse` help display when help
6003  for an option is set to 1+ blank spaces or when *choices* arg is an empty
6004  container.
6005
6006- bpo-44547: Implement ``Fraction.__int__``, so that a
6007  :class:`fractions.Fraction` instance ``f`` passes an ``isinstance(f,
6008  typing.SupportsInt)`` check.
6009
6010- bpo-40321: Adds support for HTTP 308 redirects to :mod:`urllib`. See
6011  :rfc:`7538` for details. Patch by Jochem Schulenklopper.
6012
6013- bpo-41374: Ensure that ``socket.TCP_*`` constants are exposed on Cygwin
6014  3.1.6 and greater.
6015
6016- bpo-35970: Add help flag to the base64 module's command line interface.
6017  Patch contributed by Robert Kuska.
6018
6019Documentation
6020-------------
6021
6022- bpo-45726: Improve documentation for :func:`functools.singledispatch` and
6023  :class:`functools.singledispatchmethod`.
6024
6025- bpo-45680: Amend the docs on ``GenericAlias`` objects to clarify that
6026  non-container classes can also implement ``__class_getitem__``. Patch
6027  contributed by Alex Waygood.
6028
6029- bpo-45618: Update Sphinx version used to build the documentation to 4.2.0.
6030  Patch by Maciej Olko.
6031
6032- bpo-45655: Add a new "relevant PEPs" section to the top of the
6033  documentation for the ``typing`` module. Patch by Alex Waygood.
6034
6035- bpo-45604: Add ``level`` argument to ``multiprocessing.log_to_stderr``
6036  function docs.
6037
6038- bpo-45516: Add protocol description to the
6039  :class:`importlib.abc.TraversableResources` documentation.
6040
6041- bpo-45464: Mention in the documentation of :ref:`Built-in Exceptions
6042  <bltin-exceptions>` that inheriting from multiple exception types in a
6043  single subclass is not recommended due to possible memory layout
6044  incompatibility.
6045
6046- bpo-45449: Add note about :pep:`585` in :mod:`collections.abc`.
6047
6048- bpo-45516: Add protocol description to the
6049  :class:`importlib.abc.Traversable` documentation.
6050
6051- bpo-20692: Add Programming FAQ entry explaining that int literal attribute
6052  access requires either a space after or parentheses around the literal.
6053
6054Tests
6055-----
6056
6057- bpo-45678: Add tests for scenarios in which
6058  :class:`functools.singledispatchmethod` is stacked on top of a method that
6059  has already been wrapped by two other decorators. Patch by Alex Waygood.
6060
6061- bpo-45578: Add tests for :func:`dis.distb`
6062
6063- bpo-45678: Add tests to ensure that ``functools.singledispatchmethod``
6064  correctly wraps the attributes of the target function.
6065
6066- bpo-45668: PGO tests now pass when Python is built without test extension
6067  modules.
6068
6069- bpo-45577: Add subtests for all ``pickle`` protocols in ``test_zoneinfo``.
6070
6071- bpo-45566: Fix ``test_frozen_pickle`` in ``test_dataclasses`` to check all
6072  ``pickle`` versions.
6073
6074- bpo-43592: :mod:`test.libregrtest` now raises the soft resource limit for
6075  the maximum number of file descriptors when the default is too low for our
6076  test suite as was often the case on macOS.
6077
6078- bpo-39679: Add more test cases for `@functools.singledispatchmethod` when
6079  combined with `@classmethod` or `@staticmethod`.
6080
6081- bpo-45410: When libregrtest spawns a worker process, stderr is now written
6082  into stdout to keep messages order. Use a single pipe for stdout and
6083  stderr, rather than two pipes. Previously, messages were out of order
6084  which made analysis of buildbot logs harder Patch by Victor Stinner.
6085
6086- bpo-45402: Fix test_tools.test_sundry() when Python is built out of tree:
6087  fix how the freeze_modules.py tool locates the _freeze_module program.
6088  Patch by Victor Stinner.
6089
6090- bpo-45403: Fix test_sys.test_stdlib_dir() when Python is built outside the
6091  source tree: compare normalized paths. Patch by Victor Stinner.
6092
6093- bpo-45400: Fix
6094  test_name_error_suggestions_do_not_trigger_for_too_many_locals() of
6095  test_exceptions if a directory name contains "a1" (like
6096  "Python-3.11.0a1"): use a stricter regular expression. Patch by Victor
6097  Stinner.
6098
6099- bpo-10572: Rename :mod:`sqlite3` tests from ``test_sqlite`` to
6100  ``test_sqlite3``, and relocate them to ``Lib/test/test_sqlite3``. Patch by
6101  Erlend E. Aasland.
6102
6103Build
6104-----
6105
6106- bpo-43158: ``setup.py`` now uses values from configure script to build the
6107  ``_uuid`` extension module. Configure now detects util-linux's
6108  ``libuuid``, too.
6109
6110- bpo-45666: Fix warning of ``swprintf`` and ``%s`` usage in
6111  ``_testembed.c``
6112
6113- bpo-45548: ``Modules/Setup`` and ``Modules/makesetup`` have been improved.
6114  The ``Setup`` file now contains working rules for all extensions. Outdated
6115  comments have been removed. Rules defined by ``makesetup`` track
6116  dependencies correctly.
6117
6118- bpo-45548: The :mod:`math` and :mod:`cmath` implementation now require a
6119  C99 compatible ``libm`` and no longer ship with workarounds for missing
6120  acosh, asinh, atanh, expm1, and log1p functions.
6121
6122- bpo-45595: ``setup.py`` and ``makesetup`` now track build dependencies on
6123  all Python header files and module specific header files.
6124
6125- bpo-45571: ``Modules/Setup`` now use ``PY_CFLAGS_NODIST`` instead of
6126  ``PY_CFLAGS`` to compile shared modules.
6127
6128- bpo-45570: :mod:`pyexpat` and :mod:`_elementtree` no longer define
6129  obsolete macros ``HAVE_EXPAT_CONFIG_H`` and ``USE_PYEXPAT_CAPI``.
6130  ``XML_POOR_ENTROPY`` is now defined in ``expat_config.h``.
6131
6132- bpo-43974: ``setup.py`` no longer defines ``Py_BUILD_CORE_MODULE``.
6133  Instead every module, that uses the internal API, defines the macro.
6134
6135- bpo-45548: Fill in missing entries in Modules/Setup.
6136
6137- bpo-45532: Update :data:`sys.version` to use ``main`` as fallback
6138  information. Patch by Jeong YunWon.
6139
6140- bpo-45536: The ``configure`` script now checks whether OpenSSL headers and
6141  libraries provide required APIs. Most common APIs are verified. The check
6142  detects outdated or missing OpenSSL. Failures do not stop configure.
6143
6144- bpo-45221: Fixed regression in handling of ``LDFLAGS`` and ``CPPFLAGS``
6145  options where :meth:`argparse.parse_known_args` could interpret an option
6146  as one of the built-in command line argument, for example ``-h`` for help.
6147
6148- bpo-45440: Building Python now requires a C99 ``<math.h>`` header file
6149  providing the following functions: ``copysign()``, ``hypot()``,
6150  ``isfinite()``, ``isinf()``, ``isnan()``, ``round()``. Patch by Victor
6151  Stinner.
6152
6153- bpo-45405: Prevent ``internal configure error`` when running ``configure``
6154  with recent versions of non-Apple clang.  Patch by David Bohman.
6155
6156- bpo-45433: Avoid linking libpython with libcrypt.
6157
6158Windows
6159-------
6160
6161- bpo-43652: Update Tcl/Tk to 8.6.11, actually this time. The previous
6162  update incorrectly included 8.6.10.
6163
6164- bpo-45337: venv now warns when the created environment may need to be
6165  accessed at a different path, due to redirections, links or junctions. It
6166  also now correctly installs or upgrades components when the alternate path
6167  is required.
6168
6169- bpo-43851: Build SQLite ``SQLITE_OMIT_AUTOINIT`` on Windows. Patch by
6170  Erlend E. Aasland.
6171
6172macOS
6173-----
6174
6175- bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey when
6176  using the Tk 8.6.11 provided by python.org macOS installers. Patch by Marc
6177  Culler of the Tk project.
6178
6179IDLE
6180----
6181
6182- bpo-45495: Add context keywords 'case' and 'match' to completions list.
6183
6184C API
6185-----
6186
6187- bpo-29103: :c:func:`PyType_FromSpec* <PyType_FromModuleAndSpec>` now
6188  copies the class name from the spec to a buffer owned by the class, so the
6189  original can be safely deallocated. Patch by Petr Viktorin.
6190
6191- bpo-45522: The internal freelists for frame, float, list, dict, async
6192  generators, and context objects can now be disabled.
6193
6194- bpo-35134: Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API.
6195  It never worked since the :c:type:`PyWeakReference` structure is opaque in
6196  the limited C API.
6197
6198- bpo-35081: Move the ``interpreteridobject.h`` header file from
6199  ``Include/`` to ``Include/internal/``. It only provides private functions.
6200  Patch by Victor Stinner.
6201
6202- bpo-35134: The non-limited API files ``cellobject.h``, ``classobject.h``,
6203  ``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h``
6204  have been moved to the ``Include/cpython`` directory. Moreover, the
6205  ``eval.h`` header file was removed. These files must not be included
6206  directly, as they are already included in ``Python.h``: :ref:`Include
6207  Files <api-includes>`. If they have been included directly, consider
6208  including ``Python.h`` instead. Patch by Victor Stinner.
6209
6210- bpo-45474: The following items are no longer available when
6211  ``Py_LIMITED_API`` is defined:
6212
6213  * :c:func:`PyMarshal_WriteLongToFile`
6214  * :c:func:`PyMarshal_WriteObjectToFile`
6215  * :c:func:`PyMarshal_ReadObjectFromString`
6216  * :c:func:`PyMarshal_WriteObjectToString`
6217  * the ``Py_MARSHAL_VERSION`` macro
6218
6219  These are not part of the :ref:`limited API <stable-abi-list>`.
6220
6221  Patch by Victor Stinner.
6222
6223- bpo-45434: Remove the ``pystrhex.h`` header file. It only contains private
6224  functions. C extensions should only include the main ``<Python.h>`` header
6225  file. Patch by Victor Stinner.
6226
6227- bpo-45440: Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the
6228  ``Py_IS_INFINITY()`` macro. Patch by Victor Stinner.
6229
6230- bpo-45434: ``<Python.h>`` no longer includes the header files
6231  ``<stdlib.h>``, ``<stdio.h>``, ``<errno.h>`` and ``<string.h>`` when the
6232  ``Py_LIMITED_API`` macro is set to ``0x030b0000`` (Python 3.11) or higher.
6233  C extensions should explicitly include the header files after ``#include
6234  <Python.h>``. Patch by Victor Stinner.
6235
6236- bpo-41123: Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros,
6237  deprecated since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or
6238  ``memcpy()`` (``wchar_t*`` string), and ``PyUnicode_Fill()`` functions
6239  instead. Patch by Victor Stinner.
6240
6241- bpo-45412: Remove the following math macros using the ``errno`` variable:
6242
6243  * ``Py_ADJUST_ERANGE1()``
6244  * ``Py_ADJUST_ERANGE2()``
6245  * ``Py_OVERFLOWED()``
6246  * ``Py_SET_ERANGE_IF_OVERFLOW()``
6247  * ``Py_SET_ERRNO_ON_MATH_ERROR()``
6248
6249  Patch by Victor Stinner.
6250
6251- bpo-45395: Custom frozen modules (the array set to
6252  ``PyImport_FrozenModules``) are now treated as additions, rather than
6253  replacing all the default frozen modules. Frozen stdlib modules can still
6254  be disabled by setting the "code" field of the custom array entry to NULL.
6255
6256- bpo-43760: Add new :c:func:`PyThreadState_EnterTracing`, and
6257  :c:func:`PyThreadState_LeaveTracing` functions to the limited C API to
6258  suspend and resume tracing and profiling. Patch by Victor Stinner.
6259
6260- bpo-44220: :c:var:`PyStructSequence_UnnamedField` is added to the Stable
6261  ABI.
6262
6263
6264What's New in Python 3.11.0 alpha 1?
6265====================================
6266
6267*Release date: 2021-10-05*
6268
6269Security
6270--------
6271
6272- bpo-42278: Replaced usage of :func:`tempfile.mktemp` with
6273  :class:`~tempfile.TemporaryDirectory` to avoid a potential race condition.
6274
6275- bpo-44600: Fix incorrect line numbers while tracing some failed patterns
6276  in :ref:`match <match>` statements. Patch by Charles Burkland.
6277
6278- bpo-41180: Add auditing events to the :mod:`marshal` module, and stop
6279  raising ``code.__init__`` events for every unmarshalled code object.
6280  Directly instantiated code objects will continue to raise an event, and
6281  audit event handlers should inspect or collect the raw marshal data. This
6282  reduces a significant performance overhead when loading from ``.pyc``
6283  files.
6284
6285- bpo-44394: Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to
6286  get the fix for the CVE-2013-0340 "Billion Laughs" vulnerability. This
6287  copy is most used on Windows and macOS.
6288
6289- bpo-43124: Made the internal ``putcmd`` function in :mod:`smtplib`
6290  sanitize input for presence of ``\r`` and ``\n`` characters to avoid
6291  (unlikely) command injection.
6292
6293- bpo-44022: :mod:`http.client` now avoids infinitely reading potential HTTP
6294  headers after a ``100 Continue`` status response from the server.
6295
6296Core and Builtins
6297-----------------
6298
6299- bpo-43760: The number of hardware branches per instruction dispatch is
6300  reduced from two to one by adding a special instruction for tracing. Patch
6301  by Mark Shannon.
6302
6303- bpo-45061: Add a deallocator to the bool type to detect refcount bugs in C
6304  extensions which call Py_DECREF(Py_True) or Py_DECREF(Py_False) by
6305  mistake. Detect also refcount bugs when the empty tuple singleton or the
6306  Unicode empty string singleton is destroyed by mistake. Patch by Victor
6307  Stinner.
6308
6309- bpo-24076: sum() was further optimised for summing up single digit
6310  integers.
6311
6312- bpo-45190: Update Unicode databases to Unicode 14.0.0.
6313
6314- bpo-45167: Fix deepcopying of :class:`types.GenericAlias` objects.
6315
6316- bpo-45155: :meth:`int.to_bytes` and :meth:`int.from_bytes` now take a
6317  default value of ``"big"`` for the ``byteorder`` argument.
6318  :meth:`int.to_bytes` also takes a default value of ``1`` for the
6319  ``length`` argument.
6320
6321- bpo-44219: Release the GIL while performing ``isatty`` system calls on
6322  arbitrary file descriptors. In particular, this affects :func:`os.isatty`,
6323  :func:`os.device_encoding` and :class:`io.TextIOWrapper`. By extension,
6324  :func:`io.open` in text mode is also affected. This change solves a
6325  deadlock in :func:`os.isatty`. Patch by Vincent Michel in :issue:`44219`.
6326
6327- bpo-44959: Added fallback to extension modules with '.sl' suffix on HP-UX
6328
6329- bpo-45121: Fix issue where ``Protocol.__init__`` raises ``RecursionError``
6330  when it's called directly or via ``super()``. Patch provided by Yurii
6331  Karabas.
6332
6333- bpo-44348: The deallocator function of the :exc:`BaseException` type now
6334  uses the trashcan mechanism to prevent stack overflow. For example, when a
6335  :exc:`RecursionError` instance is raised, it can be linked to another
6336  RecursionError through the ``__context__`` attribute or the
6337  ``__traceback__`` attribute, and then a chain of exceptions is created.
6338  When the chain is destroyed, nested deallocator function calls can crash
6339  with a stack overflow if the chain is too long compared to the available
6340  stack memory. Patch by Victor Stinner.
6341
6342- bpo-45123: Fix PyAiter_Check to only check for the __anext__ presence (not
6343  for __aiter__). Rename PyAiter_Check to PyAIter_Check, PyObject_GetAiter
6344  -> PyObject_GetAIter.
6345
6346- bpo-1514420: Interpreter no longer attempts to open files with names in
6347  angle brackets (like "<string>" or "<stdin>") when formatting an
6348  exception.
6349
6350- bpo-41031: Match C and Python code formatting of unprintable exceptions
6351  and exceptions in the :mod:`__main__` module.
6352
6353- bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and
6354  :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal
6355  newline") in the file mode. This flag was deprecated since Python 3.3.
6356  Patch by Victor Stinner.
6357
6358- bpo-45083: When the interpreter renders an exception, its name now has a
6359  complete qualname. Previously only the class name was concatenated to the
6360  module name, which sometimes resulted in an incorrect full name being
6361  displayed.
6362
6363  (This issue impacted only the C code exception rendering, the
6364  :mod:`traceback` module was using qualname already).
6365
6366- bpo-34561: List sorting now uses the merge-ordering strategy from Munro
6367  and Wild's ``powersort()``. Unlike the former strategy, this is provably
6368  near-optimal in the entropy of the distribution of run lengths. Most uses
6369  of ``list.sort()`` probably won't see a significant time difference, but
6370  may see significant improvements in cases where the former strategy was
6371  exceptionally poor. However, as these are all fast linear-time
6372  approximations to a problem that's inherently at best quadratic-time to
6373  solve truly optimally, it's also possible to contrive cases where the
6374  former strategy did better.
6375
6376- bpo-45056: Compiler now removes trailing unused constants from co_consts.
6377
6378- bpo-45020: Add a new command line option, "-X frozen_modules=[on|off]" to
6379  opt out of (or into) using optional frozen modules.  This defaults to "on"
6380  (or "off" if it's running out of the source tree).
6381
6382- bpo-45012: In :mod:`posix`, release GIL during ``stat()``, ``lstat()``,
6383  and ``fstatat()`` syscalls made by :func:`os.DirEntry.stat`. Patch by
6384  Stanisław Skonieczny.
6385
6386- bpo-45018: Fixed pickling of range iterators that iterated for over
6387  ``2**32`` times.
6388
6389- bpo-45000: A :exc:`SyntaxError` is now raised when trying to delete
6390  :const:`__debug__`. Patch by Dong-hee Na.
6391
6392- bpo-44963: Implement ``send()`` and ``throw()`` methods for
6393  ``anext_awaitable`` objects. Patch by Pablo Galindo.
6394
6395- bpo-44962: Fix a race in WeakKeyDictionary, WeakValueDictionary and
6396  WeakSet when two threads attempt to commit the last pending removal. This
6397  fixes asyncio.create_task and fixes a data loss in asyncio.run where
6398  shutdown_asyncgens is not run
6399
6400- bpo-24234: Implement the :meth:`__bytes__` special method on the
6401  :class:`bytes` type, so a bytes object ``b``  passes an ``isinstance(b,
6402  typing.SupportsBytes)`` check.
6403
6404- bpo-24234: Implement the :meth:`__complex__` special method on the
6405  :class:`complex` type, so a complex number ``z`` passes an ``isinstance(z,
6406  typing.SupportsComplex)`` check.
6407
6408- bpo-44954: Fixed a corner case bug where the result of
6409  ``float.fromhex('0x.8p-1074')`` was rounded the wrong way.
6410
6411- bpo-44947: Refine the syntax error for trailing commas in import
6412  statements. Patch by Pablo Galindo.
6413
6414- bpo-44945: Specialize the BINARY_ADD instruction using the PEP 659
6415  machinery. Adds five new instructions:
6416
6417  * BINARY_ADD_ADAPTIVE
6418  * BINARY_ADD_FLOAT
6419  * BINARY_ADD_INT
6420  * BINARY_ADD_UNICODE
6421  * BINARY_ADD_UNICODE_INPLACE_FAST
6422
6423- bpo-44929: Fix some edge cases of ``enum.Flag`` string representation in
6424  the REPL. Patch by Pablo Galindo.
6425
6426- bpo-44914: Class version tags are no longer recycled.
6427
6428  This means that a version tag serves as a unique identifier for the state
6429  of a class. We rely on this for effective specialization of the LOAD_ATTR
6430  and other instructions.
6431
6432- bpo-44698: Restore behaviour of complex exponentiation with integer-valued
6433  exponent of type :class:`float` or :class:`complex`.
6434
6435- bpo-44895: A debug variable :envvar:`PYTHONDUMPREFSFILE` is added for
6436  creating a dump file which is generated by :option:`--with-trace-refs`.
6437  Patch by Dong-hee Na.
6438
6439- bpo-44900: Add five superinstructions for PEP 659 quickening:
6440
6441  * LOAD_FAST LOAD_FAST
6442  * STORE_FAST LOAD_FAST
6443  * LOAD_FAST LOAD_CONST
6444  * LOAD_CONST LOAD_FAST
6445  * STORE_FAST STORE_FAST
6446
6447- bpo-44889: Initial implementation of adaptive specialization of
6448  ``LOAD_METHOD``. The following specialized forms were added:
6449
6450  * ``LOAD_METHOD_CACHED``
6451
6452  * ``LOAD_METHOD_MODULE``
6453
6454  * ``LOAD_METHOD_CLASS``
6455
6456- bpo-44890: Specialization stats are always collected in debug builds.
6457
6458- bpo-44885: Correct the ast locations of f-strings with format specs and
6459  repeated expressions. Patch by Pablo Galindo
6460
6461- bpo-44878: Remove the loop from the bytecode interpreter. All instructions
6462  end with a DISPATCH macro, so the loop is now redundant.
6463
6464- bpo-44878: Remove switch statement for interpreter loop when using
6465  computed gotos. This makes sure that we only have one dispatch table in
6466  the interpreter.
6467
6468- bpo-44874: Deprecate the old trashcan macros
6469  (``Py_TRASHCAN_SAFE_BEGIN``/``Py_TRASHCAN_SAFE_END``). They should be
6470  replaced by the new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``.
6471
6472- bpo-44872: Use new trashcan macros (Py_TRASHCAN_BEGIN/END) in
6473  frameobject.c instead of the old ones (Py_TRASHCAN_SAFE_BEGIN/END).
6474
6475- bpo-33930: Fix segmentation fault with deep recursion when cleaning method
6476  objects. Patch by Augusto Goulart and Pablo Galindo.
6477
6478- bpo-25782: Fix bug where ``PyErr_SetObject`` hangs when the current
6479  exception has a cycle in its context chain.
6480
6481- bpo-44856: Fix reference leaks in the error paths of ``update_bases()``
6482  and ``__build_class__``. Patch by Pablo Galindo.
6483
6484- bpo-44826: Initial implementation of adaptive specialization of STORE_ATTR
6485
6486  Three specialized forms of STORE_ATTR are added:
6487
6488  * STORE_ATTR_SLOT
6489
6490  * STORE_ATTR_SPLIT_KEYS
6491
6492  * STORE_ATTR_WITH_HINT
6493
6494- bpo-44838: Fixed a bug that was causing the parser to raise an incorrect
6495  custom :exc:`SyntaxError` for invalid 'if' expressions. Patch by Pablo
6496  Galindo.
6497
6498- bpo-44821: Create instance dictionaries (__dict__) eagerly, to improve
6499  regularity of object layout and assist specialization.
6500
6501- bpo-44792: Improve syntax errors for if expressions. Patch by Miguel Brito
6502
6503- bpo-34013: Generalize the invalid legacy statement custom error message
6504  (like the one generated when "print" is called without parentheses) to
6505  include more generic expressions. Patch by Pablo Galindo
6506
6507- bpo-44732: Rename ``types.Union`` to ``types.UnionType``.
6508
6509- bpo-44725: Expose specialization stats in python via
6510  :func:`_opcode.get_specialization_stats`.
6511
6512- bpo-44717: Improve AttributeError on circular imports of submodules.
6513
6514- bpo-44698: Fix undefined behaviour in complex object exponentiation.
6515
6516- bpo-44653: Support :mod:`typing` types in parameter substitution in the
6517  union type.
6518
6519- bpo-44676: Add ability to serialise ``types.Union`` objects. Patch
6520  provided by Yurii Karabas.
6521
6522- bpo-44633: Parameter substitution of the union type with wrong types now
6523  raises ``TypeError`` instead of returning ``NotImplemented``.
6524
6525- bpo-44661: Update ``property_descr_set`` to use vectorcall if possible.
6526  Patch by Dong-hee Na.
6527
6528- bpo-44662: Add ``__module__`` to ``types.Union``. This also fixes
6529  ``types.Union`` issues with ``typing.Annotated``. Patch provided by Yurii
6530  Karabas.
6531
6532- bpo-44655: Include the name of the type in unset __slots__ attribute
6533  errors. Patch by Pablo Galindo
6534
6535- bpo-44655: Don't include a missing attribute with the same name as the
6536  failing one when offering suggestions for missing attributes. Patch by
6537  Pablo Galindo
6538
6539- bpo-44646: Fix the hash of the union type: it no longer depends on the
6540  order of arguments.
6541
6542- bpo-44636: Collapse union of equal types. E.g. the result of ``int | int``
6543  is now ``int``. Fix comparison of the union type with non-hashable
6544  objects. E.g. ``int | str == {}`` no longer raises a TypeError.
6545
6546- bpo-44611: On Windows, :func:`os.urandom`: uses BCryptGenRandom API
6547  instead of CryptGenRandom API which is deprecated from Microsoft Windows
6548  API. Patch by Dong-hee Na.
6549
6550- bpo-44635: Convert ``None`` to ``type(None)`` in the union type
6551  constructor.
6552
6553- bpo-26280: Implement adaptive specialization for BINARY_SUBSCR
6554
6555  Three specialized forms of BINARY_SUBSCR are added:
6556
6557  * BINARY_SUBSCR_LIST_INT
6558
6559  * BINARY_SUBSCR_TUPLE_INT
6560
6561  * BINARY_SUBSCR_DICT
6562
6563- bpo-44589: Mapping patterns in ``match`` statements with two or more equal
6564  literal keys will now raise a :exc:`SyntaxError` at compile-time.
6565
6566- bpo-44606: Fix ``__instancecheck__`` and ``__subclasscheck__`` for the
6567  union type.
6568
6569- bpo-42073: The ``@classmethod`` decorator can now wrap other
6570  classmethod-like descriptors.
6571
6572- bpo-41972: Tuned the string-searching algorithm of fastsearch.h to have a
6573  shorter inner loop for most cases.
6574
6575- bpo-44590: All necessary data for executing a Python function (local
6576  variables, stack, etc) is now kept in a per-thread stack. Frame objects
6577  are lazily allocated on demand. This increases performance by about 7% on
6578  the standard benchmark suite. Introspection and debugging are unaffected
6579  as frame objects are always available when needed. Patch by Mark Shannon.
6580
6581- bpo-44584: The threading debug (:envvar:`PYTHONTHREADDEBUG` environment
6582  variable) is deprecated in Python 3.10 and will be removed in Python 3.12.
6583  This feature requires a debug build of Python. Patch by Victor Stinner.
6584
6585- bpo-43895: An obsolete internal cache of shared object file handles added
6586  in 1995 that attempted, but did not guarantee, that a .so would not be
6587  dlopen'ed twice to work around flaws in mid-1990s posix-ish operating
6588  systems has been removed from dynload_shlib.c.
6589
6590- bpo-44490: :mod:`typing` now searches for type parameters in
6591  ``types.Union`` objects. ``get_type_hints`` will also properly resolve
6592  annotations with nested ``types.Union`` objects. Patch provided by Yurii
6593  Karabas.
6594
6595- bpo-43950: Code objects can now provide the column information for
6596  instructions when available. This is levaraged during traceback printing
6597  to show the expressions responsible for errors.
6598
6599  Contributed by Pablo Galindo, Batuhan Taskaya and Ammar Askar as part of
6600  :pep:`657`.
6601
6602- bpo-44562: Remove uses of :c:func:`PyObject_GC_Del` in error path when
6603  initializing :class:`types.GenericAlias`.
6604
6605- bpo-41486: Fix a memory consumption and copying performance regression in
6606  earlier 3.10 beta releases if someone used an output buffer larger than
6607  4GiB with zlib.decompress on input data that expands that large.
6608
6609- bpo-43908: Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can
6610  now inherit the :pep:`590` vectorcall protocol.  Previously, this was only
6611  possible for :ref:`static types <static-types>`.  Patch by Erlend E.
6612  Aasland.
6613
6614- bpo-44553: Implement GC methods for ``types.Union`` to break reference
6615  cycles and prevent memory leaks.
6616
6617- bpo-44490: Add ``__parameters__`` attribute and ``__getitem__`` operator
6618  to ``types.Union``. Patch provided by Yurii Karabas.
6619
6620- bpo-44523: Remove the pass-through for :func:`hash` of
6621  :class:`weakref.proxy` objects to prevent unintended consequences when the
6622  original referred object dies while the proxy is part of a hashable
6623  object. Patch by Pablo Galindo.
6624
6625- bpo-44483: Fix a crash in ``types.Union`` objects when creating a union of
6626  an object with bad ``__module__`` field.
6627
6628- bpo-44486: Modules will always have a dictionary, even when created by
6629  ``types.ModuleType.__new__()``
6630
6631- bpo-44472: Fix ltrace functionality when exceptions are raised. Patch by
6632  Pablo Galindo
6633
6634- bpo-12022: A :exc:`TypeError` is now raised instead of an
6635  :exc:`AttributeError` in :keyword:`with` and :keyword:`async with`
6636  statements for objects which do not support the :term:`context manager` or
6637  :term:`asynchronous context manager` protocols correspondingly.
6638
6639- bpo-44297: Make sure that the line number is set when entering a
6640  comprehension scope. Ensures that backtraces inclusing generator
6641  expressions show the correct line number.
6642
6643- bpo-44456: Improve the syntax error when mixing positional and keyword
6644  patterns. Patch by Pablo Galindo.
6645
6646- bpo-44409: Fix error location information for tokenizer errors raised on
6647  initialization of the tokenizer. Patch by Pablo Galindo.
6648
6649- bpo-44396: Fix a possible crash in the tokenizer when raising syntax
6650  errors for unclosed strings. Patch by Pablo Galindo.
6651
6652- bpo-44376: Exact integer exponentiation (like ``i**2`` or ``pow(i, 2)``)
6653  with a small exponent is much faster, due to reducing overhead in such
6654  cases.
6655
6656- bpo-44313: Directly imported objects and modules (through import and from
6657  import statements) don't generate ``LOAD_METHOD``/``CALL_METHOD`` for
6658  directly accessed objects on their namespace. They now use the regular
6659  ``LOAD_ATTR``/``CALL_FUNCTION``.
6660
6661- bpo-44338: Implement adaptive specialization for LOAD_GLOBAL
6662
6663  Two specialized forms of LOAD_GLOBAL are added:
6664
6665  * LOAD_GLOBAL_MODULE
6666
6667  * LOAD_GLOBAL_BUILTIN
6668
6669- bpo-44368: Improve syntax errors for invalid "as" targets. Patch by Pablo
6670  Galindo
6671
6672- bpo-44349: Fix an edge case when displaying text from files with encoding
6673  in syntax errors. Patch by Pablo Galindo.
6674
6675- bpo-44337: Initial implementation of adaptive specialization of LOAD_ATTR
6676
6677  Four specialized forms of LOAD_ATTR are added:
6678
6679  * LOAD_ATTR_SLOT
6680
6681  * LOAD_ATTR_SPLIT_KEYS
6682
6683  * LOAD_ATTR_WITH_HINT
6684
6685  * LOAD_ATTR_MODULE
6686
6687- bpo-44335: Fix a regression when identifying incorrect characters in
6688  syntax errors. Patch by Pablo Galindo
6689
6690- bpo-43693: Computation of the offsets of cell variables is done in the
6691  compiler instead of at runtime. This reduces the overhead of handling cell
6692  and free variables, especially in the case where a variable is both an
6693  argument and cell variable.
6694
6695- bpo-44317: Improve tokenizer error with improved locations. Patch by Pablo
6696  Galindo.
6697
6698- bpo-44304: Fix a crash in the :mod:`sqlite3` module that happened when the
6699  garbage collector clears :class:`sqlite.Statement` objects. Patch by Pablo
6700  Galindo
6701
6702- bpo-44305: Improve error message for ``try`` blocks without ``except`` or
6703  ``finally`` blocks. Patch by Pablo Galindo.
6704
6705- bpo-43413: Constructors of subclasses of some builtin classes (e.g.
6706  :class:`tuple`, :class:`list`, :class:`frozenset`) no longer accept
6707  arbitrary keyword arguments. [reverted in 3.11a4] Subclass of :class:`set`
6708  can now define a ``__new__()`` method with additional keyword parameters
6709  without overriding also ``__init__()``.
6710
6711- bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris.
6712  This issue does not affect other Solaris systems.
6713
6714- bpo-43693: A new opcode MAKE_CELL has been added that effectively moves
6715  some of the work done on function entry into the compiler and into the
6716  eval loop.  In addition to creating the required cell objects, the new
6717  opcode converts relevant arguments (and other locals) to cell variables on
6718  function entry.
6719
6720- bpo-44232: Fix a regression in :func:`type` when a metaclass raises an
6721  exception. The C function :c:func:`type_new` must properly report the
6722  exception when a metaclass constructor raises an exception and the winner
6723  class is not the metaclass. Patch by Victor Stinner.
6724
6725- bpo-44201: Avoid side effects of checking for specialized syntax errors in
6726  the REPL that was causing it to ask for extra tokens after a syntax error
6727  had been detected. Patch by Pablo Galindo
6728
6729- bpo-43693: ``PyCodeObject`` gained ``co_fastlocalnames`` and
6730  ``co_fastlocalkinds`` as the authoritative source of fast locals info.
6731  Marshaled code objects have changed accordingly.
6732
6733- bpo-44184: Fix a crash at Python exit when a deallocator function removes
6734  the last strong reference to a heap type. Patch by Victor Stinner.
6735
6736- bpo-44187: Implement quickening in the interpreter. This offers no
6737  advantages as yet, but is an enabler of future optimizations. See PEP 659
6738  for full explanation.
6739
6740- bpo-44180: The parser doesn't report generic syntax errors that happen in
6741  a position further away that the one it reached in the first pass. Patch
6742  by Pablo Galindo
6743
6744- bpo-44168: Fix error message in the parser involving keyword arguments
6745  with invalid expressions. Patch by Pablo Galindo
6746
6747- bpo-44156: String caches in ``compile.c`` are now subinterpreter
6748  compatible.
6749
6750- bpo-44143: Fixed a crash in the parser that manifest when raising
6751  tokenizer errors when an existing exception was present. Patch by Pablo
6752  Galindo.
6753
6754- bpo-44032: Move 'fast' locals and other variables from the frame object to
6755  a per-thread datastack.
6756
6757- bpo-44114: Fix incorrect dictkeys_reversed and dictitems_reversed function
6758  signatures in C code, which broke webassembly builds.
6759
6760- bpo-44110: Improve :func:`str.__getitem__` error message
6761
6762- bpo-26110: Add ``CALL_METHOD_KW`` opcode to speed up method calls with
6763  keyword arguments.  Idea originated from PyPy.  A side effect is executing
6764  ``CALL_METHOD`` is now branchless in the evaluation loop.
6765
6766- bpo-28307: Compiler now optimizes simple C-style formatting with literal
6767  format containing only format codes %s, %r and %a by converting them to
6768  f-string expressions.
6769
6770- bpo-43149: Correct the syntax error message regarding multiple exception
6771  types to not refer to "exception groups". Patch by Pablo Galindo
6772
6773- bpo-43822: The parser will prioritize tokenizer errors over custom syntax
6774  errors when raising exceptions. Patch by Pablo Galindo.
6775
6776- bpo-40222: "Zero cost" exception handling.
6777
6778  * Uses a lookup table to determine how to handle exceptions.
6779  * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating the runtime overhead of try statements.
6780  * Reduces the size of the frame object by about 60%.
6781
6782  Patch by Mark Shannon
6783
6784- bpo-43918: Document the signature and ``default`` argument in the
6785  docstring of the new ``anext`` builtin.
6786
6787- bpo-43833: Emit a deprecation warning if the numeric literal is
6788  immediately followed by one of keywords: and, else, for, if, in, is, or.
6789  Raise a syntax error with more informative message if it is immediately
6790  followed by other keyword or identifier.
6791
6792- bpo-43879: Add native_thread_id to PyThreadState. Patch by Gabriele N.
6793  Tornetta.
6794
6795- bpo-43693: Compute cell offsets relative to locals in compiler. Allows the
6796  interpreter to treats locals and cells a single array, which is slightly
6797  more efficient. Also make the LOAD_CLOSURE opcode an alias for LOAD_FAST.
6798  Preserving LOAD_CLOSURE helps keep bytecode a bit more readable.
6799
6800- bpo-17792: More accurate error messages for access of unbound locals or
6801  free vars.
6802
6803- bpo-28146: Fix a confusing error message in :func:`str.format`.
6804
6805- bpo-11105: When compiling :class:`ast.AST` objects with recursive
6806  references through :func:`compile`, the interpreter doesn't crash anymore
6807  instead it raises a :exc:`RecursionError`.
6808
6809- bpo-39091: Fix crash when using passing a non-exception to a generator's
6810  ``throw()`` method. Patch by Noah Oxer
6811
6812- bpo-33346: Asynchronous comprehensions are now allowed inside
6813  comprehensions in asynchronous functions.  Outer comprehensions implicitly
6814  become asynchronous.
6815
6816Library
6817-------
6818
6819- bpo-45371: Fix clang rpath issue in :mod:`distutils`. The UnixCCompiler
6820  now uses correct clang option to add a runtime library directory (rpath)
6821  to a shared library.
6822
6823- bpo-45329: Fix freed memory access in :class:`pyexpat.xmlparser` when
6824  building it with an installed expat library <= 2.2.0.
6825
6826- bpo-41710: On Unix, if the ``sem_clockwait()`` function is available in
6827  the C library (glibc 2.30 and newer), the :meth:`threading.Lock.acquire`
6828  method now uses the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the
6829  timeout, rather than using the system clock (:data:`time.CLOCK_REALTIME`),
6830  to not be affected by system clock changes. Patch by Victor Stinner.
6831
6832- bpo-1596321: Fix the :func:`threading._shutdown` function when the
6833  :mod:`threading` module was imported first from a thread different than
6834  the main thread: no longer log an error at Python exit.
6835
6836- bpo-45274: Fix a race condition in the :meth:`Thread.join()
6837  <threading.Thread.join>` method of the :mod:`threading` module. If the
6838  function is interrupted by a signal and the signal handler raises an
6839  exception, make sure that the thread remains in a consistent state to
6840  prevent a deadlock. Patch by Victor Stinner.
6841
6842- bpo-21302: In Unix operating systems, :func:`time.sleep` now uses the
6843  ``nanosleep()`` function, if ``clock_nanosleep()`` is not available but
6844  ``nanosleep()`` is available. ``nanosleep()`` allows to sleep with
6845  nanosecond precision.
6846
6847- bpo-21302: On Windows, :func:`time.sleep` now uses a waitable timer which
6848  has a resolution of 100 nanoseconds (10\ :sup:`-7` seconds). Previously,
6849  it had a resolution of 1 millisecond (10\ :sup:`-3` seconds). Patch by
6850  Benjamin Szőke and Victor Stinner.
6851
6852- bpo-45238: Fix :meth:`unittest.IsolatedAsyncioTestCase.debug`: it runs now
6853  asynchronous methods and callbacks.
6854
6855- bpo-36674: :meth:`unittest.TestCase.debug` raises now a
6856  :class:`unittest.SkipTest` if the class or the test method are decorated
6857  with the skipping decorator.
6858
6859- bpo-45235: Fix an issue where argparse would not preserve values in a
6860  provided namespace when using a subparser with defaults.
6861
6862- bpo-45183: Have zipimport.zipimporter.find_spec() not raise an exception
6863  when the underlying zip file has been deleted and the internal cache has
6864  been reset via invalidate_cache().
6865
6866- bpo-45234: Fixed a regression in :func:`~shutil.copyfile`,
6867  :func:`~shutil.copy`, :func:`~shutil.copy2` raising
6868  :exc:`FileNotFoundError` when source is a directory, which should raise
6869  :exc:`IsADirectoryError`
6870
6871- bpo-45228: Fix stack buffer overflow in parsing J1939 network address.
6872
6873- bpo-45225: use map function instead of genexpr in capwords.
6874
6875- bpo-42135: Fix typo: ``importlib.find_loader`` is really slated for
6876  removal in Python 3.12 not 3.10, like the others in PR 25169.
6877
6878  Patch by Hugo van Kemenade.
6879
6880- bpo-20524: Improves error messages on ``.format()`` operation for ``str``,
6881  ``float``, ``int``, and ``complex``. New format now shows the problematic
6882  pattern and the object type.
6883
6884- bpo-45168: Change :func:`dis.dis` output to omit op arg values that cannot
6885  be resolved due to ``co_consts``, ``co_names`` etc not being provided.
6886  Previously the oparg itself was repeated in the value field, which is not
6887  useful and can be confusing.
6888
6889- bpo-21302: In Unix operating systems, :func:`time.sleep` now uses the
6890  ``clock_nanosleep()`` function, if available, which allows to sleep for an
6891  interval specified with nanosecond precision.
6892
6893- bpo-45173: Remove from the :mod:`configparser` module: the
6894  :class:`SafeConfigParser` class, the :attr:`filename` property of the
6895  :class:`ParsingError` class, the :meth:`readfp` method of the
6896  :class:`ConfigParser` class, deprecated since Python 3.2.
6897
6898  Patch by Hugo van Kemenade.
6899
6900- bpo-44987: Pure ASCII strings are now normalized in constant time by
6901  :func:`unicodedata.normalize`. Patch by Dong-hee Na.
6902
6903- bpo-35474: Calling :func:`mimetypes.guess_all_extensions` with
6904  ``strict=False`` no longer affects the result of the following call with
6905  ``strict=True``. Also, mutating the returned list no longer affects the
6906  global state.
6907
6908- bpo-45166: :func:`typing.get_type_hints` now works with
6909  :data:`~typing.Final` wrapped in :class:`~typing.ForwardRef`.
6910
6911- bpo-45162: Remove many old deprecated :mod:`unittest` features:
6912
6913  * "``fail*``" and "``assert*``" aliases of :class:`~unittest.TestCase` methods.
6914  * Broken from start :class:`~unittest.TestCase` method ``assertDictContainsSubset()``.
6915  * Ignored :meth:`<unittest.TestLoader.loadTestsFromModule> TestLoader.loadTestsFromModule` parameter *use_load_tests*.
6916  * Old alias ``_TextTestResult`` of :class:`~unittest.TextTestResult`.
6917
6918- bpo-38371: Remove the deprecated ``split()`` method of
6919  :class:`_tkinter.TkappType`. Patch by Erlend E. Aasland.
6920
6921- bpo-20499: Improve the speed and accuracy of statistics.pvariance().
6922
6923- bpo-45132: Remove :meth:`__getitem__` methods of
6924  :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper`
6925  and :class:`fileinput.FileInput`, deprecated since Python 3.9.
6926
6927  Patch by Hugo van Kemenade.
6928
6929- bpo-45129: Due to significant security concerns, the *reuse_address*
6930  parameter of :meth:`asyncio.loop.create_datagram_endpoint`, disabled in
6931  Python 3.9, is now entirely removed. This is because of the behavior of
6932  the socket option ``SO_REUSEADDR`` in UDP.
6933
6934  Patch by Hugo van Kemenade.
6935
6936- bpo-45124: The ``bdist_msi`` command, deprecated in Python 3.9, is now
6937  removed.
6938
6939  Use ``bdist_wheel`` (wheel packages) instead.
6940
6941  Patch by Hugo van Kemenade.
6942
6943- bpo-30856: :class:`unittest.TestResult` methods
6944  :meth:`~unittest.TestResult.addFailure`,
6945  :meth:`~unittest.TestResult.addError`,
6946  :meth:`~unittest.TestResult.addSkip` and
6947  :meth:`~unittest.TestResult.addSubTest` are now called immediately after
6948  raising an exception in test or finishing a subtest. Previously they were
6949  called only after finishing the test clean up.
6950
6951- bpo-45034: Changes how error is formatted for ``struct.pack`` with ``'H'``
6952  and ``'h'`` modes and too large / small numbers. Now it shows the actual
6953  numeric limits, while previously it was showing arithmetic expressions.
6954
6955- bpo-25894: :mod:`unittest` now always reports skipped and failed subtests
6956  separately: separate characters in default mode and separate lines in
6957  verbose mode. Also the test description is now output for errors in test
6958  method, class and module cleanups.
6959
6960- bpo-45081: Fix issue when dataclasses that inherit from
6961  ``typing.Protocol`` subclasses have wrong ``__init__``. Patch provided by
6962  Yurii Karabas.
6963
6964- bpo-45085: The ``binhex`` module, deprecated in Python 3.9, is now
6965  removed. The following :mod:`binascii` functions, deprecated in Python
6966  3.9, are now also removed:
6967
6968  * ``a2b_hqx()``, ``b2a_hqx()``;
6969  * ``rlecode_hqx()``, ``rledecode_hqx()``.
6970
6971  The :func:`binascii.crc_hqx` function remains available.
6972
6973  Patch by Victor Stinner.
6974
6975- bpo-40360: The :mod:`lib2to3` package is now deprecated and may not be
6976  able to parse Python 3.10 or newer. See the :pep:`617` (New PEG parser for
6977  CPython). Patch by Victor Stinner.
6978
6979- bpo-45075: Rename :meth:`traceback.StackSummary.format_frame` to
6980  :meth:`traceback.StackSummary.format_frame_summary`. This method was added
6981  for 3.11 so it was not released yet.
6982
6983  Updated code and docs to better distinguish frame and FrameSummary.
6984
6985- bpo-31299: Add option to completely drop frames from a traceback by
6986  returning ``None`` from a :meth:`~traceback.StackSummary.format_frame`
6987  override.
6988
6989- bpo-41620: :meth:`~unittest.TestCase.run` now always return a
6990  :class:`~unittest.TestResult` instance. Previously it returned ``None`` if
6991  the test class or method was decorated with a skipping decorator.
6992
6993- bpo-45021: Fix a potential deadlock at shutdown of forked children when
6994  using :mod:`concurrent.futures` module
6995
6996- bpo-43913: Fix bugs in cleaning up classes and modules in :mod:`unittest`:
6997
6998  * Functions registered with :func:`~unittest.addModuleCleanup` were not called unless the user defines ``tearDownModule()`` in their test module.
6999  * Functions registered with :meth:`~unittest.TestCase.addClassCleanup` were not called if ``tearDownClass`` is set to ``None``.
7000  * Buffering in :class:`~unittest.TestResult` did not work with functions registered with ``addClassCleanup()`` and ``addModuleCleanup()``.
7001  * Errors in functions registered with ``addClassCleanup()`` and ``addModuleCleanup()`` were not handled correctly in buffered and debug modes.
7002  * Errors in ``setUpModule()`` and functions registered with ``addModuleCleanup()`` were reported in wrong order.
7003  * And several lesser bugs.
7004
7005- bpo-45030: Fix integer overflow in pickling and copying the range
7006  iterator.
7007
7008- bpo-45001: Made email date parsing more robust against malformed input,
7009  namely a whitespace-only ``Date:`` header. Patch by Wouter Bolsterlee.
7010
7011- bpo-45010: Remove support of special method ``__div__`` in
7012  :mod:`unittest.mock`. It is not used in Python 3.
7013
7014- bpo-39218: Improve accuracy of variance calculations by using ``x*x``
7015  instead of ``x**2``.
7016
7017- bpo-43613: Improve the speed of :func:`gzip.compress` and
7018  :func:`gzip.decompress` by compressing and decompressing at once in memory
7019  instead of in a streamed fashion.
7020
7021- bpo-37596: Ensure that :class:`set` and :class:`frozenset` objects are
7022  always :mod:`marshalled <marshal>` reproducibly.
7023
7024- bpo-44019: A new function ``operator.call`` has been added, such that
7025  ``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``.
7026
7027- bpo-42255: :class:`webbrowser.MacOSX` is deprecated and will be removed in
7028  Python 3.13. It is untested and undocumented and also not used by
7029  webbrowser itself. Patch by Dong-hee Na.
7030
7031- bpo-44955: Method :meth:`~unittest.TestResult.stopTestRun` is now always
7032  called in pair with method :meth:`~unittest.TestResult.startTestRun` for
7033  :class:`~unittest.TestResult` objects implicitly created in
7034  :meth:`~unittest.TestCase.run`. Previously it was not called for test
7035  methods and classes decorated with a skipping decorator.
7036
7037- bpo-39039: tarfile.open raises :exc:`~tarfile.ReadError` when a zlib error
7038  occurs during file extraction.
7039
7040- bpo-44935: :mod:`subprocess` on Solaris now also uses
7041  :func:`os.posix_spawn()` for better performance.
7042
7043- bpo-44911: :class:`~unittest.IsolatedAsyncioTestCase` will no longer throw
7044  an exception while cancelling leaked tasks. Patch by Bar Harel.
7045
7046- bpo-41322: Added ``DeprecationWarning`` for tests and async tests that
7047  return a value!=None (as this may indicate an improperly written test, for
7048  example a test written as a generator function).
7049
7050- bpo-44524: Make exception message more useful when subclass from typing
7051  special form alias. Patch provided by Yurii Karabas.
7052
7053- bpo-38956: :class:`argparse.BooleanOptionalAction`'s default value is no
7054  longer printed twice when used with
7055  :class:`argparse.ArgumentDefaultsHelpFormatter`.
7056
7057- bpo-44860: Fix the ``posix_user`` scheme in :mod:`sysconfig` to not depend
7058  on :data:`sys.platlibdir`.
7059
7060- bpo-44859: Improve error handling in :mod:`sqlite3` and raise more
7061  accurate exceptions.
7062
7063  * :exc:`MemoryError` is now raised instead of :exc:`sqlite3.Warning` when memory is not enough for encoding a statement to UTF-8 in ``Connection.__call__()`` and ``Cursor.execute()``.
7064  * :exc:`UnicodEncodeError` is now raised instead of :exc:`sqlite3.Warning` when the statement contains surrogate characters in ``Connection.__call__()`` and ``Cursor.execute()``.
7065  * :exc:`TypeError` is now raised instead of :exc:`ValueError` for non-string script argument in ``Cursor.executescript()``.
7066  * :exc:`ValueError` is now raised for script containing the null character instead of truncating it in ``Cursor.executescript()``.
7067  * Correctly handle exceptions raised when getting boolean value of the result of the progress handler.
7068  * Add many tests covering different corner cases.
7069
7070- bpo-44581: Upgrade bundled pip to 21.2.3 and setuptools to 57.4.0
7071
7072- bpo-44849: Fix the :func:`os.set_inheritable` function on FreeBSD 14 for
7073  file descriptor opened with the :data:`~os.O_PATH` flag: ignore the
7074  :data:`~errno.EBADF` error on ``ioctl()``, fallback on the ``fcntl()``
7075  implementation. Patch by Victor Stinner.
7076
7077- bpo-44605: The @functools.total_ordering() decorator now works with
7078  metaclasses.
7079
7080- bpo-44524: Fixed an issue wherein the ``__name__`` and ``__qualname__``
7081  attributes of subscribed specialforms could be ``None``.
7082
7083- bpo-44839: :class:`MemoryError` raised in user-defined functions will now
7084  produce a ``MemoryError`` in :mod:`sqlite3`. :class:`OverflowError` will
7085  now be converted to :class:`~sqlite3.DataError`. Previously
7086  :class:`~sqlite3.OperationalError` was produced in these cases.
7087
7088- bpo-44822: :mod:`sqlite3` user-defined functions and aggregators returning
7089  :class:`strings <str>` with embedded NUL characters are no longer
7090  truncated. Patch by Erlend E. Aasland.
7091
7092- bpo-44801: Ensure that the :class:`~typing.ParamSpec` variable in Callable
7093  can only be substituted with a parameters expression (a list of types, an
7094  ellipsis, ParamSpec or Concatenate).
7095
7096- bpo-44806: Non-protocol subclasses of :class:`typing.Protocol` ignore now
7097  the ``__init__`` method inherited from protocol base classes.
7098
7099- bpo-27275: :meth:`collections.OrderedDict.popitem` and
7100  :meth:`collections.OrderedDict.pop` no longer call ``__getitem__`` and
7101  ``__delitem__`` methods of the OrderedDict subclasses.
7102
7103- bpo-44793: Fix checking the number of arguments when subscribe a generic
7104  type with ``ParamSpec`` parameter.
7105
7106- bpo-44784: In importlib.metadata tests, override warnings behavior under
7107  expected DeprecationWarnings (importlib_metadata 4.6.3).
7108
7109- bpo-44667: The :func:`tokenize.tokenize` doesn't incorrectly generate a
7110  ``NEWLINE`` token if the source doesn't end with a new line character but
7111  the last line is a comment, as the function is already generating a ``NL``
7112  token. Patch by Pablo Galindo
7113
7114- bpo-44771: Added ``importlib.simple`` module implementing adapters from a
7115  low-level resources reader interface to a ``TraversableResources``
7116  interface. Legacy API (``path``, ``contents``, ...) is now supported
7117  entirely by the ``.files()`` API with a compatibility shim supplied for
7118  resource loaders without that functionality. Feature parity with
7119  ``importlib_resources`` 5.2.
7120
7121- bpo-44752: :mod:`rcompleter` does not call :func:`getattr` on
7122  :class:`property` objects to avoid the side-effect of  evaluating the
7123  corresponding method.
7124
7125- bpo-44747: Refactor usage of ``sys._getframe`` in ``typing`` module. Patch
7126  provided by Yurii Karabas.
7127
7128- bpo-42378: Fixes the issue with log file being overwritten when
7129  :class:`logging.FileHandler` is used in :mod:`atexit` with *filemode* set
7130  to ``'w'``. Note this will cause the message in *atexit* not being logged
7131  if the log stream is already closed due to shutdown of logging.
7132
7133- bpo-44720: ``weakref.proxy`` objects referencing non-iterators now raise
7134  ``TypeError`` rather than dereferencing the null ``tp_iternext`` slot and
7135  crashing.
7136
7137- bpo-44704: The implementation of ``collections.abc.Set._hash()`` now
7138  matches that of ``frozenset.__hash__()``.
7139
7140- bpo-44666: Fixed issue in :func:`compileall.compile_file` when
7141  ``sys.stdout`` is redirected. Patch by Stefan Hölzl.
7142
7143- bpo-44688: :meth:`sqlite3.Connection.create_collation` now accepts
7144  non-ASCII collation names. Patch by Erlend E. Aasland.
7145
7146- bpo-44690: Adopt *binacii.a2b_base64*'s strict mode in *base64.b64decode*.
7147
7148- bpo-42854: Fixed a bug in the :mod:`_ssl` module that was throwing
7149  :exc:`OverflowError` when using :meth:`_ssl._SSLSocket.write` and
7150  :meth:`_ssl._SSLSocket.read` for a big value of the ``len`` parameter.
7151  Patch by Pablo Galindo
7152
7153- bpo-44686: Replace ``unittest.mock._importer`` with
7154  ``pkgutil.resolve_name``.
7155
7156- bpo-44353: Make ``NewType.__call__`` faster by implementing it in C. Patch
7157  provided by Yurii Karabas.
7158
7159- bpo-44682: Change the :mod:`pdb` *commands* directive to disallow setting
7160  commands for an invalid breakpoint and to display an appropriate error.
7161
7162- bpo-44353: Refactor ``typing.NewType`` from function into callable class.
7163  Patch provided by Yurii Karabas.
7164
7165- bpo-44678: Added a separate error message for discontinuous padding in
7166  *binascii.a2b_base64* strict mode.
7167
7168- bpo-44524: Add missing ``__name__`` and ``__qualname__`` attributes to
7169  ``typing`` module classes. Patch provided by Yurii Karabas.
7170
7171- bpo-40897: Give priority to using the current class constructor in
7172  :func:`inspect.signature`. Patch by Weipeng Hong.
7173
7174- bpo-44638: Add a reference to the zipp project and hint as to how to use
7175  it.
7176
7177- bpo-44648: Fixed wrong error being thrown by :func:`inspect.getsource`
7178  when examining a class in the interactive session. Instead of
7179  :exc:`TypeError`, it should be :exc:`OSError` with appropriate error
7180  message.
7181
7182- bpo-44608: Fix memory leak in :func:`_tkinter._flatten` if it is called
7183  with a sequence or set, but not list or tuple.
7184
7185- bpo-44594: Fix an edge case of :class:`ExitStack` and
7186  :class:`AsyncExitStack` exception chaining.  They will now match ``with``
7187  block behavior when ``__context__`` is explicitly set to ``None`` when the
7188  exception is in flight.
7189
7190- bpo-42799: In :mod:`fnmatch`, the cache size for compiled regex patterns
7191  (:func:`functools.lru_cache`) was bumped up from 256 to 32768, affecting
7192  functions: :func:`fnmatch.fnmatch`, :func:`fnmatch.fnmatchcase`,
7193  :func:`fnmatch.filter`.
7194
7195- bpo-41928: Update :func:`shutil.copyfile` to raise
7196  :exc:`FileNotFoundError` instead of confusing :exc:`IsADirectoryError`
7197  when a path ending with a :const:`os.path.sep` does not exist;
7198  :func:`shutil.copy` and :func:`shutil.copy2` are also affected.
7199
7200- bpo-44569: Added the :func:`StackSummary.format_frame` function in
7201  :mod:`traceback`. This allows users to customize the way individual lines
7202  are formatted in tracebacks without re-implementing logic to handle
7203  recursive tracebacks.
7204
7205- bpo-44566: handle StopIteration subclass raised from
7206  @contextlib.contextmanager generator
7207
7208- bpo-44558: Make the implementation consistency of
7209  :func:`~operator.indexOf` between C and Python versions. Patch by Dong-hee
7210  Na.
7211
7212- bpo-41249: Fixes ``TypedDict`` to work with ``typing.get_type_hints()``
7213  and postponed evaluation of annotations across modules.
7214
7215- bpo-44554: Refactor argument processing in :func:`pdb.main` to simplify
7216  detection of errors in input loading and clarify behavior around module or
7217  script invocation.
7218
7219- bpo-34798: Break up paragraph about :class:`pprint.PrettyPrinter`
7220  construction parameters to make it easier to read.
7221
7222- bpo-44539: Added support for recognizing JPEG files without JFIF or Exif
7223  markers.
7224
7225- bpo-44461: Fix bug with :mod:`pdb`'s handling of import error due to a
7226  package which does not have a ``__main__`` module
7227
7228- bpo-43625: Fix a bug in the detection of CSV file headers by
7229  :meth:`csv.Sniffer.has_header` and improve documentation of same.
7230
7231- bpo-44516: Update vendored pip to 21.1.3
7232
7233- bpo-42892: Fixed an exception thrown while parsing a malformed multipart
7234  email by :class:`email.message.EmailMessage`.
7235
7236- bpo-44468: :func:`typing.get_type_hints` now finds annotations in classes
7237  and base classes with unexpected ``__module__``. Previously, it skipped
7238  those MRO elements.
7239
7240- bpo-44491: Allow clearing the :mod:`sqlite3` authorizer callback by
7241  passing :const:`None` to :meth:`~sqlite3.Connection.set_authorizer`. Patch
7242  by Erlend E. Aasland.
7243
7244- bpo-43977: Set the proper :const:`Py_TPFLAGS_MAPPING` and
7245  :const:`Py_TPFLAGS_SEQUENCE` flags for subclasses created before a parent
7246  has been registered as a :class:`collections.abc.Mapping` or
7247  :class:`collections.abc.Sequence`.
7248
7249- bpo-44482: Fix very unlikely resource leak in :mod:`glob` in alternate
7250  Python implementations.
7251
7252- bpo-44466: The :mod:`faulthandler` module now detects if a fatal error
7253  occurs during a garbage collector collection. Patch by Victor Stinner.
7254
7255- bpo-44471: A :exc:`TypeError` is now raised instead of an
7256  :exc:`AttributeError` in :meth:`contextlib.ExitStack.enter_context` and
7257  :meth:`contextlib.AsyncExitStack.enter_async_context` for objects which do
7258  not support the :term:`context manager` or :term:`asynchronous context
7259  manager` protocols correspondingly.
7260
7261- bpo-44404: :mod:`tkinter`'s ``after()`` method now supports callables
7262  without the ``__name__`` attribute.
7263
7264- bpo-41546: Make :mod:`pprint` (like the builtin ``print``) not attempt to
7265  write to ``stdout`` when it is ``None``.
7266
7267- bpo-44458: ``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking
7268  collisions when bz2, lmza or zlib are statically linked.
7269
7270- bpo-44464: Remove exception for flake8 in deprecated importlib.metadata
7271  interfaces. Sync with importlib_metadata 4.6.
7272
7273- bpo-44446: Take into account that ``lineno`` might be ``None`` in
7274  :class:`traceback.FrameSummary`.
7275
7276- bpo-44439: Fix in :meth:`bz2.BZ2File.write` / :meth:`lzma.LZMAFile.write`
7277  methods, when the input data is an object that supports the buffer
7278  protocol, the file length may be wrong.
7279
7280- bpo-44434: _thread.start_new_thread() no longer calls
7281  PyThread_exit_thread() explicitly at the thread exit, the call was
7282  redundant. On Linux with the glibc, pthread_exit() aborts the whole
7283  process if dlopen() fails to open libgcc_s.so file (ex: EMFILE error).
7284  Patch by Victor Stinner.
7285
7286- bpo-42972: The _thread.RLock type now fully implement the GC protocol: add
7287  a traverse function and the :const:`Py_TPFLAGS_HAVE_GC` flag. Patch by
7288  Victor Stinner.
7289
7290- bpo-44422: The :func:`threading.enumerate` function now uses a reentrant
7291  lock to prevent a hang on reentrant call. Patch by Victor Stinner.
7292
7293- bpo-38291: Importing typing.io or typing.re now prints a
7294  ``DeprecationWarning``.
7295
7296- bpo-37880: argparse actions store_const and append_const each receive a
7297  default value of None when the ``const`` kwarg is not provided.
7298  Previously, this raised a :exc:`TypeError`.
7299
7300- bpo-44389: Fix deprecation of :data:`ssl.OP_NO_TLSv1_3`
7301
7302- bpo-27827: :meth:`pathlib.PureWindowsPath.is_reserved` now identifies a
7303  greater range of reserved filenames, including those with trailing spaces
7304  or colons.
7305
7306- bpo-44395: Fix :meth:`~email.message.MIMEPart.as_string` to pass unixfrom
7307  properly. Patch by Dong-hee Na.
7308
7309- bpo-34266: Handle exceptions from parsing the arg of :mod:`pdb`'s
7310  run/restart command.
7311
7312- bpo-44362: Improve :mod:`ssl` module's deprecation messages, error
7313  reporting, and documentation for deprecations.
7314
7315- bpo-44342: [Enum] Change pickling from by-value to by-name.
7316
7317- bpo-44356: [Enum] Allow multiple data-type mixins if they are all the
7318  same.
7319
7320- bpo-44351: Restore back :func:`parse_makefile` in
7321  :mod:`distutils.sysconfig` because it behaves differently than the similar
7322  implementation in :mod:`sysconfig`.
7323
7324- bpo-35800: :class:`smtpd.MailmanProxy` is now removed as it is unusable
7325  without an external module, ``mailman``. Patch by Dong-hee Na.
7326
7327- bpo-44357: Added a function that returns cube root of the given number
7328  :func:`math.cbrt`
7329
7330- bpo-44339: Change ``math.pow(±0.0, -math.inf)`` to return ``inf`` instead
7331  of raising ``ValueError``. This brings the special-case handling of
7332  ``math.pow`` into compliance with the IEEE 754 standard.
7333
7334- bpo-44242: Remove missing flag check from Enum creation and move into a
7335  ``verify`` decorator.
7336
7337- bpo-44246: In ``importlib.metadata``, restore compatibility in the result
7338  from ``Distribution.entry_points`` (``EntryPoints``) to honor expectations
7339  in older implementations and issuing deprecation warnings for these cases:
7340  A. ``EntryPoints`` objects are once again mutable, allowing   for
7341  ``sort()`` and other list-based mutation operations.   Avoid deprecation
7342  warnings by casting to a   mutable sequence (e.g.
7343  ``list(dist.entry_points).sort()``). B. ``EntryPoints`` results once again
7344  allow   for access by index. To avoid deprecation warnings,   cast the
7345  result to a Sequence first   (e.g. ``tuple(dist.entry_points)[0]``).
7346
7347- bpo-44246: In importlib.metadata.entry_points, de-duplication of
7348  distributions no longer requires loading the full metadata for
7349  PathDistribution objects, improving entry point loading performance by
7350  ~10x.
7351
7352- bpo-43858: Added a function that returns a copy of a dict of logging
7353  levels: :func:`logging.getLevelNamesMapping`
7354
7355- bpo-44260: The :class:`random.Random` constructor no longer reads system
7356  entropy without need.
7357
7358- bpo-44254: On Mac, give turtledemo button text a color that works on both
7359  light or dark background.  Programmers cannot control the latter.
7360
7361- bpo-44258: Support PEP 515 for Fraction's initialization from string.
7362
7363- bpo-44235: Remove deprecated functions in the :mod:`gettext`. Patch by
7364  Dong-hee Na.
7365
7366- bpo-38693: Prefer f-strings to ``.format`` in importlib.resources.
7367
7368- bpo-33693: Importlib.metadata now prefers f-strings to .format.
7369
7370- bpo-44241: Incorporate minor tweaks from importlib_metadata 4.1:
7371  SimplePath protocol, support for Metadata 2.2.
7372
7373- bpo-43216: Remove the :func:`@asyncio.coroutine <asyncio.coroutine>`
7374  :term:`decorator` enabling legacy generator-based coroutines to be
7375  compatible with async/await code; remove
7376  :class:`asyncio.coroutines.CoroWrapper` used for wrapping legacy coroutine
7377  objects in the debug mode. The decorator has been deprecated since Python
7378  3.8 and the removal was initially scheduled for Python 3.10. Patch by
7379  Illia Volochii.
7380
7381- bpo-44210: Make importlib.metadata._meta.PackageMetadata public.
7382
7383- bpo-43643: Declare readers.MultiplexedPath.name as a property per the
7384  spec.
7385
7386- bpo-27334: The :mod:`sqlite3` context manager now performs a rollback
7387  (thus releasing the database lock) if commit failed.  Patch by Luca Citi
7388  and Erlend E. Aasland.
7389
7390- bpo-4928: Documented existing behavior on POSIX: NamedTemporaryFiles are
7391  not deleted when creating process is killed with SIGKILL
7392
7393- bpo-44154: Optimize :class:`fractions.Fraction` pickling for large
7394  components.
7395
7396- bpo-33433: For IPv4 mapped IPv6 addresses (:rfc:`4291` Section 2.5.5.2),
7397  the :mod:`ipaddress.IPv6Address.is_private` check is deferred to the
7398  mapped IPv4 address. This solves a bug where public mapped IPv4 addresses
7399  were considered private by the IPv6 check.
7400
7401- bpo-44150: Add optional *weights* argument to statistics.fmean().
7402
7403- bpo-44142: :func:`ast.unparse` will now drop the redundant parentheses
7404  when tuples used as assignment targets (e.g in for loops).
7405
7406- bpo-44145: :mod:`hmac` computations were not releasing the GIL while
7407  calling the OpenSSL ``HMAC_Update`` C API (a new feature in 3.9).  This
7408  unintentionally prevented parallel computation as other :mod:`hashlib`
7409  algorithms support.
7410
7411- bpo-44095: :class:`zipfile.Path` now supports :attr:`zipfile.Path.stem`,
7412  :attr:`zipfile.Path.suffixes`, and :attr:`zipfile.Path.suffix` attributes.
7413
7414- bpo-44077: It's now possible to receive the type of service (ToS), a.k.a.
7415  differentiated services (DS), a.k.a. differentiated services code point
7416  (DSCP) and explicit congestion notification (ECN) IP header fields with
7417  ``socket.IP_RECVTOS``.
7418
7419- bpo-37788: Fix a reference leak when a Thread object is never joined.
7420
7421- bpo-38908: Subclasses of ``typing.Protocol`` which only have data
7422  variables declared will now raise a ``TypeError`` when checked with
7423  ``isinstance`` unless they are decorated with :func:`runtime_checkable`.
7424  Previously, these checks passed silently. Patch provided by Yurii Karabas.
7425
7426- bpo-44098: ``typing.ParamSpec`` will no longer be found in the
7427  ``__parameters__`` of most :mod:`typing` generics except in valid use
7428  locations specified by :pep:`612`. This prevents incorrect usage like
7429  ``typing.List[P][int]``. This change means incorrect usage which may have
7430  passed silently in 3.10 beta 1 and earlier will now error.
7431
7432- bpo-44089: Allow subclassing ``csv.Error`` in 3.10 (it was allowed in 3.9
7433  and earlier but was disallowed in early versions of 3.10).
7434
7435- bpo-44081: :func:`ast.unparse` now doesn't use redundant spaces to
7436  separate ``lambda`` and the ``:`` if there are no parameters.
7437
7438- bpo-44061: Fix regression in previous release when calling
7439  :func:`pkgutil.iter_modules` with a list of :class:`pathlib.Path` objects
7440
7441- bpo-44059: Register the SerenityOS Browser in the :mod:`webbrowser`
7442  module.
7443
7444- bpo-36515: The :mod:`hashlib` module no longer does unaligned memory
7445  accesses when compiled for ARM platforms.
7446
7447- bpo-40465: Remove random module features deprecated in Python 3.9.
7448
7449- bpo-44018: random.seed() no longer mutates bytearray inputs.
7450
7451- bpo-38352: Add ``IO``, ``BinaryIO``, ``TextIO``, ``Match``, and
7452  ``Pattern`` to ``typing.__all__``. Patch by Jelle Zijlstra.
7453
7454- bpo-44002: :mod:`urllib.parse` now uses :func:`functool.lru_cache` for its
7455  internal URL splitting and quoting caches instead of rolling its own like
7456  its the '90s.
7457
7458  The undocumented internal :mod:`urllib.parse` ``Quoted`` class API is now
7459  deprecated, for removal in 3.14.
7460
7461- bpo-43972: When :class:`http.server.SimpleHTTPRequestHandler` sends a
7462  ``301 (Moved Permanently)`` for a directory path not ending with `/`, add
7463  a ``Content-Length: 0`` header. This improves the behavior for certain
7464  clients.
7465
7466- bpo-28528: Fix a bug in :mod:`pdb` where :meth:`~pdb.Pdb.checkline` raises
7467  :exc:`AttributeError` if it is called after :meth:`~pdb.Pdb.reset`.
7468
7469- bpo-43853: Improved string handling for :mod:`sqlite3` user-defined
7470  functions and aggregates:
7471
7472  * It is now possible to pass strings with embedded null characters to UDFs
7473  * Conversion failures now correctly raise :exc:`MemoryError`
7474
7475  Patch by Erlend E. Aasland.
7476
7477- bpo-43666: AIX: `Lib/_aix_support.get_platform()` may fail in an AIX WPAR.
7478  The fileset bos.rte appears to have a builddate in both LPAR and WPAR so
7479  this fileset is queried rather than bos.mp64. To prevent a similar
7480  situation (no builddate in ODM) a value (9988) sufficient for completing a
7481  build is provided. Patch by M Felt.
7482
7483- bpo-43650: Fix :exc:`MemoryError` in :func:`shutil.unpack_archive` which
7484  fails inside :func:`shutil._unpack_zipfile` on large files. Patch by Igor
7485  Bolshakov.
7486
7487- bpo-43612: :func:`zlib.compress` now accepts a wbits parameter which
7488  allows users to compress data as a raw deflate block without zlib headers
7489  and trailers in one go. Previously this required instantiating a
7490  ``zlib.compressobj``. It also provides a faster alternative to
7491  ``gzip.compress`` when wbits=31 is used.
7492
7493- bpo-43392: :func:`importlib._bootstrap._find_and_load` now implements a
7494  two-step check to avoid locking when modules have been already imported
7495  and are ready. This improves performance of repeated calls to
7496  :func:`importlib.import_module` and :func:`importlib.__import__`.
7497
7498- bpo-43318: Fix a bug where :mod:`pdb` does not always echo cleared
7499  breakpoints.
7500
7501- bpo-43234: Prohibit passing
7502  non-:class:`concurrent.futures.ThreadPoolExecutor` executors to
7503  :meth:`loop.set_default_executor` following a deprecation in Python 3.8.
7504  Patch by Illia Volochii.
7505
7506- bpo-43232: Prohibit previously deprecated potentially disruptive
7507  operations on :class:`asyncio.trsock.TransportSocket`. Patch by Illia
7508  Volochii.
7509
7510- bpo-30077: Added support for Apple's aifc/sowt pseudo-compression
7511
7512- bpo-42971: Add definition of ``errno.EQFULL`` for platforms that define
7513  this constant (such as macOS).
7514
7515- bpo-43086: Added a new optional :code:`strict_mode` parameter to
7516  *binascii.a2b_base64*. When :code:`scrict_mode` is set to :code:`True`,
7517  the *a2b_base64* function will accept only valid base64 content. More
7518  details about what "valid base64 content" is, can be found in the
7519  function's documentation.
7520
7521- bpo-43024: Improve the help signature of
7522  :func:`traceback.print_exception`, :func:`traceback.format_exception` and
7523  :func:`traceback.format_exception_only`.
7524
7525- bpo-33809: Add the :meth:`traceback.TracebackException.print` method which
7526  prints the formatted exception information.
7527
7528- bpo-42862: :mod:`sqlite3` now utilizes :meth:`functools.lru_cache` to
7529  implement the connection statement cache. As a small optimisation, the
7530  default statement cache size has been increased from 100 to 128. Patch by
7531  Erlend E. Aasland.
7532
7533- bpo-41818: Soumendra Ganguly: add termios.tcgetwinsize(),
7534  termios.tcsetwinsize().
7535
7536- bpo-40497: :meth:`subprocess.check_output` now raises :exc:`ValueError`
7537  when the invalid keyword argument *check* is passed by user code.
7538  Previously such use would fail later with a :exc:`TypeError`. Patch by
7539  Rémi Lapeyre.
7540
7541- bpo-37449: ``ensurepip`` now uses ``importlib.resources.files()``
7542  traversable APIs
7543
7544- bpo-40956: Use Argument Clinic in :mod:`sqlite3`.  Patches by Erlend E.
7545  Aasland.
7546
7547- bpo-41730: ``DeprecationWarning`` is now raised when importing
7548  :mod:`tkinter.tix`, which has been deprecated in documentation since
7549  Python 3.6.
7550
7551- bpo-20684: Remove unused ``_signature_get_bound_param`` function from
7552  :mod:`inspect` - by Anthony Sottile.
7553
7554- bpo-41402: Fix :meth:`email.message.EmailMessage.set_content` when called
7555  with binary data and ``7bit`` content transfer encoding.
7556
7557- bpo-32695: The *compresslevel* and *preset* keyword arguments of
7558  :func:`tarfile.open` are now both documented and tested.
7559
7560- bpo-41137: Use utf-8 encoding while reading .pdbrc files. Patch by
7561  Srinivas Reddy Thatiparthy
7562
7563- bpo-24391: Improved reprs of :mod:`threading` synchronization objects:
7564  :class:`~threading.Semaphore`, :class:`~threading.BoundedSemaphore`,
7565  :class:`~threading.Event` and :class:`~threading.Barrier`.
7566
7567- bpo-5846: Deprecated the following :mod:`unittest` functions, scheduled
7568  for removal in Python 3.13:
7569
7570  * :func:`~unittest.findTestCases`
7571  * :func:`~unittest.makeSuite`
7572  * :func:`~unittest.getTestCaseNames`
7573
7574  Use :class:`~unittest.TestLoader` methods instead:
7575
7576  * :meth:`unittest.TestLoader.loadTestsFromModule`
7577  * :meth:`unittest.TestLoader.loadTestsFromTestCase`
7578  * :meth:`unittest.TestLoader.getTestCaseNames`
7579
7580  Patch by Erlend E. Aasland.
7581
7582- bpo-40563: Support pathlike objects on dbm/shelve. Patch by Hakan Çelik
7583  and Henry-Joseph Audéoud.
7584
7585- bpo-34990: Fixed a Y2k38 bug in the compileall module where it would fail
7586  to compile files with a modification time after the year 2038.
7587
7588- bpo-39549: Whereas the code for reprlib.Repr had previously used a
7589  hardcoded string value of '...', this PR updates it to use of a
7590  “fillvalue” attribute, whose value defaults to '...' and can be reset in
7591  either individual reprlib.Repr instances or in subclasses thereof.
7592
7593- bpo-37022: :mod:`pdb` now displays exceptions from ``repr()`` with its
7594  ``p`` and ``pp`` commands.
7595
7596- bpo-38840: Fix ``test___all__`` on platforms lacking a shared memory
7597  implementation.
7598
7599- bpo-39359: Add one missing check that the password is a bytes object for
7600  an encrypted zipfile.
7601
7602- bpo-38741: :mod:`configparser`: using ']' inside a section header will no
7603  longer cut the section name short at the ']'
7604
7605- bpo-38415: Added missing behavior to
7606  :func:`contextlib.asynccontextmanager` to match
7607  :func:`contextlib.contextmanager` so decorated functions can themselves be
7608  decorators.
7609
7610- bpo-30256: Pass multiprocessing BaseProxy argument ``manager_owned``
7611  through AutoProxy.
7612
7613- bpo-27513: :func:`email.utils.getaddresses` now accepts
7614  :class:`email.header.Header` objects along with string values. Patch by
7615  Zackery Spytz.
7616
7617- bpo-16379: Add SQLite error code and name to :mod:`sqlite3` exceptions.
7618  Patch by Aviv Palivoda, Daniel Shahaf, and Erlend E. Aasland.
7619
7620- bpo-26228: pty.spawn no longer hangs on FreeBSD, macOS, and Solaris.
7621
7622- bpo-33349: lib2to3 now recognizes async generators everywhere.
7623
7624- bpo-29298: Fix ``TypeError`` when required subparsers without ``dest`` do
7625  not receive arguments. Patch by Anthony Sottile.
7626
7627Documentation
7628-------------
7629
7630- bpo-45216: Remove extra documentation listing methods in ``difflib``. It
7631  was rendering twice in pydoc and was outdated in some places.
7632
7633- bpo-45024: :mod:`collections.abc` documentation has been expanded to
7634  explicitly cover how instance and subclass checks work, with additional
7635  doctest examples and an exhaustive list of ABCs which test membership
7636  purely by presence of the right :term:`special method`\s. Patch by Raymond
7637  Hettinger.
7638
7639- bpo-44957: Promote PEP 604 union syntax by using it where possible. Also,
7640  mention ``X | Y`` more prominently in section about ``Union`` and mention
7641  ``X | None`` at all in section about ``Optional``.
7642
7643- bpo-16580: Added code equivalents for the :meth:`int.to_bytes` and
7644  :meth:`int.from_bytes` methods, as well as tests ensuring that these code
7645  equivalents are valid.
7646
7647- bpo-44903: Removed the othergui.rst file, any references to it, and the
7648  list of GUI frameworks in the FAQ. In their place I've added links to the
7649  Python Wiki `page on GUI frameworks
7650  <https://wiki.python.org/moin/GuiProgramming>`.
7651
7652- bpo-33479: Tkinter documentation has been greatly expanded with new
7653  "Architecture" and "Threading model" sections.
7654
7655- bpo-36700: :mod:`base64` RFC references were updated to point to
7656  :rfc:`4648`; a section was added to point users to the new "security
7657  considerations" section of the RFC.
7658
7659- bpo-44740: Replaced occurrences of uppercase "Web" and "Internet" with
7660  lowercase versions per the 2016 revised Associated Press Style Book.
7661
7662- bpo-44693: Update the definition of __future__ in the glossary by
7663  replacing the confusing word "pseudo-module" with a more accurate
7664  description.
7665
7666- bpo-35183: Add typical examples to os.path.splitext docs
7667
7668- bpo-30511: Clarify that :func:`shutil.make_archive` is not thread-safe due
7669  to reliance on changing the current working directory.
7670
7671- bpo-44561: Update of three expired hyperlinks in
7672  Doc/distributing/index.rst: "Project structure", "Building and packaging
7673  the project", and "Uploading the project to the Python Packaging Index".
7674
7675- bpo-44651: Delete entry "coercion" in Doc/glossary.rst for its outdated
7676  definition.
7677
7678- bpo-42958: Updated the docstring and docs of :func:`filecmp.cmp` to be
7679  more accurate and less confusing especially in respect to *shallow* arg.
7680
7681- bpo-44631: Refactored the ``repr()`` code of the ``_Environ`` (os module).
7682
7683- bpo-44613: importlib.metadata is no longer provisional.
7684
7685- bpo-44558: Match the docstring and python implementation of
7686  :func:`~operator.countOf` to the behavior of its c implementation.
7687
7688- bpo-44544: List all kwargs for :func:`textwrap.wrap`,
7689  :func:`textwrap.fill`, and :func:`textwrap.shorten`. Now, there are nav
7690  links to attributes of :class:`TextWrap`, which makes navigation much
7691  easier while minimizing duplication in the documentation.
7692
7693- bpo-38062: Clarify that atexit uses equality comparisons internally.
7694
7695- bpo-40620: Convert examples in tutorial controlflow.rst section 4.3 to be
7696  interpreter-demo style.
7697
7698- bpo-43066: Added a warning to :mod:`zipfile` docs: filename arg with a
7699  leading slash may cause archive to be un-openable on Windows systems.
7700
7701- bpo-39452: Rewrote ``Doc/library/__main__.rst``. Broadened scope of the
7702  document to explicitly discuss and differentiate between ``__main__.py``
7703  in packages versus the ``__name__ == '__main__'`` expression (and the
7704  idioms that surround it).
7705
7706- bpo-13814: In the Design FAQ, answer "Why don't generators support the
7707  with statement?"
7708
7709- bpo-27752: Documentation of csv.Dialect is more descriptive.
7710
7711- bpo-44453: Fix documentation for the return type of
7712  :func:`sysconfig.get_path`.
7713
7714- bpo-44392: Added a new section in the C API documentation for types used
7715  in type hinting.  Documented ``Py_GenericAlias`` and
7716  ``Py_GenericAliasType``.
7717
7718- bpo-38291: Mark ``typing.io`` and ``typing.re`` as deprecated since Python
7719  3.8 in the documentation. They were never properly supported by type
7720  checkers.
7721
7722- bpo-44322: Document that SyntaxError args have a details tuple and that
7723  details are adjusted for errors in f-string field replacement expressions.
7724
7725- bpo-42392: Document the deprecation and removal of the ``loop`` parameter
7726  for many functions and classes in :mod:`asyncio`.
7727
7728- bpo-44195: Corrected references to ``TraversableResources`` in docs. There
7729  is no ``TraversableReader``.
7730
7731- bpo-41963: Document that ``ConfigParser`` strips off comments when reading
7732  configuration files.
7733
7734- bpo-44072: Correct where in the numeric ABC hierarchy ``**`` support is
7735  added, i.e., in numbers.Complex, not numbers.Integral.
7736
7737- bpo-43558: Add the remark to :mod:`dataclasses` documentation that the
7738  :meth:`__init__` of any base class has to be called in
7739  :meth:`__post_init__`, along with a code example.
7740
7741- bpo-44025: Clarify when '_' in match statements is a keyword, and when
7742  not.
7743
7744- bpo-41706: Fix docs about how methods like ``__add__`` are invoked when
7745  evaluating operator expressions.
7746
7747- bpo-41621: Document that :class:`collections.defaultdict` parameter
7748  ``default_factory`` defaults to None and is positional-only.
7749
7750- bpo-41576: document BaseException in favor of bare except
7751
7752- bpo-21760: The description for __file__ fixed. Patch by Furkan Onder
7753
7754- bpo-39498: Add a "Security Considerations" index which links to standard
7755  library modules that have explicitly documented security considerations.
7756
7757- bpo-33479: Remove the unqualified claim that tkinter is threadsafe. It has
7758  not been true for several years and likely never was. An explanation of
7759  what is true may be added later, after more discussion, and possibly after
7760  patching _tkinter.c,
7761
7762Tests
7763-----
7764
7765- bpo-40173: Fix :func:`test.support.import_helper.import_fresh_module`.
7766
7767- bpo-45280: Add a test case for empty :class:`typing.NamedTuple`.
7768
7769- bpo-45269: Cover case when invalid ``markers`` type is supplied to
7770  ``c_make_encoder``.
7771
7772- bpo-45128: Fix ``test_multiprocessing_fork`` failure due to
7773  ``test_logging`` and ``sys.modules`` manipulation.
7774
7775- bpo-45209: Fix ``UserWarning: resource_tracker`` warning in
7776  ``_test_multiprocessing._TestSharedMemory.test_shared_memory_cleaned_after_process_termination``
7777
7778- bpo-45185: Enables ``TestEnumerations`` test cases in ``test_ssl`` suite.
7779
7780- bpo-45195: Fix test_readline.test_nonascii(): sometimes, the newline
7781  character is not written at the end, so don't expect it in the output.
7782  Patch by Victor Stinner.
7783
7784- bpo-45156: Fixes infinite loop on :func:`unittest.mock.seal` of mocks
7785  created by :func:`~unittest.create_autospec`.
7786
7787- bpo-45125: Improves pickling tests and docs of ``SharedMemory`` and
7788  ``SharableList`` objects.
7789
7790- bpo-44860: Update ``test_sysconfig.test_user_similar()`` for the
7791  posix_user scheme: ``platlib`` doesn't use :data:`sys.platlibdir`. Patch
7792  by Victor Stinner.
7793
7794- bpo-45052: ``WithProcessesTestSharedMemory.test_shared_memory_basics``
7795  test was ignored, because ``self.assertEqual(sms.size, sms2.size)`` line
7796  was failing. It is now removed and test is unskipped.
7797
7798  The main motivation for this line to be removed from the test is that the
7799  ``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
7800  decided by the platform.
7801
7802- bpo-44895: libregrtest now clears the type cache later to reduce the risk
7803  of false alarm when checking for reference leaks. Previously, the type
7804  cache was cleared too early and libregrtest raised a false alarm about
7805  reference leaks under very specific conditions. Patch by Irit Katriel and
7806  Victor Stinner.
7807
7808- bpo-45042: Fixes that test classes decorated with
7809  ``@hashlib_helper.requires_hashdigest`` were skipped all the time.
7810
7811- bpo-25130: Add calls of :func:`gc.collect` in tests to support PyPy.
7812
7813- bpo-45011: Made tests relying on the :mod:`_asyncio` C extension module
7814  optional to allow running on alternative Python implementations. Patch by
7815  Serhiy Storchaka.
7816
7817- bpo-44949: Fix auto history tests of test_readline: sometimes, the newline
7818  character is not written at the end, so don't expect it in the output.
7819
7820- bpo-44891: Tests were added to clarify :func:`id` is preserved when ``obj
7821  * 1`` is used on :class:`str` and :class:`bytes` objects. Patch by Nikita
7822  Sobolev.
7823
7824- bpo-44852: Add ability to wholesale silence DeprecationWarnings while
7825  running the regression test suite.
7826
7827- bpo-40928: Notify users running test_decimal regression tests on macOS of
7828  potential harmless "malloc can't allocate region" messages spewed by
7829  test_decimal.
7830
7831- bpo-44734: Fixed floating point precision issue in turtle tests.
7832
7833- bpo-44708: Regression tests, when run with -w, are now re-running only the
7834  affected test methods instead of re-running the entire test file.
7835
7836- bpo-42095: Added interop tests for Apple plists: generate plist files with
7837  Python plistlib and parse with Apple plutil; and the other way round.
7838
7839- bpo-44647: Added a permanent Unicode-valued environment variable to
7840  regression tests to ensure they handle this use case in the future. If
7841  your test environment breaks because of that, report a bug to us, and
7842  temporarily set PYTHONREGRTEST_UNICODE_GUARD=0 in your test environment.
7843
7844- bpo-44515: Adjust recently added contextlib tests to avoid assuming the
7845  use of a refcounted GC
7846
7847- bpo-44287: Fix asyncio test_popen() of test_windows_utils by using a
7848  longer timeout. Use military grade battle-tested
7849  :data:`test.support.SHORT_TIMEOUT` timeout rather than a hardcoded timeout
7850  of 10 seconds: it's 30 seconds by default, but it is made longer on slow
7851  buildbots. Patch by Victor Stinner.
7852
7853- bpo-44451: Reset ``DeprecationWarning`` filters in
7854  ``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index``
7855  to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored.
7856
7857- bpo-44363: Account for address sanitizer in test_capi. test_capi now
7858  passes when run GCC address sanitizer.
7859
7860- bpo-44364: Add non integral tests for :func:`math.sqrt` function.
7861
7862- bpo-43921: Fix test_ssl.test_wrong_cert_tls13(): use
7863  ``suppress_ragged_eofs=False``, since ``read()`` can raise
7864  :exc:`ssl.SSLEOFError` on Windows. Patch by Victor Stinner.
7865
7866- bpo-43921: Fix test_pha_required_nocert() of test_ssl: catch two more EOF
7867  cases (when the ``recv()`` method returns an empty string). Patch by
7868  Victor Stinner.
7869
7870- bpo-44131: Add test_frozenmain to test_embed to test the
7871  :c:func:`Py_FrozenMain` C function. Patch by Victor Stinner.
7872
7873- bpo-31904: Ignore error string case in test_file_not_exists().
7874
7875- bpo-42083: Add test to check that ``PyStructSequence_NewType`` accepts a
7876  ``PyStructSequence_Desc`` with ``doc`` field set to ``NULL``.
7877
7878- bpo-35753: Fix crash in doctest when doctest parses modules that include
7879  unwrappable functions by skipping those functions.
7880
7881- bpo-30256: Add test for nested queues when using ``multiprocessing``
7882  shared objects ``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy``
7883
7884Build
7885-----
7886
7887- bpo-45220: Avoid building with the Windows 11 SDK previews automatically.
7888  This may be overridden by setting the ``DefaultWindowsSDKVersion``
7889  environment variable before building.
7890
7891- bpo-45020: Freeze stdlib modules that are imported during startup.  This
7892  provides significant performance improvements to startup.  If necessary,
7893  use the previously added "-X frozen_modules=off" commandline option to
7894  force importing the source modules.
7895
7896- bpo-45188: Windows builds now regenerate frozen modules as the first part
7897  of the build. Previously the regeneration was later in the build, which
7898  would require it to be restarted if any modules had changed.
7899
7900- bpo-45163: Fixes Haiku platform build.
7901
7902- bpo-45067: The ncurses function extended_color_content was introduced in
7903  2017
7904
7905  (https://invisible-island.net/ncurses/NEWS.html#index-t20170401).  The
7906
7907  ncurses-devel package in CentOS 7 had a older version ncurses resulted in
7908  compilation error.  For compiling ncurses with extended color support, we
7909  verify the version of the ncurses library >= 20170401.
7910
7911- bpo-45019: Generate lines in relevant files for frozen modules.  Up until
7912  now each of the files had to be edited manually.  This change makes it
7913  easier to add to and modify the frozen modules.
7914
7915- bpo-44340: Add support for building with clang thin lto via
7916  --with-lto=thin/full. Patch by Dong-hee Na and Brett Holman.
7917
7918- bpo-44535: Enable building using a Visual Studio 2022 install on Windows.
7919
7920- bpo-43298: Improved error message when building without a Windows SDK
7921  installed.
7922
7923- bpo-44381: The Windows build now accepts :envvar:`EnableControlFlowGuard`
7924  set to ``guard`` to enable CFG.
7925
7926- bpo-41282: Fix broken ``make install`` that caused standard library
7927  extension modules to be unnecessarily and incorrectly rebuilt during the
7928  install phase of cpython.
7929
7930Windows
7931-------
7932
7933- bpo-45375: Fixes an assertion failure due to searching for the standard
7934  library in unnormalised paths.
7935
7936- bpo-45022: Update Windows release to include libffi 3.4.2
7937
7938- bpo-45007: Update to OpenSSL 1.1.1l in Windows build
7939
7940- bpo-44848: Upgrade Windows installer to use SQLite 3.36.0.
7941
7942- bpo-44572: Avoid consuming standard input in the :mod:`platform` module
7943
7944- bpo-44582: Accelerate speed of :mod:`mimetypes` initialization using a
7945  native implementation of the registry scan.
7946
7947- bpo-41299: Fix 16 milliseconds jitter when using timeouts in
7948  :mod:`threading`, such as with :meth:`threading.Lock.acquire` or
7949  :meth:`threading.Condition.wait`.
7950
7951- bpo-42686: Build :mod:`sqlite3` with math functions enabled. Patch by
7952  Erlend E. Aasland.
7953
7954- bpo-40263: This is a follow-on bug from
7955  https://bugs.python.org/issue26903. Once that is applied we run into an
7956  off-by-one assertion problem. The assert was not correct.
7957
7958macOS
7959-----
7960
7961- bpo-45007: Update macOS installer builds to use OpenSSL 1.1.1l.
7962
7963- bpo-34602: When building CPython on macOS with ``./configure
7964  --with-undefined-behavior-sanitizer --with-pydebug``, the stack size is
7965  now quadrupled to allow for the entire test suite to pass.
7966
7967- bpo-44848: Update macOS installer to use SQLite 3.36.0.
7968
7969- bpo-44689: :meth:`ctypes.util.find_library` now works correctly on macOS
7970  11 Big Sur even if Python is built on an older version of macOS.
7971  Previously, when built on older macOS systems, ``find_library`` was not
7972  able to find  macOS system libraries when running on Big Sur due to
7973  changes in  how system libraries are stored.
7974
7975- bpo-41972: The framework build's user header path in sysconfig is changed
7976  to add a 'pythonX.Y' component to match distutils's behavior.
7977
7978- bpo-43109: Allow --with-lto configure option to work with Apple-supplied
7979  Xcode or Command Line Tools.
7980
7981- bpo-34932: Add socket.TCP_KEEPALIVE support for macOS. Patch by Shane
7982  Harvey.
7983
7984IDLE
7985----
7986
7987- bpo-45296: On Windows, change exit/quit message to suggest Ctrl-D, which
7988  works, instead of <Ctrl-Z Return>, which does not work in IDLE.
7989
7990- bpo-45193: Make completion boxes appear on Ubuntu again.
7991
7992- bpo-40128: Mostly fix completions on macOS when not using tcl/tk 8.6.11
7993  (as with 3.9). The added update_idletask call should be harmless and
7994  possibly helpful otherwise.
7995
7996- bpo-33962: Move the indent space setting from the Font tab to the new
7997  Windows tab. Patch by Mark Roseman and Terry Jan Reedy.
7998
7999- bpo-40468: Split the settings dialog General tab into Windows and Shell/ED
8000  tabs. Move help sources, which extend the Help menu, to the Extensions
8001  tab. Make space for new options and shorten the dialog. The latter makes
8002  the dialog better fit small screens.
8003
8004- bpo-41611: Avoid uncaught exceptions in
8005  ``AutoCompleteWindow.winconfig_event()``.
8006
8007- bpo-41611: Fix IDLE sometimes freezing upon tab-completion on macOS.
8008
8009- bpo-44010: Highlight the new :ref:`match <match>` statement's :ref:`soft
8010  keywords <soft-keywords>`: :keyword:`match`, :keyword:`case <match>`, and
8011  :keyword:`_ <wildcard-patterns>`. However, this highlighting is not
8012  perfect and will be incorrect in some rare cases, including some ``_``-s
8013  in ``case`` patterns.
8014
8015- bpo-44026: Include interpreter's typo fix suggestions in message line for
8016  NameErrors and AttributeErrors.  Patch by E. Paine.
8017
8018Tools/Demos
8019-----------
8020
8021- bpo-44786: Fix a warning in regular expression in the c-analyzer script.
8022
8023- bpo-44967: pydoc now returns a non-zero status code when a module cannot
8024  be found.
8025
8026- bpo-44978: Allow the Argument Clinic tool to handle ``__complex__``
8027  special methods.
8028
8029- bpo-43425: Removed the 'test2to3' demo project that demonstrated using
8030  lib2to3 to support Python 2.x and Python 3.x from a single source in a
8031  distutils package. Patch by Dong-hee Na
8032
8033- bpo-44074: Make patchcheck automatically detect the correct base branch
8034  name (previously it was hardcoded to 'master')
8035
8036- bpo-20291: Added support for variadic positional parameters in Argument
8037  Clinic.
8038
8039C API
8040-----
8041
8042- bpo-41710: The PyThread_acquire_lock_timed() function now clamps the
8043  timeout if it is too large, rather than aborting the process. Patch by
8044  Victor Stinner.
8045
8046- bpo-44687: :meth:`BufferedReader.peek` no longer raises :exc:`ValueError`
8047  when the entire file has already been buffered.
8048
8049- bpo-45116: Add the :c:macro:`Py_ALWAYS_INLINE` macro to ask the compiler
8050  to always inline a static inline function. The compiler can ignore it and
8051  decides to not inline the function. Patch by Victor Stinner.
8052
8053- bpo-45094: Add the :c:macro:`Py_NO_INLINE` macro to disable inlining on a
8054  function. Patch by Victor Stinner.
8055
8056- bpo-45061: Add a deallocator to the :class:`bool` type to detect refcount
8057  bugs in C extensions which call ``Py_DECREF(Py_True);`` or
8058  ``Py_DECREF(Py_False);`` by mistake. Patch by Victor Stinner.
8059
8060- bpo-42035: Add a new :c:func:`PyType_GetQualName` function to get type's
8061  qualified name.
8062
8063- bpo-41103: Reverts removal of the old buffer protocol because they are
8064  part of stable ABI.
8065
8066- bpo-44751: Remove ``crypt.h`` include from the public ``Python.h`` header.
8067
8068- bpo-42747: The ``Py_TPFLAGS_HAVE_VERSION_TAG`` type flag now does nothing.
8069  The ``Py_TPFLAGS_HAVE_AM_SEND`` flag (which was added in 3.10) is removed.
8070  Both were unnecessary because it is not possible to have type objects with
8071  the relevant fields missing.
8072
8073- bpo-44530: Added the ``co_qualname`` to the ``PyCodeObject`` structure to
8074  propagate the qualified name from the compiler to code objects.
8075
8076  Patch by Gabriele N. Tornetta
8077
8078- bpo-44441: :c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to
8079  its initial value at exit. It must be possible to call
8080  :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` at
8081  each Python initialization. Patch by Victor Stinner.
8082
8083- bpo-39947: Remove 4 private trashcan C API functions which were only kept
8084  for the backward compatibility of the stable ABI with Python 3.8 and
8085  older, since the trashcan API was not usable with the limited C API on
8086  Python 3.8 and older. The trashcan API was excluded from the limited C API
8087  in Python 3.9.
8088
8089  Removed functions:
8090
8091  * _PyTrash_deposit_object()
8092  * _PyTrash_destroy_chain()
8093  * _PyTrash_thread_deposit_object()
8094  * _PyTrash_thread_destroy_chain()
8095
8096  The trashcan C API was never usable with the limited C API, since old
8097  trashcan macros accessed directly :c:type:`PyThreadState` members like
8098  ``_tstate->trash_delete_nesting``, whereas the :c:type:`PyThreadState`
8099  structure is opaque in the limited C API.
8100
8101  Exclude also the ``PyTrash_UNWIND_LEVEL`` constant from the C API.
8102
8103  Patch by Victor Stinner.
8104
8105- bpo-40939: Removed documentation for the removed ``PyParser_*`` C API.
8106
8107- bpo-43795: The list in :ref:`stable-abi-list` now shows the public name
8108  :c:struct:`PyFrameObject` rather than ``_frame``. The non-existing entry
8109  ``_node`` no longer appears in the list.
8110
8111- bpo-44378: :c:func:`Py_IS_TYPE` no longer uses :c:func:`Py_TYPE` to avoid
8112  a compiler warning: no longer cast ``const PyObject*`` to ``PyObject*``.
8113  Patch by Victor Stinner.
8114
8115- bpo-39573: Convert the :c:func:`Py_TYPE` and :c:func:`Py_SIZE` macros to
8116  static inline functions. The :c:func:`Py_SET_TYPE` and
8117  :c:func:`Py_SET_SIZE` functions must now be used to set an object type and
8118  size. Patch by Victor Stinner.
8119
8120- bpo-44263: The :c:func:`PyType_Ready` function now raises an error if a
8121  type is defined with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no
8122  traverse function (:c:member:`PyTypeObject.tp_traverse`). Patch by Victor
8123  Stinner.
8124
8125- bpo-43795: The undocumented function :c:func:`Py_FrozenMain` is removed
8126  from the Limited API.
8127
8128- bpo-44113: Deprecate the following functions to configure the Python
8129  initialization:
8130
8131  * :c:func:`PySys_AddWarnOptionUnicode`
8132  * :c:func:`PySys_AddWarnOption`
8133  * :c:func:`PySys_AddXOption`
8134  * :c:func:`PySys_HasWarnOptions`
8135  * :c:func:`Py_SetPath`
8136  * :c:func:`Py_SetProgramName`
8137  * :c:func:`Py_SetPythonHome`
8138  * :c:func:`Py_SetStandardStreamEncoding`
8139  * :c:func:`_Py_SetProgramFullPath`
8140
8141  Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization
8142  Configuration <init-config>` instead (:pep:`587`).
8143
8144- bpo-44094: Remove ``PyErr_SetFromErrnoWithUnicodeFilename()``,
8145  ``PyErr_SetFromWindowsErrWithUnicodeFilename()``, and
8146  ``PyErr_SetExcFromWindowsErrWithUnicodeFilename()``. They are not
8147  documented and have been deprecated since Python 3.3.
8148
8149- bpo-43795: :c:func:`PyCodec_Unregister` is now properly exported as a
8150  function in the Windows Stable ABI DLL.
8151
8152- bpo-44029: Remove deprecated ``Py_UNICODE`` APIs: ``PyUnicode_Encode``,
8153  ``PyUnicode_EncodeUTF7``, ``PyUnicode_EncodeUTF8``,
8154  ``PyUnicode_EncodeUTF16``, ``PyUnicode_EncodeUTF32``,
8155  ``PyUnicode_EncodeLatin1``, ``PyUnicode_EncodeMBCS``,
8156  ``PyUnicode_EncodeDecimal``, ``PyUnicode_EncodeRawUnicodeEscape``,
8157  ``PyUnicode_EncodeCharmap``, ``PyUnicode_EncodeUnicodeEscape``,
8158  ``PyUnicode_TransformDecimalToASCII``, ``PyUnicode_TranslateCharmap``,
8159  ``PyUnicodeEncodeError_Create``, ``PyUnicodeTranslateError_Create``. See
8160  :pep:`393` and :pep:`624` for reference.
8161
8162- bpo-42035: Add a new :c:func:`PyType_GetName` function to get type's short
8163  name.
8164
8165
8166What's New in Python 3.10.0 beta 1?
8167===================================
8168
8169*Release date: 2021-05-03*
8170
8171Security
8172--------
8173
8174- bpo-43434: Creating :class:`sqlite3.Connection` objects now also produces
8175  ``sqlite3.connect`` and ``sqlite3.connect/handle`` :ref:`auditing events
8176  <auditing>`. Previously these events were only produced by
8177  :func:`sqlite3.connect` calls. Patch by Erlend E. Aasland.
8178
8179- bpo-43998: The :mod:`ssl` module sets more secure cipher suites defaults.
8180  Ciphers without forward secrecy and with SHA-1 MAC are disabled by
8181  default. Security level 2 prohibits weak RSA, DH, and ECC keys with less
8182  than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum
8183  protocol version TLS 1.2. Settings are based on Hynek Schlawack's
8184  research.
8185
8186- bpo-43882: The presence of newline or tab characters in parts of a URL
8187  could allow some forms of attacks.
8188
8189  Following the controlling specification for URLs defined by WHATWG
8190  :func:`urllib.parse` now removes ASCII newlines and tabs from URLs,
8191  preventing such attacks.
8192
8193- bpo-43472: Ensures interpreter-level audit hooks receive the
8194  ``cpython.PyInterpreterState_New`` event when called through the
8195  ``_xxsubinterpreters`` module.
8196
8197- bpo-43362: Fix invalid free in _sha3 module. The issue was introduced in
8198  3.10.0a1. Python 3.9 and earlier are not affected.
8199
8200- bpo-43762: Add audit events for :func:`sqlite3.connect/handle`,
8201  :meth:`sqlite3.Connection.enable_load_extension`, and
8202  :meth:`sqlite3.Connection.load_extension`. Patch by Erlend E. Aasland.
8203
8204- bpo-43756: Add new audit event ``glob.glob/2`` to incorporate the new
8205  *root_dir* and *dir_fd* arguments added to :func:`glob.glob` and
8206  :func:`glob.iglob`.
8207
8208- bpo-36384: :mod:`ipaddress` module no longer accepts any leading zeros in
8209  IPv4 address strings. Leading zeros are ambiguous and interpreted as octal
8210  notation by some libraries. For example the legacy function
8211  :func:`socket.inet_aton` treats leading zeros as octal notation. glibc
8212  implementation of modern :func:`~socket.inet_pton` does not accept any
8213  leading zeros. For a while the :mod:`ipaddress` module used to accept
8214  ambiguous leading zeros.
8215
8216- bpo-43075: Fix Regular Expression Denial of Service (ReDoS) vulnerability
8217  in :class:`urllib.request.AbstractBasicAuthHandler`.  The ReDoS-vulnerable
8218  regex has quadratic worst-case complexity and it allows cause a denial of
8219  service when identifying crafted invalid RFCs. This ReDoS issue is on the
8220  client side and needs remote attackers to control the HTTP server.
8221
8222- bpo-42800: Audit hooks are now fired for frame.f_code, traceback.tb_frame,
8223  and generator code/frame attribute access.
8224
8225- bpo-37363: Add audit events to the :mod:`http.client` module.
8226
8227Core and Builtins
8228-----------------
8229
8230- bpo-43977: Prevent classes being both a sequence and a mapping when
8231  pattern matching.
8232
8233- bpo-43977: Use :c:member:`~PyTypeObject.tp_flags` on the class object to
8234  determine if the subject is a sequence or mapping when pattern matching.
8235  Avoids the need to import :mod:`collections.abc` when pattern matching.
8236
8237- bpo-43892: Restore proper validation of complex literal value patterns
8238  when parsing :keyword:`!match` blocks.
8239
8240- bpo-43933: Set frame.f_lineno to the line number of the 'with' kweyword
8241  when executing the call to ``__exit__``.
8242
8243- bpo-43933: If the current position in a frame has no line number then set
8244  the f_lineno attribute to None, instead of -1, to conform to PEP 626. This
8245  should not normally be possible, but might occur in some unusual
8246  circumstances.
8247
8248- bpo-43963: Importing the :mod:`_signal` module in a subinterpreter has no
8249  longer side effects.
8250
8251- bpo-42739: The internal representation of line number tables is changed to
8252  not use sentinels, and an explicit length parameter is added to the out of
8253  process API function ``PyLineTable_InitAddressRange``. This makes the
8254  handling of line number tables more robust in some circumstances.
8255
8256- bpo-43908: Make :mod:`re` types immutable. Patch by Erlend E. Aasland.
8257
8258- bpo-43908: Make the :class:`array.array` type immutable. Patch by Erlend
8259  E. Aasland.
8260
8261- bpo-43901: Change class and module objects to lazy-create empty
8262  annotations dicts on demand.  The annotations dicts are stored in the
8263  object's __dict__ for backwards compatibility.
8264
8265- bpo-43892: Match patterns now use new dedicated AST nodes (``MatchValue``,
8266  ``MatchSingleton``, ``MatchSequence``, ``MatchStar``, ``MatchMapping``,
8267  ``MatchClass``) rather than reusing expression AST nodes. ``MatchAs`` and
8268  ``MatchOr`` are now defined as pattern nodes rather than as expression
8269  nodes. Patch by Nick Coghlan.
8270
8271- bpo-42725: Usage of ``await``/``yield``/``yield from`` and named
8272  expressions within an annotation is now forbidden when PEP 563 is
8273  activated.
8274
8275- bpo-43754: When performing structural pattern matching (:pep:`634`),
8276  captured names are now left unbound until the *entire* pattern has matched
8277  successfully.
8278
8279- bpo-42737: Annotations for complex targets (everything beside simple
8280  names) no longer cause any runtime effects with ``from __future__ import
8281  annotations``.
8282
8283- bpo-43914: :exc:`SyntaxError` exceptions raised by the interpreter will
8284  highlight the full error range of the expression that consistutes the
8285  syntax error itself, instead of just where the problem is detected. Patch
8286  by Pablo Galindo.
8287
8288- bpo-38605: Revert making ``from __future__ import annotations`` the
8289  default. This follows the Steering Council decision to postpone PEP 563
8290  changes to at least Python 3.11. See the original email for more
8291  information regarding the decision:
8292  https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/.
8293  Patch by Pablo Galindo.
8294
8295- bpo-43475: Hashes of NaN values now depend on object identity.  Formerly,
8296  they always hashed to 0 even though NaN values are not equal to one
8297  another.  Having the same hash for unequal values caused pile-ups in hash
8298  tables.
8299
8300- bpo-43859: Improve the error message for :exc:`IndentationError`
8301  exceptions. Patch by Pablo Galindo
8302
8303- bpo-41323: Constant tuple folding in bytecode optimizer now reuses tuple
8304  in constant table.
8305
8306- bpo-43846: Data stack usage is much reduced for large literal and call
8307  expressions.
8308
8309- bpo-38530: When printing :exc:`NameError` raised by the interpreter,
8310  :c:func:`PyErr_Display` will offer suggestions of similar variable names
8311  in the function that the exception was raised from. Patch by Pablo Galindo
8312
8313- bpo-43823: Improve syntax errors for invalid dictionary literals. Patch by
8314  Pablo Galindo.
8315
8316- bpo-43822: Improve syntax errors in the parser for missing commas between
8317  expressions. Patch by Pablo Galindo.
8318
8319- bpo-43798: :class:`ast.alias` nodes now include source location metadata
8320  attributes e.g. lineno, col_offset.
8321
8322- bpo-43797: Improve ``SyntaxError`` error messages for invalid comparisons.
8323  Patch by Pablo Galindo.
8324
8325- bpo-43760: Move the flag for checking whether tracing is enabled to the C
8326  stack, from the heap. Should speed up dispatch in the interpreter.
8327
8328- bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) and class
8329  methods (:func:`@classmethod <classmethod>`) now inherit the method
8330  attributes (``__module__``, ``__name__``, ``__qualname__``, ``__doc__``,
8331  ``__annotations__``) and have a new ``__wrapped__`` attribute. Patch by
8332  Victor Stinner.
8333
8334- bpo-43751: Fixed a bug where ``anext(ait, default)`` would erroneously
8335  return None.
8336
8337- bpo-42128: :data:`~object.__match_args__` is no longer allowed to be a
8338  list.
8339
8340- bpo-43683: Add GEN_START opcode. Marks start of generator, including
8341  async, or coroutine and handles sending values to a newly created
8342  generator or coroutine.
8343
8344- bpo-43105: Importlib now resolves relative paths when creating module spec
8345  objects from file locations.
8346
8347- bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) are now
8348  callable as regular functions. Patch by Victor Stinner.
8349
8350- bpo-42609: Prevented crashes in the AST validator and optimizer when
8351  compiling some absurdly long expressions like ``"+0"*1000000``.
8352  :exc:`RecursionError` is now raised instead.
8353
8354- bpo-38530: When printing :exc:`AttributeError`, :c:func:`PyErr_Display`
8355  will offer suggestions of similar attribute names in the object that the
8356  exception was raised from. Patch by Pablo Galindo
8357
8358Library
8359-------
8360
8361- bpo-44015: In @dataclass(), raise a TypeError if KW_ONLY is specified more
8362  than once.
8363
8364- bpo-25478: Added a *total()* method to collections.Counter() to compute
8365  the sum of the counts.
8366
8367- bpo-43733: Change :class:`netrc.netrc` to use UTF-8 encoding before using
8368  locale encoding.
8369
8370- bpo-43979: Removed an unnecessary list comprehension before looping from
8371  :func:`urllib.parse.parse_qsl`.  Patch by Christoph Zwerschke and Dong-hee
8372  Na.
8373
8374- bpo-43993: Update bundled pip to 21.1.1.
8375
8376- bpo-43957: [Enum] Deprecate ``TypeError`` when non-member is used in a
8377  containment check; In 3.12 ``True`` or ``False`` will be returned instead,
8378  and containment will return ``True`` if the value is either a member of
8379  that enum or one of its members' value.
8380
8381- bpo-42904: For backwards compatibility with previous minor versions of
8382  Python, if :func:`typing.get_type_hints` receives no namespace dictionary
8383  arguments, :func:`typing.get_type_hints` will search through the global
8384  then local namespaces during evaluation of stringized type annotations
8385  (string forward references) inside a class.
8386
8387- bpo-43945: [Enum] Deprecate non-standard mixin format() behavior: in 3.12
8388  the enum member, not the member's value, will be used for format() calls.
8389
8390- bpo-41139: Deprecate undocumented ``cgi.log()`` API.
8391
8392- bpo-43937: Fixed the :mod:`turtle` module working with non-default root
8393  window.
8394
8395- bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0
8396
8397- bpo-43907: Fix a bug in the pure-Python pickle implementation when using
8398  protocol 5, where bytearray instances that occur several time in the
8399  pickled object graph would incorrectly unpickle into repeated copies of
8400  the bytearray object.
8401
8402- bpo-43926: In ``importlib.metadata``, provide a uniform interface to
8403  ``Description``, allow for any field to be encoded with multiline values,
8404  remove continuation lines from multiline values, and add a ``.json``
8405  property for easy access to the PEP 566 JSON-compatible form. Sync with
8406  ``importlib_metadata 4.0``.
8407
8408- bpo-43920: OpenSSL 3.0.0: :meth:`~ssl.SSLContext.load_verify_locations`
8409  now returns a consistent error message when cadata contains no valid
8410  certificate.
8411
8412- bpo-43607: :mod:`urllib` can now convert Windows paths with ``\\?\``
8413  prefixes into URL paths.
8414
8415- bpo-43817: Add :func:`inspect.get_annotations`, which safely computes the
8416  annotations defined on an object.  It works around the quirks of accessing
8417  the annotations from various types of objects, and makes very few
8418  assumptions about the object passed in. :func:`inspect.get_annotations`
8419  can also correctly un-stringize stringized annotations.
8420
8421  :func:`inspect.signature`, :func:`inspect.from_callable`, and
8422  :func:`inspect.from_function` now call :func:`inspect.get_annotations` to
8423  retrieve annotations.  This means :func:`inspect.signature` and
8424  :func:`inspect.from_callable` can now un-stringize stringized annotations,
8425  too.
8426
8427- bpo-43284: platform.win32_ver derives the windows version from
8428  sys.getwindowsversion().platform_version which in turn derives the version
8429  from kernel32.dll (which can be of a different version than Windows
8430  itself). Therefore change the platform.win32_ver to determine the version
8431  using the platform module's _syscmd_ver private function to return an
8432  accurate version.
8433
8434- bpo-42854: The :mod:`ssl` module now uses ``SSL_read_ex`` and
8435  ``SSL_write_ex`` internally. The functions support reading and writing of
8436  data larger than 2 GB. Writing zero-length data no longer fails with a
8437  protocol violation error.
8438
8439- bpo-42333: Port ``_ssl`` extension module to multiphase initialization.
8440
8441- bpo-43880: :mod:`ssl` now raises DeprecationWarning for OP_NO_SSL/TLS*
8442  options, old TLS versions, old protocols, and other features that have
8443  been deprecated since Python 3.6, 3.7, or OpenSSL 1.1.0.
8444
8445- bpo-41559: :pep:`612` is now implemented purely in Python; builtin
8446  ``types.GenericAlias`` objects no longer include ``typing.ParamSpec`` in
8447  ``__parameters__`` (with the exception of ``collections.abc.Callable``\ 's
8448  ``GenericAlias``). This means previously invalid uses of ``ParamSpec``
8449  (such as ``list[P]``) which worked in earlier versions of Python 3.10
8450  alpha, will now raise ``TypeError`` during substitution.
8451
8452- bpo-43867: The :mod:`multiprocessing` ``Server`` class now explicitly
8453  catches :exc:`SystemExit` and closes the client connection in this case.
8454  It happens when the ``Server.serve_client()`` method reaches the end of
8455  file (EOF).
8456
8457- bpo-40443: Remove unused imports: pyclbr no longer uses copy, and typing
8458  no longer uses ast. Patch by Victor Stinner.
8459
8460- bpo-43820: Remove an unneeded copy of the namespace passed to
8461  dataclasses.make_dataclass().
8462
8463- bpo-43787: Add ``__iter__()`` method to :class:`bz2.BZ2File`,
8464  :class:`gzip.GzipFile`, and :class:`lzma.LZMAFile`. It makes iterating
8465  them about 2x faster. Patch by Inada Naoki.
8466
8467- bpo-43680: Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and
8468  _pyio.open instead. Until Python 3.9, _pyio.open was not a static method
8469  and builtins.open was set to OpenWrapper to not become a bound method when
8470  set to a class variable. _io.open is a built-in function whereas
8471  _pyio.open is a Python function. In Python 3.10, _pyio.open() is now a
8472  static method, and builtins.open() is now io.open().
8473
8474- bpo-43680: The Python :func:`_pyio.open` function becomes a static method
8475  to behave as :func:`io.open` built-in function: don't become a bound
8476  method when stored as a class variable. It becomes possible since static
8477  methods are now callable in Python 3.10. Moreover,
8478  :func:`_pyio.OpenWrapper` becomes a simple alias to :func:`_pyio.open`.
8479  Patch by Victor Stinner.
8480
8481- bpo-41515: Fix :exc:`KeyError` raised in :func:`typing.get_type_hints` due
8482  to synthetic modules that don't appear in ``sys.modules``.
8483
8484- bpo-43776: When :class:`subprocess.Popen` args are provided as a string or
8485  as :class:`pathlib.Path`, the Popen instance repr now shows the right
8486  thing.
8487
8488- bpo-42248: [Enum] ensure exceptions raised in ``_missing__`` are released
8489
8490- bpo-43744: fix issue with enum member name matching the start of a private
8491  variable name
8492
8493- bpo-43772: Fixed the return value of ``TypeVar.__ror__``. Patch by Jelle
8494  Zijlstra.
8495
8496- bpo-43764: Add match_args parameter to @dataclass decorator to allow
8497  suppression of __match_args__ generation.
8498
8499- bpo-43799: OpenSSL 3.0.0: define ``OPENSSL_API_COMPAT`` 1.1.1 to suppress
8500  deprecation warnings. Python requires OpenSSL 1.1.1 APIs.
8501
8502- bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a
8503  result, an already-mocked object cannot have an attribute mocked using
8504  ``autospec=True`` or be the subject of a ``create_autospec(...)`` call.
8505  This can uncover bugs in tests since these Mock-derived Mocks will always
8506  pass certain tests (e.g. :func:`isinstance`) and builtin assert functions
8507  (e.g. assert_called_once_with) will unconditionally pass.
8508
8509- bpo-43794: Add :data:`ssl.OP_IGNORE_UNEXPECTED_EOF` constants (OpenSSL
8510  3.0.0)
8511
8512- bpo-43785: Improve ``bz2.BZ2File`` performance by removing the RLock from
8513  BZ2File. This makes BZ2File thread unsafe in the face of multiple
8514  simultaneous readers or writers, just like its equivalent classes in
8515  :mod:`gzip` and :mod:`lzma` have always been.  Patch by Inada Naoki.
8516
8517- bpo-43789: OpenSSL 3.0.0: Don't call the password callback function a
8518  second time when first call has signaled an error condition.
8519
8520- bpo-43788: The header files for :mod:`ssl` error codes are now OpenSSL
8521  version-specific. Exceptions will now show correct reason and library
8522  codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's
8523  text file with error codes.
8524
8525- bpo-43766: Implement :pep:`647` in the :mod:`typing` module by adding
8526  :data:`TypeGuard`.
8527
8528- bpo-25264: :func:`os.path.realpath` now accepts a *strict* keyword-only
8529  argument. When set to ``True``, :exc:`OSError` is raised if a path doesn't
8530  exist or a symlink loop is encountered.
8531
8532- bpo-43780: In ``importlib.metadata``, incorporate changes from
8533  importlib_metadata 3.10: Add mtime-based caching during distribution
8534  discovery. Flagged use of dict result from ``entry_points()`` as
8535  deprecated.
8536
8537- The ``P.args`` and ``P.kwargs`` attributes of :class:`typing.ParamSpec`
8538  are now instances of the new classes :class:`typing.ParamSpecArgs` and
8539  :class:`typing.ParamSpecKwargs`, which enables a more useful ``repr()``.
8540  Patch by Jelle Zijlstra.
8541
8542- bpo-43731: Add an ``encoding`` parameter :func:`logging.fileConfig()`.
8543
8544- bpo-43712: Add ``encoding`` and ``errors`` parameters to
8545  :func:`fileinput.input` and :class:`fileinput.FileInput`.
8546
8547- bpo-38659: A ``simple_enum`` decorator is added to the ``enum`` module to
8548  convert a normal class into an Enum. ``test_simple_enum`` added to test
8549  simple enums against a corresponding normal Enum.  Standard library
8550  modules updated to use ``simple_enum``.
8551
8552- bpo-43764: Fix an issue where :data:`~object.__match_args__` generation
8553  could fail for some :mod:`dataclasses`.
8554
8555- bpo-43752: Fix :mod:`sqlite3` regression for zero-sized blobs with
8556  converters, where ``b""`` was returned instead of ``None``. The regression
8557  was introduced by PR 24723. Patch by Erlend E. Aasland.
8558
8559- bpo-43655: :mod:`tkinter` dialog windows are now recognized as dialogs by
8560  window managers on macOS and X Window.
8561
8562- bpo-43723: The following ``threading`` methods are now deprecated and
8563  should be replaced:
8564
8565  - ``currentThread`` => :func:`threading.current_thread`
8566
8567  - ``activeCount`` => :func:`threading.active_count`
8568
8569  - ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all`
8570
8571  - ``Event.isSet`` => :meth:`threading.Event.is_set`
8572
8573  - ``Thread.setName`` => :attr:`threading.Thread.name`
8574
8575  - ``thread.getName`` => :attr:`threading.Thread.name`
8576
8577  - ``Thread.isDaemon`` => :attr:`threading.Thread.daemon`
8578
8579  - ``Thread.setDaemon`` => :attr:`threading.Thread.daemon`
8580
8581  Patch by Jelle Zijlstra.
8582
8583- bpo-2135: Deprecate find_module() and find_loader() implementations in
8584  importlib and zipimport.
8585
8586- bpo-43534: :func:`turtle.textinput` and :func:`turtle.numinput` create now
8587  a transient window working on behalf of the canvas window.
8588
8589- bpo-43532: Add the ability to specify keyword-only fields to dataclasses.
8590  These fields will become keyword-only arguments to the generated __init__.
8591
8592- bpo-43522: Fix problem with
8593  :attr:`~ssl.SSLContext.hostname_checks_common_name`. OpenSSL does not copy
8594  hostflags from *struct SSL_CTX* to *struct SSL*.
8595
8596- bpo-8978: Improve error message for :func:`tarfile.open` when :mod:`lzma`
8597  / :mod:`bz2` are unavailable.  Patch by Anthony Sottile.
8598
8599- bpo-42967: Allow :class:`bytes` ``separator`` argument in
8600  ``urllib.parse.parse_qs`` and ``urllib.parse.parse_qsl`` when parsing
8601  :class:`str` query strings. Previously, this raised a ``TypeError``.
8602
8603- bpo-43296: Improve :mod:`sqlite3` error handling: ``sqlite3_value_blob()``
8604  errors that set ``SQLITE_NOMEM`` now raise :exc:`MemoryError`. Patch by
8605  Erlend E. Aasland.
8606
8607- bpo-43312: New functions :func:`sysconfig.get_preferred_scheme` and
8608  :func:`sysconfig.get_default_scheme` are added to query a platform for its
8609  preferred "user", "home", and "prefix" (default) scheme names.
8610
8611- bpo-43265: Improve :meth:`sqlite3.Connection.backup` error handling. The
8612  error message for non-existent target database names is now ``unknown
8613  database <database name>`` instead of ``SQL logic error``. Patch by Erlend
8614  E. Aasland.
8615
8616- bpo-41282: Install schemes in :mod:`distutils.command.install` are now
8617  loaded from :mod:`sysconfig`.
8618
8619- bpo-41282: :mod:`distutils.sysconfig` has been merged to :mod:`sysconfig`.
8620
8621- bpo-43176: Fixed processing of a dataclass that inherits from a frozen
8622  dataclass with no fields.  It is now correctly detected as an error.
8623
8624- bpo-43080: :mod:`pprint` now has support for
8625  :class:`dataclasses.dataclass`. Patch by Lewis Gaul.
8626
8627- bpo-39950: Add `pathlib.Path.hardlink_to()` method that supersedes
8628  `link_to()`. The new method has the same argument order as `symlink_to()`.
8629
8630- bpo-42904: :func:`typing.get_type_hints` now checks the local namespace of
8631  a class when evaluating :pep:`563` annotations inside said class.
8632
8633- bpo-42269: Add ``slots`` parameter to ``dataclasses.dataclass`` decorator
8634  to automatically generate ``__slots__`` for class. Patch provided by Yurii
8635  Karabas.
8636
8637- bpo-39529: Deprecated use of :func:`asyncio.get_event_loop` without
8638  running event loop. Emit deprecation warning for :mod:`asyncio` functions
8639  which implicitly create a :class:`~asyncio.Future` or
8640  :class:`~asyncio.Task` objects if there is no running event loop and no
8641  explicit *loop* argument is passed: :func:`~asyncio.ensure_future`,
8642  :func:`~asyncio.wrap_future`, :func:`~asyncio.gather`,
8643  :func:`~asyncio.shield`, :func:`~asyncio.as_completed` and constructors of
8644  :class:`~asyncio.Future`, :class:`~asyncio.Task`,
8645  :class:`~asyncio.StreamReader`, :class:`~asyncio.StreamReaderProtocol`.
8646
8647- bpo-18369: Certificate and PrivateKey classes were added to the ssl
8648  module. Certificates and keys can now be loaded from memory buffer, too.
8649
8650- bpo-41486: Use a new output buffer management code for :mod:`bz2` /
8651  :mod:`lzma` / :mod:`zlib` modules, and add ``.readall()`` function to
8652  ``_compression.DecompressReader`` class. These bring some performance
8653  improvements. Patch by Ma Lin.
8654
8655- bpo-31870: The :func:`ssl.get_server_certificate` function now has a
8656  *timeout* parameter.
8657
8658- bpo-41735: Fix thread locks in zlib module may go wrong in rare case.
8659  Patch by Ma Lin.
8660
8661- bpo-36470: Fix dataclasses with ``InitVar``\s and
8662  :func:`~dataclasses.replace()`. Patch by Claudiu Popa.
8663
8664- bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag
8665
8666- bpo-35114: :func:`ssl.RAND_status` now returns a boolean value (as
8667  documented) instead of ``1`` or ``0``.
8668
8669- bpo-39906: :meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now
8670  accept a *follow_symlinks* keyword-only argument for consistency with
8671  corresponding functions in the :mod:`os` module.
8672
8673- bpo-39899: :func:`os.path.expanduser()` now refuses to guess Windows home
8674  directories if the basename of current user's home directory does not
8675  match their username.
8676
8677  :meth:`pathlib.Path.expanduser()` and :meth:`~pathlib.Path.home()` now
8678  consistently raise :exc:`RuntimeError` exception when a home directory
8679  cannot be resolved. Previously a :exc:`KeyError` exception could be raised
8680  on Windows when the ``"USERNAME"``  environment variable was unset.
8681
8682- bpo-36076: Added SNI support to :func:`ssl.get_server_certificate`.
8683
8684- bpo-38490: Covariance, Pearson's correlation, and simple linear regression
8685  functionality was added to statistics module. Patch by Tymoteusz Wołodźko.
8686
8687- bpo-33731: Provide a locale.localize() function, which converts a
8688  normalized number string into a locale format.
8689
8690- bpo-32745: Fix a regression in the handling of ctypes'
8691  :data:`ctypes.c_wchar_p` type: embedded null characters would cause a
8692  :exc:`ValueError` to be raised. Patch by Zackery Spytz.
8693
8694Documentation
8695-------------
8696
8697- bpo-43987: Add "Annotations Best Practices" document as a new HOWTO.
8698
8699- bpo-43977: Document the new :const:`Py_TPFLAGS_MAPPING` and
8700  :const:`Py_TPFLAGS_SEQUENCE` type flags.
8701
8702- bpo-43959: The documentation on the PyContextVar C-API was clarified.
8703
8704- bpo-43938: Update dataclasses documentation to express that
8705  FrozenInstanceError is derived from AttributeError.
8706
8707- bpo-43778: Fix the Sphinx glossary_search extension: create the _static/
8708  sub-directory if it doesn't exist.
8709
8710- bpo-43755: Update documentation to reflect that unparenthesized lambda
8711  expressions can no longer be the expression part in an ``if`` clause in
8712  comprehensions and generator expressions since Python 3.9.
8713
8714- bpo-43739: Fixing the example code in Doc/extending/extending.rst to
8715  declare and initialize the pmodule variable to be of the right type.
8716
8717Tests
8718-----
8719
8720- bpo-43961: Fix test_logging.test_namer_rotator_inheritance() on Windows:
8721  use :func:`os.replace` rather than :func:`os.rename`. Patch by Victor
8722  Stinner.
8723
8724- bpo-43842: Fix a race condition in the SMTP test of test_logging. Don't
8725  close a file descriptor (socket) from a different thread while
8726  asyncore.loop() is polling the file descriptor. Patch by Victor Stinner.
8727
8728- bpo-43843: :mod:`test.libregrtest` now marks a test as ENV_CHANGED
8729  (altered the execution environment) if a thread raises an exception but
8730  does not catch it. It sets a hook on :func:`threading.excepthook`. Use
8731  ``--fail-env-changed`` option to mark the test as failed. Patch by Victor
8732  Stinner.
8733
8734- bpo-43811: Tests multiple OpenSSL versions on GitHub Actions. Use ccache
8735  to speed up testing.
8736
8737- bpo-43791: OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and
8738  1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR.
8739
8740Build
8741-----
8742
8743- bpo-43567: Improved generated code refresh (AST/tokens/opcodes/keywords)
8744  on Windows.
8745
8746- bpo-43669: Implement :pep:`644`. Python now requires OpenSSL 1.1.1 or
8747  newer.
8748
8749Windows
8750-------
8751
8752- bpo-35306: Adds additional arguments to :func:`os.startfile` function.
8753
8754- bpo-43538: Avoid raising errors from :meth:`pathlib.Path.exists()` when
8755  passed an invalid filename.
8756
8757- bpo-38822: Fixed :func:`os.stat` failing on inaccessible directories with
8758  a trailing slash, rather than falling back to the parent directory's
8759  metadata. This implicitly affected :func:`os.path.exists` and
8760  :func:`os.path.isdir`.
8761
8762- bpo-26227: Fixed decoding of host names in :func:`socket.gethostbyaddr`
8763  and :func:`socket.gethostbyname_ex`.
8764
8765- bpo-40432: Updated pegen regeneration script on Windows to find and use
8766  Python 3.8 or higher.  Prior to this, pegen regeneration already required
8767  3.8 or higher, but the script may have used lower versions of Python.
8768
8769- bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. Earlier
8770  releases were mislabelled and actually included 1.1.1i again.
8771
8772- bpo-43652: Update Tcl and Tk to 8.6.11 in Windows installer.
8773
8774- bpo-43492: Upgrade Windows installer to use SQLite 3.35.5.
8775
8776- bpo-30555: Fix ``WindowsConsoleIO`` errors in the presence of fd
8777  redirection. Patch by Segev Finer.
8778
8779macOS
8780-----
8781
8782- bpo-42119: Fix check for macOS SDK paths when building Python. Narrow
8783  search to match contents of SDKs, namely only files in
8784  ``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than
8785  ``/usr/local``. Previously, anything under ``/System`` was assumed to be
8786  in an SDK which causes problems with the new file system layout in 10.15+
8787  where user file systems may appear to be mounted under ``/System``.  Paths
8788  in ``/Library`` were also incorrectly treated as SDK locations.
8789
8790- bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3
8791
8792- bpo-44009: Provide "python3.x-intel64" executable to allow reliably
8793  forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64
8794  emulation on Apple Silicon Macs.  This can be useful for testing or when
8795  universal2 wheels are not yet available.
8796
8797- bpo-43851: Build SQLite with ``SQLITE_OMIT_AUTOINIT`` on macOS. Patch by
8798  Erlend E. Aasland.
8799
8800- bpo-43492: Update macOS installer to use SQLite 3.35.4.
8801
8802- bpo-42235: ``Mac/BuildScript/build-installer.py`` will now use
8803  "--enable-optimizations" and ``--with-lto`` when building on macOS 10.15
8804  or later.
8805
8806IDLE
8807----
8808
8809- bpo-37903: Add mouse actions to the shell sidebar.  Left click and
8810  optional drag selects one or more lines, as with the editor line number
8811  sidebar.  Right click after selecting raises a context menu with 'copy
8812  with prompts'.  This zips together prompts from the sidebar with lines
8813  from the selected text.
8814
8815- bpo-43981: Fix reference leak in test_sidebar and test_squeezer. Patches
8816  by Terry Jan Reedy and Pablo Galindo
8817
8818- bpo-37892: Indent IDLE Shell input with spaces instead of tabs
8819
8820- bpo-43655: IDLE dialog windows are now recognized as dialogs by window
8821  managers on macOS and X Window.
8822
8823- bpo-37903: IDLE's shell now shows prompts in a separate side-bar.
8824
8825C API
8826-----
8827
8828- bpo-43916: Add a new :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag
8829  to disallow creating type instances. Patch by Victor Stinner.
8830
8831- bpo-43774: Remove the now unused ``PYMALLOC_DEBUG`` macro. Debug hooks on
8832  memory allocators are now installed by default if Python is built in debug
8833  mode (if ``Py_DEBUG`` macro is defined). Moreover, they can now be used on
8834  Python build in release mode (ex: using ``PYTHONMALLOC=debug`` environment
8835  variable).
8836
8837- bpo-43962: _PyInterpreterState_IDIncref() now calls
8838  _PyInterpreterState_IDInitref() and always increments id_refcount.
8839  Previously, calling _xxsubinterpreters.get_current() could create an
8840  id_refcount inconsistency when a _xxsubinterpreters.InterpreterID object
8841  was deallocated. Patch by Victor Stinner.
8842
8843- bpo-28254: Add new C-API functions to control the state of the garbage
8844  collector: :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`,
8845  :c:func:`PyGC_IsEnabled()`, corresponding to the functions in the
8846  :mod:`gc` module.
8847
8848- bpo-43908: Introduce :const:`Py_TPFLAGS_IMMUTABLETYPE` flag for immutable
8849  type objects, and modify :c:func:`PyType_Ready` to set it for static
8850  types. Patch by Erlend E. Aasland.
8851
8852- bpo-43795: :c:func:`PyMem_Calloc` is now available in the limited C API
8853  (``Py_LIMITED_API``).
8854
8855- bpo-43868: :c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by
8856  limited C API headers and by ``python3.dll`` on Windows. Like any function
8857  that takes ``FILE*``, it is not part of the stable ABI.
8858
8859- bpo-43795: Stable ABI and limited API definitions are generated from a
8860  central manifest (:pep:`652`).
8861
8862- bpo-43753: Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the
8863  *x* object is the *y* object, the same as ``x is y`` in Python. Add also
8864  the :c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse`
8865  functions to test if an object is, respectively, the ``None`` singleton,
8866  the ``True`` singleton or the ``False`` singleton. Patch by Victor
8867  Stinner.
8868
8869
8870What's New in Python 3.10.0 alpha 7?
8871====================================
8872
8873*Release date: 2021-04-05*
8874
8875Security
8876--------
8877
8878- bpo-42988: CVE-2021-3426: Remove the ``getfile`` feature of the
8879  :mod:`pydoc` module which could be abused to read arbitrary files on the
8880  disk (directory traversal vulnerability). Moreover, even source code of
8881  Python modules can contain sensitive data like passwords. Vulnerability
8882  reported by David Schwörer.
8883
8884- bpo-43285: :mod:`ftplib` no longer trusts the IP address value returned
8885  from the server in response to the PASV command by default.  This prevents
8886  a malicious FTP server from using the response to probe IPv4 address and
8887  port combinations on the client network.
8888
8889  Code that requires the former vulnerable behavior may set a
8890  ``trust_server_pasv_ipv4_address`` attribute on their :class:`ftplib.FTP`
8891  instances to ``True`` to re-enable it.
8892
8893- bpo-43439: Add audit hooks for :func:`gc.get_objects`,
8894  :func:`gc.get_referrers` and :func:`gc.get_referents`. Patch by Pablo
8895  Galindo.
8896
8897Core and Builtins
8898-----------------
8899
8900- bpo-27129: Update CPython bytecode magic number.
8901
8902- bpo-43672: Raise ImportWarning when calling find_loader().
8903
8904- bpo-43660: Fix crash that happens when replacing ``sys.stderr`` with a
8905  callable that can remove the object while an exception is being printed.
8906  Patch by Pablo Galindo.
8907
8908- bpo-27129: The bytecode interpreter uses instruction, rather byte, offsets
8909  internally. This reduces the number of EXTENDED_ARG instructions needed
8910  and streamlines instruction dispatch a bit.
8911
8912- bpo-40645: Fix reference leak in the :mod:`_hashopenssl` extension. Patch
8913  by Pablo Galindo.
8914
8915- bpo-42134: Calls to find_module() by the import system now raise
8916  ImportWarning.
8917
8918- bpo-41064: Improve the syntax error for invalid usage of double starred
8919  elements ('**') in f-strings. Patch by Pablo Galindo.
8920
8921- bpo-43575: Speed up calls to ``map()`` by using the :pep:`590`
8922  ``vectorcall`` calling convention. Patch by Dong-hee Na.
8923
8924- bpo-42137: The import system now prefers using ``__spec__`` for
8925  ``ModuleType.__repr__`` over ``module_repr()``.
8926
8927- bpo-43452: Added micro-optimizations to ``_PyType_Lookup()`` to improve
8928  cache lookup performance in the common case of cache hits.
8929
8930- bpo-43555: Report the column offset for :exc:`SyntaxError` for invalid
8931  line continuation characters. Patch by Pablo Galindo.
8932
8933- bpo-43517: Fix misdetection of circular imports when using ``from pkg.mod
8934  import attr``, which caused false positives in non-trivial multi-threaded
8935  code.
8936
8937- bpo-43497: Emit SyntaxWarnings for assertions with tuple constants, this
8938  is a regression introduced in python3.7
8939
8940- bpo-39316: Tracing now has correct line numbers for attribute accesses
8941  when the attribute is on a different line from the object. Improves
8942  debugging and profiling for multi-line method chains.
8943
8944- bpo-35883: Python no longer fails at startup with a fatal error if a
8945  command line argument contains an invalid Unicode character. The
8946  :c:func:`Py_DecodeLocale` function now escapes byte sequences which would
8947  be decoded as Unicode characters outside the [U+0000; U+10ffff] range.
8948
8949- bpo-43410: Fix a bug that was causing the parser to crash when emitting
8950  syntax errors when reading input from stdin. Patch by Pablo Galindo
8951
8952- bpo-43406: Fix a possible race condition where ``PyErr_CheckSignals``
8953  tries to execute a non-Python signal handler.
8954
8955- bpo-42128: Add ``__match_args__`` to :c:type:`structsequence` based
8956  classes. Patch by Pablo Galindo.
8957
8958- bpo-43390: CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for
8959  the VM's default signal handlers.  This is friendlier to other in-process
8960  code that an extension module or embedding use could pull in (such as
8961  Golang's cgo) where tiny thread stacks are the norm and ``sigaltstack()``
8962  has been used to provide for signal handlers.  This is a no-op change for
8963  the vast majority of processes that don't use sigaltstack.
8964
8965- bpo-43287: Speed up calls to ``filter()`` by using the :pep:`590`
8966  ``vectorcall`` calling convention. Patch by Dong-hee Na.
8967
8968- bpo-37448: Add a radix tree based memory map to track in-use obmalloc
8969  arenas. Use to replace the old implementation of address_in_range(). The
8970  radix tree approach makes it easy to increase pool sizes beyond the OS
8971  page size. Boosting the pool and arena size allows obmalloc to handle a
8972  significantly higher percentage of requests from its ultra-fast paths.
8973
8974  It also has the advantage of eliminating the memory unsanitary behavior of
8975  the previous address_in_range(). The old address_in_range() was marked
8976  with the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and
8977  _Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed.
8978
8979  To disable the radix tree map, set a preprocessor flag as follows:
8980  `-DWITH_PYMALLOC_RADIX_TREE=0`.
8981
8982  Co-authored-by: Tim Peters <tim.peters@gmail.com>
8983
8984- bpo-29988: Only handle asynchronous exceptions and requests to drop the
8985  GIL when returning from a call or on the back edges of loops. Makes sure
8986  that :meth:`__exit__` is always called in with statements, even for
8987  interrupts.
8988
8989Library
8990-------
8991
8992- bpo-43720: Document various stdlib deprecations in imp, pkgutil, and
8993  importlib.util for removal in Python 3.12.
8994
8995- bpo-43433: :class:`xmlrpc.client.ServerProxy` no longer ignores query and
8996  fragment in the URL of the server.
8997
8998- bpo-31956: The :meth:`~array.array.index` method of :class:`array.array`
8999  now has optional *start* and *stop* parameters.
9000
9001- bpo-40066: Enum: adjust ``repr()`` to show only enum and member name (not
9002  value, nor angle brackets) and ``str()`` to show only member name.  Update
9003  and improve documentation to match.
9004
9005- bpo-42136: Deprecate all module_repr() methods found in importlib as their
9006  use is being phased out by Python 3.12.
9007
9008- bpo-35930: Raising an exception raised in a "future" instance will create
9009  reference cycles.
9010
9011- bpo-41369: Finish updating the vendored libmpdec to version 2.5.1.  Patch
9012  by Stefan Krah.
9013
9014- bpo-43422: Revert the _decimal C API which was added in bpo-41324.
9015
9016- bpo-43577: Fix deadlock when using :class:`ssl.SSLContext` debug callback
9017  with :meth:`ssl.SSLContext.sni_callback`.
9018
9019- bpo-43571: It's now possible to create MPTCP sockets with IPPROTO_MPTCP
9020
9021- bpo-43542: ``image/heic`` and ``image/heif`` were added to
9022  :mod:`mimetypes`.
9023
9024- bpo-40645: The :mod:`hmac` module now uses OpenSSL's HMAC implementation
9025  when digestmod argument is a hash name or builtin hash function.
9026
9027- bpo-43510: Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X
9028  warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING`
9029  environment variable and ``encoding="locale"`` argument value.
9030
9031- bpo-43521: ``ast.unparse`` can now render NaNs and empty sets.
9032
9033- bpo-42914: :func:`pprint.pprint` gains a new boolean
9034  ``underscore_numbers`` optional argument to emit integers with thousands
9035  separated by an underscore character for improved readability (for example
9036  ``1_000_000`` instead of ``1000000``).
9037
9038- bpo-41361: :meth:`~collections.deque.rotate` calls are now slightly faster
9039  due to faster argument parsing.
9040
9041- bpo-43423: :func:`subprocess.communicate` no longer raises an IndexError
9042  when there is an empty stdout or stderr IO buffer during a timeout on
9043  Windows.
9044
9045- bpo-27820: Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN
9046  with initial_response_ok=False will fail.
9047
9048  The cause is that SMTP.auth_login _always_ returns a password if provided
9049  with a challenge string, thus non-compliant with the standard for AUTH
9050  LOGIN.
9051
9052  Also fixes bug with the test for smtpd.
9053
9054- bpo-43445: Add frozen modules to :data:`sys.stdlib_module_names`. For
9055  example, add ``"_frozen_importlib"`` and ``"_frozen_importlib_external"``
9056  names.
9057
9058- bpo-43245: Add keyword arguments support to ``ChainMap.new_child()``.
9059
9060- bpo-29982: Add optional parameter *ignore_cleanup_errors* to
9061  :func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup`
9062  attempts. Contributed by C.A.M. Gerlach.
9063
9064- bpo-43428: Include changes from `importlib_metadata 3.7
9065  <https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_:
9066
9067  Performance enhancements to distribution discovery.
9068
9069  ``entry_points`` only returns unique distributions.
9070
9071  Introduces new ``EntryPoints`` object for containing a set of entry points
9072  with convenience methods for selecting entry points by group or name.
9073  ``entry_points`` now returns this object if selection parameters are
9074  supplied but continues to return a dict object for compatibility. Users
9075  are encouraged to rely on the selection interface. The dict object result
9076  is likely to be deprecated in the future.
9077
9078  Added packages_distributions function to return a mapping of packages to
9079  the distributions that provide them.
9080
9081- bpo-43332: Improves the networking efficiency of :mod:`http.client` when
9082  using a proxy via :meth:`~HTTPConnection.set_tunnel`.  Fewer small send
9083  calls are made during connection setup.
9084
9085- bpo-43420: Improve performance of :class:`fractions.Fraction` arithmetics
9086  for large components.  Contributed by Sergey B. Kirpichev.
9087
9088- bpo-43356: Allow passing a signal number to ``_thread.interrupt_main()``.
9089
9090- bpo-43399: Fix ``ElementTree.extend`` not working on iterators when using
9091  the Python implementation
9092
9093- bpo-43369: Improve :mod:`sqlite3` error handling: If
9094  ``sqlite3_column_text()`` and ``sqlite3_column_blob()`` set
9095  ``SQLITE_NOMEM``, :exc:`MemoryError` is now raised. Patch by Erlend E.
9096  Aasland.
9097
9098- bpo-43368: Fix a regression introduced in PR 24562, where an empty
9099  bytestring was fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`.
9100  Patch by Mariusz Felisiak.
9101
9102- bpo-41282: Fixed stacklevel of ``DeprecationWarning`` emitted from
9103  ``import distutils``.
9104
9105- bpo-42129: ``importlib.resources`` now honors namespace packages, merging
9106  resources from each location in the namespace as introduced in
9107  ``importlib_resources`` 3.2 and including incidental changes through
9108  5.0.3.
9109
9110- bpo-43295: :meth:`datetime.datetime.strptime` now raises ``ValueError``
9111  instead of ``IndexError`` when matching ``'z'`` with the ``%z`` format
9112  specifier.
9113
9114- bpo-43125: Return empty string if base64mime.body_encode receive empty
9115  bytes
9116
9117- bpo-43084: :func:`curses.window.enclose` returns now ``True`` or ``False``
9118  (as was documented) instead of ``1`` or ``0``.
9119
9120- bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2
9121
9122- bpo-14678: Add an invalidate_caches() method to the zipimport.zipimporter
9123  class to support importlib.invalidate_caches(). Patch by Desmond Cheong.
9124
9125- bpo-42782: Fail fast in :func:`shutil.move()` to avoid creating
9126  destination directories on failure.
9127
9128- bpo-40066: Enum's `repr()` and `str()` have changed: `repr()` is now
9129  *EnumClass.MemberName* and `str()` is *MemberName*.  Additionally, stdlib
9130  Enum's whose contents are available as module attributes, such as
9131  `RegexFlag.IGNORECASE`, have their `repr()` as *module.name*, e.g.
9132  `re.IGNORECASE`.
9133
9134- bpo-26053: Fixed bug where the :mod:`pdb` interactive run command echoed
9135  the args from the shell command line, even if those have been overridden
9136  at the pdb prompt.
9137
9138- bpo-24160: Fixed bug where breakpoints did not persist across multiple
9139  debugger sessions in :mod:`pdb`'s interactive mode.
9140
9141- bpo-40701: When the :data:`tempfile.tempdir` global variable is set to a
9142  value of type bytes, it is now handled consistently.  Previously
9143  exceptions could be raised from some tempfile APIs when the directory did
9144  not already exist in this situation.  Also ensures that the
9145  :func:`tempfile.gettempdir()` and :func:`tempfile.gettempdirb()` functions
9146  *always* return ``str`` and ``bytes`` respectively.
9147
9148- bpo-39342: Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as
9149  :data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate
9150  validation as explained in
9151  https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html.
9152
9153- bpo-31861: Add builtins.aiter and builtins.anext. Patch by Joshua Bronson
9154  (@jab), Daniel Pope (@lordmauve), and Justin Wang (@justin39).
9155
9156Documentation
9157-------------
9158
9159- bpo-43199: Answer "Why is there no goto?" in the Design and History FAQ.
9160
9161- bpo-43407: Clarified that a result from :func:`time.monotonic`,
9162  :func:`time.perf_counter`, :func:`time.process_time`, or
9163  :func:`time.thread_time` can be compared with the result from any
9164  following call to the same function - not just the next immediate call.
9165
9166- bpo-43354: Fix type documentation for ``Fault.faultCode``; the type has to
9167  be ``int`` instead of ``str``.
9168
9169- bpo-41933: Clarified wording of s * n in the Common Sequence Operations
9170
9171Tests
9172-----
9173
9174- bpo-37945: Fix test_getsetlocale_issue1813() of test_locale: skip the test
9175  if ``setlocale()`` fails. Patch by Victor Stinner.
9176
9177- bpo-41561: Add workaround for Ubuntu's custom OpenSSL security level
9178  policy.
9179
9180Build
9181-----
9182
9183- bpo-43179: Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for
9184  alignment-related code in optimized string routines. Patch by Jessica
9185  Clarke.
9186
9187- bpo-43631: Update macOS, Windows, and CI to OpenSSL 1.1.1k.
9188
9189- bpo-43617: Improve configure.ac: Check for presence of autoconf-archive
9190  package and remove our copies of M4 macros.
9191
9192- bpo-43466: The ``configure`` script now supports ``--with-openssl-rpath``
9193  option.
9194
9195- bpo-43372: Use ``_freeze_importlib`` to generate code for the
9196  ``__hello__`` module. This approach ensures the code matches the
9197  interpreter version.  Previously, PYTHON_FOR_REGEN was used to generate
9198  the code, which might be wrong.  The marshal format for code objects has
9199  changed with bpo-42246, commit 877df851. Update the code and the expected
9200  code sizes in ctypes test_frozentable.
9201
9202Windows
9203-------
9204
9205- bpo-43440: Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch
9206  by Erlend E. Aasland.
9207
9208IDLE
9209----
9210
9211- bpo-42225: Document that IDLE can fail on Unix either from misconfigured
9212  IP masquerade rules or failure displaying complex colored (non-ascii)
9213  characters.
9214
9215C API
9216-----
9217
9218- bpo-43688: The limited C API is now supported if Python is built in debug
9219  mode (if the ``Py_DEBUG`` macro is defined). In the limited C API, the
9220  :c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented
9221  as opaque function calls, rather than accessing directly the
9222  :c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode
9223  and the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became
9224  possible to support the limited C API in debug mode because the
9225  :c:type:`PyObject` structure is the same in release and debug mode since
9226  Python 3.8 (see :issue:`36465`).
9227
9228  The limited C API is still not supported in the ``--with-trace-refs``
9229  special build (``Py_TRACE_REFS`` macro).
9230
9231  Patch by Victor Stinner.
9232
9233- bpo-43244: Remove the ``pyarena.h`` header file with functions:
9234
9235  * ``PyArena_New()``
9236  * ``PyArena_Free()``
9237  * ``PyArena_Malloc()``
9238  * ``PyArena_AddPyObject()``
9239
9240  These functions were undocumented, excluded from the limited C API, and
9241  were only used internally by the compiler. Patch by Victor Stinner.
9242
9243- bpo-43244: Remove the compiler and parser functions using ``struct _mod``
9244  type, because the public AST C API was removed:
9245
9246  * ``PyAST_Compile()``
9247  * ``PyAST_CompileEx()``
9248  * ``PyAST_CompileObject()``
9249  * ``PyFuture_FromAST()``
9250  * ``PyFuture_FromASTObject()``
9251  * ``PyParser_ASTFromFile()``
9252  * ``PyParser_ASTFromFileObject()``
9253  * ``PyParser_ASTFromFilename()``
9254  * ``PyParser_ASTFromString()``
9255  * ``PyParser_ASTFromStringObject()``
9256
9257  These functions were undocumented and excluded from the limited C API.
9258  Patch by Victor Stinner.
9259
9260- bpo-43244: Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header
9261  files. These functions were undocumented and excluded from the limited C
9262  API. Most names defined by these header files were not prefixed by ``Py``
9263  and so could create names conflicts. For example, ``Python-ast.h`` defined
9264  a ``Yield`` macro which was conflict with the ``Yield`` name used by the
9265  Windows ``<winbase.h>`` header. Use the Python :mod:`ast` module instead.
9266  Patch by Victor Stinner.
9267
9268- bpo-43541: Fix a ``PyEval_EvalCodeEx()`` regression: fix reference
9269  counting on builtins. Patch by Victor Stinner.
9270
9271- bpo-43244: Remove the ``symtable.h`` header file and the undocumented
9272  functions:
9273
9274  * ``PyST_GetScope()``
9275  * ``PySymtable_Build()``
9276  * ``PySymtable_BuildObject()``
9277  * ``PySymtable_Free()``
9278  * ``Py_SymtableString()``
9279  * ``Py_SymtableStringObject()``
9280
9281  The ``Py_SymtableString()`` function was part the stable ABI by mistake
9282  but it could not be used, because the ``symtable.h`` header file was
9283  excluded from the limited C API.
9284
9285  The Python :mod:`symtable` module remains available and is unchanged.
9286
9287  Patch by Victor Stinner.
9288
9289- bpo-43244: Remove the ``PyAST_Validate()`` function. It is no longer
9290  possible to build a AST object (``mod_ty`` type) with the public C API.
9291  The function was already excluded from the limited C API (:pep:`384`).
9292  Patch by Victor Stinner.
9293
9294
9295What's New in Python 3.10.0 alpha 6?
9296====================================
9297
9298*Release date: 2021-03-01*
9299
9300Security
9301--------
9302
9303- bpo-42967: Fix web cache poisoning vulnerability by defaulting the query
9304  args separator to ``&``, and allowing the user to choose a custom
9305  separator.
9306
9307Core and Builtins
9308-----------------
9309
9310- bpo-43321: Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with
9311  ``#`` but without ``PY_SSIZE_T_CLEAN`` defined.
9312
9313- bpo-36346: ``PyArg_Parse*()`` functions now emits ``DeprecationWarning``
9314  when ``u`` or ``Z`` format is used. See :pep:`623` for detail.
9315
9316- bpo-43277: Add a new :c:func:`PySet_CheckExact` function to the C-API to
9317  check if an object is an instance of :class:`set` but not an instance of a
9318  subtype. Patch by Pablo Galindo.
9319
9320- bpo-42990: The :data:`types.FunctionType` constructor now inherits the
9321  current builtins if the *globals* dictionary has no ``"__builtins__"``
9322  key, rather than using ``{"None": None}`` as builtins: same behavior as
9323  :func:`eval` and :func:`exec` functions. Defining a function with ``def
9324  function(...): ...`` in Python is not affected, globals cannot be
9325  overridden with this syntax: it also inherits the current builtins. Patch
9326  by Victor Stinner.
9327
9328- bpo-42990: Functions have a new ``__builtins__`` attribute which is used
9329  to look for builtin symbols when a function is executed, instead of
9330  looking into ``__globals__['__builtins__']``. Patch by Mark Shannon and
9331  Victor Stinner.
9332
9333- bpo-43149: Improve the error message in the parser for exception groups
9334  without parentheses. Patch by Pablo Galindo.
9335
9336- bpo-43121: Fixed an incorrect :exc:`SyntaxError` message for missing comma
9337  in literals. Patch by Pablo Galindo.
9338
9339- bpo-42819: :mod:`readline`: Explicitly disable bracketed paste in the
9340  interactive interpreter, even if it's set in the inputrc, is enabled by
9341  default (eg GNU Readline 8.1), or a user calls
9342  ``readline.read_init_file()``. The Python REPL has not implemented
9343  bracketed paste support. Also, bracketed mode writes the ``"\x1b[?2004h"``
9344  escape sequence into stdout which causes test failures in applications
9345  that don't support it. It can still be explicitly enabled by calling
9346  ``readline.parse_and_bind("set enable-bracketed-paste on")``. Patch by
9347  Dustin Rodrigues.
9348
9349- bpo-42808: Simple calls to ``type(object)`` are now faster due to the
9350  ``vectorcall`` calling convention. Patch by Dennis Sweeney.
9351
9352- bpo-42217: Make the compiler merges same co_code and co_linetable objects
9353  in a module like already did for co_consts.
9354
9355- bpo-41972: Substring search functions such as ``str1 in str2`` and
9356  ``str2.find(str1)`` now sometimes use the "Two-Way" string comparison
9357  algorithm to avoid quadratic behavior on long strings.
9358
9359- bpo-42128: Implement :pep:`634` (structural pattern matching). Patch by
9360  Brandt Bucher.
9361
9362- bpo-40692: In the :class:`concurrent.futures.ProcessPoolExecutor`,
9363  validate that :func:`multiprocess.synchronize` is available on a given
9364  platform and rely on that check in the :mod:`concurrent.futures` test
9365  suite so we can run tests that are unrelated to
9366  :class:`ProcessPoolExecutor` on those platforms.
9367
9368- bpo-38302: If :func:`object.__ipow__` returns :const:`NotImplemented`, the
9369  operator will correctly fall back to :func:`object.__pow__` and
9370  :func:`object.__rpow__` as expected.
9371
9372Library
9373-------
9374
9375- bpo-43316: The ``python -m gzip`` command line application now properly
9376  fails when detecting an unsupported extension. It exits with a non-zero
9377  exit code and prints an error message to stderr.
9378
9379- bpo-43317: Set the chunk size for the ``gzip`` module main function to
9380  io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes
9381  constant that was used previously.
9382
9383- bpo-43146: Handle None in single-arg versions of
9384  :func:`~traceback.print_exception` and
9385  :func:`~traceback.format_exception`.
9386
9387- bpo-43260: Fix TextIOWrapper can not flush internal buffer forever after
9388  very large text is written.
9389
9390- bpo-43258: Prevent needless allocation of :mod:`sqlite3` aggregate
9391  function context when no rows match an aggregate query. Patch by Erlend E.
9392  Aasland.
9393
9394- bpo-43251: Improve :mod:`sqlite3` error handling:
9395  ``sqlite3_column_name()`` failures now result in :exc:`MemoryError`. Patch
9396  by Erlend E. Aasland.
9397
9398- bpo-40956: Fix segfault in :meth:`sqlite3.Connection.backup` if no
9399  argument was provided. The regression was introduced by PR 23838. Patch by
9400  Erlend E. Aasland.
9401
9402- bpo-43172: The readline module now passes its tests when built directly
9403  against libedit. Existing irreconcilable API differences remain in
9404  :func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based
9405  on libreadline vs libedit use.
9406
9407- bpo-43163: Fix a bug in :mod:`codeop` that was causing it to not ask for
9408  more input when multi-line snippets have unclosed parentheses. Patch by
9409  Pablo Galindo
9410
9411- bpo-43162: deprecate unsupported ability to access enum members as
9412  attributes of other enum members
9413
9414- bpo-43146: Fix recent regression in None argument handling in
9415  :mod:`~traceback` module functions.
9416
9417- bpo-43102: The namedtuple __new__ method had its __builtins__ set to None
9418  instead of an actual dictionary.  This created problems for introspection
9419  tools.
9420
9421- bpo-43106: Added :data:`~os.O_EVTONLY`, :data:`~os.O_FSYNC`,
9422  :data:`~os.O_SYMLINK` and :data:`~os.O_NOFOLLOW_ANY` for macOS. Patch by
9423  Dong-hee Na.
9424
9425- bpo-42960: Adds :data:`resource.RLIMIT_KQUEUES` constant from FreeBSD to
9426  the :mod:`resource` module.
9427
9428- bpo-42151: Make the pure Python implementation of
9429  :mod:`xml.etree.ElementTree` behave the same as the C implementation
9430  (:mod:`_elementree`) regarding default attribute values (by not setting
9431  ``specified_attributes=1``).
9432
9433- bpo-29753: In ctypes, now packed bitfields are calculated properly and the
9434  first item of packed bitfields is now shrank correctly.
9435
9436Documentation
9437-------------
9438
9439- bpo-27646: Clarify that 'yield from <expr>' works with any iterable, not
9440  just iterators.
9441
9442- bpo-36346: Update some deprecated unicode APIs which are documented as
9443  "will be removed in 4.0" to "3.12". See :pep:`623` for detail.
9444
9445Tests
9446-----
9447
9448- bpo-43288: Fix test_importlib to correctly skip Unicode file tests if the
9449  filesystem does not support them.
9450
9451Build
9452-----
9453
9454- bpo-43174: Windows build now uses ``/utf-8`` compiler option.
9455
9456- bpo-43103: Add a new configure ``--without-static-libpython`` option to
9457  not build the ``libpythonMAJOR.MINOR.a`` static library and not install
9458  the ``python.o`` object file.
9459
9460- bpo-13501: The configure script can now use *libedit* instead of
9461  *readline* with the command line option ``--with-readline=editline``.
9462
9463- bpo-42603: Make configure script use pkg-config to detect the location of
9464  Tcl/Tk headers and libraries, used to build tkinter.
9465
9466  On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred
9467  over Tcl/Tk frameworks installed in ``/{System/,}Library/Frameworks``. If
9468  both exist and the latter is preferred, the appropriate ``--with-tcltk-*``
9469  configuration options need to be explicitly set.
9470
9471- bpo-39448: Add the "regen-frozen" makefile target that regenerates the
9472  code for the frozen ``__hello__`` module.
9473
9474Windows
9475-------
9476
9477- bpo-43155: :c:func:`PyCMethod_New` is now present in ``python3.lib``.
9478
9479macOS
9480-----
9481
9482- bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j.
9483
9484IDLE
9485----
9486
9487- bpo-43283: Document why printing to IDLE's Shell is often slower than
9488  printing to a system terminal and that it can be made faster by
9489  pre-formatting a single string before printing.
9490
9491C API
9492-----
9493
9494- bpo-43278: Always put compiler and system information on the first line of
9495  the REPL welcome message.
9496
9497- bpo-43270: Remove the private ``_PyErr_OCCURRED()`` macro: use the public
9498  :c:func:`PyErr_Occurred` function instead.
9499
9500- bpo-35134: Move odictobject.h, parser_interface.h, picklebufobject.h,
9501  pydebug.h, and pyfpe.h into the cpython/ directory. They must not be
9502  included directly, as they are already included by Python.h: :ref:`Include
9503  Files <api-includes>`.
9504
9505- bpo-35134: Move pyarena.h, pyctype.h, and pytime.h into the cpython/
9506  directory. They must not be included directly, as they are already
9507  included by Python.h: :ref:`Include Files <api-includes>`.
9508
9509- bpo-40170: :c:func:`PyExceptionClass_Name` is now always declared as a
9510  function, in order to hide implementation details. The macro accessed
9511  :c:member:`PyTypeObject.tp_name` directly.  Patch by Erlend E. Aasland.
9512
9513- bpo-43239: The :c:func:`PyCFunction_New` function is now exported in the
9514  ABI when compiled with ``-fvisibility=hidden``.
9515
9516- bpo-40170: :c:func:`PyIter_Check` is now always declared as a function, in
9517  order to hide implementation details. The macro accessed
9518  :c:member:`PyTypeObject.tp_iternext` directly. Patch by Erlend E. Aasland.
9519
9520- bpo-40170: Convert :c:func:`PyDescr_IsData` macro to a function to hide
9521  implementation details: The macro accessed
9522  :c:member:`PyTypeObject.tp_descr_set` directly. Patch by Erlend E.
9523  Aasland.
9524
9525- bpo-43181: Convert :c:func:`PyObject_TypeCheck` macro to a static inline
9526  function. Patch by Erlend E. Aasland.
9527
9528
9529What's New in Python 3.10.0 alpha 5?
9530====================================
9531
9532*Release date: 2021-02-02*
9533
9534Security
9535--------
9536
9537- bpo-42938: Avoid static buffers when computing the repr of
9538  :class:`ctypes.c_double` and :class:`ctypes.c_longdouble` values.
9539
9540Core and Builtins
9541-----------------
9542
9543- bpo-42990: Refactor the ``PyEval_`` family of functions.
9544
9545  * An new function ``_PyEval_Vector`` is added to simplify calls to Python from C.
9546  * ``_PyEval_EvalCodeWithName`` is removed
9547  * ``PyEval_EvalCodeEx`` is retained as part of the API, but is not used internally
9548
9549- bpo-38631: Replace :c:func:`Py_FatalError` calls in the compiler with
9550  regular :exc:`SystemError` exceptions. Patch by Victor Stinner.
9551
9552- bpo-42997: Improve error message for missing ":" before blocks. Patch by
9553  Pablo Galindo.
9554
9555- bpo-43017: Improve error message in the parser when using un-parenthesised
9556  tuples in comprehensions. Patch by Pablo Galindo.
9557
9558- bpo-42986: Fix parser crash when reporting syntax errors in f-string with
9559  newlines. Patch by Pablo Galindo.
9560
9561- bpo-40176: Syntax errors for unterminated string literals now point to the
9562  start of the string instead of reporting EOF/EOL.
9563
9564- bpo-42927: The inline cache for ``LOAD_ATTR`` now also optimizes access to
9565  attributes defined by ``__slots__``. This makes reading such attribute up
9566  to 30% faster.
9567
9568- bpo-42864: Improve error messages in the parser when parentheses are not
9569  closed. Patch by Pablo Galindo.
9570
9571- bpo-42924: Fix ``bytearray`` repetition incorrectly copying data from the
9572  start of the buffer, even if the data is offset within the buffer (e.g.
9573  after reassigning a slice at the start of the ``bytearray`` to a shorter
9574  byte string).
9575
9576- bpo-42882: Fix the :c:func:`_PyUnicode_FromId` function
9577  (_Py_IDENTIFIER(var) API) when :c:func:`Py_Initialize` /
9578  :c:func:`Py_Finalize` is called multiple times: preserve
9579  ``_PyRuntime.unicode_ids.next_index`` value.
9580
9581- bpo-42827: Fix a crash when working out the error line of a
9582  :exc:`SyntaxError` in some multi-line expressions.
9583
9584- bpo-42823: frame.f_lineno is correct even if frame.f_trace is set to True
9585
9586- bpo-37324: Remove deprecated aliases to
9587  :ref:`collections-abstract-base-classes` from the :mod:`collections`
9588  module.
9589
9590- bpo-41994: Fixed possible leak in ``import`` when ``sys.modules`` is not a
9591  ``dict``.
9592
9593- bpo-27772: In string formatting, preceding the *width* field by ``'0'`` no
9594  longer affects the default alignment for strings.
9595
9596Library
9597-------
9598
9599- bpo-43108: Fixed a reference leak in the :mod:`curses` module. Patch by
9600  Pablo Galindo
9601
9602- bpo-43077: Update the bundled pip to 21.0.1 and setuptools to 52.0.0.
9603
9604- bpo-41282: Deprecate ``distutils`` in documentation and add warning on
9605  import.
9606
9607- bpo-43014: Improve performance of :mod:`tokenize` by 20-30%.  Patch by
9608  Anthony Sottile.
9609
9610- bpo-42323: Fix :func:`math.nextafter` for NaN on AIX.
9611
9612- bpo-42955: Add :data:`sys.stdlib_module_names`, containing the list of the
9613  standard library module names. Patch by Victor Stinner.
9614
9615- bpo-42944: Fix ``random.Random.sample`` when ``counts`` argument is not
9616  ``None``.
9617
9618- bpo-42934: Use :class:`~traceback.TracebackException`'s new ``compact``
9619  param in :class:`~unittest.TestResult` to reduce time and memory consumed
9620  by traceback formatting.
9621
9622- bpo-42931: Add :func:`randbytes` to ``random.__all__``.
9623
9624- bpo-38250: [Enum] Flags consisting of a single bit are now considered
9625  canonical, and will be the only flags returned from listing and iterating
9626  over a Flag class or a Flag member.  Multi-bit flags are considered
9627  aliases; they will be returned from lookups and operations that result in
9628  their value. Iteration for both Flag and Flag members is in definition
9629  order.
9630
9631- bpo-42877: Added the ``compact`` parameter to the constructor of
9632  :class:`traceback.TracebackException` to reduce time and memory for use
9633  cases that only need to call :func:`TracebackException.format` and
9634  :func:`TracebackException.format_exception_only`.
9635
9636- bpo-42923: The :c:func:`Py_FatalError` function and the
9637  :mod:`faulthandler` module now dump the list of extension modules on a
9638  fatal error.
9639
9640- bpo-42848: Removed recursion from :class:`~traceback.TracebackException`
9641  to allow it to handle long exception chains.
9642
9643- bpo-42901: [Enum] move member creation from ``EnumMeta.__new__`` to
9644  ``_proto_member.__set_name__``, allowing members to be created and visible
9645  in ``__init_subclass__``.
9646
9647- bpo-42780: Fix os.set_inheritable() for O_PATH file descriptors on Linux.
9648
9649- bpo-42866: Fix a reference leak in the ``getcodec()`` function of CJK
9650  codecs. Patch by Victor Stinner.
9651
9652- bpo-42846: Convert the 6 CJK codec extension modules (_codecs_cn,
9653  _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw) to the
9654  multiphase initialization API (:pep:`489`). Patch by Victor Stinner.
9655
9656- bpo-42851: remove __init_subclass__ support for Enum members
9657
9658- bpo-42834: Make internal caches of the ``_json`` module compatible with
9659  subinterpreters.
9660
9661- bpo-41748: Fix HTMLParser parsing rules for element attributes containing
9662  commas with spaces. Patch by Karl Dubost.
9663
9664- bpo-40810: Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.
9665
9666- bpo-1635741: Convert the _multibytecodec extension module (CJK codecs) to
9667  multi-phase initialization (:pep:`489`).  Patch by Erlend E. Aasland.
9668
9669- bpo-42802: The distutils ``bdist_wininst`` command deprecated in Python
9670  3.8 has been removed. The distutils ``bdist_wheel`` command is now
9671  recommended to distribute binary packages on Windows.
9672
9673- bpo-24464: The undocumented built-in function
9674  ``sqlite3.enable_shared_cache`` is now deprecated, scheduled for removal
9675  in Python 3.12.  Its use is strongly discouraged by the SQLite3
9676  documentation.  Patch by Erlend E. Aasland.
9677
9678- bpo-42384: Make pdb populate sys.path[0] exactly the same as regular
9679  python execution.
9680
9681- bpo-42383: Fix pdb: previously pdb would fail to restart the debugging
9682  target if it was specified using a relative path and the current directory
9683  changed.
9684
9685- bpo-42005: Fix CLI of :mod:`cProfile` and :mod:`profile` to catch
9686  :exc:`BrokenPipeError`.
9687
9688- bpo-41604: Don't decrement the reference count of the previous user_ptr
9689  when set_panel_userptr fails.
9690
9691- bpo-41149: Allow executing callables that have a boolean value of
9692  ``False`` when passed to :class:`Threading.thread` as the target. Patch
9693  contributed by Barney Stratford.
9694
9695- bpo-38307: Add an 'end_lineno' attribute to the Class and Function objects
9696  that appear in the tree returned by pyclbr functions.  This and the
9697  existing 'lineno' attribute define the extent of class and def statements.
9698  Patch by Aviral Srivastava.
9699
9700- bpo-39273: The ``BUTTON5_*`` constants are now exposed in the
9701  :mod:`curses` module if available.
9702
9703- bpo-33289: Correct call to :mod:`tkinter.colorchooser` to return RGB
9704  triplet of ints instead of floats.  Patch by Cheryl Sabella.
9705
9706Documentation
9707-------------
9708
9709- bpo-40304: Fix doc for type(name, bases, dict).  Patch by Boris
9710  Verkhovskiy and Éric Araujo.
9711
9712- bpo-42811: Updated importlib.utils.resolve_name() doc to use
9713  __spec__.parent instead of __package__. (Thanks Yair Frid.)
9714
9715Tests
9716-----
9717
9718- bpo-40823: Use :meth:`unittest.TestLoader().loadTestsFromTestCase` instead
9719  of :meth:`unittest.makeSuite` in :mod:`sqlite3` tests. Patch by Erlend E.
9720  Aasland.
9721
9722- bpo-40810: In :mod:`sqlite3`, fix ``CheckTraceCallbackContent`` for SQLite
9723  pre 3.7.15.
9724
9725Build
9726-----
9727
9728- bpo-43031: Pass ``--timeout=$(TESTTIMEOUT)`` option to the default profile
9729  task ``./python -m test --pgo`` command.
9730
9731- bpo-36143: ``make regen-all`` now also runs ``regen-keyword``. Patch by
9732  Victor Stinner.
9733
9734- bpo-42874: Removed the grep -q and -E flags in the tzpath validation
9735  section of the configure script to better accommodate users of some
9736  platforms (specifically Solaris 10).
9737
9738- bpo-31904: Add library search path by wr-cc in add_cross_compiling_paths()
9739  for VxWorks.
9740
9741- bpo-42856: Add ``--with-wheel-pkg-dir=PATH`` option to the ``./configure``
9742  script. If specified, the :mod:`ensurepip` module looks for ``setuptools``
9743  and ``pip`` wheel packages in this directory: if both are present, these
9744  wheel packages are used instead of ensurepip bundled wheel packages.
9745
9746  Some Linux distribution packaging policies recommend against bundling
9747  dependencies. For example, Fedora installs wheel packages in the
9748  ``/usr/share/python-wheels/`` directory and don't install the
9749  ``ensurepip._bundled`` package.
9750
9751Windows
9752-------
9753
9754- bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i
9755
9756- bpo-42584: Upgrade Windows installer to use SQLite 3.34.0.
9757
9758macOS
9759-----
9760
9761- bpo-42504: Ensure that the value of
9762  sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') is always a string,
9763  even in when the value is parsable as an integer.
9764
9765IDLE
9766----
9767
9768- bpo-43008: Make IDLE invoke :func:`sys.excepthook` in normal, 2-process
9769  mode. Patch by Ken Hilton.
9770
9771- bpo-33065: Fix problem debugging user classes with __repr__ method.
9772
9773- bpo-23544: Disable Debug=>Stack Viewer when user code is running or
9774  Debugger is active, to prevent hang or crash.  Patch by Zackery Spytz.
9775
9776- bpo-32631: Finish zzdummy example extension module: make menu entries
9777  work; add docstrings and tests with 100% coverage.
9778
9779C API
9780-----
9781
9782- bpo-42979: When Python is built in debug mode (with C assertions), calling
9783  a type slot like ``sq_length`` (``__len__()`` in Python) now fails with a
9784  fatal error if the slot succeeded with an exception set, or failed with no
9785  exception set. The error message contains the slot, the type name, and the
9786  current exception (if an exception is set). Patch by Victor Stinner.
9787
9788- bpo-43030: Fixed a compiler warning in :c:func:`Py_UNICODE_ISSPACE()` on
9789  platforms with signed ``wchar_t``.
9790
9791
9792What's New in Python 3.10.0 alpha 4?
9793====================================
9794
9795*Release date: 2021-01-04*
9796
9797Core and Builtins
9798-----------------
9799
9800- bpo-42814: Fix undefined behavior in ``Objects/genericaliasobject.c``.
9801
9802- bpo-42806: Fix the column offsets for f-strings :mod:`ast` nodes
9803  surrounded by parentheses and for nodes that spawn multiple lines. Patch
9804  by Pablo Galindo.
9805
9806- bpo-40631: Fix regression where a single parenthesized starred expression
9807  was a valid assignment target.
9808
9809- bpo-27794: Improve the error message for failed writes/deletes to property
9810  objects. When possible, the attribute name is now shown. Patch provided by
9811  Yurii Karabas.
9812
9813- bpo-42745: Make the type attribute lookup cache per-interpreter. Patch by
9814  Victor Stinner.
9815
9816- bpo-42246: Jumps to jumps are not eliminated when it would break PEP 626.
9817
9818- bpo-42246: Make sure that the ``f_lasti`` and ``f_lineno`` attributes of a
9819  frame are set correctly when an exception is raised or re-raised. Required
9820  for PEP 626.
9821
9822- bpo-32381: The coding cookie (ex: ``# coding: latin1``) is now ignored in
9823  the command passed to the :option:`-c` command line option. Patch by
9824  Victor Stinner.
9825
9826- bpo-30858: Improve error location in expressions that contain assignments.
9827  Patch by Pablo Galindo and Lysandros Nikolaou.
9828
9829- bpo-42615: Remove jump commands made redundant by the deletion of
9830  unreachable bytecode blocks
9831
9832- bpo-42639: Make the :mod:`atexit` module state per-interpreter. It is now
9833  safe have more than one :mod:`atexit` module instance. Patch by Dong-hee
9834  Na and Victor Stinner.
9835
9836- bpo-32381: Fix encoding name when running a ``.pyc`` file on Windows:
9837  :c:func:`PyRun_SimpleFileExFlags()` now uses the correct encoding to
9838  decode the filename.
9839
9840- bpo-42195: The ``__args__`` of the parameterized generics for
9841  :data:`typing.Callable` and :class:`collections.abc.Callable` are now
9842  consistent.  The ``__args__`` for :class:`collections.abc.Callable` are
9843  now flattened while :data:`typing.Callable`'s have not changed.  To allow
9844  this change, :class:`types.GenericAlias` can now be subclassed and
9845  ``collections.abc.Callable``'s ``__class_getitem__`` will now return a
9846  subclass of ``types.GenericAlias``.  Tests for typing were also updated to
9847  not subclass things like ``Callable[..., T]`` as that is not a valid base
9848  class.  Finally, both ``Callable``\ s no longer validate their
9849  ``argtypes``, in ``Callable[[argtypes], resulttype]`` to prepare for
9850  :pep:`612`.  Patch by Ken Jin.
9851
9852- bpo-40137: Convert functools module to use
9853  :c:func:`PyType_FromModuleAndSpec`.
9854
9855- bpo-40077: Convert :mod:`array` to use heap types, and establish module
9856  state for these.
9857
9858- bpo-42008: Fix _random.Random() seeding.
9859
9860- bpo-1635741: Port the :mod:`pyexpat` extension module to multi-phase
9861  initialization (:pep:`489`).
9862
9863- bpo-40521: Make the Unicode dictionary of interned strings compatible with
9864  subinterpreters. Patch by Victor Stinner.
9865
9866- bpo-39465: Make :c:func:`_PyUnicode_FromId` function compatible with
9867  subinterpreters. Each interpreter now has an array of identifier objects
9868  (interned strings decoded from UTF-8). Patch by Victor Stinner.
9869
9870Library
9871-------
9872
9873- bpo-42257: Handle empty string in variable executable in
9874  platform.libc_ver()
9875
9876- bpo-42772: randrange() now raises a TypeError when step is specified
9877  without a stop argument.  Formerly, it silently ignored the step argument.
9878
9879- bpo-42759: Fixed equality comparison of :class:`tkinter.Variable` and
9880  :class:`tkinter.font.Font`. Objects which belong to different Tcl
9881  interpreters are now always different, even if they have the same name.
9882
9883- bpo-42756: Configure LMTP Unix-domain socket to use socket global default
9884  timeout when a timeout is not explicitly provided.
9885
9886- bpo-23328: Allow / character in username, password fields on _PROXY
9887  envars.
9888
9889- bpo-42740: :func:`typing.get_args` and :func:`typing.get_origin` now
9890  support :pep:`604` union types and :pep:`612` additions to ``Callable``.
9891
9892- bpo-42655: :mod:`subprocess` *extra_groups* is now correctly passed into
9893  setgroups() system call.
9894
9895- bpo-42727: ``EnumMeta.__prepare__`` now accepts ``**kwds`` to properly
9896  support ``__init_subclass__``
9897
9898- bpo-38308: Add optional *weights* to *statistics.harmonic_mean()*.
9899
9900- bpo-42721: When simple query dialogs (:mod:`tkinter.simpledialog`),
9901  message boxes (:mod:`tkinter.messagebox`) or color choose dialog
9902  (:mod:`tkinter.colorchooser`) are created without arguments *master* and
9903  *parent*, and the default root window is not yet created, and
9904  :func:`~tkinter.NoDefaultRoot` was not called, a new temporal hidden root
9905  window will be created automatically. It will not be set as the default
9906  root window and will be destroyed right after closing the dialog window.
9907  It will help to use these simple dialog windows in programs which do not
9908  need other GUI.
9909
9910- bpo-25246: Optimized :meth:`collections.deque.remove`.
9911
9912- bpo-35728: Added a root parameter to :func:`tkinter.font.nametofont`.
9913
9914- bpo-15303: :mod:`tkinter` supports now widgets with boolean value False.
9915
9916- bpo-42681: Fixed range checks for color and pair numbers in :mod:`curses`.
9917
9918- bpo-42685: Improved placing of simple query windows in Tkinter (such as
9919  :func:`tkinter.simpledialog.askinteger`). They are now centered at the
9920  center of the parent window if it is specified and shown, otherwise at the
9921  center of the screen.
9922
9923- bpo-9694: Argparse help no longer uses the confusing phrase, "optional
9924  arguments". It uses "options" instead.
9925
9926- bpo-1635741: Port the :mod:`_thread` extension module to the multiphase
9927  initialization API (:pep:`489`) and convert its static types to heap
9928  types.
9929
9930- bpo-37961: Fix crash in :func:`tracemalloc.Traceback.__repr__` (regressed
9931  in Python 3.9).
9932
9933- bpo-42630: :mod:`tkinter` functions and constructors which need a default
9934  root window raise now :exc:`RuntimeError` with descriptive message instead
9935  of obscure :exc:`AttributeError` or :exc:`NameError` if it is not created
9936  yet or cannot be created automatically.
9937
9938- bpo-42639: :func:`atexit._run_exitfuncs` now logs callback exceptions
9939  using :data:`sys.unraisablehook`, rather than logging them directly into
9940  :data:`sys.stderr` and raise the last exception.
9941
9942- bpo-42644: ``logging.disable`` will now validate the types and value of
9943  its parameter. It also now accepts strings representing the levels (as
9944  does ``loging.setLevel``) instead of only the numerical values.
9945
9946- bpo-42639: At Python exit, if a callback registered with
9947  :func:`atexit.register` fails, its exception is now logged. Previously,
9948  only some exceptions were logged, and the last exception was always
9949  silently ignored.
9950
9951- bpo-36541: Fixed lib2to3.pgen2 to be able to parse PEP-570 positional only
9952  argument syntax.
9953
9954- bpo-42382: In ``importlib.metadata``: -  ``EntryPoint`` objects now expose
9955  a ``.dist`` object referencing the ``Distribution`` when constructed from
9956  a ``Distribution``. - Add support for package discovery under package
9957  normalization rules. - The object returned by ``metadata()`` now has a
9958  formally defined protocol called ``PackageMetadata`` with declared support
9959  for the ``.get_all()`` method. - Synced with importlib_metadata 3.3.
9960
9961- bpo-41877: A check is added against misspellings of autospect, auto_spec
9962  and set_spec being passed as arguments to patch, patch.object and
9963  create_autospec.
9964
9965- bpo-39717: [tarfile] update nested exception raising to use ``from None``
9966  or ``from e``
9967
9968- bpo-41877: AttributeError for suspected misspellings of assertions on
9969  mocks are now pointing out that the cause are misspelled assertions and
9970  also what to do if the misspelling is actually an intended attribute name.
9971  The unittest.mock document is also updated to reflect the current set of
9972  recognised misspellings.
9973
9974- bpo-41559: Implemented :pep:`612`: added ``ParamSpec`` and ``Concatenate``
9975  to :mod:`typing`.  Patch by Ken Jin.
9976
9977- bpo-42385: StrEnum: fix _generate_next_value_ to return a str
9978
9979- bpo-31904: Define THREAD_STACK_SIZE for VxWorks.
9980
9981- bpo-34750: [Enum] `_EnumDict.update()` is now supported
9982
9983- bpo-42517: Enum: private names do not become members / do not generate
9984  errors -- they remain normal attributes
9985
9986- bpo-42678: ``Enum``: call ``__init_subclass__`` after members have been
9987  added
9988
9989- bpo-28964: :func:`ast.literal_eval` adds line number information (if
9990  available) in error message for malformed nodes.
9991
9992- bpo-42470: :func:`random.sample` no longer warns on a sequence which is
9993  also a set.
9994
9995- bpo-31904: :func:`posixpath.expanduser` returns the input *path* unchanged
9996  if user home directory is None on VxWorks.
9997
9998- bpo-42388: Fix subprocess.check_output(..., input=None) behavior when
9999  text=True to be consistent with that of the documentation and
10000  universal_newlines=True.
10001
10002- bpo-34463: Fixed discrepancy between :mod:`traceback` and the interpreter
10003  in formatting of SyntaxError with lineno not set (:mod:`traceback` was
10004  changed to match interpreter).
10005
10006- bpo-42393: Raise :exc:`OverflowError` instead of silent truncation in
10007  :meth:`socket.ntohs` and :meth:`socket.htons`.  Silent truncation was
10008  deprecated in Python 3.7. Patch by Erlend E. Aasland
10009
10010- bpo-42222: Harmonized :func:`random.randrange` argument handling to match
10011  :func:`range`.
10012
10013  * The integer test and conversion in ``randrange()`` now uses
10014    :func:`operator.index`.
10015  * Non-integer arguments to ``randrange()`` are deprecated.
10016  * The ``ValueError`` is deprecated in favor of a ``TypeError``.
10017  * It now runs a little faster than before.
10018
10019  (Contributed by Raymond Hettinger and Serhiy Storchaka.)
10020
10021- bpo-42163: Restore compatibility for ``uname_result`` around deepcopy and
10022  _replace.
10023
10024- bpo-42090: ``zipfile.Path.joinpath`` now accepts arbitrary arguments, same
10025  as ``pathlib.Path.joinpath``.
10026
10027- bpo-1635741: Port the _csv module to the multi-phase initialization API
10028  (:pep:`489`).
10029
10030- bpo-42059: :class:`typing.TypedDict` types created using the alternative
10031  call-style syntax now correctly respect the ``total`` keyword argument
10032  when setting their ``__required_keys__`` and ``__optional_keys__`` class
10033  attributes.
10034
10035- bpo-41960: Add ``globalns`` and ``localns`` parameters to the
10036  :func:`inspect.signature` and :meth:`inspect.Signature.from_callable`.
10037
10038- bpo-41907: fix ``format()`` behavior for ``IntFlag``
10039
10040- bpo-41891: Ensure asyncio.wait_for waits for task completion
10041
10042- bpo-24792: Fixed bug where :mod:`zipimporter` sometimes reports an
10043  incorrect cause of import errors.
10044
10045- bpo-31904: Fix site and sysconfig modules for VxWorks RTOS which has no
10046  home directories.
10047
10048- bpo-41462: Add :func:`os.set_blocking()` support for VxWorks RTOS.
10049
10050- bpo-40219: Lowered :class:`tkinter.ttk.LabeledScale` dummy widget to
10051  prevent hiding part of the content label.
10052
10053- bpo-37193: Fixed memory leak in ``socketserver.ThreadingMixIn`` introduced
10054  in Python 3.7.
10055
10056- bpo-39068: Fix initialization race condition in :func:`a85encode` and
10057  :func:`b85encode` in :mod:`base64`. Patch by Brandon Stansbury.
10058
10059Documentation
10060-------------
10061
10062- bpo-17140: Add documentation for the
10063  :class:`multiprocessing.pool.ThreadPool` class.
10064
10065- bpo-34398: Prominently feature listings from the glossary in documentation
10066  search results. Patch by Ammar Askar.
10067
10068Tests
10069-----
10070
10071- bpo-42794: Update test_nntplib to use official group name of news.aioe.org
10072  for testing. Patch by Dong-hee Na.
10073
10074- bpo-31904: Skip some asyncio tests on VxWorks.
10075
10076- bpo-42641: Enhance ``test_select.test_select()``: it now takes 500
10077  milliseconds rather than 10 seconds. Use Python rather than a shell to
10078  make the test more portable.
10079
10080- bpo-31904: Skip some tests in _test_all_chown_common() on VxWorks.
10081
10082- bpo-42199: Fix bytecode helper assertNotInBytecode.
10083
10084- bpo-41443: Add more attribute checking in test_posix.py
10085
10086- bpo-31904: Disable os.popen and impacted tests on VxWorks
10087
10088- bpo-41439: Port test_ssl and test_uuid to VxWorks RTOS.
10089
10090Build
10091-----
10092
10093- bpo-42692: Fix __builtin_available check on older compilers. Patch by
10094  Joshua Root.
10095
10096- bpo-27640: Added ``--disable-test-modules`` option to the ``configure``
10097  script: don't build nor install test modules. Patch by Xavier de Gaye,
10098  Thomas Petazzoni and Peixing Xin.
10099
10100- bpo-42604: Now all platforms use a value for the "EXT_SUFFIX" build
10101  variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now
10102  ".cpython-310d.so" instead of ".so"). Previously only Linux, Mac and
10103  VxWorks were using a value for "EXT_SUFFIX" that included "SOABI".
10104
10105- bpo-42598: Fix implicit function declarations in configure which could
10106  have resulted in incorrect configuration checks.  Patch contributed by
10107  Joshua Root.
10108
10109- bpo-31904: Enable libpython3.so for VxWorks.
10110
10111- bpo-29076: Add fish shell support to macOS installer.
10112
10113macOS
10114-----
10115
10116- bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (rc2,
10117  expected to be final release).
10118
10119- bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i.
10120
10121- bpo-42584: Update macOS installer to use SQLite 3.34.0.
10122
10123Tools/Demos
10124-----------
10125
10126- bpo-42726: Fixed Python 3 compatibility issue with gdb/libpython.py
10127  handling of attribute dictionaries.
10128
10129- bpo-42613: Fix ``freeze.py`` tool to use the prope config and library
10130  directories. Patch by Victor Stinner.
10131
10132C API
10133-----
10134
10135- bpo-42591: Export the :c:func:`Py_FrozenMain` function: fix a Python 3.9.0
10136  regression. Python 3.9 uses ``-fvisibility=hidden`` and the function was
10137  not exported explicitly and so not exported.
10138
10139- bpo-32381: Remove the private :c:func:`_Py_fopen` function which is no
10140  longer needed. Use :c:func:`_Py_wfopen` or :c:func:`_Py_fopen_obj`
10141  instead. Patch by Victor Stinner.
10142
10143- bpo-1635741: Port :mod:`resource` extension module to module state
10144
10145- bpo-42111: Update the ``xxlimited`` module to be a better example of how
10146  to use the limited C API.
10147
10148- bpo-40052: Fix an alignment build warning/error in function
10149  ``PyVectorcall_Function()``. Patch by Andreas Schneider, Antoine Pitrou
10150  and Petr Viktorin.
10151
10152
10153What's New in Python 3.10.0 alpha 3?
10154====================================
10155
10156*Release date: 2020-12-07*
10157
10158Security
10159--------
10160
10161- bpo-40791: Add ``volatile`` to the accumulator variable in
10162  ``hmac.compare_digest``, making constant-time-defeating optimizations less
10163  likely.
10164
10165Core and Builtins
10166-----------------
10167
10168- bpo-42576: ``types.GenericAlias`` will now raise a ``TypeError`` when
10169  attempting to initialize with a keyword argument.  Previously, this would
10170  cause the interpreter to crash if the interpreter was compiled with debug
10171  symbols. This does not affect interpreters compiled for release.  Patch by
10172  Ken Jin.
10173
10174- bpo-42536: Several built-in and standard library types now ensure that
10175  their internal result tuples are always tracked by the :term:`garbage
10176  collector <garbage collection>`:
10177
10178  - :meth:`collections.OrderedDict.items() <collections.OrderedDict>`
10179
10180  - :meth:`dict.items`
10181
10182  - :func:`enumerate`
10183
10184  - :func:`functools.reduce`
10185
10186  - :func:`itertools.combinations`
10187
10188  - :func:`itertools.combinations_with_replacement`
10189
10190  - :func:`itertools.permutations`
10191
10192  - :func:`itertools.product`
10193
10194  - :func:`itertools.zip_longest`
10195
10196  - :func:`zip`
10197
10198  Previously, they could have become untracked by a prior garbage
10199  collection. Patch by Brandt Bucher.
10200
10201- bpo-42500: Improve handling of exceptions near recursion limit. Converts a
10202  number of Fatal Errors in RecursionErrors.
10203
10204- bpo-42246: PEP 626: After a return, the f_lineno attribute of a frame is
10205  always the last line executed.
10206
10207- bpo-42435: Speed up comparison of bytes objects with non-bytes objects
10208  when option :option:`-b` is specified. Speed up comparison of bytarray
10209  objects with non-buffer object.
10210
10211- bpo-1635741: Port the ``_warnings`` extension module to the multi-phase
10212  initialization API (:pep:`489`). Patch by Victor Stinner.
10213
10214- bpo-41686: On Windows, the ``SIGINT`` event, ``_PyOS_SigintEvent()``, is
10215  now created even if Python is configured to not install signal handlers
10216  (if :c:member:`PyConfig.install_signal_handlers` equals to 0, or
10217  ``Py_InitializeEx(0)``).
10218
10219- bpo-42381: Allow assignment expressions in set literals and set
10220  comprehensions as per PEP 572. Patch by Pablo Galindo.
10221
10222- bpo-42202: Change function parameters annotations internal representation
10223  to tuple of strings. Patch provided by Yurii Karabas.
10224
10225- bpo-42374: Fix a regression introduced by the new parser, where an
10226  unparenthesized walrus operator was not allowed within generator
10227  expressions.
10228
10229- bpo-42316: Allow an unparenthesized walrus in subscript indexes.
10230
10231- bpo-42349: Make sure that the compiler front-end produces a well-formed
10232  control flow graph. Be be more aggressive in the compiler back-end, as it
10233  is now safe to do so.
10234
10235- bpo-42296: On Windows, fix a regression in signal handling which prevented
10236  to interrupt a program using CTRL+C. The signal handler can be run in a
10237  thread different than the Python thread, in which case the test deciding
10238  if the thread can handle signals is wrong.
10239
10240- bpo-42332: :class:`types.GenericAlias` objects can now be the targets of
10241  weakrefs.
10242
10243- bpo-42282: Optimise constant subexpressions that appear as part of named
10244  expressions (previously the AST optimiser did not descend into named
10245  expressions). Patch by Nick Coghlan.
10246
10247- bpo-42266: Fixed a bug with the LOAD_ATTR opcode cache that was not
10248  respecting monkey-patching a class-level attribute to make it a
10249  descriptor. Patch by Pablo Galindo.
10250
10251- bpo-40077: Convert :mod:`queue` to use heap types.
10252
10253- bpo-42246: Improved accuracy of line tracing events and f_lineno attribute
10254  of Frame objects. See PEP 626 for details.
10255
10256- bpo-40077: Convert :mod:`mmap` to use heap types.
10257
10258- bpo-42233: Allow ``GenericAlias`` objects to use :ref:`union type
10259  expressions <types-union>`. This allows expressions like ``list[int] |
10260  dict[float, str]`` where previously a ``TypeError`` would have been
10261  thrown.  This also fixes union type expressions not de-duplicating
10262  ``GenericAlias`` objects. (Contributed by Ken Jin in :issue:`42233`.)
10263
10264- bpo-26131: The import system triggers a `ImportWarning` when it falls back
10265  to using `load_module()`.
10266
10267Library
10268-------
10269
10270- bpo-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed.
10271  Replace the special purpose getallmatchingheaders with generic get_all
10272  method and add relevant tests.
10273
10274  Original Patch by Martin Panter. Modified by Senthil Kumaran.
10275
10276- bpo-42562: Fix issue when dis failed to parse function that has no line
10277  numbers. Patch provided by Yurii Karabas.
10278
10279- bpo-17735: :func:`inspect.findsource` now raises :exc:`OSError` instead of
10280  :exc:`IndexError` when :attr:`co_lineno` of a code object is greater than
10281  the file length. This can happen, for example, when a file is edited after
10282  it was imported.  PR by Irit Katriel.
10283
10284- bpo-42116: Fix handling of trailing comments by :func:`inspect.getsource`.
10285
10286- bpo-42532: Remove unexpected call of ``__bool__`` when passing a
10287  ``spec_arg`` argument to a Mock.
10288
10289- bpo-38200: Added itertools.pairwise()
10290
10291- bpo-41818: Fix test_master_read() so that it succeeds on all platforms
10292  that either raise OSError or return b"" upon reading from master.
10293
10294- bpo-42487: ChainMap.__iter__ no longer calls __getitem__ on underlying
10295  maps
10296
10297- bpo-42482: :class:`~traceback.TracebackException` no longer holds a
10298  reference to the exception's traceback object. Consequently, instances of
10299  TracebackException for equivalent but non-equal exceptions now compare as
10300  equal.
10301
10302- bpo-41818: Make test_openpty() avoid unexpected success due to number of
10303  rows and/or number of columns being == 0.
10304
10305- bpo-42392: Remove loop parameter from ``asyncio.subprocess`` and
10306  ``asyncio.tasks`` functions. Patch provided by Yurii Karabas.
10307
10308- bpo-42392: Remove loop parameter from ``asyncio.open_connection`` and
10309  ``asyncio.start_server`` functions. Patch provided by Yurii Karabas.
10310
10311- bpo-28468: Add :func:`platform.freedesktop_os_release` function to parse
10312  freedesktop.org ``os-release`` files.
10313
10314- bpo-42299: Removed the ``formatter`` module, which was deprecated in
10315  Python 3.4. It is somewhat obsolete, little used, and not tested. It was
10316  originally scheduled to be removed in Python 3.6, but such removals were
10317  delayed until after Python 2.7 EOL. Existing users should copy whatever
10318  classes they use into their code. Patch by Dong-hee Na and and Terry J.
10319  Reedy.
10320
10321- bpo-26131: Deprecate zipimport.zipimporter.load_module() in favour of
10322  exec_module().
10323
10324- bpo-41818: Updated tests for the pty library. test_basic() has been
10325  changed to test_openpty(); this additionally checks if slave termios and
10326  slave winsize are being set properly by pty.openpty(). In order to add
10327  support for FreeBSD, NetBSD, OpenBSD, and Darwin, this also adds
10328  test_master_read(), which demonstrates that pty.spawn() should not depend
10329  on an OSError to exit from its copy loop.
10330
10331- bpo-42392: Remove loop parameter from ``__init__`` in all
10332  ``asyncio.locks`` and ``asyncio.Queue`` classes. Patch provided by Yurii
10333  Karabas.
10334
10335- bpo-15450: Make :class:`filecmp.dircmp` respect subclassing. Now the
10336  :attr:`filecmp.dircmp.subdirs` behaves as expected when subclassing
10337  dircmp.
10338
10339- bpo-42413: The exception :exc:`socket.timeout` is now an alias of
10340  :exc:`TimeoutError`.
10341
10342- bpo-31904: Support signal module on VxWorks.
10343
10344- bpo-42406: We fixed an issue in `pickle.whichmodule` in which importing
10345  `multiprocessing` could change the how pickle identifies which module an
10346  object belongs to, potentially breaking the unpickling of those objects.
10347
10348- bpo-42403: Simplify the :mod:`importlib` external bootstrap code:
10349  ``importlib._bootstrap_external`` now uses regular imports to import
10350  builtin modules. When it is imported, the builtin :func:`__import__()`
10351  function is already fully working and so can be used to import builtin
10352  modules like :mod:`sys`. Patch by Victor Stinner.
10353
10354- bpo-1635741: Convert _sre module types to heap types (PEP 384). Patch by
10355  Erlend E. Aasland.
10356
10357- bpo-42375: subprocess module update for DragonFlyBSD support.
10358
10359- bpo-41713: Port the ``_signal`` extension module to the multi-phase
10360  initialization API (:pep:`489`). Patch by Victor Stinner and Mohamed
10361  Koubaa.
10362
10363- bpo-37205: :func:`time.time()`, :func:`time.perf_counter()` and
10364  :func:`time.monotonic()` functions can no longer fail with a Python fatal
10365  error, instead raise a regular Python exception on failure.
10366
10367- bpo-42328: Fixed :meth:`tkinter.ttk.Style.map`. The function accepts now
10368  the representation of the default state as empty sequence (as returned by
10369  ``Style.map()``). The structure of the result is now the same on all
10370  platform and does not depend on the value of ``wantobjects``.
10371
10372- bpo-42345: Fix various issues with ``typing.Literal`` parameter handling
10373  (flatten, deduplicate, use type to cache key). Patch provided by Yurii
10374  Karabas.
10375
10376- bpo-37205: :func:`time.perf_counter()` on Windows and
10377  :func:`time.monotonic()` on macOS are now system-wide. Previously, they
10378  used an offset computed at startup to reduce the precision loss caused by
10379  the float type. Use :func:`time.perf_counter_ns()` and
10380  :func:`time.monotonic_ns()` added in Python 3.7 to avoid this precision
10381  loss.
10382
10383- bpo-42318: Fixed support of non-BMP characters in :mod:`tkinter` on macOS.
10384
10385- bpo-42350: Fix the :class:`threading.Thread` class at fork: do nothing if
10386  the thread is already stopped (ex: fork called at Python exit).
10387  Previously, an error was logged in the child process.
10388
10389- bpo-42333: Port _ssl extension module to heap types.
10390
10391- bpo-42014: The ``onerror`` callback from ``shutil.rmtree`` now receives
10392  correct function when ``os.open`` fails.
10393
10394- bpo-42237: Fix `os.sendfile()` on illumos.
10395
10396- bpo-42308: Add :data:`threading.__excepthook__` to allow retrieving the
10397  original value of :func:`threading.excepthook` in case it is set to a
10398  broken or a different value. Patch by Mario Corchero.
10399
10400- bpo-42131: Implement PEP 451/spec methods on zipimport.zipimporter:
10401  find_spec(), create_module(), and exec_module().
10402
10403  This also allows for the documented deprecation of find_loader(),
10404  find_module(), and load_module().
10405
10406- bpo-41877: Mock objects which are not unsafe will now raise an
10407  AttributeError if an attribute with the prefix asert, aseert, or assrt is
10408  accessed, in addition to this already happening for the prefixes assert or
10409  assret.
10410
10411- bpo-42264: ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete
10412  since Python 3.3, when it was made an alias to :class:`str`.  It is now
10413  deprecated, scheduled for removal in Python 3.12.
10414
10415- bpo-42251: Added :func:`threading.gettrace` and
10416  :func:`threading.getprofile` to retrieve the functions set by
10417  :func:`threading.settrace` and :func:`threading.setprofile` respectively.
10418  Patch by Mario Corchero.
10419
10420- bpo-42249: Fixed writing binary Plist files larger than 4 GiB.
10421
10422- bpo-42236: On Unix, the :func:`os.device_encoding` function now returns
10423  ``'UTF-8'`` rather than the device encoding if the :ref:`Python UTF-8 Mode
10424  <utf8-mode>` is enabled.
10425
10426- bpo-41754: webbrowser: Ignore *NotADirectoryError* when calling
10427  ``xdg-settings``.
10428
10429- bpo-42183: Fix a stack overflow error for asyncio Task or Future repr().
10430
10431  The overflow occurs under some circumstances when a Task or Future
10432  recursively returns itself.
10433
10434- bpo-42140: Improve asyncio.wait function to create the futures set just
10435  one time.
10436
10437- bpo-42133: Update various modules in the stdlib to fall back on
10438  `__spec__.loader` when `__loader__` isn't defined on a module.
10439
10440- bpo-26131: The `load_module()` methods found in importlib now trigger a
10441  DeprecationWarning.
10442
10443- bpo-39825: Windows: Change ``sysconfig.get_config_var('EXT_SUFFIX')`` to
10444  the expected full ``platform_tag.extension`` format. Previously it was
10445  hard-coded to ``.pyd``, now it is compatible with ``distutils.sysconfig``
10446  and will result in something like ``.cp38-win_amd64.pyd``. This brings
10447  windows into conformance with the other platforms.
10448
10449- bpo-26389: The :func:`traceback.format_exception`,
10450  :func:`traceback.format_exception_only`, and
10451  :func:`traceback.print_exception` functions can now take an exception
10452  object as a positional-only argument.
10453
10454- bpo-41889: Enum: fix regression involving inheriting a multiply inherited
10455  enum
10456
10457- bpo-41861: Convert :mod:`sqlite3` to use heap types (PEP 384). Patch by
10458  Erlend E. Aasland.
10459
10460- bpo-40624: Added support for the XPath ``!=`` operator in xml.etree
10461
10462- bpo-28850: Fix :meth:`pprint.PrettyPrinter.format` overrides being ignored
10463  for contents of small containers. The :func:`pprint._safe_repr` function
10464  was removed.
10465
10466- bpo-41625: Expose the :c:func:`splice` as :func:`os.splice` in the
10467  :mod:`os` module. Patch by Pablo Galindo
10468
10469- bpo-34215: Clarify the error message for
10470  :exc:`asyncio.IncompleteReadError` when ``expected`` is ``None``.
10471
10472- bpo-41543: Add async context manager support for contextlib.nullcontext.
10473
10474- bpo-21041: :attr:`pathlib.PurePath.parents` now supports negative
10475  indexing. Patch contributed by Yaroslav Pankovych.
10476
10477- bpo-41332: Added missing connect_accepted_socket() method to
10478  ``asyncio.AbstractEventLoop``.
10479
10480- bpo-12800: Extracting a symlink from a tarball should succeed and
10481  overwrite the symlink if it already exists. The fix is to remove the
10482  existing file or symlink before extraction. Based on patch by Chris AtLee,
10483  Jeffrey Kintscher, and Senthil Kumaran.
10484
10485- bpo-40968: :mod:`urllib.request` and :mod:`http.client` now send
10486  ``http/1.1`` ALPN extension during TLS handshake when no custom context is
10487  supplied.
10488
10489- bpo-41001: Add func:`os.eventfd` to provide a low level interface for
10490  Linux's event notification file descriptor.
10491
10492- bpo-40816: Add AsyncContextDecorator to contextlib to support async
10493  context manager as a decorator.
10494
10495- bpo-40550: Fix time-of-check/time-of-action issue in
10496  subprocess.Popen.send_signal.
10497
10498- bpo-39411: Add an ``is_async`` identifier to :mod:`pyclbr`'s ``Function``
10499  objects. Patch by Batuhan Taskaya
10500
10501- bpo-35498: Add slice support to :attr:`pathlib.PurePath.parents`.
10502
10503Documentation
10504-------------
10505
10506- bpo-42238: Tentative to deprecate ``make suspicious`` by first removing it
10507  from the CI and documentation builds, but keeping it around for manual
10508  uses.
10509
10510- bpo-42153: Fix the URL for the IMAP protocol documents.
10511
10512- bpo-41028: Language and version switchers, previously maintained in every
10513  cpython branches, are now handled by docsbuild-script.
10514
10515Tests
10516-----
10517
10518- bpo-41473: Re-enable test_gdb on gdb 9.2 and newer:
10519  https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb
10520  10.1.
10521
10522- bpo-42553: Fix ``test_asyncio.test_call_later()`` race condition: don't
10523  measure asyncio performance in the ``call_later()`` unit test. The test
10524  failed randomly on the CI.
10525
10526- bpo-31904: Fix test_netrc on VxWorks: create temporary directories using
10527  temp_cwd().
10528
10529- bpo-31904: skip test_getaddrinfo_ipv6_scopeid_symbolic and
10530  test_getnameinfo_ipv6_scopeid_symbolic on VxWorks
10531
10532- bpo-31904: skip test_test of test_mailcap on VxWorks
10533
10534- bpo-31904: add shell requirement for test_pipes
10535
10536- bpo-31904: skip some tests related to fifo on VxWorks
10537
10538- bpo-31904: Fix test_doctest.py failures for VxWorks.
10539
10540- bpo-40754: Include ``_testinternalcapi`` module in Windows installer for
10541  test suite
10542
10543- bpo-41561: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is
10544  not available
10545
10546- bpo-31904: Fix os module failures for VxWorks RTOS.
10547
10548- bpo-31904: Fix fifo test cases for VxWorks RTOS.
10549
10550Build
10551-----
10552
10553- bpo-31904: remove libnet dependency from detect_socket() for VxWorks
10554
10555- bpo-42398: Fix a race condition in "make regen-all" when make -jN option
10556  is used to run jobs in parallel. The clinic.py script now only use atomic
10557  write to write files. Moveover, generated files are now left unchanged if
10558  the content does not change, to not change the file modification time.
10559
10560- bpo-41617: Fix building ``pycore_bitutils.h`` internal header on old clang
10561  version without ``__builtin_bswap16()`` (ex: Xcode 4.6.3 on Mac OS X
10562  10.7). Patch by Joshua Root and Victor Stinner.
10563
10564- bpo-38823: It is no longer possible to build the ``_ctypes`` extension
10565  module without :c:type:`wchar_t` type: remove ``CTYPES_UNICODE`` macro.
10566  Anyway, the :c:type:`wchar_t` type is required to build Python. Patch by
10567  Victor Stinner.
10568
10569- bpo-42087: Support was removed for AIX 5.3 and below. See :issue:`40680`.
10570
10571- bpo-40998: Addressed three compiler warnings found by undefined behavior
10572  sanitizer (ubsan).
10573
10574Windows
10575-------
10576
10577- bpo-42120: Remove macro definition of ``copysign`` (to ``_copysign``) in
10578  headers.
10579
10580- bpo-38506: The Windows launcher now properly handles Python 3.10 when
10581  listing installed Python versions.
10582
10583macOS
10584-----
10585
10586- bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11
10587
10588- bpo-41116: Ensure distutils.unixxcompiler.find_library_file can find
10589  system provided libraries on macOS 11.
10590
10591- bpo-41100: Add support for macOS 11 and Apple Silicon systems.
10592
10593  It is now possible to build "Universal 2" binaries using
10594  "--enable-universalsdk --with-universal-archs=universal2".
10595
10596  Binaries build on later macOS versions can be deployed back to older
10597  versions (tested up to macOS 10.9), when using the correct deployment
10598  target. This is tested using Xcode 11 and later.
10599
10600- bpo-42232: Added Darwin specific madvise options to mmap module.
10601
10602- bpo-38443: The ``--enable-universalsdk`` and ``--with-universal-archs``
10603  options for the configure script now check that the specified
10604  architectures can be used.
10605
10606IDLE
10607----
10608
10609- bpo-42508: Keep IDLE running on macOS.  Remove obsolete workaround that
10610  prevented running files with shortcuts when using new universal2
10611  installers built on macOS 11.
10612
10613- bpo-42426: Fix reporting offset of the RE error in searchengine.
10614
10615- bpo-42415: Get docstrings for IDLE calltips more often by using
10616  inspect.getdoc.
10617
10618Tools/Demos
10619-----------
10620
10621- bpo-42212: The smelly.py script now also checks the Python dynamic library
10622  and extension modules, not only the Python static library. Make also the
10623  script more verbose: explain what it does.
10624
10625- bpo-36310: Allow :file:`Tools/i18n/pygettext.py` to detect calls to
10626  ``gettext`` in f-strings.
10627
10628C API
10629-----
10630
10631- bpo-42423: The :c:func:`PyType_FromSpecWithBases` and
10632  :c:func:`PyType_FromModuleAndSpec` functions now accept a single class as
10633  the *bases* argument.
10634
10635- bpo-1635741: Port :mod:`select` extension module to multiphase
10636  initialization (:pep:`489`).
10637
10638- bpo-1635741: Port _posixsubprocess extension module to multiphase
10639  initialization (:pep:`489`).
10640
10641- bpo-1635741: Port _posixshmem extension module to multiphase
10642  initialization (:pep:`489`)
10643
10644- bpo-1635741: Port _struct extension module to multiphase initialization
10645  (:pep:`489`)
10646
10647- bpo-1635741: Port :mod:`spwd` extension module to multiphase
10648  initialization (:pep:`489`)
10649
10650- bpo-1635741: Port :mod:`gc` extension module to multiphase initialization
10651  (:pep:`489`)
10652
10653- bpo-1635741: Port _queue extension module to multiphase initialization
10654  (:pep:`489`)
10655
10656- bpo-39573: Convert :c:func:`Py_TYPE` and :c:func:`Py_SIZE` back to macros
10657  to allow using them as an l-value. Many third party C extension modules
10658  rely on the ability of using Py_TYPE() and Py_SIZE() to set an object type
10659  and size: ``Py_TYPE(obj) = type;`` and ``Py_SIZE(obj) = size;``.
10660
10661- bpo-1635741: Port :mod:`symtable` extension module to multiphase
10662  initialization (:pep:`489`)
10663
10664- bpo-1635741: Port :mod:`grp` and :mod:`pwd` extension modules to
10665  multiphase initialization (:pep:`489`)
10666
10667- bpo-1635741: Port _random extension module to multiphase initialization
10668  (:pep:`489`)
10669
10670- bpo-1635741: Port _hashlib extension module to multiphase initialization
10671  (:pep:`489`)
10672
10673- bpo-41713: Removed the undocumented ``PyOS_InitInterrupts()`` function.
10674  Initializing Python already implicitly installs signal handlers: see
10675  :c:member:`PyConfig.install_signal_handlers`. Patch by Victor Stinner.
10676
10677- bpo-40170: The ``Py_TRASHCAN_BEGIN`` macro no longer accesses PyTypeObject
10678  attributes, but now can get the condition by calling the new private
10679  :c:func:`_PyTrash_cond()` function which hides implementation details.
10680
10681- bpo-42260: :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`,
10682  :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`,
10683  :c:func:`Py_GetPythonHome` and :c:func:`Py_GetProgramName` functions now
10684  return ``NULL`` if called before :c:func:`Py_Initialize` (before Python is
10685  initialized). Use the new :ref:`Python Initialization Configuration API
10686  <init-config>` to get the :ref:`Python Path Configuration.
10687  <init-path-config>`. Patch by Victor Stinner.
10688
10689- bpo-42260: The :c:func:`PyConfig_Read` function now only parses
10690  :c:member:`PyConfig.argv` arguments once: :c:member:`PyConfig.parse_argv`
10691  is set to ``2`` after arguments are parsed. Since Python arguments are
10692  strippped from :c:member:`PyConfig.argv`, parsing arguments twice would
10693  parse the application options as Python options.
10694
10695- bpo-42262: Added :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to
10696  increment the reference count of an object and return the object. Patch by
10697  Victor Stinner.
10698
10699- bpo-42260: When :c:func:`Py_Initialize` is called twice, the second call
10700  now updates more :mod:`sys` attributes for the configuration, rather than
10701  only :data:`sys.argv`. Patch by Victor Stinner.
10702
10703- bpo-41832: The :c:func:`PyType_FromModuleAndSpec` function now accepts
10704  NULL ``tp_doc`` slot.
10705
10706- bpo-1635741: Added :c:func:`PyModule_AddObjectRef` function: similar to
10707  :c:func:`PyModule_AddObject` but don't steal a reference to the value on
10708  success. Patch by Victor Stinner.
10709
10710- bpo-42171: The :c:data:`METH_FASTCALL` calling convention is added to the
10711  limited API. The functions  :c:func:`PyModule_AddType`,
10712  :c:func:`PyType_FromModuleAndSpec`, :c:func:`PyType_GetModule` and
10713  :c:func:`PyType_GetModuleState` are added to the limited API on Windows.
10714
10715- bpo-42085: Add dedicated entry to PyAsyncMethods for sending values
10716
10717- bpo-41073: :c:func:`PyType_GetSlot()` can now accept static types.
10718
10719- bpo-30459: :c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and
10720  :c:func:`PyCell_SET` macros can no longer be used as l-value or r-value.
10721  For example, ``x = PyList_SET_ITEM(a, b, c)`` and ``PyList_SET_ITEM(a, b,
10722  c) = x`` now fail with a compiler error. It prevents bugs like ``if
10723  (PyList_SET_ITEM (a, b, c) < 0) ...`` test. Patch by Zackery Spytz and
10724  Victor Stinner.
10725
10726
10727What's New in Python 3.10.0 alpha 2?
10728====================================
10729
10730*Release date: 2020-11-03*
10731
10732Security
10733--------
10734
10735- bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when
10736  processing malformed Apple Property List files in binary format.
10737
10738- bpo-42051: The :mod:`plistlib` module no longer accepts entity
10739  declarations in XML plist files to avoid XML vulnerabilities. This should
10740  not affect users as entity declarations are not used in regular plist
10741  files.
10742
10743Core and Builtins
10744-----------------
10745
10746- bpo-42236: If the ``nl_langinfo(CODESET)`` function returns an empty
10747  string, Python now uses UTF-8 as the filesystem encoding. Patch by Victor
10748  Stinner.
10749
10750- bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug
10751  mode. Now errors are checked in left-recursive rules to avoid cases where
10752  such errors do not get handled in time and appear as long-distance crashes
10753  in other places.
10754
10755- bpo-42214: Fixed a possible crash in the PEG parser when checking for the
10756  '!=' token in the ``barry_as_flufl`` rule. Patch by Pablo Galindo.
10757
10758- bpo-42206: Propagate and raise the errors caused by
10759  :c:func:`PyAST_Validate` in the parser.
10760
10761- bpo-41796: The :mod:`ast` module internal state is now per interpreter.
10762  Patch by Victor Stinner.
10763
10764- bpo-42143: Fix handling of errors during creation of ``PyFunctionObject``,
10765  which resulted in operations on uninitialized memory. Patch by Yonatan
10766  Goldschmidt.
10767
10768- bpo-41659: Fix a bug in the parser, where a curly brace following a
10769  `primary` didn't fail immediately. This led to invalid expressions like `a
10770  {b}` to throw a :exc:`SyntaxError` with a wrong offset, or invalid
10771  expressions ending with a curly brace like `a {` to not fail immediately
10772  in the REPL.
10773
10774- bpo-42150: Fix possible buffer overflow in the new parser when checking
10775  for continuation lines. Patch by Pablo Galindo.
10776
10777- bpo-42123: Run the parser two times. On the first run, disable all the
10778  rules that only generate better error messages to gain performance. If
10779  there's a parse failure, run the parser a second time with those enabled.
10780
10781- bpo-42093: The ``LOAD_ATTR`` instruction now uses new "per opcode cache"
10782  mechanism and it is about 36% faster now. Patch by Pablo Galindo and Yury
10783  Selivanov.
10784
10785- bpo-42030: Support for the legacy AIX-specific shared library loading
10786  support has been removed. All versions of AIX since 4.3 have supported and
10787  defaulted to using the common Unix mechanism instead.
10788
10789- bpo-41984: The garbage collector now tracks all user-defined classes.
10790  Patch by Brandt Bucher.
10791
10792- bpo-41993: Fixed potential issues with removing not completely initialized
10793  module from ``sys.modules`` when import fails.
10794
10795- bpo-41979: Star-unpacking is now allowed for with item's targets in the
10796  PEG parser.
10797
10798- bpo-41974: Removed special methods ``__int__``, ``__float__``,
10799  ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__rfloordiv__``,
10800  ``__rmod__`` and ``__rdivmod__`` of the :class:`complex` class.  They
10801  always raised a :exc:`TypeError`.
10802
10803- bpo-41902: Micro optimization when compute
10804  :c:member:`~PySequenceMethods.sq_item` and
10805  :c:member:`~PyMappingMethods.mp_subscript` of :class:`range`. Patch by
10806  Dong-hee Na.
10807
10808- bpo-41894: When loading a native module and a load failure occurs, prevent
10809  a possible UnicodeDecodeError when not running in a UTF-8 locale by
10810  decoding the load error message using the current locale's encoding.
10811
10812- bpo-41902: Micro optimization for range.index if step is 1. Patch by
10813  Dong-hee Na.
10814
10815- bpo-41435: Add `sys._current_exceptions()` function to retrieve a
10816  dictionary mapping each thread's identifier to the topmost exception
10817  currently active in that thread at the time the function is called.
10818
10819- bpo-38605: Enable ``from __future__ import annotations`` (:pep:`563`) by
10820  default. The values found in :attr:`__annotations__` dicts are now
10821  strings, e.g. ``{"x": "int"}`` instead of ``{"x": int}``.
10822
10823Library
10824-------
10825
10826- bpo-35455: On Solaris, :func:`~time.thread_time` is now implemented with
10827  ``gethrvtime()`` because ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` is not
10828  always available. Patch by Jakub Kulik.
10829
10830- bpo-42233: The :func:`repr` of :mod:`typing` types containing
10831  :ref:`Generic Alias Types <types-genericalias>` previously did not show
10832  the parameterized types in the ``GenericAlias``.  They have now been
10833  changed to do so.
10834
10835- bpo-29566: ``binhex.binhex()`` consistently writes macOS 9 line endings.
10836
10837- bpo-26789: The :class:`logging.FileHandler` class now keeps a reference to
10838  the builtin :func:`open` function to be able to open or reopen the file
10839  during Python finalization. Fix errors like: ``NameError: name 'open' is
10840  not defined``. Patch by Victor Stinner.
10841
10842- bpo-42157: Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an
10843  internal PyCapsule object. The related private ``_PyUnicode_Name_CAPI``
10844  structure was moved to the internal C API. Patch by Victor Stinner.
10845
10846- bpo-42157: Convert the :mod:`unicodedata` extension module to the
10847  multiphase initialization API (:pep:`489`) and convert the
10848  ``unicodedata.UCD`` static type to a heap type. Patch by Mohamed Koubaa
10849  and Victor Stinner.
10850
10851- bpo-42146: Fix memory leak in :func:`subprocess.Popen` in case an uid
10852  (gid) specified in `user` (`group`, `extra_groups`) overflows `uid_t`
10853  (`gid_t`).
10854
10855- bpo-42103: :exc:`~plistlib.InvalidFileException` and :exc:`RecursionError`
10856  are now the only errors caused by loading malformed binary Plist file
10857  (previously ValueError and TypeError could be raised in some specific
10858  cases).
10859
10860- bpo-41490: In ``importlib.resources``, ``.path`` method is more aggressive
10861  about releasing handles to zipfile objects early, enabling use-cases like
10862  certifi to leave the context open but delete the underlying zip file.
10863
10864- bpo-41052: Pickling heap types implemented in C with protocols 0 and 1
10865  raises now an error instead of producing incorrect data.
10866
10867- bpo-42089: In ``importlib.metadata.PackageNotFoundError``, make reference
10868  to the package metadata being missing to improve the user experience.
10869
10870- bpo-41491: plistlib: fix parsing XML plists with hexadecimal integer
10871  values
10872
10873- bpo-42065: Fix an incorrectly formatted error from
10874  :meth:`_codecs.charmap_decode` when called with a mapped value outside the
10875  range of valid Unicode code points. PR by Max Bernstein.
10876
10877- bpo-41966: Fix pickling pure Python :class:`datetime.time` subclasses.
10878  Patch by Dean Inwood.
10879
10880- bpo-19270: :meth:`sched.scheduler.cancel()` will now cancel the correct
10881  event, if two events with same priority are scheduled for the same time.
10882  Patch by Bar Harel.
10883
10884- bpo-28660: :func:`textwrap.wrap` now attempts to break long words after
10885  hyphens when ``break_long_words=True`` and ``break_on_hyphens=True``.
10886
10887- bpo-35823: Use ``vfork()`` instead of ``fork()`` for
10888  :func:`subprocess.Popen` on Linux to improve performance in cases where it
10889  is deemed safe.
10890
10891- bpo-42043: Add support for ``zipfile.Path`` inheritance.
10892  ``zipfile.Path.is_file()`` now returns False for non-existent names.
10893  ``zipfile.Path`` objects now expose a ``.filename`` attribute and rely on
10894  that to resolve ``.name`` and ``.parent`` when the ``Path`` object is at
10895  the root of the zipfile.
10896
10897- bpo-42021: Fix possible ref leaks in :mod:`sqlite3` module init.
10898
10899- bpo-39101: Fixed tests using IsolatedAsyncioTestCase from hanging on
10900  BaseExceptions.
10901
10902- bpo-41976: Fixed a bug that was causing :func:`ctypes.util.find_library`
10903  to return ``None`` when triying to locate a library in an environment when
10904  gcc>=9 is available and ``ldconfig`` is not. Patch by Pablo Galindo
10905
10906- bpo-41943: Fix bug where TestCase.assertLogs doesn't correctly filter
10907  messages by level.
10908
10909- bpo-41923: Implement :pep:`613`, introducing :data:`typing.TypeAlias`
10910  annotation.
10911
10912- bpo-41905: A new function in abc: *update_abstractmethods* to re-calculate
10913  an abstract class's abstract status. In addition, *dataclass* has been
10914  changed to call this function.
10915
10916- bpo-23706: Added *newline* parameter to ``pathlib.Path.write_text()``.
10917
10918- bpo-41876: Tkinter font class repr uses font name
10919
10920- bpo-41831: ``str()`` for the ``type`` attribute of the ``tkinter.Event``
10921  object always returns now the numeric code returned by Tk instead of the
10922  name of the event type.
10923
10924- bpo-39337: :func:`encodings.normalize_encoding` now ignores non-ASCII
10925  characters.
10926
10927- bpo-41747: Ensure all methods that generated from
10928  :func:`dataclasses.dataclass` objects now have the proper ``__qualname__``
10929  attribute referring to the class they belong to. Patch by Batuhan Taskaya.
10930
10931- bpo-30681: Handle exceptions caused by unparsable date headers when using
10932  email "default" policy.  Patch by Tim Bell, Georges Toth
10933
10934- bpo-41586: Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module. Allow
10935  setting pipesize on subprocess.Popen.
10936
10937- bpo-41229: Add ``contextlib.aclosing`` for deterministic cleanup of async
10938  generators which is analogous to ``contextlib.closing`` for non-async
10939  generators. Patch by Joongi Kim and John Belmonte.
10940
10941- bpo-16396: Allow ``ctypes.wintypes`` to be imported on non-Windows
10942  systems.
10943
10944- bpo-4356: Add a key function to the bisect module.
10945
10946- bpo-40592: :func:`shutil.which` now ignores empty entries in
10947  :envvar:`PATHEXT` instead of treating them as a match.
10948
10949- bpo-40492: Fix ``--outfile`` for :mod:`cProfile` / :mod:`profile` not
10950  writing the output file in the original directory when the program being
10951  profiled changes the working directory.  PR by Anthony Sottile.
10952
10953- bpo-34204: The :mod:`shelve` module now uses
10954  :data:`pickle.DEFAULT_PROTOCOL` by default instead of :mod:`pickle`
10955  protocol ``3``.
10956
10957- bpo-27321: Fixed KeyError exception when flattening an email to a string
10958  attempts to replace a non-existent Content-Transfer-Encoding header.
10959
10960- bpo-38976: The :mod:`http.cookiejar` module now supports the parsing of
10961  cookies in CURL-style cookiejar files through MozillaCookieJar on all
10962  platforms. Previously, such cookie entries would be silently ignored when
10963  loading a cookiejar with such entries.
10964
10965  Additionally, the HTTP Only attribute is persisted in the object, and will
10966  be correctly written to file if the MozillaCookieJar object is
10967  subsequently dumped.
10968
10969Documentation
10970-------------
10971
10972- bpo-42061: Document __format__ functionality for IP addresses.
10973
10974- bpo-41910: Document the default implementation of `object.__eq__`.
10975
10976- bpo-42010: Clarify that subscription expressions are also valid for
10977  certain :term:`classes <class>` and :term:`types <type>` in the standard
10978  library, and for user-defined classes and types if the classmethod
10979  :meth:`__class_getitem__` is provided.
10980
10981- bpo-41805: Documented :ref:`generic alias type <types-genericalias>` and
10982  :data:`types.GenericAlias`. Also added an entry in glossary for
10983  :term:`generic types <generic type>`.
10984
10985- bpo-39693: Fix tarfile's extractfile documentation
10986
10987- bpo-39416: Document some restrictions on the default string
10988  representations of numeric classes.
10989
10990Tests
10991-----
10992
10993- bpo-41739: Fix test_logging.test_race_between_set_target_and_flush(): the
10994  test now waits until all threads complete to avoid leaking running
10995  threads.
10996
10997- bpo-41970: Avoid a test failure in ``test_lib2to3`` if the module has
10998  already imported at the time the test executes. Patch by Pablo Galindo.
10999
11000- bpo-41944: Tests for CJK codecs no longer call ``eval()`` on content
11001  received via HTTP.
11002
11003- bpo-41306: Fixed a failure in ``test_tk.test_widgets.ScaleTest`` happening
11004  when executing the test with Tk 8.6.10.
11005
11006Build
11007-----
11008
11009- bpo-38980: Add ``-fno-semantic-interposition`` to both the compile and
11010  link line when building with ``--enable-optimizations``. Patch by Victor
11011  Stinner and Pablo Galindo.
11012
11013Windows
11014-------
11015
11016- bpo-38439: Updates the icons for IDLE in the Windows Store package.
11017
11018- bpo-38252: Use 8-byte step to detect ASCII sequence in 64-bit Windows
11019  build.
11020
11021- bpo-39107: Update Tcl and Tk to 8.6.10 in Windows installer.
11022
11023- bpo-41557: Update Windows installer to use SQLite 3.33.0.
11024
11025- bpo-38324: Avoid Unicode errors when accessing certain locale data on
11026  Windows.
11027
11028macOS
11029-----
11030
11031- bpo-41471: Ignore invalid prefix lengths in system proxy excludes.
11032
11033IDLE
11034----
11035
11036- bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings,
11037  and searches. Some patches by Mark Roseman.
11038
11039- bpo-40511: Typing opening and closing parentheses inside the parentheses
11040  of a function call will no longer cause unnecessary "flashing" off and on
11041  of an existing open call-tip, e.g. when typed in a string literal.
11042
11043- bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created
11044  by Andrew Clover. Remove the low-color gif variations from the .ico file.
11045
11046C API
11047-----
11048
11049- bpo-42157: The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule
11050  API ``unicodedata.ucnhash_CAPI`` has been moved to the internal C API.
11051  Patch by Victor Stinner.
11052
11053- bpo-42015: Fix potential crash in deallocating method objects when
11054  dynamically allocated `PyMethodDef`'s lifetime is managed through the
11055  ``self`` argument of a `PyCFunction`.
11056
11057- bpo-40423: The :mod:`subprocess` module and ``os.closerange`` will now use
11058  the ``close_range(low, high, flags)`` syscall when it is available for
11059  more efficient closing of ranges of descriptors.
11060
11061- bpo-41845: :c:func:`PyObject_GenericGetDict` is available again in the
11062  limited API when targeting 3.10 or later.
11063
11064- bpo-40422: Add `_Py_closerange` function to provide performant closing of
11065  a range of file descriptors.
11066
11067- bpo-41986: :c:data:`Py_FileSystemDefaultEncodeErrors` and
11068  :c:data:`Py_UTF8Mode` are available again in limited API.
11069
11070- bpo-41756: Add `PyIter_Send` function to allow sending value into
11071  generator/coroutine/iterator without raising StopIteration exception to
11072  signal return.
11073
11074- bpo-41784: Added ``PyUnicode_AsUTF8AndSize`` to the limited C API.
11075
11076
11077What's New in Python 3.10.0 alpha 1?
11078====================================
11079
11080*Release date: 2020-10-05*
11081
11082Security
11083--------
11084
11085- bpo-41304: Fixes `python3x._pth` being ignored on Windows, caused by the
11086  fix for :issue:`29778` (CVE-2020-15801).
11087
11088- bpo-41162: Audit hooks are now cleared later during finalization to avoid
11089  missing events.
11090
11091- bpo-29778: Ensure :file:`python3.dll` is loaded from correct locations
11092  when Python is embedded (CVE-2020-15523).
11093
11094- bpo-41004: The __hash__() methods of  ipaddress.IPv4Interface and
11095  ipaddress.IPv6Interface incorrectly generated constant hash values of 32
11096  and 128 respectively. This resulted in always causing hash collisions. The
11097  fix uses hash() to generate hash values for the tuple of (address, mask
11098  length, network address).
11099
11100- bpo-39603: Prevent http header injection by rejecting control characters
11101  in http.client.putrequest(...).
11102
11103Core and Builtins
11104-----------------
11105
11106- bpo-41909: Fixed stack overflow in :func:`issubclass` and
11107  :func:`isinstance` when getting the ``__bases__`` attribute leads to
11108  infinite recursion.
11109
11110- bpo-41922: Speed up calls to ``reversed()`` by using the :pep:`590`
11111  ``vectorcall`` calling convention. Patch by Dong-hee Na.
11112
11113- bpo-41873: Calls to ``float()`` are now faster due to the ``vectorcall``
11114  calling convention. Patch by Dennis Sweeney.
11115
11116- bpo-41870: Speed up calls to ``bool()`` by using the :pep:`590`
11117  ``vectorcall`` calling convention. Patch by Dong-hee Na.
11118
11119- bpo-1635741: Port the :mod:`_bisect` module to the multi-phase
11120  initialization API (:pep:`489`).
11121
11122- bpo-39934: Correctly count control blocks in 'except' in compiler. Ensures
11123  that a syntax error, rather a fatal error, occurs for deeply nested, named
11124  exception handlers.
11125
11126- bpo-41780: Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by
11127  Batuhan Taskaya.
11128
11129- bpo-1635741: Port the :mod:`_lsprof` extension module to multi-phase
11130  initialization (:pep:`489`).
11131
11132- bpo-1635741: Port the :mod:`cmath` extension module to multi-phase
11133  initialization (:pep:`489`).
11134
11135- bpo-1635741: Port the :mod:`_scproxy` extension module to multi-phase
11136  initialization (:pep:`489`).
11137
11138- bpo-1635741: Port the :mod:`termios` extension module to multi-phase
11139  initialization (:pep:`489`).
11140
11141- bpo-1635741: Convert the :mod:`_sha256` extension module types to heap
11142  types.
11143
11144- bpo-41690: Fix a possible stack overflow in the parser when parsing
11145  functions and classes with a huge amount of arguments. Patch by Pablo
11146  Galindo.
11147
11148- bpo-1635741: Port the :mod:`_overlapped` extension module to multi-phase
11149  initialization (:pep:`489`).
11150
11151- bpo-1635741: Port the :mod:`_curses_panel` extension module to multi-phase
11152  initialization (:pep:`489`).
11153
11154- bpo-1635741: Port the :mod:`_opcode` extension module to multi-phase
11155  initialization (:pep:`489`).
11156
11157- bpo-41681: Fixes the wrong error description in the error raised by using
11158  2 `,` in format string in f-string and :meth:`str.format`.
11159
11160- bpo-41675: The implementation of :func:`signal.siginterrupt` now uses
11161  :c:func:`sigaction` (if it is available in the system) instead of the
11162  deprecated :c:func:`siginterrupt`. Patch by Pablo Galindo.
11163
11164- bpo-41670: Prevent line trace being skipped on platforms not compiled with
11165  ``USE_COMPUTED_GOTOS``. Fixes issue where some lines nested within a
11166  try-except block were not being traced on Windows.
11167
11168- bpo-41654: Fix a crash that occurred when destroying subclasses of
11169  :class:`MemoryError`. Patch by Pablo Galindo.
11170
11171- bpo-1635741: Port the :mod:`zlib` extension module to multi-phase
11172  initialization (:pep:`489`).
11173
11174- bpo-41631: The ``_ast`` module uses again a global state. Using a module
11175  state per module instance is causing subtle practical problems. For
11176  example, the Mercurial project replaces the ``__import__()`` function to
11177  implement lazy import, whereas Python expected that ``import _ast`` always
11178  return a fully initialized ``_ast`` module.
11179
11180- bpo-40077: Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`.
11181
11182- bpo-1653741: Port :mod:`_sha3` to multi-phase init.  Convert static types
11183  to heap types.
11184
11185- bpo-1635741: Port the :mod:`_blake2` extension module to the multi-phase
11186  initialization API (:pep:`489`).
11187
11188- bpo-41533: Free the stack allocated in ``va_build_stack`` if
11189  ``do_mkstack`` fails and the stack is not a ``small_stack``.
11190
11191- bpo-41531: Fix a bug that was dropping keys when compiling dict literals
11192  with more than 0xFFFF elements. Patch by Pablo Galindo.
11193
11194- bpo-41525: The output of ``python --help`` contains now only ASCII
11195  characters.
11196
11197- bpo-1635741: Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5`
11198  extension modules to multi-phase initialization API (:pep:`489`).
11199
11200- bpo-41431: Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)``
11201  and ``{}.update(d)``).
11202
11203- bpo-41428: Implement PEP 604. This supports (int | str) etc. in place of
11204  Union[str, int].
11205
11206- bpo-41340: Removed fallback implementation for ``strdup``.
11207
11208- bpo-38156: Handle interrupts that come after EOF correctly in
11209  ``PyOS_StdioReadline``.
11210
11211- bpo-41342: :func:`round` with integer argument is now faster (9--60%).
11212
11213- bpo-41334: Constructors :func:`str`, :func:`bytes` and :func:`bytearray`
11214  are now faster (around 30--40% for small objects).
11215
11216- bpo-41295: Resolve a regression in CPython 3.8.4 where defining
11217  "__setattr__" in a multi-inheritance setup and calling up the hierarchy
11218  chain could fail if builtins/extension types were involved in the base
11219  types.
11220
11221- bpo-41323: Bytecode optimizations are performed directly on the control
11222  flow graph. This will result in slightly more compact code objects in some
11223  circumstances.
11224
11225- bpo-41247: Always cache the running loop holder when running
11226  ``asyncio.set_running_loop``.
11227
11228- bpo-41252: Fix incorrect refcounting in _ssl.c's
11229  ``_servername_callback()``.
11230
11231- bpo-1635741: Port :mod:`multiprocessing` to multi-phase initialization
11232
11233- bpo-1635741: Port :mod:`winapi` to multiphase initialization
11234
11235- bpo-41215: Use non-NULL default values in the PEG parser keyword list to
11236  overcome a bug that was preventing Python from being properly compiled
11237  when using the XLC compiler. Patch by Pablo Galindo.
11238
11239- bpo-41218: Python 3.8.3 had a regression where compiling with
11240  ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension
11241  with CO_COROUTINE. Now only list comprehension making use of async/await
11242  will tagged as so.
11243
11244- bpo-1635741: Port :mod:`faulthandler` to multiphase initialization.
11245
11246- bpo-1635741: Port :mod:`sha256` to multiphase initialization
11247
11248- bpo-41175: Guard against a NULL pointer dereference within bytearrayobject
11249  triggered by the ``bytearray() + bytearray()`` operation.
11250
11251- bpo-41100: add arm64 to the allowable Mac OS arches in mpdecimal.h
11252
11253- bpo-41094: Fix decoding errors with audit when open files with non-ASCII
11254  names on non-UTF-8 locale.
11255
11256- bpo-39960: The "hackcheck" that prevents sneaking around a type's
11257  __setattr__() by calling the superclass method was rewritten to allow C
11258  implemented heap types.
11259
11260- bpo-41084: Prefix the error message with 'f-string: ', when parsing an
11261  f-string expression which throws a :exc:`SyntaxError`.
11262
11263- bpo-40521: Empty frozensets are no longer singletons.
11264
11265- bpo-41076: Pre-feed the parser with the location of the f-string
11266  expression, not the f-string itself, which allows us to skip the shifting
11267  of the AST node locations after the parsing is completed.
11268
11269- bpo-41056: Fixes a reference to deallocated stack space during startup
11270  when constructing sys.path involving a relative symlink when code was
11271  supplied via -c.  (discovered via Coverity)
11272
11273- bpo-41061: Fix incorrect expressions and asserts in hashtable code and
11274  tests.
11275
11276- bpo-41052: Opt out serialization/deserialization for _random.Random
11277
11278- bpo-40939: Rename `PyPegen*` functions to `PyParser*`, so that we can
11279  remove the old set of `PyParser*` functions that were using the old
11280  parser, but keep everything backwards-compatible.
11281
11282- bpo-35975: Stefan Behnel reported that cf_feature_version is used even
11283  when PyCF_ONLY_AST is not set. This is against the intention and against
11284  the documented behavior, so it's been fixed.
11285
11286- bpo-40939: Remove the remaining files from the old parser and the
11287  :mod:`symbol` module.
11288
11289- bpo-40077: Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`.
11290
11291- bpo-41006: The ``encodings.latin_1`` module is no longer imported at
11292  startup. Now it is only imported when it is the filesystem encoding or the
11293  stdio encoding.
11294
11295- bpo-40636: :func:`zip` now supports :pep:`618`'s ``strict`` parameter,
11296  which raises a :exc:`ValueError` if the arguments are exhausted at
11297  different lengths. Patch by Brandt Bucher.
11298
11299- bpo-1635741: Port :mod:`_gdbm` to multiphase initialization.
11300
11301- bpo-40985: Fix a bug that caused the :exc:`SyntaxError` text to be empty
11302  when a file ends with a line ending in a line continuation character (i.e.
11303  backslash). The error text should contain the text of the last line.
11304
11305- bpo-40958: Fix a possible buffer overflow in the PEG parser when gathering
11306  information for emitting syntax errors. Patch by Pablo Galindo.
11307
11308- bpo-1635741: Port :mod:`_dbm` to multiphase initialization.
11309
11310- bpo-40957: Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
11311
11312- bpo-40950: Add a state to the :mod:`nis` module (:pep:`3121`) and apply
11313  the multiphase initialization. Patch by Dong-hee Na.
11314
11315- bpo-40947: The Python :ref:`Path Configuration <init-path-config>` now
11316  takes :c:member:`PyConfig.platlibdir` in account.
11317
11318- bpo-40939: Remove the old parser, the :mod:`parser` module and all
11319  associated support code, command-line options and environment variables.
11320  Patch by Pablo Galindo.
11321
11322- bpo-40847: Fix a bug where a line with only a line continuation character
11323  is not considered a blank line at tokenizer level. In such cases, more
11324  than a single `NEWLINE` token was emitted. The old parser was working
11325  around the issue, but the new parser threw a :exc:`SyntaxError` for valid
11326  input due to this. For example, an empty line following a line
11327  continuation character was interpreted as a :exc:`SyntaxError`.
11328
11329- bpo-40890: Each dictionary view now has a ``mapping`` attribute that
11330  provides a :class:`types.MappingProxyType` wrapping the original
11331  dictionary.  Patch contributed by Dennis Sweeney.
11332
11333- bpo-40889: Improved the performance of symmetric difference operations on
11334  dictionary item views.  Patch by Dennis Sweeney.
11335
11336- bpo-40904: Fix possible segfault in the new PEG parser when parsing
11337  f-string containing yield statements with no value (:code:`f"{yield}"`).
11338  Patch by Pablo Galindo
11339
11340- bpo-40903: Fixed a possible segfault in the new PEG parser when producing
11341  error messages for invalid assignments of the form :code:`p=p=`. Patch by
11342  Pablo Galindo
11343
11344- bpo-40880: Fix invalid memory read in the new parser when checking
11345  newlines in string literals. Patch by Pablo Galindo.
11346
11347- bpo-40883: Fix memory leak in when parsing f-strings in the new parser.
11348  Patch by Pablo Galindo
11349
11350- bpo-40870: Raise :exc:`ValueError` when validating custom AST's where the
11351  constants ``True``, ``False`` and ``None`` are used within a
11352  :class:`ast.Name` node.
11353
11354- bpo-40854: Allow overriding :data:`sys.platlibdir` via a new
11355  :envvar:`PYTHONPLATLIBDIR` environment variable.
11356
11357- bpo-40826: Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set
11358  an exception and pass the Python thread state when checking if there is a
11359  pending signal.
11360
11361- bpo-1635741: Port :mod:`fcntl` to multiphase initialization.
11362
11363- bpo-19468: Delete unnecessary instance check in importlib.reload(). Patch
11364  by Furkan Önder.
11365
11366- bpo-40824: Unexpected errors in calling the ``__iter__`` method are no
11367  longer masked by ``TypeError`` in the :keyword:`in` operator and functions
11368  :func:`~operator.contains`, :func:`~operator.indexOf` and
11369  :func:`~operator.countOf` of the :mod:`operator` module.
11370
11371- bpo-40792: Attributes ``start``, ``stop`` and ``step`` of the
11372  :class:`range` object now always has exact type :class:`int`.  Previously,
11373  they could have been an instance of a subclass of ``int``.
11374
11375- bpo-40780: Fix a corner case where g-style string formatting of a float
11376  failed to remove trailing zeros.
11377
11378- bpo-38964: When there's a :exc:`SyntaxError` in the expression part of an
11379  fstring, the filename attribute of the :exc:`SyntaxError` gets correctly
11380  set to the name of the file the fstring resides in.
11381
11382- bpo-40750: Support the "-d" debug flag in the new PEG parser. Patch by
11383  Pablo Galindo
11384
11385- bpo-40217: Instances of types created with
11386  :c:func:`PyType_FromSpecWithBases` will no longer automatically visit
11387  their class object when traversing references in the garbage collector.
11388  The user is expected to manually visit the object's class. Patch by Pablo
11389  Galindo.
11390
11391- bpo-39573: :c:func:`Py_TYPE()` is changed to the inline static function.
11392  Patch by Dong-hee Na.
11393
11394- bpo-40696: Fix a hang that can arise after :meth:`generator.throw` due to
11395  a cycle in the exception context chain.
11396
11397- bpo-40521: Each interpreter now its has own free lists, singletons and
11398  caches:
11399
11400  * Free lists: float, tuple, list, dict, frame, context,
11401    asynchronous generator, MemoryError.
11402  * Singletons: empty tuple, empty bytes string, empty Unicode string,
11403    single byte character, single Unicode (latin1) character.
11404  * Slice cache.
11405
11406  They are no longer shared by all interpreters.
11407
11408- bpo-40679: Certain :exc:`TypeError` messages about missing or extra
11409  arguments now include the function's :term:`qualified name`.  Patch by
11410  Dennis Sweeney.
11411
11412- bpo-29590: Make the stack trace correct after calling
11413  :meth:`generator.throw` on a generator that has yielded from a ``yield
11414  from``.
11415
11416- bpo-4022: Improve performance of generators by not raising internal
11417  StopIteration.
11418
11419- bpo-1635741: Port :mod:`mmap` to multiphase initialization.
11420
11421- bpo-1635741: Port :mod:`_lzma` to multiphase initialization.
11422
11423- bpo-37999: Builtin and extension functions that take integer arguments no
11424  longer accept :class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\
11425  s and other objects that can be converted to integers only with a loss
11426  (e.g. that have the :meth:`~object.__int__` method but do not have the
11427  :meth:`~object.__index__` method).
11428
11429- bpo-29882: Add :meth:`int.bit_count()`, counting the number of ones in the
11430  binary representation of an integer. Patch by Niklas Fiekas.
11431
11432- bpo-36982: Use ncurses extended color functions when available to support
11433  terminals with 256 colors, and add the new function
11434  :func:`curses.has_extended_color_support` to indicate whether extended
11435  color support is provided by the underlying ncurses library.
11436
11437- bpo-19569: Add the private macros ``_Py_COMP_DIAG_PUSH``,
11438  ``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``.
11439
11440- bpo-26680: The int type now supports the x.is_integer() method for
11441  compatibility with float.
11442
11443Library
11444-------
11445
11446- bpo-41900: C14N 2.0 serialisation in xml.etree.ElementTree failed for
11447  unprefixed attributes when a default namespace was defined.
11448
11449- bpo-41887: Strip leading spaces and tabs on :func:`ast.literal_eval`. Also
11450  document stripping of spaces and tabs for :func:`eval`.
11451
11452- bpo-41773: Note in documentation that :func:`random.choices` doesn't
11453  support non-finite weights, raise :exc:`ValueError` when given non-finite
11454  weights.
11455
11456- bpo-41840: Fix a bug in the :mod:`symtable` module that was causing
11457  module-scope global variables to not be reported as both local and global.
11458  Patch by Pablo Galindo.
11459
11460- bpo-41842: Add :func:`codecs.unregister` function to unregister a codec
11461  search function.
11462
11463- bpo-40564: In ``zipfile.Path``, mutate the passed ZipFile object type
11464  instead of making a copy. Prevents issues when both the local copy and the
11465  caller’s copy attempt to close the same file handle.
11466
11467- bpo-40670: More reliable validation of statements in
11468  :class:`timeit.Timer`. It now accepts "empty" statements (only whitespaces
11469  and comments) and rejects misindentent statements.
11470
11471- bpo-41833: The :class:`threading.Thread` constructor now uses the target
11472  name if the *target* argument is specified but the *name* argument is
11473  omitted.
11474
11475- bpo-41817: fix `tkinter.EventType` Enum so all members are strings, and
11476  none are tuples
11477
11478- bpo-41810: :data:`types.EllipsisType`, :data:`types.NotImplementedType`
11479  and :data:`types.NoneType` have been reintroduced, providing a new set of
11480  types readily interpretable by static type checkers.
11481
11482- bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch
11483  contributed by Peter David McCormick.
11484
11485- bpo-41816: StrEnum added: it ensures that all members are already strings
11486  or string candidates
11487
11488- bpo-41517: fix bug allowing Enums to be extended via multiple inheritance
11489
11490- bpo-39587: use the correct mix-in data type when constructing Enums
11491
11492- bpo-41792: Add is_typeddict function to typing.py to check if a type is a
11493  TypedDict class
11494
11495  Previously there was no way to check that without using private API. See
11496  the `relevant issue in python/typing
11497  <https://github.com/python/typing/issues/751>`
11498
11499- bpo-41789: Honor `object` overrides in `Enum` class creation
11500  (specifically, `__str__`, `__repr__`, `__format__`, and `__reduce_ex__`).
11501
11502- bpo-32218: `enum.Flag` and `enum.IntFlag` members are now iterable
11503
11504- bpo-39651: Fix a race condition in the ``call_soon_threadsafe()`` method
11505  of ``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has
11506  been closed.
11507
11508- bpo-1635741: Port the ``mashal`` extension module to the multi-phase
11509  initialization API (:pep:`489`).
11510
11511- bpo-1635741: Port the ``_string`` extension module to the multi-phase
11512  initialization API (:pep:`489`).
11513
11514- bpo-41732: Added an :term:`iterator` to :class:`memoryview`.
11515
11516- bpo-41720: Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not
11517  int or float.
11518
11519- bpo-41696: Fix handling of debug mode in :func:`asyncio.run`. This allows
11520  setting ``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode
11521  when using :func:`asyncio.run`.
11522
11523- bpo-41687: Fix implementation of sendfile to be compatible with Solaris.
11524
11525- bpo-41662: No longer override exceptions raised in ``__len__()`` of a
11526  sequence of parameters in :mod:`sqlite3` with
11527  :exc:`~sqlite3.ProgrammingError`.
11528
11529- bpo-39010: Restarting a ``ProactorEventLoop`` on Windows no longer logs
11530  spurious ``ConnectionResetErrors``.
11531
11532- bpo-41638: :exc:`~sqlite3.ProgrammingError` message for absent parameter
11533  in :mod:`sqlite3` contains now the name of the parameter instead of its
11534  index when parameters are supplied as a dict.
11535
11536- bpo-41662: Fixed crash when mutate list of parameters during iteration in
11537  :mod:`sqlite3`.
11538
11539- bpo-41513: Improved the accuracy of math.hypot().  Internally, each step
11540  is computed with extra precision so that the result is now almost always
11541  correctly rounded.
11542
11543- bpo-41609: The pdb whatis command correctly reports instance methods as
11544  'Method' rather than 'Function'.
11545
11546- bpo-39994: Fixed pprint's handling of dict subclasses that override
11547  __repr__.
11548
11549- bpo-32751: When cancelling the task due to a timeout,
11550  :meth:`asyncio.wait_for` will now wait until the cancellation is complete
11551  also in the case when *timeout* is <= 0, like it does with positive
11552  timeouts.
11553
11554- bpo-37658: :meth:`asyncio.wait_for` now properly handles races between
11555  cancellation of itself and the completion of the wrapped awaitable.
11556
11557- bpo-40782: Change the method asyncio.AbstractEventLoop.run_in_executor to
11558  not be a coroutine.
11559
11560- bpo-41520: Fix :mod:`codeop` regression that prevented turning compile
11561  warnings into errors.
11562
11563- bpo-41528: turtle uses math module functions to convert degrees to radians
11564  and vice versa and to calculate vector norm
11565
11566- bpo-41513: Minor algorithmic improvement to math.hypot() and math.dist()
11567  giving small gains in speed and accuracy.
11568
11569- bpo-41503: Fixed a race between setTarget and flush in
11570  logging.handlers.MemoryHandler.
11571
11572- bpo-41497: Fix potential UnicodeDecodeError in dis module.
11573
11574- bpo-41467: On Windows, fix asyncio ``recv_into()`` return value when the
11575  socket/pipe is closed (:exc:`BrokenPipeError`): return ``0`` rather than
11576  an empty byte string (``b''``).
11577
11578- bpo-41425: Make tkinter doc example runnable.
11579
11580- bpo-41421: Make an algebraic simplification to random.paretovariate().  It
11581  now is slightly less subject to round-off error and is slightly faster.
11582  Inputs that used to cause ZeroDivisionError now cause an OverflowError
11583  instead.
11584
11585- bpo-41440: Add :func:`os.cpu_count()` support for VxWorks RTOS.
11586
11587- bpo-41316: Fix the :mod:`tarfile` module to write only basename of TAR
11588  file to GZIP compression header.
11589
11590- bpo-41384: Raise TclError instead of TypeError when an unknown option is
11591  passed to tkinter.OptionMenu.
11592
11593- bpo-41317: Use add_done_callback() in asyncio.loop.sock_accept() to
11594  unsubscribe reader early on cancellation.
11595
11596- bpo-41364: Reduce import overhead of :mod:`uuid`.
11597
11598- bpo-35328: Set the environment variable ``VIRTUAL_ENV_PROMPT`` at
11599  :mod:`venv` activation.
11600
11601- bpo-41341: Recursive evaluation of `typing.ForwardRef` in
11602  `get_type_hints`.
11603
11604- bpo-41344: Prevent creating :class:`shared_memory.SharedMemory` objects
11605  with :code:`size=0`.
11606
11607- bpo-41333: :meth:`collections.OrderedDict.pop` is now 2 times faster.
11608
11609- bpo-41288: Unpickling invalid NEWOBJ_EX opcode with the C implementation
11610  raises now UnpicklingError instead of crashing.
11611
11612- bpo-39017: Avoid infinite loop when reading specially crafted TAR files
11613  using the tarfile module (CVE-2019-20907).
11614
11615- bpo-41273: Speed up any transport using ``_ProactorReadPipeTransport`` by
11616  calling ``recv_into`` instead of ``recv``, thus not creating a new buffer
11617  for each ``recv`` call in the transport's read loop.
11618
11619- bpo-41235: Fix the error handling in
11620  :meth:`ssl.SSLContext.load_dh_params`.
11621
11622- bpo-41207: In distutils.spawn, restore expectation that DistutilsExecError
11623  is raised when the command is not found.
11624
11625- bpo-29727: Register :class:`array.array` as a
11626  :class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo.
11627
11628- bpo-39168: Remove the ``__new__`` method of :class:`typing.Generic`.
11629
11630- bpo-41194: Fix a crash in the ``_ast`` module: it can no longer be loaded
11631  more than once. It now uses a global state rather than a module state.
11632
11633- bpo-41195: Add read-only ssl.SSLContext.security_level attribute to
11634  retrieve the context's security level.
11635
11636- bpo-41193: The ``write_history()`` atexit function of the readline
11637  completer now ignores any :exc:`OSError` to ignore error if the filesystem
11638  is read-only, instead of only ignoring :exc:`FileNotFoundError` and
11639  :exc:`PermissionError`.
11640
11641- bpo-41182: selector: use DefaultSelector based upon implementation
11642
11643- bpo-41161: The decimal module now requires libmpdec-2.5.0. Users of
11644  --with-system-libmpdec should update their system library.
11645
11646- bpo-40874: The decimal module now requires libmpdec-2.5.0.
11647
11648- bpo-41138: Fixed the :mod:`trace` module CLI for Python source files with
11649  non-UTF-8 encoding.
11650
11651- bpo-31082: Use the term "iterable" in the docstring for
11652  :func:`functools.reduce`.
11653
11654- bpo-40521: Remove freelist from collections.deque().
11655
11656- bpo-31938: Fix default-value signatures of several functions in the
11657  :mod:`select` module - by Anthony Sottile.
11658
11659- bpo-41068: Fixed reading files with non-ASCII names from ZIP archive
11660  directly after writing them.
11661
11662- bpo-41058: :func:`pdb.find_function` now correctly determines the source
11663  file encoding.
11664
11665- bpo-41056: Invalid file descriptor values are now prevented from being
11666  passed to os.fpathconf. (discovered by Coverity)
11667
11668- bpo-41056: Fix a NULL pointer dereference within the ssl module during a
11669  MemoryError in the keylog callback. (discovered by Coverity)
11670
11671- bpo-41056: Fixed an instance where a MemoryError within the zoneinfo
11672  module might not be reported or not reported at its source. (found by
11673  Coverity)
11674
11675- bpo-41048: :func:`mimetypes.read_mime_types` function reads the rule file
11676  using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy
11677  Thatiparthy.
11678
11679- bpo-41043: Fixed the use of :func:`~glob.glob` in the stdlib: literal part
11680  of the path is now always correctly escaped.
11681
11682- bpo-41025: Fixed an issue preventing the C implementation of
11683  :class:`zoneinfo.ZoneInfo` from being subclassed.
11684
11685- bpo-35018: Add the :class:`xml.sax.handler.LexicalHandler` class that is
11686  present in other SAX XML implementations.
11687
11688- bpo-41002: Improve performance of HTTPResponse.read with a given amount.
11689  Patch by Bruce Merry.
11690
11691- bpo-40448: :mod:`ensurepip` now disables the use of `pip` cache when
11692  installing the bundled versions of `pip` and `setuptools`.  Patch by
11693  Krzysztof Konopko.
11694
11695- bpo-40967: Removed :meth:`asyncio.Task.current_task` and
11696  :meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre.
11697
11698- bpo-40924: Ensure ``importlib.resources.path`` returns an extant path for
11699  the SourceFileLoader's resource reader. Avoids the regression identified
11700  in master while a long-term solution is devised.
11701
11702- bpo-40955: Fix a minor memory leak in :mod:`subprocess` module when
11703  extra_groups was specified.
11704
11705- bpo-40855: The standard deviation and variance functions in the statistics
11706  module were ignoring their mu and xbar arguments.
11707
11708- bpo-40939: Use the new PEG parser when generating the stdlib
11709  :mod:`keyword` module.
11710
11711- bpo-23427: Add :data:`sys.orig_argv` attribute: the list of the original
11712  command line arguments passed to the Python executable.
11713
11714- bpo-33689: Ignore empty or whitespace-only lines in .pth files. This
11715  matches the documentated behavior. Before, empty lines caused the
11716  site-packages dir to appear multiple times in sys.path. By Ido Michael,
11717  contributors Malcolm Smith and Tal Einat.
11718
11719- bpo-40884: Added a `defaults` parameter to :class:`logging.Formatter`, to
11720  allow specifying default values for custom fields. Patch by Asaf Alon and
11721  Bar Harel.
11722
11723- bpo-40876: Clarify error message in the :mod:`csv` module.
11724
11725- bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1.
11726
11727- bpo-40807: Stop codeop._maybe_compile, used by code.InteractiveInterpreter
11728  (and IDLE). from emitting each warning three times.
11729
11730- bpo-32604: Fix reference leak in the :mod:`select` module when the module
11731  is imported in a subinterpreter.
11732
11733- bpo-39791: Built-in loaders (SourceFileLoader and ZipImporter) now supply
11734  ``TraversableResources`` implementations for ``ResourceReader``, and the
11735  fallback function has been removed.
11736
11737- bpo-39314: :class:`rlcompleter.Completer` and the standard Python shell
11738  now close the parenthesis for functions that take no arguments. Patch
11739  contributed by Rémi Lapeyre.
11740
11741- bpo-17005: The topological sort functionality that was introduced
11742  initially in the :mod:`functools` module has been moved to a new
11743  :mod:`graphlib` module to better accommodate the new tools and keep the
11744  original scope of the :mod:`functools` module. Patch by Pablo Galindo
11745
11746- bpo-40834: Fix truncate when sending str object
11747  with_xxsubinterpreters.channel_send.
11748
11749- bpo-40755: Add rich comparisons to collections.Counter().
11750
11751- bpo-26407: Unexpected errors in calling the ``__iter__`` method are no
11752  longer masked by ``TypeError`` in :func:`csv.reader`,
11753  :func:`csv.writer.writerow` and :meth:`csv.writer.writerows`.
11754
11755- bpo-39384: Fixed email.contentmanager to allow set_content() to set a null
11756  string.
11757
11758- bpo-40744: The :mod:`sqlite3` module uses SQLite API functions that
11759  require SQLite v3.7.3 or higher.  This patch removes support for older
11760  SQLite versions, and explicitly requires SQLite 3.7.3 both at build,
11761  compile and runtime.  Patch by Sergey Fedoseev and Erlend E. Aasland.
11762
11763- bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time
11764  to avoid errors on some compilers.
11765
11766- bpo-38488: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
11767
11768- bpo-40792: The result of :func:`operator.index` now always has exact type
11769  :class:`int`. Previously, the result could have been an instance of a
11770  subclass of ``int``.
11771
11772- bpo-40767: :mod:`webbrowser` now properly finds the default browser in
11773  pure Wayland systems by checking the WAYLAND_DISPLAY environment variable.
11774  Patch contributed by Jérémy Attali.
11775
11776- bpo-40791: :func:`hashlib.compare_digest` uses OpenSSL's
11777  ``CRYPTO_memcmp()`` function when OpenSSL is available.
11778
11779- bpo-40795: :mod:`ctypes` module: If ctypes fails to convert the result of
11780  a callback or if a ctypes callback function raises an exception,
11781  sys.unraisablehook is now called with an exception set. Previously, the
11782  error was logged into stderr by :c:func:`PyErr_Print`.
11783
11784- bpo-16995: Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode`
11785  to support the Base32 Encoding with Extended Hex Alphabet.
11786
11787- bpo-30008: Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds
11788  that use ``no-deprecated`` and ``--api=1.1.0``.
11789
11790- bpo-30064: Fix asyncio ``loop.sock_*`` race condition issue
11791
11792- bpo-40759: Deprecate the :mod:`symbol` module.
11793
11794- bpo-40756: The second argument (extra) of ``LoggerAdapter.__init__`` now
11795  defaults to None.
11796
11797- bpo-37129: Add a new :data:`os.RWF_APPEND` flag for :func:`os.pwritev`.
11798
11799- bpo-40737: Fix possible reference leak for :mod:`sqlite3` initialization.
11800
11801- bpo-40726: Handle cases where the ``end_lineno`` is ``None`` on
11802  :func:`ast.increment_lineno`.
11803
11804- bpo-40698: :mod:`distutils` upload creates SHA2-256 and Blake2b-256
11805  digests. MD5 digests is skipped if platform blocks MD5.
11806
11807- bpo-40695: :mod:`hashlib` no longer falls back to builtin hash
11808  implementations when OpenSSL provides a hash digest and the algorithm is
11809  blocked by security policy.
11810
11811- bpo-9216: func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP
11812  constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle
11813  strict security policy better.
11814
11815- bpo-40614: :func:`ast.parse` will not parse self documenting expressions
11816  in f-strings when passed ``feature_version`` is less than ``(3, 8)``.
11817
11818- bpo-40626: Add h5 file extension as MIME Type application/x-hdf5, as per
11819  HDF Group recommendation for HDF5 formatted data files. Patch contributed
11820  by Mark Schwab.
11821
11822- bpo-25920: On macOS, when building Python for macOS 10.4 and older, which
11823  wasn't the case for python.org macOS installer, :func:`socket.getaddrinfo`
11824  no longer uses an internal lock to prevent race conditions when calling
11825  ``getaddrinfo()`` which is thread-safe since macOS 10.5. Python 3.9
11826  requires macOS 10.6 or newer. The internal lock caused random hang on fork
11827  when another thread was calling :func:`socket.getaddrinfo`. The lock was
11828  also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD
11829  older than 4.
11830
11831- bpo-40671: Prepare ``_hashlib`` for :pep:`489` and use
11832  :c:func:`PyModule_AddType`.
11833
11834- bpo-32309: Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is
11835  mainly used for running IO-bound functions in a separate thread to avoid
11836  blocking the event loop, and essentially works as a high-level version of
11837  :meth:`~asyncio.loop.run_in_executor` that can directly take keyword
11838  arguments.
11839
11840- bpo-36543: Restored the deprecated :mod:`xml.etree.cElementTree` module.
11841
11842- bpo-40611: :data:`~mmap.MAP_POPULATE` constant has now been added to the
11843  list of exported :mod:`mmap` module flags.
11844
11845- bpo-39881: PEP 554 for use in the test suite. (Patch By Joannah Nanjekye)
11846
11847- bpo-13097: ``ctypes`` now raises an ``ArgumentError`` when a callback is
11848  invoked with more than 1024 arguments.
11849
11850- bpo-39385: A new test assertion context-manager,
11851  :func:`unittest.assertNoLogs` will ensure a given block of code emits no
11852  log messages using the logging module. Contributed by Kit Yan Choi.
11853
11854- bpo-23082: Updated the error message and docs of PurePath.relative_to() to
11855  better reflect the function behaviour.
11856
11857- bpo-40318: Use SQLite3 trace v2 API, if it is available.
11858
11859- bpo-40105: ZipFile truncates files to avoid corruption when a shorter
11860  comment is provided in append ("a") mode. Patch by Jan Mazur.
11861
11862- bpo-40084: Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes
11863  as well as methods.
11864
11865- bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than
11866  OSError when peer closes connection during TLS negotiation
11867
11868- bpo-39728: fix default `_missing_` so a duplicate `ValueError` is not set
11869  as the `__context__` of the original `ValueError`
11870
11871- bpo-39244: Fixed :class:`multiprocessing.context.get_all_start_methods` to
11872  properly return the default method first on macOS.
11873
11874- bpo-39040: Fix parsing of invalid mime headers parameters by collapsing
11875  whitespace between encoded words in a bare-quote-string.
11876
11877- bpo-38731: Add ``--quiet`` option to command-line interface of
11878  :mod:`py_compile`. Patch by Gregory Schevchenko.
11879
11880- bpo-35714: :exc:`struct.error` is now raised if there is a null character
11881  in a :mod:`struct` format string.
11882
11883- bpo-38144: Added the *root_dir* and *dir_fd* parameters in
11884  :func:`glob.glob`.
11885
11886- bpo-26543: Fix :meth:`IMAP4.noop()` when debug mode is enabled (ex:
11887  ``imaplib.Debug = 3``).
11888
11889- bpo-12178: :func:`csv.writer` now correctly escapes *escapechar* when
11890  input contains *escapechar*.  Patch by Catalin Iacob, Berker Peksag, and
11891  Itay Elbirt.
11892
11893- bpo-36290: AST nodes are now raising :exc:`TypeError` on conflicting
11894  keyword arguments. Patch contributed by Rémi Lapeyre.
11895
11896- bpo-33944: Added site.py site-packages tracing in verbose mode.
11897
11898- bpo-35078: Refactor formatweekday, formatmonthname methods in
11899  LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to
11900  call the base class methods.This enables customizable CSS classes for
11901  LocaleHTMLCalendar. Patch by Srinivas Reddy Thatiparthy
11902
11903- bpo-29620: :func:`~unittest.TestCase.assertWarns` no longer raises a
11904  ``RuntimeException`` when accessing a module's ``__warningregistry__``
11905  causes importation of a new module, or when a new module is imported in
11906  another thread. Patch by Kernc.
11907
11908- bpo-31844: Remove ``ParserBase.error()`` method from the private and
11909  undocumented ``_markupbase`` module.  :class:`html.parser.HTMLParser` is
11910  the only subclass of ``ParserBase`` and its ``error()`` implementation was
11911  deprecated in Python 3.4 and removed in Python 3.5.
11912
11913- bpo-34226: Fix `cgi.parse_multipart` without content_length. Patch by
11914  Roger Duran
11915
11916- bpo-33660: Fix pathlib.PosixPath to resolve a relative path located on the
11917  root directory properly.
11918
11919- bpo-28557: Improve the error message for a misbehaving ``rawio.readinto``
11920
11921- bpo-26680: The d.is_integer() method is added to the Decimal type, for
11922  compatibility with other number types.
11923
11924- bpo-26680: The x.is_integer() method is incorporated into the abstract
11925  types of the numeric tower, Real, Rational and Integral, with appropriate
11926  default implementations.
11927
11928Documentation
11929-------------
11930
11931- bpo-41428: Add documentation for :pep:`604` (Allow writing union types as
11932  ``X | Y``).
11933
11934- bpo-41774: In Programming FAQ "Sequences (Tuples/Lists)" section, add "How
11935  do you remove multiple items from a list".
11936
11937- bpo-35293: Fix RemovedInSphinx40Warning when building the documentation.
11938  Patch by Dong-hee Na.
11939
11940- bpo-37149: Change Shipman tkinter doc link from archive.org to TkDocs.
11941  (The doc has been removed from the NMT server.)  The new link responds
11942  much faster and includes a short explanatory note.
11943
11944- bpo-41726: Update the refcounts info of ``PyType_FromModuleAndSpec``.
11945
11946- bpo-41624: Fix the signature of :class:`typing.Coroutine`.
11947
11948- bpo-40204: Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable
11949  ``c_warn_on_allowed_pre_v3`` option to make the documentation compatible
11950  with Sphinx 2 and Sphinx 3.
11951
11952- bpo-41045: Add documentation for debug feature of f-strings.
11953
11954- bpo-41314: Changed the release when ``from __future__ import annotations``
11955  becomes the default from ``4.0`` to ``3.10`` (following a change in PEP
11956  563).
11957
11958- bpo-40979: Refactored typing.rst, arranging more than 70 classes,
11959  functions, and decorators into new sub-sections.
11960
11961- bpo-40552: Fix in tutorial section 4.2. Code snippet is now correct.
11962
11963- bpo-39883: Make code, examples, and recipes in the Python documentation be
11964  licensed under the more permissive BSD0 license in addition to the
11965  existing Python 2.0 license.
11966
11967- bpo-37703: Updated Documentation to comprehensively elaborate on the
11968  behaviour of gather.cancel()
11969
11970Tests
11971-----
11972
11973- bpo-41939: Fix test_site.test_license_exists_at_url(): call
11974  ``urllib.request.urlcleanup()`` to reset the global
11975  ``urllib.request._opener``. Patch by Victor Stinner.
11976
11977- bpo-41731: Make test_cmd_line_script pass with option '-vv'.
11978
11979- bpo-41602: Add tests for SIGINT handling in the runpy module.
11980
11981- bpo-41521: :mod:`test.support`: Rename ``blacklist`` parameter of
11982  :func:`~test.support.check__all__` to ``not_exported``.
11983
11984- bpo-41477: Make ctypes optional in test_genericalias.
11985
11986- bpo-41085: Fix integer overflow in the :meth:`array.array.index` method on
11987  64-bit Windows for index larger than ``2**31``.
11988
11989- bpo-41069: :data:`test.support.TESTFN` and the current directory for tests
11990  when run via ``test.regrtest`` contain now non-ascii characters if
11991  possible.
11992
11993- bpo-38377: On Linux, skip tests using multiprocessing if the current user
11994  cannot create a file in ``/dev/shm/`` directory. Add the
11995  :func:`~test.support.skip_if_broken_multiprocessing_synchronize` function
11996  to the :mod:`test.support` module.
11997
11998- bpo-41009: Fix use of ``support.require_{linux|mac|freebsd}_version()``
11999  decorators as class decorator.
12000
12001- bpo-41003: Fix ``test_copyreg`` when ``numpy`` is installed:
12002  ``test.pickletester`` now saves/restores warnings filters when importing
12003  ``numpy``, to ignore filters installed by ``numpy``.
12004
12005- bpo-40964: Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu
12006  is blocking incoming connections.
12007
12008- bpo-40927: Fix test_binhex when run twice: it now uses
12009  import_fresh_module() to ensure that it raises DeprecationWarning each
12010  time.
12011
12012- bpo-17258: Skip some :mod:`multiprocessing` tests when MD5 hash digest is
12013  blocked.
12014
12015- bpo-31904: Increase LOOPBACK_TIMEOUT to 10 for VxWorks RTOS.
12016
12017- bpo-38169: Increase code coverage for SharedMemory and ShareableList
12018
12019- bpo-34401: Make test_gdb properly run on HP-UX. Patch by Michael Osipov.
12020
12021Build
12022-----
12023
12024- bpo-38249: Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable()
12025  if only the compiler is able to use it. Patch by Dong-hee Na.
12026
12027- bpo-41617: Fix ``pycore_bitutils.h`` header file to support old clang
12028  versions: ``__builtin_bswap16()`` is not available in LLVM clang 3.0.
12029
12030- bpo-40204: Pin Sphinx version to 2.3.1 in ``Doc/Makefile``.
12031
12032- bpo-36020: The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf`
12033  are now required to build Python.
12034
12035- bpo-40684: ``make install`` now uses the ``PLATLIBDIR`` variable for the
12036  destination ``lib-dynload/`` directory when ``./configure
12037  --with-platlibdir`` is used.
12038
12039- bpo-40683: Fixed an issue where the :mod:`zoneinfo` module and its tests
12040  were not included when Python is installed with ``make``.
12041
12042Windows
12043-------
12044
12045- bpo-41744: Fixes automatic import of props file when using the Nuget
12046  package.
12047
12048- bpo-41627: The user site directory for 32-bit now includes a ``-32``
12049  suffix to distinguish it from the 64-bit interpreter's directory.
12050
12051- bpo-41526: Fixed layout of final page of the installer by removing the
12052  special thanks to Mark Hammond (with his permission).
12053
12054- bpo-41492: Fixes the description that appears in UAC prompts.
12055
12056- bpo-40948: Improve post-install message to direct people to the "py"
12057  command.
12058
12059- bpo-41412: The installer will now fail to install on Windows 7 and Windows
12060  8. Further, the UCRT dependency is now always downloaded on demand.
12061
12062- bpo-40741: Update Windows release to include SQLite 3.32.3.
12063
12064- bpo-41142: :mod:`msilib` now supports creating CAB files with non-ASCII
12065  file path and adding files with non-ASCII file path to them.
12066
12067- bpo-41074: Fixed support of non-ASCII names in functions
12068  :func:`msilib.OpenDatabase` and :func:`msilib.init_database` and non-ASCII
12069  SQL in method :meth:`msilib.Database.OpenView`.
12070
12071- bpo-41039: Stable ABI redirection DLL (python3.dll) now uses ``#pragma
12072  comment(linker)`` for re-exporting.
12073
12074- bpo-40164: Updates Windows OpenSSL to 1.1.1g
12075
12076- bpo-39631: Changes the registered MIME type for ``.py`` files on Windows
12077  to ``text/x-python`` instead of ``text/plain``.
12078
12079- bpo-40677: Manually define IO_REPARSE_TAG_APPEXECLINK in case some old
12080  Windows SDK doesn't have it.
12081
12082- bpo-37556: Extend py.exe help to mention overrides via venv, shebang,
12083  environmental variables & ini files.
12084
12085macOS
12086-----
12087
12088- bpo-41557: Update macOS installer to use SQLite 3.33.0.
12089
12090- bpo-39580: Avoid opening Finder window if running installer from the
12091  command line. Patch contributed by Rick Heil.
12092
12093- bpo-41100: Fix configure error when building on macOS 11. Note that the
12094  current Python release was released shortly after the first developer
12095  preview of macOS 11 (Big Sur); there are other known issues with building
12096  and running on the developer preview. Big Sur is expected to be fully
12097  supported in a future bugfix release of Python 3.8.x and with 3.9.0.
12098
12099- bpo-40741: Update macOS installer to use SQLite 3.32.3.
12100
12101- bpo-41005: fixed an XDG settings issue not allowing macos to open browser
12102  in webbrowser.py
12103
12104- bpo-40741: Update macOS installer to use SQLite 3.32.2.
12105
12106IDLE
12107----
12108
12109- bpo-41775: Use 'IDLE Shell' as shell title
12110
12111- bpo-35764: Rewrite the Calltips doc section.
12112
12113- bpo-40181: In calltips, stop reminding that '/' marks the end of
12114  positional-only arguments.
12115
12116- bpo-41468: Improve IDLE run crash error message (which users should never
12117  see).
12118
12119- bpo-41373: Save files loaded with no line ending, as when blank, or
12120  different line endings, by setting its line ending to the system default.
12121  Fix regression in 3.8.4 and 3.9.0b4.
12122
12123- bpo-41300: Save files with non-ascii chars. Fix regression released in
12124  3.9.0b4 and 3.8.4.
12125
12126- bpo-37765: Add keywords to module name completion list.  Rewrite
12127  Completions section of IDLE doc.
12128
12129- bpo-41152: The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is
12130  now always UTF-8.
12131
12132- bpo-41144: Make Open Module open a special module such as os.path.
12133
12134- bpo-39885: Make context menu Cut and Copy work again when right-clicking
12135  within a selection.
12136
12137- bpo-40723: Make test_idle pass when run after import.
12138
12139C API
12140-----
12141
12142- bpo-41936: Removed undocumented macros ``Py_ALLOW_RECURSION`` and
12143  ``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the
12144  :c:type:`PyInterpreterState` structure.
12145
12146- bpo-41692: The ``PyUnicode_InternImmortal()`` function is now deprecated
12147  and will be removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace`
12148  instead. Patch by Victor Stinner.
12149
12150- bpo-41842: Add :c:func:`PyCodec_Unregister` function to unregister a codec
12151  search function.
12152
12153- bpo-41834: Remove the ``_Py_CheckRecursionLimit`` variable: it has been
12154  replaced by ``ceval.recursion_limit`` of the :c:type:`PyInterpreterState`
12155  structure. Patch by Victor Stinner.
12156
12157- bpo-41689: Types created with :c:func:`PyType_FromSpec` now make any
12158  signature in their ``tp_doc`` slot accessible from ``__text_signature__``.
12159
12160- bpo-41524: Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented
12161  pointers beyond the end of a string.
12162
12163- bpo-41324: Add a minimal decimal capsule API.  The API supports fast
12164  conversions between Decimals up to 38 digits and their triple
12165  representation as a C struct.
12166
12167- bpo-30155: Add :c:func:`PyDateTime_DATE_GET_TZINFO` and
12168  :c:func:`PyDateTime_TIME_GET_TZINFO` macros for accessing the ``tzinfo``
12169  attributes of :class:`datetime.datetime` and :class:`datetime.time`
12170  objects.
12171
12172- bpo-40170: Revert :c:func:`PyType_HasFeature` change: it reads again
12173  directly the :c:member:`PyTypeObject.tp_flags` member when the limited C
12174  API is not used, rather than always calling :c:func:`PyType_GetFlags`
12175  which hides implementation details.
12176
12177- bpo-41123: Remove ``PyUnicode_AsUnicodeCopy``.
12178
12179- bpo-41123: Removed ``PyLong_FromUnicode()``.
12180
12181- bpo-41123: Removed ``PyUnicode_GetMax()``.
12182
12183- bpo-41123: Removed ``Py_UNICODE_str*`` functions manipulating
12184  ``Py_UNICODE*`` strings.
12185
12186- bpo-41103: ``PyObject_AsCharBuffer()``, ``PyObject_AsReadBuffer()``,
12187  ``PyObject_CheckReadBuffer()``, and ``PyObject_AsWriteBuffer()`` are
12188  removed. Please migrate to new buffer protocol;
12189  :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release`.
12190
12191- bpo-36346: Raises DeprecationWarning for ``PyUnicode_FromUnicode(NULL,
12192  size)`` and ``PyUnicode_FromStringAndSize(NULL, size)`` with ``size > 0``.
12193
12194- bpo-36346: Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``,
12195  ``PyUnicode_WSTR_LENGTH``, ``PyUnicode_FromUnicode``,
12196  ``PyUnicode_AsUnicode``, and ``PyUnicode_AsUnicodeAndSize`` as deprecated
12197  in C. Remove ``Py_UNICODE_MATCH`` which was deprecated and broken since
12198  Python 3.3.
12199
12200- bpo-40989: The :c:func:`PyObject_INIT` and :c:func:`PyObject_INIT_VAR`
12201  macros become aliases to, respectively, :c:func:`PyObject_Init` and
12202  :c:func:`PyObject_InitVar` functions.
12203
12204- bpo-36020: On Windows, ``#include "pyerrors.h"`` no longer defines
12205  ``snprintf`` and ``vsnprintf`` macros.
12206
12207- bpo-40943: The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use
12208  :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use
12209  ``#``: ``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and
12210  ``Z#``. See :ref:`Parsing arguments and building values <arg-parsing>` and
12211  the :pep:`353`.
12212
12213- bpo-40910: Export explicitly the :c:func:`Py_GetArgcArgv` function to the
12214  C API and document the function. Previously, it was exported implicitly
12215  which no longer works since Python is built with ``-fvisibility=hidden``.
12216
12217- bpo-40724: Allow defining buffer slots in type specs.
12218
12219- bpo-40679: Fix a ``_PyEval_EvalCode()`` crash if *qualname* argument is
12220  NULL.
12221
12222- bpo-40839: Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had
12223  been allowed for historical reason. It is no longer allowed.
12224
12225- bpo-40826: :c:func:`PyOS_InterruptOccurred` now fails with a fatal error
12226  if it is called with the GIL released.
12227
12228- bpo-40792: The result of :c:func:`PyNumber_Index` now always has exact
12229  type :class:`int`. Previously, the result could have been an instance of a
12230  subclass of ``int``.
12231
12232- bpo-39573: Convert :c:func:`Py_REFCNT` and :c:func:`Py_SIZE` macros to
12233  static inline functions. They cannot be used as l-value anymore: use
12234  :c:func:`Py_SET_REFCNT` and :c:func:`Py_SET_SIZE` to set an object
12235  reference count and size. This change is backward incompatible on purpose,
12236  to prepare the C API for an opaque :c:type:`PyObject` structure.
12237
12238- bpo-40703: The PyType_FromSpec*() functions no longer overwrite the type's
12239  "__module__" attribute if it is set via "Py_tp_members" or "Py_tp_getset".
12240
12241- bpo-39583: Remove superfluous "extern C" declarations from
12242  ``Include/cpython/*.h``.
12243
12244
12245What's New in Python 3.9.0 beta 1?
12246==================================
12247
12248*Release date: 2020-05-19*
12249
12250Security
12251--------
12252
12253- bpo-40501: :mod:`uuid` no longer uses :mod:`ctypes` to load
12254  :file:`libuuid` or :file:`rpcrt4.dll` at runtime.
12255
12256Core and Builtins
12257-----------------
12258
12259- bpo-40663: Correctly generate annotations where parentheses are omitted
12260  but required (e.g: ``Type[(str, int, *other))]``.
12261
12262- bpo-40596: Fixed :meth:`str.isidentifier` for non-canonicalized strings
12263  containing non-BMP characters on Windows.
12264
12265- bpo-40593: Improved syntax errors for invalid characters in source code.
12266
12267- bpo-40585: Fixed a bug when using :func:`codeop.compile_command` that was
12268  causing exceptions to be swallowed with the new parser. Patch by Pablo
12269  Galindo
12270
12271- bpo-40566: Apply :pep:`573` to :mod:`abc`.
12272
12273- bpo-40502: Initialize ``n->n_col_offset``. (Patch by Joannah Nanjekye)
12274
12275- bpo-40527: Fix command line argument parsing: no longer write errors
12276  multiple times into stderr.
12277
12278- bpo-1635741: Port :mod:`errno` to multiphase initialization (:pep:`489`).
12279
12280- bpo-40523: Add pass-throughs for :func:`hash` and :func:`reversed` to
12281  :class:`weakref.proxy` objects. Patch by Pablo Galindo.
12282
12283- bpo-1635741: Port :mod:`syslog` to multiphase initialization (:pep:`489`).
12284
12285- bpo-40246: Reporting a specialised error message for invalid string
12286  prefixes, which was introduced in :issue:`40246`, is being reverted due to
12287  backwards compatibility concerns for strings that immediately follow a
12288  reserved keyword without whitespace between them. Constructs like
12289  `bg="#d00" if clear else"#fca"` were failing to parse, which is not an
12290  acceptable breakage on such short notice.
12291
12292- bpo-40417: Fix imp module deprecation warning when PyImport_ReloadModule
12293  is called. Patch by Robert Rouhani.
12294
12295- bpo-40408: Fixed support of nested type variables in GenericAlias (e.g.
12296  ``list[list[T]]``).
12297
12298- bpo-1635741: Port _stat module to multiphase initialization (:pep:`489`).
12299
12300- bpo-29587: Enable implicit exception chaining when calling
12301  :meth:`generator.throw`.
12302
12303- bpo-40328: Add tools for generating mappings headers for CJKCodecs.
12304
12305- bpo-40228: Setting frame.f_lineno is now robust w.r.t. changes in the
12306  source-to-bytecode compiler
12307
12308- bpo-38880: Added the ability to list interpreters associated with channel
12309  ends in the internal subinterpreters module.
12310
12311- bpo-37986: Improve performance of :c:func:`PyLong_FromDouble` for values
12312  that fit into :c:expr:`long`.
12313
12314Library
12315-------
12316
12317- bpo-40662: Fixed :func:`ast.get_source_segment` for ast nodes that have
12318  incomplete location information. Patch by Irit Katriel.
12319
12320- bpo-40665: Convert :mod:`bisect` to use Argument Clinic.
12321
12322- bpo-40536: Added the :func:`~zoneinfo.available_timezones` function to the
12323  :mod:`zoneinfo` module. Patch by Paul Ganssle.
12324
12325- bpo-40645: The :class:`hmac.HMAC` exposes internal implementation details.
12326  The attributes ``digest_cons``, ``inner``, and ``outer`` are deprecated
12327  and will be removed in the future.
12328
12329- bpo-40645: The internal module ``_hashlib`` wraps and exposes OpenSSL's
12330  HMAC API. The new code will be used in Python 3.10 after the internal
12331  implementation details of the pure Python HMAC module are no longer part
12332  of the public API.
12333
12334- bpo-40637: Builtin hash modules can now be disabled or selectively enabled
12335  with ``configure --with-builtin-hashlib-hashes=sha3,blake1`` or
12336  ``--without-builtin-hashlib-hashes``.
12337
12338- bpo-37630: The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF
12339  from OpenSSL when available.
12340
12341- bpo-40479: The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2.
12342
12343- bpo-40257: Revert changes to :func:`inspect.getdoc`.
12344
12345- bpo-40607: When cancelling a task due to timeout, :meth:`asyncio.wait_for`
12346  will now propagate the exception if an error happens during cancellation.
12347  Patch by Roman Skurikhin.
12348
12349- bpo-40612: Fix edge cases in SyntaxError formatting. If the offset is <=
12350  0, no caret is printed. If the offset is > line length, the caret is
12351  printed pointing just after the last character.
12352
12353- bpo-40597: If text content lines are longer than policy.max_line_length,
12354  always use a content-encoding to make sure they are wrapped.
12355
12356- bpo-40571: Added functools.cache() as a simpler, more discoverable way to
12357  access the unbounded cache variant of lru_cache(maxsize=None).
12358
12359- bpo-40503: :pep:`615`, the :mod:`zoneinfo` module. Adds support for the
12360  IANA time zone database.
12361
12362- bpo-40397: Removed attributes ``__args__`` and ``__parameters__`` from
12363  special generic aliases like ``typing.List`` (not subscripted).
12364
12365- bpo-40549: Convert posixmodule.c ("posix" or "nt" module) to the
12366  multiphase initialization (PEP 489).
12367
12368- bpo-31033: Add a ``msg`` argument to :meth:`Future.cancel` and
12369  :meth:`Task.cancel`.
12370
12371- bpo-40541: Added an optional *counts* parameter to random.sample().
12372
12373- bpo-40515: The :mod:`ssl` and :mod:`hashlib` modules now actively check
12374  that OpenSSL is build with thread support. Python 3.7.0 made thread
12375  support mandatory and no longer works safely with a no-thread builds.
12376
12377- bpo-31033: When a :class:`asyncio.Task` is cancelled, the exception
12378  traceback now chains all the way back to where the task was first
12379  interrupted.
12380
12381- bpo-40504: :func:`functools.lru_cache` objects can now be the targets of
12382  weakrefs.
12383
12384- bpo-40559: Fix possible memory leak in the C implementation of
12385  :class:`asyncio.Task`.
12386
12387- bpo-40480: ``fnmatch.fnmatch()`` could take exponential time in the
12388  presence of multiple ``*`` pattern characters.  This was repaired by
12389  generating more elaborate regular expressions to avoid futile
12390  backtracking.
12391
12392- bpo-40495: :mod:`compileall` is now able to use hardlinks to prevent
12393  duplicates in a case when ``.pyc`` files for different optimization levels
12394  have the same content.
12395
12396- bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and
12397  1.1 methods.
12398
12399- bpo-40355: Improve error reporting in :func:`ast.literal_eval` in the
12400  presence of malformed :class:`ast.Dict` nodes instead of silently ignoring
12401  any non-conforming elements. Patch by Curtis Bucher.
12402
12403- bpo-40465: Deprecated the optional *random* argument to
12404  *random.shuffle()*.
12405
12406- bpo-40459: :func:`platform.win32_ver` now produces correct *ptype* strings
12407  instead of empty strings.
12408
12409- bpo-39435: The first argument of :func:`pickle.loads` is now
12410  positional-only.
12411
12412- bpo-39305: Update :mod:`nntplib` to merge :class:`nntplib.NNTP` and
12413  :class:`nntplib._NNTPBase`. Patch by Dong-hee Na.
12414
12415- bpo-32494: Update :mod:`dbm.gnu` to use gdbm_count if possible when
12416  calling :func:`len`. Patch by Dong-hee Na.
12417
12418- bpo-40453: Add ``isolated=True`` keyword-only parameter to
12419  ``_xxsubinterpreters.create()``. An isolated subinterpreter cannot spawn
12420  threads, spawn a child process or call ``os.fork()``.
12421
12422- bpo-40286: Remove ``_random.Random.randbytes()``: the C implementation of
12423  ``randbytes()``. Implement the method in Python to ease subclassing:
12424  ``randbytes()`` now directly reuses ``getrandbits()``.
12425
12426- bpo-40394: Added default arguments to
12427  :meth:`difflib.SequenceMatcher.find_longest_match()`.
12428
12429- bpo-39995: Fix a race condition in concurrent.futures._ThreadWakeup:
12430  access to _ThreadWakeup is now protected with the shutdown lock.
12431
12432- bpo-30966: ``Process.shutdown(wait=True)`` of :mod:`concurrent.futures`
12433  now closes explicitly the result queue.
12434
12435- bpo-30966: Add a new :meth:`~multiprocessing.SimpleQueue.close` method to
12436  the :class:`~multiprocessing.SimpleQueue` class to explicitly close the
12437  queue.
12438
12439- bpo-39966: Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps'
12440  set uses default return values for magic methods.
12441
12442- bpo-39791: Added ``files()`` function to importlib.resources with support
12443  for subdirectories in package data, matching backport in
12444  importlib_resources 1.5.
12445
12446- bpo-40375: :meth:`imaplib.IMAP4.unselect` is added. Patch by Dong-hee Na.
12447
12448- bpo-40389: ``repr()`` now returns ``typing.Optional[T]`` when called for
12449  ``typing.Union`` of two types, one of which is ``NoneType``.
12450
12451- bpo-40291: Add support for CAN_J1939 sockets (available on Linux 5.4+)
12452
12453- bpo-40273: :class:`types.MappingProxyType` is now reversible.
12454
12455- bpo-39075: The repr for :class:`types.SimpleNamespace` is now insertion
12456  ordered rather than alphabetical.
12457
12458- bpo-40192: On AIX, :func:`~time.thread_time` is now implemented with
12459  ``thread_cputime()`` which has nanosecond resolution, rather than
12460  ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` which has a resolution of 10
12461  milliseconds. Patch by Batuhan Taskaya.
12462
12463- bpo-40025: Raise TypeError when _generate_next_value_ is defined after
12464  members. Patch by Ethan Onstott.
12465
12466- bpo-39058: In the argparse module, the repr for Namespace() and other
12467  argument holders now displayed in the order attributes were added.
12468  Formerly, it displayed in alphabetical order even though argument order is
12469  preserved the user visible parts of the module.
12470
12471- bpo-24416: The ``isocalendar()`` methods of :class:`datetime.date` and
12472  :class:`datetime.datetime` now return a :term:`named tuple` instead of a
12473  :class:`tuple`.
12474
12475Documentation
12476-------------
12477
12478- bpo-34790: Add version of removal for explicit passing of coros to
12479  `asyncio.wait()`'s documentation
12480
12481- bpo-40561: Provide docstrings for webbrowser open functions.
12482
12483- bpo-40499: Mention that :func:`asyncio.wait` requires a non-empty set of
12484  awaitables.
12485
12486- bpo-39705: Tutorial example for sorted() in the Loop Techniques section is
12487  given a better explanation. Also a new example is included to explain
12488  sorted()'s basic behavior.
12489
12490- bpo-39435: Fix an incorrect signature for :func:`pickle.loads` in the docs
12491
12492Tests
12493-----
12494
12495- bpo-40055: distutils.tests now saves/restores warnings filters to leave
12496  them unchanged. Importing tests imports docutils which imports
12497  pkg_resources which adds a warnings filter.
12498
12499- bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code.
12500
12501Build
12502-----
12503
12504- bpo-40653: Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling
12505  issue.
12506
12507- bpo-40514: Add ``--with-experimental-isolated-subinterpreters`` build
12508  option to ``configure``: better isolate subinterpreters, experimental
12509  build mode.
12510
12511Windows
12512-------
12513
12514- bpo-40650: Include winsock2.h in pytime.c for timeval.
12515
12516- bpo-40458: Increase reserved stack space to prevent overflow crash on
12517  Windows.
12518
12519- bpo-39148: Add IPv6 support to :mod:`asyncio` datagram endpoints in
12520  ProactorEventLoop. Change the raised exception for unknown address
12521  families to ValueError as it's not coming from Windows API.
12522
12523macOS
12524-----
12525
12526- bpo-34956: When building Python on macOS from source, ``_tkinter`` now
12527  links with non-system Tcl and Tk frameworks if they are installed in
12528  ``/Library/Frameworks``, as had been the case on older releases of macOS.
12529  If a macOS SDK is explicitly configured, by using
12530  ``--enable-universalsdk=`` or ``-isysroot``, only the SDK itself is
12531  searched. The default behavior can still be overridden with
12532  ``--with-tcltk-includes`` and ``--with-tcltk-libs``.
12533
12534- bpo-35569: Expose RFC 3542 IPv6 socket options.
12535
12536Tools/Demos
12537-----------
12538
12539- bpo-40479: Update multissltest helper to test with latest OpenSSL 1.0.2,
12540  1.1.0, 1.1.1, and 3.0.0-alpha.
12541
12542- bpo-40431: Fix a syntax typo in ``turtledemo`` that now raises a
12543  ``SyntaxError``.
12544
12545- bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old
12546  releases. The multissltest tool now tries to download from current and old
12547  download URLs.
12548
12549C API
12550-----
12551
12552- bpo-39465: Remove the ``_PyUnicode_ClearStaticStrings()`` function from
12553  the C API.
12554
12555- bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks now
12556  that we allow subtypes of PyCFunction, as well as PyCMethod_CheckExact()
12557  and PyCMethod_Check() for the new PyCMethod subtype.
12558
12559- bpo-40545: Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()``
12560  to properly export the function in the C API. The function remains private
12561  (``_Py``) prefix.
12562
12563- bpo-40412: Nullify inittab_copy during finalization, preventing future
12564  interpreter initializations in an embedded situation from crashing. Patch
12565  by Gregory Szorc.
12566
12567- bpo-40429: The :c:func:`PyThreadState_GetFrame` function now returns a
12568  strong reference to the frame.
12569
12570- bpo-40428: Remove the following functions from the C API. Call
12571  :c:func:`PyGC_Collect` explicitly to free all free lists.
12572
12573  * ``PyAsyncGen_ClearFreeLists()``
12574  * ``PyContext_ClearFreeList()``
12575  * ``PyDict_ClearFreeList()``
12576  * ``PyFloat_ClearFreeList()``
12577  * ``PyFrame_ClearFreeList()``
12578  * ``PyList_ClearFreeList()``
12579  * ``PySet_ClearFreeList()``
12580  * ``PyTuple_ClearFreeList()``
12581
12582- bpo-40421: New :c:func:`PyFrame_GetBack` function: get the frame next
12583  outer frame.
12584
12585- bpo-40421: New :c:func:`PyFrame_GetCode` function: return a borrowed
12586  reference to the frame code.
12587
12588- bpo-40217: Ensure that instances of types created with
12589  :c:func:`PyType_FromSpecWithBases` will visit its class object when
12590  traversing references in the garbage collector (implemented as an
12591  extension of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by
12592  Pablo Galindo.
12593
12594- bpo-38787: Module C state is now accessible from C-defined heap type
12595  methods (:pep:`573`). Patch by Marcel Plch and Petr Viktorin.
12596
12597
12598What's New in Python 3.9.0 alpha 6?
12599===================================
12600
12601*Release date: 2020-04-27*
12602
12603Security
12604--------
12605
12606- bpo-40121: Fixes audit events raised on creating a new socket.
12607
12608- bpo-39073: Disallow CR or LF in email.headerregistry.Address arguments to
12609  guard against header injection attacks.
12610
12611- bpo-39503: CVE-2020-8492: The
12612  :class:`~urllib.request.AbstractBasicAuthHandler` class of the
12613  :mod:`urllib.request` module uses an inefficient regular expression which
12614  can be exploited by an attacker to cause a denial of service. Fix the
12615  regex to prevent the catastrophic backtracking. Vulnerability reported by
12616  Ben Caller and Matt Schwager.
12617
12618Core and Builtins
12619-----------------
12620
12621- bpo-40313: Improve the performance of bytes.hex().
12622
12623- bpo-40334: Switch to a new parser, based on PEG.  For more details see PEP
12624  617. To temporarily switch back to the old parser, use ``-X oldparser`` or
12625  ``PYTHONOLDPARSER=1``.  In Python 3.10 we will remove the old parser
12626  completely, including the ``parser`` module (already deprecated) and
12627  anything that depends on it.
12628
12629- bpo-40267: Fix the tokenizer to display the correct error message, when
12630  there is a SyntaxError on the last input character and no newline follows.
12631  It used to be `unexpected EOF while parsing`, while it should be `invalid
12632  syntax`.
12633
12634- bpo-39522: Correctly unparse explicit ``u`` prefix for strings when
12635  postponed evaluation for annotations activated. Patch by Batuhan Taskaya.
12636
12637- bpo-40246: Report a specialized error message, `invalid string prefix`,
12638  when the tokenizer encounters a string with an invalid prefix.
12639
12640- bpo-40082: Fix the signal handler: it now always uses the main
12641  interpreter, rather than trying to get the current Python thread state.
12642
12643- bpo-37388: str.encode() and str.decode() no longer check the encoding and
12644  errors in development mode or in debug mode during Python finalization.
12645  The codecs machinery can no longer work on very late calls to str.encode()
12646  and str.decode().
12647
12648- bpo-40077: Fix possible refleaks in :mod:`_json`, memo of PyScannerObject
12649  should be traversed.
12650
12651- bpo-37207: Speed up calls to ``dict()`` by using the :pep:`590`
12652  ``vectorcall`` calling convention.
12653
12654- bpo-40141: Add column and line information to ``ast.keyword`` nodes. Patch
12655  by Pablo Galindo.
12656
12657- bpo-1635741: Port :mod:`resource` to multiphase initialization
12658  (:pep:`489`).
12659
12660- bpo-1635741: Port :mod:`math` to multiphase initialization (:pep:`489`).
12661
12662- bpo-1635741: Port _uuid module to multiphase initialization (:pep:`489`).
12663
12664- bpo-40077: Convert json module to use :c:func:`PyType_FromSpec`.
12665
12666- bpo-40067: Improve the error message for multiple star expressions in an
12667  assignment. Patch by Furkan Onder
12668
12669- bpo-1635741: Port _functools module to multiphase initialization (PEP
12670  489). Patch by Paulo Henrique Silva.
12671
12672- bpo-1635741: Port operator module to multiphase initialization (PEP 489).
12673  Patch by Paulo Henrique Silva.
12674
12675- bpo-20526: Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is
12676  a borrowed reference, not a strong reference: ``PyThreadState_Clear()``
12677  must not call ``Py_CLEAR(tstate->frame)``.
12678
12679- bpo-1635741: Port time module to multiphase initialization (:pep:`489`).
12680  Patch by Paulo Henrique Silva.
12681
12682- bpo-1635741: Port _weakref extension module to multiphase initialization
12683  (:pep:`489`).
12684
12685- bpo-40020: Fix a leak and subsequent crash in parsetok.c caused by realloc
12686  misuse on a rare codepath.
12687
12688- bpo-39939: Added str.removeprefix and str.removesuffix methods and
12689  corresponding bytes, bytearray, and collections.UserString methods to
12690  remove affixes from a string if present. See :pep:`616` for a full
12691  description. Patch by Dennis Sweeney.
12692
12693- bpo-39481: Implement PEP 585. This supports list[int], tuple[str, ...]
12694  etc.
12695
12696- bpo-32894: Support unparsing of infinity numbers in postponed annotations.
12697  Patch by Batuhan Taşkaya.
12698
12699- bpo-37207: Speed up calls to ``list()`` by using the :pep:`590`
12700  ``vectorcall`` calling convention. Patch by Mark Shannon.
12701
12702Library
12703-------
12704
12705- bpo-40398: :func:`typing.get_args` now always returns an empty tuple for
12706  special generic aliases.
12707
12708- bpo-40396: Functions :func:`typing.get_origin`, :func:`typing.get_args`
12709  and :func:`typing.get_type_hints` support now generic aliases like
12710  ``list[int]``.
12711
12712- bpo-38061: Optimize the :mod:`subprocess` module on FreeBSD using
12713  ``closefrom()``. A single ``close(fd)`` syscall is cheap, but when
12714  ``sysconf(_SC_OPEN_MAX)`` is high, the loop calling ``close(fd)`` on each
12715  file descriptor can take several milliseconds.
12716
12717  The workaround on FreeBSD to improve performance was to load and mount the
12718  fdescfs kernel module, but this is not enabled by default.
12719
12720  Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
12721  (kevans) and Kubilay Kocak (koobs):
12722  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
12723
12724- bpo-38061: On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls
12725  ``closefrom(fd_low)`` if *fd_high* is greater than or equal to
12726  ``sysconf(_SC_OPEN_MAX)``.
12727
12728  Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
12729  (kevans) and Kubilay Kocak (koobs):
12730  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
12731
12732- bpo-40360: The :mod:`lib2to3` module is pending deprecation due to
12733  :pep:`617`.
12734
12735- bpo-40138: Fix the Windows implementation of :func:`os.waitpid` for exit
12736  code larger than ``INT_MAX >> 8``. The exit status is now interpreted as
12737  an unsigned number.
12738
12739- bpo-39942: Set "__main__" as the default module name when "__name__" is
12740  missing in :class:`typing.TypeVar`. Patch by Weipeng Hong.
12741
12742- bpo-40275: The :mod:`logging` package is now imported lazily in
12743  :mod:`unittest` only when the :meth:`~unittest.TestCase.assertLogs`
12744  assertion is used.
12745
12746- bpo-40275: The :mod:`asyncio` package is now imported lazily in
12747  :mod:`unittest` only when the :class:`~unittest.IsolatedAsyncioTestCase`
12748  class is used.
12749
12750- bpo-40330: In :meth:`ShareableList.__setitem__`, check the size of a new
12751  string item after encoding it to utf-8, not before.
12752
12753- bpo-40148: Added :meth:`pathlib.Path.with_stem()` to create a new Path
12754  with the stem replaced.
12755
12756- bpo-40325: Deprecated support for set objects in random.sample().
12757
12758- bpo-40257: Improved help for the :mod:`typing` module. Docstrings are now
12759  shown for all special forms and special generic aliases (like ``Union``
12760  and ``List``). Using ``help()`` with generic alias like ``List[int]`` will
12761  show the help for the correspondent concrete type (``list`` in this case).
12762
12763- bpo-40257: func:`inspect.getdoc` no longer returns docstring inherited
12764  from the type of the object or from parent class if it is a class if it is
12765  not defined in the object itself. In :mod:`pydoc` the documentation string
12766  is now shown not only for class, function, method etc, but for any object
12767  that has its own ``__doc__`` attribute.
12768
12769- bpo-40287: Fixed ``SpooledTemporaryFile.seek()`` to return the position.
12770
12771- bpo-40290: Added zscore() to statistics.NormalDist().
12772
12773- bpo-40282: Allow ``random.getrandbits(0)`` to succeed and to return 0.
12774
12775- bpo-40286: Add :func:`random.randbytes` function and
12776  :meth:`random.Random.randbytes` method to generate random bytes.
12777
12778- bpo-40277: :func:`collections.namedtuple` now provides a human-readable
12779  repr for its field accessors.
12780
12781- bpo-40270: The included copy of sqlite3 on Windows is now compiled with
12782  the json extension. This allows the use of functions such as
12783  ``json_object``.
12784
12785- bpo-29255: Wait in `KqueueSelector.select` when no fds are registered
12786
12787- bpo-40260: Ensure :mod:`modulefinder` uses :func:`io.open_code` and
12788  respects coding comments.
12789
12790- bpo-40234: Allow again to spawn daemon threads in subinterpreters (revert
12791  change which denied them).
12792
12793- bpo-39207: Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are
12794  now spawned on demand, only when there are no available idle workers to
12795  reuse. This optimizes startup overhead and reduces the amount of lost CPU
12796  time to idle workers. Patch by Kyle Stanley.
12797
12798- bpo-40091: Fix a hang at fork in the logging module: the new private
12799  _at_fork_reinit() method is now used to reinitialize locks at fork in the
12800  child process.
12801
12802- bpo-40149: Implement traverse and clear slots in _abc._abc_data type.
12803
12804- bpo-40208: Remove deprecated :meth:`symtable.SymbolTable.has_exec`.
12805
12806- bpo-40196: Fix a bug in the :mod:`symtable` module that was causing
12807  incorrectly report global variables as local. Patch by Pablo Galindo.
12808
12809- bpo-40190: Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`.
12810
12811- bpo-40182: Removed the ``_field_types`` attribute of the
12812  :class:`typing.NamedTuple` class.
12813
12814- bpo-36517: Multiple inheritance with :class:`typing.NamedTuple` now raises
12815  an error instead of silently ignoring other types.
12816
12817- bpo-40126: Fixed reverting multiple patches in unittest.mock. Patcher's
12818  ``__exit__()`` is now never called if its ``__enter__()`` is failed.
12819  Returning true from ``__exit__()`` silences now the exception.
12820
12821- bpo-40094: CGIHTTPRequestHandler of http.server now logs the CGI script
12822  exit code, rather than the CGI script exit status of os.waitpid(). For
12823  example, if the script is killed by signal 11, it now logs: "CGI script
12824  exit code -11."
12825
12826- bpo-40108: Improve the error message when triying to import a module using
12827  :mod:`runpy` and incorrently use the ".py" extension at the end of the
12828  module name. Patch by Pablo Galindo.
12829
12830- bpo-40094: Add :func:`os.waitstatus_to_exitcode` function: convert a wait
12831  status to an exit code.
12832
12833- bpo-40089: Fix threading._after_fork(): if fork was not called by a thread
12834  spawned by threading.Thread, threading._after_fork() now creates a
12835  _MainThread instance for _main_thread, instead of a _DummyThread instance.
12836
12837- bpo-40089: Add a private ``_at_fork_reinit()`` method to
12838  :class:`_thread.Lock`, :class:`_thread.RLock`, :class:`threading.RLock`
12839  and :class:`threading.Condition` classes: reinitialize the lock at fork in
12840  the child process, reset the lock to the unlocked state. Rename also the
12841  private ``_reset_internal_locks()`` method of :class:`threading.Event` to
12842  ``_at_fork_reinit()``.
12843
12844- bpo-25780: Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the
12845  :mod:`socket` module.
12846
12847- bpo-39503: :class:`~urllib.request.AbstractBasicAuthHandler` of
12848  :mod:`urllib.request` now parses all WWW-Authenticate HTTP headers and
12849  accepts multiple challenges per header: use the realm of the first Basic
12850  challenge.
12851
12852- bpo-39812: Removed daemon threads from :mod:`concurrent.futures` by adding
12853  an internal `threading._register_atexit()`, which calls registered
12854  functions prior to joining all non-daemon threads. This allows for
12855  compatibility with subinterpreters, which don't support daemon threads.
12856
12857- bpo-40050: Fix ``importlib._bootstrap_external``: avoid creating a new
12858  ``winreg`` builtin module if it's already available in
12859  :data:`sys.modules`, and remove redundant imports.
12860
12861- bpo-40014: Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails
12862  because the group list is too small, retry with a larger group list. On
12863  failure, the glibc implementation of ``getgrouplist()`` sets ``ngroups``
12864  to the total number of groups. For other implementations, double the group
12865  list size.
12866
12867- bpo-40017: Add :data:`time.CLOCK_TAI` constant if the operating system
12868  support it.
12869
12870- bpo-40016: In re docstring, clarify the relationship between inline and
12871  argument compile flags.
12872
12873- bpo-39953: Update internal table of OpenSSL error codes in the ``ssl``
12874  module.
12875
12876- bpo-36144: Added :pep:`584` operators to
12877  :class:`weakref.WeakValueDictionary`.
12878
12879- bpo-36144: Added :pep:`584` operators to
12880  :class:`weakref.WeakKeyDictionary`.
12881
12882- bpo-38891: Fix linear runtime behaviour of the `__getitem__` and
12883  `__setitem__` methods in
12884  :class:`multiprocessing.shared_memory.ShareableList`. This avoids
12885  quadratic performance when iterating a `ShareableList`. Patch by Thomas
12886  Krennwallner.
12887
12888- bpo-39682: Remove undocumented support for *closing* a `pathlib.Path`
12889  object via its context manager. The context manager magic methods remain,
12890  but they are now a no-op, making `Path` objects immutable.
12891
12892- bpo-36144: Added :pep:`584` operators (``|`` and ``|=``) to
12893  :class:`collections.ChainMap`.
12894
12895- bpo-39011: Normalization of line endings in ElementTree attributes was
12896  removed, as line endings which were replaced by entity numbers should be
12897  preserved in original form.
12898
12899- bpo-38410: Properly handle :func:`sys.audit` failures in
12900  :func:`sys.set_asyncgen_hooks`.
12901
12902- bpo-36541: lib2to3 now recognizes named assignment expressions (the walrus
12903  operator, ``:=``)
12904
12905- bpo-35967: In platform, delay the invocation of 'uname -p' until the
12906  processor attribute is requested.
12907
12908- bpo-35113: :meth:`inspect.getsource` now returns correct source code for
12909  inner class with same name as module level class. Decorators are also
12910  returned as part of source of the class. Patch by Karthikeyan
12911  Singaravelan.
12912
12913- bpo-33262: Deprecate passing None as an argument for
12914  :func:`shlex.split()`'s ``s`` parameter.  Patch by Zackery Spytz.
12915
12916- bpo-31758: Prevent crashes when using an uninitialized
12917  ``_elementtree.XMLParser`` object. Patch by Oren Milman.
12918
12919Documentation
12920-------------
12921
12922- bpo-27635: The pickle documentation incorrectly claimed that ``__new__``
12923  isn't called by default when unpickling.
12924
12925- bpo-39879: Updated :ref:`datamodel` docs to include :func:`dict` insertion
12926  order preservation. Patch by Furkan Onder and Samy Lahfa.
12927
12928- bpo-38387: Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference.
12929
12930- bpo-13743: Some methods within xml.dom.minidom.Element class are now
12931  better documented.
12932
12933Tests
12934-----
12935
12936- bpo-31904: Set expected default encoding in test_c_locale_coercion.py for
12937  VxWorks RTOS.
12938
12939- bpo-40162: Update Travis CI configuration to OpenSSL 1.1.1f.
12940
12941- bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines.
12942
12943- bpo-40094: Add :func:`test.support.wait_process` function.
12944
12945- bpo-40003: ``test.bisect_cmd`` now copies Python command line options like
12946  ``-O`` or ``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used
12947  with ``-w``/``--verbose2`` option.
12948
12949- bpo-39380: Add the encoding in :class:`ftplib.FTP` and
12950  :class:`ftplib.FTP_TLS` to the constructor as keyword-only and change the
12951  default from ``latin-1`` to ``utf-8`` to follow :rfc:`2640`.
12952
12953- bpo-39793: Use the same domain when testing ``make_msgid``. Patch by
12954  Batuhan Taskaya.
12955
12956- bpo-1812: Fix newline handling in doctest.testfile when loading from a
12957  package whose loader has a get_data method. Patch by Peter Donis.
12958
12959Build
12960-----
12961
12962- bpo-38360: Support single-argument form of macOS -isysroot flag.
12963
12964- bpo-40158: Fix CPython MSBuild Properties in NuGet Package
12965  (build/native/python.props)
12966
12967- bpo-38527: Fix configure check on Solaris for "float word ordering":
12968  sometimes, the correct "grep" command was not being used. Patch by Arnon
12969  Yaari.
12970
12971Windows
12972-------
12973
12974- bpo-40164: Updates Windows to OpenSSL 1.1.1f
12975
12976- bpo-8901: Ignore the Windows registry when the ``-E`` option is used.
12977
12978macOS
12979-----
12980
12981- bpo-38329: python.org macOS installers now update the Current version
12982  symlink of /Library/Frameworks/Python.framework/Versions for 3.9 installs.
12983  Previously, Current was only updated for Python 2.x installs. This should
12984  make it easier to embed Python 3 into other macOS applications.
12985
12986- bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g.
12987
12988IDLE
12989----
12990
12991- bpo-38439: Add a 256×256 pixel IDLE icon to support more modern
12992  environments. Created by Andrew Clover. Delete the unused macOS idle.icns
12993  icon file.
12994
12995- bpo-38689: IDLE will no longer freeze when inspect.signature fails when
12996  fetching a calltip.
12997
12998Tools/Demos
12999-----------
13000
13001- bpo-40385: Removed the checkpyc.py tool. Please see compileall without
13002  force mode as a potential alternative.
13003
13004- bpo-40179: Fixed translation of ``#elif`` in Argument Clinic.
13005
13006- bpo-40094: Fix ``which.py`` script exit code: it now uses
13007  :func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status
13008  into an exit code.
13009
13010C API
13011-----
13012
13013- bpo-40241: Move the :c:type:`PyGC_Head` structure to the internal C API.
13014
13015- bpo-40170: Convert :c:func:`PyObject_IS_GC` macro to a function to hide
13016  implementation details.
13017
13018- bpo-40241: Add the functions :c:func:`PyObject_GC_IsTracked` and
13019  :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if
13020  Python objects are being currently tracked or have been already finalized
13021  by the garbage collector respectively. Patch by Pablo Galindo.
13022
13023- bpo-40170: The :c:func:`PyObject_NEW` macro becomes an alias to the
13024  :c:func:`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro
13025  becomes an alias to the :c:func:`PyObject_NewVar` macro, to hide
13026  implementation details. They no longer access directly the
13027  :c:member:`PyTypeObject.tp_basicsize` member.
13028
13029- bpo-40170: :c:func:`PyType_HasFeature` now always calls
13030  :c:func:`PyType_GetFlags` to hide implementation details. Previously, it
13031  accessed directly the :c:member:`PyTypeObject.tp_flags` member when the
13032  limited C API was not used.
13033
13034- bpo-40170: Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a
13035  function to hide implementation details: the macro accessed directly to
13036  the :c:member:`PyTypeObject.tp_weaklistoffset` member.
13037
13038- bpo-40170: Convert :c:func:`PyObject_CheckBuffer` macro to a function to
13039  hide implementation details: the macro accessed directly the
13040  :c:member:`PyTypeObject.tp_as_buffer` member.
13041
13042- bpo-40170: Always declare :c:func:`PyIndex_Check` as an opaque function to
13043  hide implementation details: remove ``PyIndex_Check()`` macro. The macro
13044  accessed directly the :c:member:`PyTypeObject.tp_as_number` member.
13045
13046- bpo-39947: Add :c:func:`PyThreadState_GetID` function: get the unique
13047  identifier of a Python thread state.
13048
13049
13050What's New in Python 3.9.0 alpha 5?
13051===================================
13052
13053*Release date: 2020-03-23*
13054
13055Security
13056--------
13057
13058- bpo-38576: Disallow control characters in hostnames in http.client,
13059  addressing CVE-2019-18348. Such potentially malicious header injection
13060  URLs now cause a InvalidURL to be raised.
13061
13062Core and Builtins
13063-----------------
13064
13065- bpo-40010: Optimize pending calls in multithreaded applications. If a
13066  thread different than the main thread schedules a pending call
13067  (:c:func:`Py_AddPendingCall`), the bytecode evaluation loop is no longer
13068  interrupted at each bytecode instruction to check for pending calls which
13069  cannot be executed. Only the main thread can execute pending calls.
13070
13071  Previously, the bytecode evaluation loop was interrupted at each
13072  instruction until the main thread executes pending calls.
13073
13074- bpo-1635741: Port _weakref extension module to multiphase initialization
13075  (:pep:`489`).
13076
13077- bpo-1635741: Port _collections module to multiphase initialization
13078  (:pep:`489`).
13079
13080- bpo-40010: Optimize signal handling in multithreaded applications. If a
13081  thread different than the main thread gets a signal, the bytecode
13082  evaluation loop is no longer interrupted at each bytecode instruction to
13083  check for pending signals which cannot be handled. Only the main thread of
13084  the main interpreter can handle signals.
13085
13086  Previously, the bytecode evaluation loop was interrupted at each
13087  instruction until the main thread handles signals.
13088
13089- bpo-39984: If :c:func:`Py_AddPendingCall` is called in a subinterpreter,
13090  the function is now scheduled to be called from the subinterpreter, rather
13091  than being called from the main interpreter. Each subinterpreter now has
13092  its own list of scheduled calls.
13093
13094- bpo-1635741: Port _heapq module to multiphase initialization.
13095
13096- bpo-1635741: Port itertools module to multiphase initialization
13097  (:pep:`489`).
13098
13099- bpo-37207: Speed up calls to ``frozenset()`` by using the :pep:`590`
13100  ``vectorcall`` calling convention. Patch by Dong-hee Na.
13101
13102- bpo-39984: subinterpreters: Move
13103  ``_PyRuntimeState.ceval.tracing_possible`` to
13104  ``PyInterpreterState.ceval.tracing_possible``: each interpreter now has
13105  its own variable.
13106
13107- bpo-37207: Speed up calls to ``set()`` by using the :pep:`590`
13108  ``vectorcall`` calling convention. Patch by Dong-hee Na.
13109
13110- bpo-1635741: Port _statistics module to multiphase initialization
13111  (:pep:`489`).
13112
13113- bpo-39968: Use inline function to replace extension modules'
13114  get_module_state macros.
13115
13116- bpo-39965: Correctly raise ``SyntaxError`` if *await* is used inside
13117  non-async functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the
13118  asyncio REPL). Patch by Pablo Galindo.
13119
13120- bpo-39562: Allow executing asynchronous comprehensions on the top level
13121  when the ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan
13122  Taskaya.
13123
13124- bpo-37207: Speed up calls to ``tuple()`` by using the :pep:`590`
13125  ``vectorcall`` calling convention. Patch by Dong-hee Na.
13126
13127- bpo-38373: Changed list overallocation strategy. It no longer
13128  overallocates if the new size is closer to overallocated size than to the
13129  old size and adds padding.
13130
13131- bpo-39926: Update Unicode database to Unicode version 13.0.0.
13132
13133- bpo-19466: Clear the frames of daemon threads earlier during the Python
13134  shutdown to call objects destructors. So "unclosed file" resource warnings
13135  are now emitted for daemon threads in a more reliable way.
13136
13137- bpo-38894: Fix a bug that was causing incomplete results when calling
13138  ``pathlib.Path.glob`` in the presence of symlinks that point to files
13139  where the user does not have read access. Patch by Pablo Galindo and Matt
13140  Wozniski.
13141
13142- bpo-39877: Fix :c:func:`PyEval_RestoreThread` random crash at exit with
13143  daemon threads. It now accesses the ``_PyRuntime`` variable directly
13144  instead of using ``tstate->interp->runtime``, since ``tstate`` can be a
13145  dangling pointer after :c:func:`Py_Finalize` has been called. Moreover,
13146  the daemon thread now exits before trying to take the GIL.
13147
13148- bpo-39871: Fix a possible :exc:`SystemError` in
13149  ``math.{atan2,copysign,remainder}()`` when the first argument cannot be
13150  converted to a :class:`float`. Patch by Zackery Spytz.
13151
13152- bpo-39776: Fix race condition where threads created by PyGILState_Ensure()
13153  could get a duplicate id.
13154
13155  This affects consumers of tstate->id like the contextvar caching
13156  machinery, which could return invalid cached objects under heavy thread
13157  load (observed in embedded scenarios).
13158
13159- bpo-39778: Fixed a crash due to incorrect handling of weak references in
13160  ``collections.OrderedDict`` classes. Patch by Pablo Galindo.
13161
13162- bpo-1635741: Port audioop extension module to multiphase initialization
13163  (:pep:`489`).
13164
13165- bpo-39702: Relax :term:`decorator` grammar restrictions to allow any valid
13166  expression (:pep:`614`).
13167
13168- bpo-38091: Tweak import deadlock detection code to not deadlock itself.
13169
13170- bpo-1635741: Port _locale extension module to multiphase initialization
13171  (:pep:`489`).
13172
13173- bpo-39087: Optimize :c:func:`PyUnicode_AsUTF8` and
13174  :c:func:`PyUnicode_AsUTF8AndSize` slightly when they need to create
13175  internal UTF-8 cache.
13176
13177- bpo-39520: Fix unparsing of ext slices with no items (``foo[:,]``). Patch
13178  by Batuhan Taskaya.
13179
13180- bpo-39220: Do not optimize annotations if 'from __future__ import
13181  annotations' is used. Patch by Pablo Galindo.
13182
13183- bpo-35712: Using :data:`NotImplemented` in a boolean context has been
13184  deprecated. Patch contributed by Josh Rosenberg.
13185
13186- bpo-22490: Don't leak environment variable ``__PYVENV_LAUNCHER__`` into
13187  the interpreter session on macOS.
13188
13189Library
13190-------
13191
13192- bpo-39830: Add :class:`zipfile.Path` to ``__all__`` in the :mod:`zipfile`
13193  module.
13194
13195- bpo-40000: Improved error messages for validation of ``ast.Constant``
13196  nodes. Patch by Batuhan Taskaya.
13197
13198- bpo-39999: ``__module__`` of the AST node classes is now set to "ast"
13199  instead of "_ast". Added docstrings for dummy AST node classes and
13200  deprecated attributes.
13201
13202- bpo-39991: :func:`uuid.getnode` now skips IPv6 addresses with the same
13203  string length than a MAC address (17 characters): only use MAC addresses.
13204
13205- bpo-39988: Deprecated ``ast.AugLoad`` and ``ast.AugStore`` node classes
13206  because they are no longer used.
13207
13208- bpo-39656: Ensure ``bin/python3.#`` is always present in virtual
13209  environments on POSIX platforms - by Anthony Sottile.
13210
13211- bpo-39969: Deprecated ``ast.Param`` node class because it's no longer
13212  used. Patch by Batuhan Taskaya.
13213
13214- bpo-39360: Ensure all workers exit when finalizing a
13215  :class:`multiprocessing.Pool` implicitly via the module finalization
13216  handlers of multiprocessing. This fixes a deadlock situation that can be
13217  experienced when the Pool is not properly finalized via the context
13218  manager or a call to ``multiprocessing.Pool.terminate``. Patch by Batuhan
13219  Taskaya and Pablo Galindo.
13220
13221- bpo-35370: sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable()
13222  now properly report :c:func:`PySys_Audit` error if "sys.setprofile" or
13223  "sys.settrace" audit event is denied.
13224
13225- bpo-39936: AIX: Fix _aix_support module when the subprocess is not
13226  available, when building Python from scratch. It now uses new private
13227  _bootsubprocess module, rather than having two implementations depending
13228  if subprocess is available or not. So _aix_support.aix_platform() result
13229  is now the same if subprocess is available or not.
13230
13231- bpo-36144: :class:`collections.OrderedDict` now implements ``|`` and
13232  ``|=`` (:pep:`584`).
13233
13234- bpo-39652: The column name found in ``sqlite3.Cursor.description`` is now
13235  truncated on the first '[' only if the PARSE_COLNAMES option is set.
13236
13237- bpo-39915: Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call
13238  objects in the order of awaited arguments instead of using
13239  :attr:`unittest.mock.Mock.call_args` which has the last value of the call.
13240  Patch by Karthikeyan Singaravelan.
13241
13242- bpo-36144: Updated :data:`os.environ` and :data:`os.environb` to support
13243  :pep:`584`'s merge (``|``) and update (``|=``) operators.
13244
13245- bpo-38662: The ``ensurepip`` module now invokes ``pip`` via the ``runpy``
13246  module. Hence it is no longer tightly coupled with the internal API of the
13247  bundled ``pip`` version, allowing easier updates to a newer ``pip``
13248  version both internally and for distributors.
13249
13250- bpo-38075: Fix the :meth:`random.Random.seed` method when a :class:`bool`
13251  is passed as the seed.
13252
13253- bpo-39916: More reliable use of ``os.scandir()`` in ``Path.glob()``. It no
13254  longer emits a ResourceWarning when interrupted.
13255
13256- bpo-39850: :mod:`multiprocessing` now supports abstract socket addresses
13257  (if abstract sockets are supported in the running platform). When creating
13258  arbitrary addresses (like when default-constructing
13259  :class:`multiprocessing.connection.Listener` objects) abstract sockets are
13260  preferred to avoid the case when the temporary-file-generated address is
13261  too large for an AF_UNIX socket address. Patch by Pablo Galindo.
13262
13263- bpo-36287: :func:`ast.dump()` no longer outputs optional fields and
13264  attributes with default values. The default values for optional fields and
13265  attributes of AST nodes are now set as class attributes (e.g.
13266  ``Constant.kind`` is set to ``None``).
13267
13268- bpo-39889: Fixed :func:`ast.unparse` for extended slices containing a
13269  single element (e.g. ``a[i:j,]``). Remove redundant tuples when index with
13270  a tuple (e.g. ``a[i, j]``).
13271
13272- bpo-39828: Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by
13273  Dong-hee Na.
13274
13275- bpo-13487: Avoid a possible *"RuntimeError: dictionary changed size during
13276  iteration"* from :func:`inspect.getmodule` when it tried to loop through
13277  :attr:`sys.modules`.
13278
13279- bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode".
13280  The "U" mode of open() is kept in Python 3.9 to ease transition from
13281  Python 2.7, but will be removed in Python 3.10.
13282
13283- bpo-28577: The hosts method on 32-bit prefix length IPv4Networks and
13284  128-bit prefix IPv6Networks now returns a list containing the single
13285  Address instead of an empty list.
13286
13287- bpo-39826: Add getConnection method to logging HTTPHandler to enable
13288  custom connections.
13289
13290- bpo-39763: Reimplement :func:`distutils.spawn.spawn` function with the
13291  :mod:`subprocess` module.
13292
13293- bpo-39794: Add --without-decimal-contextvar build option.  This enables a
13294  thread-local rather than a coroutine local context.
13295
13296- bpo-36144: :class:`collections.defaultdict` now implements ``|``
13297  (:pep:`584`).
13298
13299- bpo-39517: Fix runpy.run_path() when using pathlike objects
13300
13301- bpo-39775: Change ``inspect.Signature.parameters`` back to
13302  ``collections.OrderedDict``. This was changed to ``dict`` in Python
13303  3.9.0a4.
13304
13305- bpo-39678: Refactor queue_manager in
13306  :class:`concurrent.futures.ProcessPoolExecutor` to make it easier to
13307  maintain.
13308
13309- bpo-39764: Fix AttributeError when calling get_stack on a PyAsyncGenObject
13310  Task
13311
13312- bpo-39769: The :func:`compileall.compile_dir` function's *ddir* parameter
13313  and the compileall command line flag `-d` no longer write the wrong
13314  pathname to the generated pyc file for submodules beneath the root of the
13315  directory tree being compiled.  This fixes a regression introduced with
13316  Python 3.5.
13317
13318- bpo-36144: :class:`types.MappingProxyType` objects now support the merge
13319  (``|``) operator from :pep:`584`.
13320
13321- bpo-38691: The :mod:`importlib` module now ignores the
13322  :envvar:`PYTHONCASEOK` environment variable when the :option:`-E` or
13323  :option:`-I` command line options are being used.
13324
13325- bpo-39719: Remove :meth:`tempfile.SpooledTemporaryFile.softspace` as files
13326  no longer have the ``softspace`` attribute in Python 3. Patch by Shantanu.
13327
13328- bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct
13329  performance degradation as found in zipp 3.0.
13330
13331- bpo-39638: Keep ASDL signatures in the docstrings for ``AST`` nodes. Patch
13332  by Batuhan Taskaya
13333
13334- bpo-39639: Deprecated ``ast.Suite`` node class because it's no longer
13335  used. Patch by Batuhan Taskaya.
13336
13337- bpo-39609: Add thread_name_prefix to default asyncio executor
13338
13339- bpo-39548: Fix handling of header in
13340  :class:`urllib.request.AbstractDigestAuthHandler` when the optional
13341  ``qop`` parameter is not present.
13342
13343- bpo-39509: HTTP status codes ``103 EARLY_HINTS`` and ``425 TOO_EARLY`` are
13344  added to :class:`http.HTTPStatus`. Patch by Dong-hee Na.
13345
13346- bpo-39507: Adding HTTP status 418 "I'm a Teapot" to HTTPStatus in http
13347  library. Patch by Ross Rhodes.
13348
13349- bpo-39495: Remove default value from *attrs* parameter of
13350  :meth:`xml.etree.ElementTree.TreeBuilder.start` for consistency between
13351  Python and C implementations.
13352
13353- bpo-38971: Open issue in the BPO indicated a desire to make the
13354  implementation of codecs.open() at parity with io.open(), which implements
13355  a try/except to assure file stream gets closed before an exception is
13356  raised.
13357
13358- bpo-38641: Added starred expressions support to ``return`` and ``yield``
13359  statements for ``lib2to3``. Patch by Vlad Emelianov.
13360
13361- bpo-37534: When using minidom module to generate XML documents the ability
13362  to add Standalone Document Declaration is added. All the changes are made
13363  to generate a document in compliance with Extensible Markup Language (XML)
13364  1.0 (Fifth Edition) W3C Recommendation (available here:
13365  https://www.w3.org/TR/xml/#sec-prolog-dtd).
13366
13367- bpo-34788: Add support for scoped IPv6 addresses to :mod:`ipaddress`.
13368  Patch by Oleksandr Pavliuk.
13369
13370- bpo-34822: Simplified AST for subscription. Simple indices are now
13371  represented by their value, extended slices are represented as tuples.
13372  :mod:`ast` classes ``Index`` and ``ExtSlice`` are considered deprecated
13373  and will be removed in future Python versions. In the meantime,
13374  ``Index(value)`` now returns a ``value`` itself, ``ExtSlice(slices)``
13375  returns ``Tuple(slices, Load())``.
13376
13377Documentation
13378-------------
13379
13380- bpo-39868: Updated the Language Reference for :pep:`572`.
13381
13382- bpo-13790: Change 'string' to 'specification' in format doc.
13383
13384- bpo-17422: The language reference no longer restricts default class
13385  namespaces to dicts only.
13386
13387- bpo-39530: Fix misleading documentation about mixed-type numeric
13388  comparisons.
13389
13390- bpo-39718: Update :mod:`token` documentation to reflect additions in
13391  Python 3.8
13392
13393- bpo-39677: Changed operand name of **MAKE_FUNCTION** from *argc* to
13394  *flags* for module :mod:`dis`
13395
13396Tests
13397-----
13398
13399- bpo-40019: test_gdb now skips tests if it detects that gdb failed to read
13400  debug information because the Python binary is optimized.
13401
13402- bpo-27807: ``test_site.test_startup_imports()`` is now skipped if a path
13403  of :data:`sys.path` contains a ``.pth`` file.
13404
13405- bpo-26067: Do not fail test_shutil test_chown test when uid or gid of user
13406  cannot be resolved to a name.
13407
13408- bpo-39855: test_subprocess.test_user() now skips the test on an user name
13409  if the user name doesn't exist. For example, skip the test if the user
13410  "nobody" doesn't exist on Linux.
13411
13412Build
13413-----
13414
13415- bpo-39761: Fix build with DTrace but without additional DFLAGS.
13416
13417- bpo-39763: setup.py now uses a basic implementation of the
13418  :mod:`subprocess` module if the :mod:`subprocess` module is not available:
13419  before required C extension modules are built.
13420
13421- bpo-1294959: Add ``--with-platlibdir`` option to the configure script:
13422  name of the platform-specific library directory, stored in the new
13423  :attr:`sys.platlibdir` attribute. It is used to build the path of
13424  platform-specific extension modules and the path of the standard library.
13425  It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is
13426  equal to ``"lib64"`` on 64-bit platforms. Patch by Jan Matějek, Matěj
13427  Cepl, Charalampos Stratakis and Victor Stinner.
13428
13429Windows
13430-------
13431
13432- bpo-39930: Ensures the required :file:`vcruntime140.dll` is included in
13433  install packages.
13434
13435- bpo-39847: Avoid hang when computer is hibernated whilst waiting for a
13436  mutex (for lock-related objects from :mod:`threading`) around 49-day
13437  uptime.
13438
13439- bpo-38597: :mod:`distutils` will no longer statically link
13440  :file:`vcruntime140.dll` when a redistributable version is unavailable.
13441  All future releases of CPython will include a copy of this DLL to ensure
13442  distributed extensions can continue to load.
13443
13444- bpo-38380: Update Windows builds to use SQLite 3.31.1
13445
13446- bpo-39789: Update Windows release build machines to Visual Studio 2019
13447  (MSVC 14.2).
13448
13449- bpo-34803: Package for nuget.org now includes repository reference and
13450  bundled icon image.
13451
13452macOS
13453-----
13454
13455- bpo-38380: Update macOS builds to use SQLite 3.31.1
13456
13457IDLE
13458----
13459
13460- bpo-27115: For 'Go to Line', use a Query box subclass with IDLE standard
13461  behavior and improved error checking.
13462
13463- bpo-39885: Since clicking to get an IDLE context menu moves the cursor,
13464  any text selection should be and now is cleared.
13465
13466- bpo-39852: Edit "Go to line" now clears any selection, preventing
13467  accidental deletion. It also updates Ln and Col on the status bar.
13468
13469- bpo-39781: Selecting code context lines no longer causes a jump.
13470
13471Tools/Demos
13472-----------
13473
13474- bpo-36184: Port python-gdb.py to FreeBSD. python-gdb.py now checks for
13475  "take_gil" function name to check if a frame tries to acquire the GIL,
13476  instead of checking for "pthread_cond_timedwait" which is specific to
13477  Linux and can be a different condition than the GIL.
13478
13479- bpo-38080: Added support to fix ``getproxies`` in the
13480  :mod:`lib2to3.fixes.fix_urllib` module. Patch by José Roberto Meza
13481  Cabrera.
13482
13483C API
13484-----
13485
13486- bpo-40024: Add :c:func:`PyModule_AddType` helper function: add a type to a
13487  module. Patch by Dong-hee Na.
13488
13489- bpo-39946: Remove ``_PyRuntime.getframe`` hook and remove
13490  ``_PyThreadState_GetFrame`` macro which was an alias to
13491  ``_PyRuntime.getframe``. They were only exposed by the internal C API.
13492  Remove also ``PyThreadFrameGetter`` type.
13493
13494- bpo-39947: Add :c:func:`PyThreadState_GetFrame` function: get the current
13495  frame of a Python thread state.
13496
13497- bpo-37207: Add _PyArg_NoKwnames helper function. Patch by Dong-hee Na.
13498
13499- bpo-39947: Add :c:func:`PyThreadState_GetInterpreter`: get the interpreter
13500  of a Python thread state.
13501
13502- bpo-39947: Add :c:func:`PyInterpreterState_Get` function to the limited C
13503  API.
13504
13505- bpo-35370: If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile`
13506  or :c:func:`PyEval_SetTrace`, log the error as an unraisable exception.
13507
13508- bpo-39947: Move the static inline function flavor of
13509  Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API:
13510  they access PyThreadState attributes. The limited C API provides regular
13511  functions which hide implementation details.
13512
13513- bpo-39947: Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer
13514  access PyThreadState attributes, but call new private _PyTrash_begin() and
13515  _PyTrash_end() functions which hide implementation details.
13516
13517- bpo-39884: :c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now
13518  include the method name in the SystemError "bad call flags" error message
13519  to ease debug.
13520
13521- bpo-39877: Deprecated :c:func:`PyEval_InitThreads` and
13522  :c:func:`PyEval_ThreadsInitialized`. Calling :c:func:`PyEval_InitThreads`
13523  now does nothing.
13524
13525- bpo-38249: :c:macro:`Py_UNREACHABLE` is now implemented with
13526  ``__builtin_unreachable()`` and analogs in release mode.
13527
13528- bpo-38643: :c:func:`PyNumber_ToBase` now raises a :exc:`SystemError`
13529  instead of crashing when called with invalid base.
13530
13531- bpo-39882: The :c:func:`Py_FatalError` function is replaced with a macro
13532  which logs automatically the name of the current function, unless the
13533  ``Py_LIMITED_API`` macro is defined.
13534
13535- bpo-39824: Extension modules: :c:member:`~PyModuleDef.m_traverse`,
13536  :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free`
13537  functions of :c:type:`PyModuleDef` are no longer called if the module
13538  state was requested but is not allocated yet. This is the case immediately
13539  after the module is created and before the module is executed
13540  (:c:data:`Py_mod_exec` function). More precisely, these functions are not
13541  called if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module
13542  state (as returned by :c:func:`PyModule_GetState`) is ``NULL``.
13543
13544  Extension modules without module state (``m_size <= 0``) are not affected.
13545
13546- bpo-38913: Fixed segfault in ``Py_BuildValue()`` called with a format
13547  containing "#" and undefined PY_SSIZE_T_CLEAN whwn an exception is set.
13548
13549- bpo-38500: Add a private API to get and set the frame evaluation function:
13550  add :c:func:`_PyInterpreterState_GetEvalFrameFunc` and
13551  :c:func:`_PyInterpreterState_SetEvalFrameFunc` C functions. The
13552  :c:type:`_PyFrameEvalFunction` function type now takes a *tstate*
13553  parameter.
13554
13555
13556What's New in Python 3.9.0 alpha 4?
13557===================================
13558
13559*Release date: 2020-02-25*
13560
13561Security
13562--------
13563
13564- bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`,
13565  `resource`, `shutil`, `signal` and `syslog`.
13566
13567- bpo-39401: Avoid unsafe DLL load at startup on Windows 7 and earlier.
13568
13569- bpo-39184: Add audit events to command execution functions in os and pty
13570  modules.
13571
13572Core and Builtins
13573-----------------
13574
13575- bpo-39382: Fix a use-after-free in the single inheritance path of
13576  ``issubclass()``, when the ``__bases__`` of an object has a single
13577  reference, and so does its first item. Patch by Yonatan Goldschmidt.
13578
13579- bpo-39573: Update clinic tool to use :c:func:`Py_IS_TYPE`. Patch by
13580  Dong-hee Na.
13581
13582- bpo-39619: Enable use of :func:`os.chroot` on HP-UX systems.
13583
13584- bpo-39573: Add :c:func:`Py_IS_TYPE` static inline function to check
13585  whether the object *o* type is *type*.
13586
13587- bpo-39606: Fix regression caused by fix for bpo-39386, that prevented
13588  calling ``aclose`` on an async generator that had already been closed or
13589  exhausted.
13590
13591- bpo-39579: Change the ending column offset of `Attribute` nodes
13592  constructed in `ast_for_dotted_name` to point at the end of the current
13593  node and not at the end of the last `NAME` node.
13594
13595- bpo-1635741: Port _crypt extension module to multiphase initialization
13596  (:pep:`489`).
13597
13598- bpo-1635741: Port _contextvars extension module to multiphase
13599  initialization (:pep:`489`).
13600
13601- bpo-39510: Fix segfault in ``readinto()`` method on closed BufferedReader.
13602
13603- bpo-39502: Fix :func:`time.localtime` on 64-bit AIX  to support years
13604  before 1902 and after 2038. Patch by M Felt.
13605
13606- bpo-39492: Fix a reference cycle in the C Pickler that was preventing the
13607  garbage collection of deleted, pickled objects.
13608
13609- bpo-39453: Fixed a possible crash in :meth:`list.__contains__` when a list
13610  is changed during comparing items. Patch by Dong-hee Na.
13611
13612- bpo-39434: :term:`floor division` of float operation now has a better
13613  performance. Also the message of :exc:`ZeroDivisionError` for this
13614  operation is updated. Patch by Dong-hee Na.
13615
13616- bpo-1635741: Port _codecs extension module to multiphase initialization
13617  (:pep:`489`).
13618
13619- bpo-1635741: Port _bz2 extension module to multiphase initialization
13620  (:pep:`489`).
13621
13622- bpo-1635741: Port _abc extension module to multiphase initialization
13623  (:pep:`489`).
13624
13625- bpo-39320: Replace two complex bytecodes for building dicts with two
13626  simpler ones. The new bytecodes ``DICT_MERGE`` and ``DICT_UPDATE`` have
13627  been added The old bytecodes ``BUILD_MAP_UNPACK`` and
13628  ``BUILD_MAP_UNPACK_WITH_CALL`` have been removed.
13629
13630- bpo-39219: Syntax errors raised in the tokenizer now always set correct
13631  "text" and "offset" attributes.
13632
13633- bpo-36051: Drop the GIL during large ``bytes.join`` operations. Patch by
13634  Bruce Merry.
13635
13636- bpo-38960: Fix DTrace build issues on FreeBSD. Patch by David Carlier.
13637
13638- bpo-37207: Speed up calls to ``range()`` by about 30%, by using the PEP
13639  590 ``vectorcall`` calling convention. Patch by Mark Shannon.
13640
13641- bpo-36144: :class:`dict` (and :class:`collections.UserDict`) objects now
13642  support PEP 584's merge (``|``) and update (``|=``) operators. Patch by
13643  Brandt Bucher.
13644
13645- bpo-32856: Optimized the idiom for assignment a temporary variable in
13646  comprehensions. Now ``for y in [expr]`` in comprehensions is as fast as a
13647  simple assignment ``y = expr``.
13648
13649Library
13650-------
13651
13652- bpo-30566: Fix :exc:`IndexError` when trying to decode an invalid string
13653  with punycode codec.
13654
13655- bpo-39649: Remove obsolete check for `__args__` in
13656  bdb.Bdb.format_stack_entry.
13657
13658- bpo-39648: Expanded :func:`math.gcd` and :func:`math.lcm` to handle
13659  multiple arguments.
13660
13661- bpo-39681: Fix a regression where the C pickle module wouldn't allow
13662  unpickling from a file-like object that doesn't expose a readinto()
13663  method.
13664
13665- bpo-35950: Raise :exc:`io.UnsupportedOperation` in
13666  :meth:`io.BufferedReader.truncate` when it is called on a read-only
13667  :class:`io.BufferedReader` instance.
13668
13669- bpo-39479: Add :func:`math.lcm` function: least common multiple.
13670
13671- bpo-39674: Revert "Do not expose abstract collection classes in the
13672  collections module" change (bpo-25988). Aliases to ABC like
13673  collections.Mapping are kept in Python 3.9 to ease transition from Python
13674  2.7, but will be removed in Python 3.10.
13675
13676- bpo-39104: Fix hanging ProcessPoolExcutor on ``shutdown(wait=False)`` when
13677  a task has failed pickling.
13678
13679- bpo-39627: Fixed TypedDict totality check for inherited keys.
13680
13681- bpo-39474: Fixed starting position of AST for expressions like ``(a)(b)``,
13682  ``(a)[b]`` and ``(a).b``.
13683
13684- bpo-21016: The :mod:`pydoc` and :mod:`trace` modules now use the
13685  :mod:`sysconfig` module to get the path to the Python standard library, to
13686  support uncommon installation path like ``/usr/lib64/python3.9/`` on
13687  Fedora. Patch by Jan Matějek.
13688
13689- bpo-39590: Collections.deque now holds strong references during
13690  deque.__contains__ and deque.count, fixing crashes.
13691
13692- bpo-39586: The distutils ``bdist_msi`` command is deprecated in Python
13693  3.9, use ``bdist_wheel`` (wheel packages) instead.
13694
13695- bpo-39595: Improved performance of zipfile.Path for files with a large
13696  number of entries. Also improved performance and fixed minor issue as
13697  published with `importlib_metadata 1.5
13698  <https://importlib-metadata.readthedocs.io/en/latest/history.html#v1-5-0>`_.
13699
13700- bpo-39350: Fix regression in :class:`fractions.Fraction` if the numerator
13701  and/or the denominator is an :class:`int` subclass. The :func:`math.gcd`
13702  function is now used to normalize the *numerator* and *denominator*.
13703  :func:`math.gcd` always return a :class:`int` type. Previously, the GCD
13704  type depended on *numerator* and *denominator*.
13705
13706- bpo-39567: Added audit for :func:`os.walk`, :func:`os.fwalk`,
13707  :meth:`pathlib.Path.glob` and :meth:`pathlib.Path.rglob`.
13708
13709- bpo-39559: Remove unused, undocumented argument ``getters`` from
13710  :func:`uuid.getnode`
13711
13712- bpo-38149: :func:`sys.audit` is now called only once per call of
13713  :func:`glob.glob` and :func:`glob.iglob`.
13714
13715- bpo-39546: Fix a regression in :class:`~argparse.ArgumentParser` where
13716  ``allow_abbrev=False`` was ignored for long options that used a prefix
13717  character other than "-".
13718
13719- bpo-39450: Striped whitespace from docstring before returning it from
13720  :func:`unittest.case.shortDescription`.
13721
13722- bpo-12915: A new function ``resolve_name`` has been added to the
13723  ``pkgutil`` module. This resolves a string of the form ``'a.b.c.d'`` or
13724  ``'a.b:c.d'`` to an object. In the example, ``a.b`` is a package/module
13725  and ``c.d`` is an object within that package/module reached via recursive
13726  attribute access.
13727
13728- bpo-39353: The :func:`binascii.crc_hqx` function is no longer deprecated.
13729
13730- bpo-39493: Mark ``typing.IO.closed`` as a property
13731
13732- bpo-39491: Add :data:`typing.Annotated` and ``include_extras`` parameter
13733  to :func:`typing.get_type_hints` as part of :pep:`593`. Patch by Till
13734  Varoquaux, documentation by Till Varoquaux and Konstantin Kashin.
13735
13736- bpo-39485: Fix a bug in :func:`unittest.mock.create_autospec` that would
13737  complain about the wrong number of arguments for custom descriptors
13738  defined in an extension module returning functions.
13739
13740- bpo-38932: Mock fully resets child objects on reset_mock(). Patch by
13741  Vegard Stikbakke
13742
13743- bpo-39082: Allow AsyncMock to correctly patch static/class methods
13744
13745- bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit\_..." symbol
13746  names in distutils to make it export the correct init symbol also on
13747  Windows.
13748
13749- bpo-18819: Omit ``devmajor`` and ``devminor`` fields for non-device files
13750  in :mod:`tarfile` archives, enabling bit-for-bit compatibility with GNU
13751  ``tar(1)``.
13752
13753- bpo-39349: Added a new *cancel_futures* parameter to
13754  :meth:`concurrent.futures.Executor.shutdown` that cancels all pending
13755  futures which have not started running, instead of waiting for them to
13756  complete before shutting down the executor.
13757
13758- bpo-39274: ``bool(fraction.Fraction)`` now returns a boolean even if
13759  (numerator != 0) does not return a boolean (ex: numpy number).
13760
13761- bpo-34793: Remove support for ``with (await asyncio.lock):`` and ``with
13762  (yield from asyncio.lock):``.  The same is correct for
13763  ``asyncio.Condition`` and ``asyncio.Semaphore``.
13764
13765- bpo-25597: Ensure, if ``wraps`` is supplied to
13766  :class:`unittest.mock.MagicMock`, it is used to calculate return values
13767  for the magic methods instead of using the default return values. Patch by
13768  Karthikeyan Singaravelan.
13769
13770- bpo-36350: `inspect.Signature.parameters` and
13771  `inspect.BoundArguments.arguments` are now dicts instead of OrderedDicts.
13772  Patch contributed by Rémi Lapeyre.
13773
13774- bpo-35727: Fix sys.exit() and sys.exit(None) exit code propagation when
13775  used in multiprocessing.Process.
13776
13777- bpo-32173: * Add `lazycache` function to `__all__`. * Use `dict.clear` to
13778  clear the cache. * Refactoring `getline` function and `checkcache`
13779  function.
13780
13781Documentation
13782-------------
13783
13784- bpo-17422: The language reference now specifies restrictions on class
13785  namespaces. Adapted from a patch by Ethan Furman.
13786
13787- bpo-39572: Updated documentation of ``total`` flag of ``TypedDict``.
13788
13789- bpo-39654: In pyclbr doc, update 'class' to 'module' where appropriate and
13790  add readmodule comment. Patch by Hakan Çelik.
13791
13792- bpo-39153: Clarify refcounting semantics for the following functions: -
13793  PyObject_SetItem - PyMapping_SetItemString - PyDict_SetItem -
13794  PyDict_SetItemString
13795
13796- bpo-39392: Explain that when filling with turtle, overlap regions may be
13797  left unfilled.
13798
13799- bpo-39369: Update mmap readline method description. The fact that the
13800  readline method does update the file position should not be ignored since
13801  this might give the impression for the programmer that it doesn't update
13802  it.
13803
13804- bpo-9056: Include subsection in TOC for PDF version of docs.
13805
13806Tests
13807-----
13808
13809- bpo-38325: Skip tests on non-BMP characters of test_winconsoleio.
13810
13811- bpo-39502: Skip test_zipfile.test_add_file_after_2107() if
13812  :func:`time.localtime` fails with :exc:`OverflowError`. It is the case on
13813  AIX 6.1 for example.
13814
13815Build
13816-----
13817
13818- bpo-39489: Remove ``COUNT_ALLOCS`` special build.
13819
13820Windows
13821-------
13822
13823- bpo-39553: Delete unused code related to SxS manifests.
13824
13825- bpo-39439: Honor the Python path when a virtualenv is active on Windows.
13826
13827- bpo-39393: Improve the error message when attempting to load a DLL with
13828  unresolved dependencies.
13829
13830- bpo-38883: :meth:`~pathlib.Path.home()` and
13831  :meth:`~pathlib.Path.expanduser()` on Windows now prefer
13832  :envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not
13833  normally set for regular user accounts. This makes them again behave like
13834  :func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in
13835  3.8, see :issue:`36264`.
13836
13837- bpo-39185: The build.bat script has additional options for very-quiet
13838  output (-q) and very-verbose output (-vv)
13839
13840IDLE
13841----
13842
13843- bpo-39663: Add tests for pyparse find_good_parse_start().
13844
13845- bpo-39600: In the font configuration window, remove duplicated font names.
13846
13847- bpo-30780: Add remaining configdialog tests for buttons and highlights and
13848  keys tabs.
13849
13850- bpo-39388: IDLE Settings Cancel button now cancels pending changes
13851
13852- bpo-38792: Close an IDLE shell calltip if a :exc:`KeyboardInterrupt` or
13853  shell restart occurs.  Patch by Zackery Spytz.
13854
13855C API
13856-----
13857
13858- bpo-35081: Move the ``bytes_methods.h`` header file to the internal C API
13859  as ``pycore_bytes_methods.h``: it only contains private symbols (prefixed
13860  by ``_Py``), except of the ``PyDoc_STRVAR_shared()`` macro.
13861
13862- bpo-35081: Move the ``dtoa.h`` header file to the internal C API as
13863  ``pycore_dtoa.h``: it only contains private functions (prefixed by
13864  ``_Py``). The :mod:`math` and :mod:`cmath` modules must now be compiled
13865  with the ``Py_BUILD_CORE`` macro defined.
13866
13867- bpo-39573: Add :c:func:`Py_SET_SIZE` function to set the size of an
13868  object.
13869
13870- bpo-39500: :c:func:`PyUnicode_IsIdentifier` does not call
13871  :c:func:`Py_FatalError` anymore if the string is not ready.
13872
13873- bpo-39573: Add :c:func:`Py_SET_TYPE` function to set the type of an
13874  object.
13875
13876- bpo-39573: Add a :c:func:`Py_SET_REFCNT` function to set the reference
13877  counter of an object.
13878
13879- bpo-39542: Convert :c:func:`PyType_HasFeature`, :c:func:`PyType_Check` and
13880  :c:func:`PyType_CheckExact` macros to static inline functions.
13881
13882- bpo-39542: In the limited C API, ``PyObject_INIT()`` and
13883  ``PyObject_INIT_VAR()`` are now defined as aliases to
13884  :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` to make their
13885  implementation opaque. It avoids to leak implementation details in the
13886  limited C API. Exclude the following functions from the limited C API:
13887  ``_Py_NewReference()``, ``_Py_ForgetReference()``,
13888  ``_PyTraceMalloc_NewReference()`` and ``_Py_GetRefTotal()``.
13889
13890- bpo-39542: Exclude trashcan mechanism from the limited C API: it requires
13891  access to PyTypeObject and PyThreadState structure fields, whereas these
13892  structures are opaque in the limited C API.
13893
13894- bpo-39511: The :c:func:`PyThreadState_Clear` function now calls the
13895  :c:member:`PyThreadState.on_delete` callback. Previously, that happened in
13896  :c:func:`PyThreadState_Delete`.
13897
13898- bpo-38076: Fix to clear the interpreter state only after clearing module
13899  globals to guarantee module state access from C Extensions during runtime
13900  destruction
13901
13902- bpo-39245: The Vectorcall API (PEP 590) was made public, adding the
13903  functions ``PyObject_Vectorcall``, ``PyObject_VectorcallMethod``,
13904  ``PyVectorcall_Function``, ``PyObject_CallOneArg``,
13905  ``PyObject_CallMethodNoArgs``, ``PyObject_CallMethodOneArg``,
13906  ``PyObject_FastCallDict``, and the flag ``Py_TPFLAGS_HAVE_VECTORCALL``.
13907
13908
13909What's New in Python 3.9.0 alpha 3?
13910===================================
13911
13912*Release date: 2020-01-24*
13913
13914Core and Builtins
13915-----------------
13916
13917- bpo-39427: Document all possibilities for the ``-X`` options in the
13918  command line help section. Patch by Pablo Galindo.
13919
13920- bpo-39421: Fix possible crashes when operating with the functions in the
13921  :mod:`heapq` module and custom comparison operators.
13922
13923- bpo-39386: Prevent double awaiting of async iterator.
13924
13925- bpo-17005: Add :class:`functools.TopologicalSorter` to the
13926  :mod:`functools` module to offers functionality to perform topological
13927  sorting of graphs. Patch by Pablo Galindo, Tim Peters and Larry Hastings.
13928
13929- bpo-39320: Replace four complex bytecodes for building sequences with
13930  three simpler ones.
13931
13932  The following four bytecodes have been removed:
13933
13934  * BUILD_LIST_UNPACK
13935  * BUILD_TUPLE_UNPACK
13936  * BUILD_SET_UNPACK
13937  * BUILD_TUPLE_UNPACK_WITH_CALL
13938
13939  The following three bytecodes have been added:
13940
13941  * LIST_TO_TUPLE
13942  * LIST_EXTEND
13943  * SET_UPDATE
13944
13945- bpo-39336: Import loaders which publish immutable module objects can now
13946  publish immutable packages in addition to individual modules.
13947
13948- bpo-39322: Added a new function :func:`gc.is_finalized` to check if an
13949  object has been finalized by the garbage collector. Patch by Pablo
13950  Galindo.
13951
13952- bpo-39048: Improve the displayed error message when incorrect types are
13953  passed to ``async with`` statements by looking up the :meth:`__aenter__`
13954  special method before the :meth:`__aexit__` special method when entering
13955  an asynchronous context manager. Patch by Géry Ogam.
13956
13957- bpo-39235: Fix AST end location for lone generator expression in function
13958  call, e.g. f(i for i in a).
13959
13960- bpo-39209: Correctly handle multi-line tokens in interactive mode. Patch
13961  by Pablo Galindo.
13962
13963- bpo-1635741: Port _json extension module to multiphase initialization
13964  (:pep:`489`).
13965
13966- bpo-39216: Fix constant folding optimization for positional only arguments
13967  - by Anthony Sottile.
13968
13969- bpo-39215: Fix ``SystemError`` when nested function has annotation on
13970  positional-only argument - by Anthony Sottile.
13971
13972- bpo-39200: Correct the error message when calling the :func:`min` or
13973  :func:`max` with no arguments. Patch by Dong-hee Na.
13974
13975- bpo-39200: Correct the error message when trying to construct
13976  :class:`range` objects with no arguments. Patch by Pablo Galindo.
13977
13978- bpo-39166: Fix incorrect line execution reporting in trace functions when
13979  tracing the last iteration of asynchronous for loops. Patch by Pablo
13980  Galindo.
13981
13982- bpo-39114: Fix incorrect line execution reporting in trace functions when
13983  tracing exception handlers with name binding. Patch by Pablo Galindo.
13984
13985- bpo-39156: Split the COMPARE_OP bytecode instruction into four distinct
13986  instructions.
13987
13988  *  COMPARE_OP for rich comparisons
13989  *  IS_OP for 'is' and 'is not' tests
13990  *  CONTAINS_OP for 'in' and 'is not' tests
13991  *  JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
13992
13993  This improves the clarity of the interpreter and should provide a modest
13994  speedup.
13995
13996- bpo-38588: Fix possible crashes in dict and list when calling
13997  :c:func:`PyObject_RichCompareBool`.
13998
13999- bpo-13601: By default, ``sys.stderr`` is line-buffered now, even if
14000  ``stderr`` is redirected to a file. You can still make ``sys.stderr``
14001  unbuffered by passing the :option:`-u` command-line option or setting the
14002  :envvar:`PYTHONUNBUFFERED` environment variable.
14003
14004  (Contributed by Jendrik Seipp in bpo-13601.)
14005
14006- bpo-38610: Fix possible crashes in several list methods by holding strong
14007  references to list elements when calling
14008  :c:func:`PyObject_RichCompareBool`.
14009
14010- bpo-32021: Include brotli .br encoding in mimetypes encodings_map
14011
14012Library
14013-------
14014
14015- bpo-39430: Fixed race condition in lazy imports in :mod:`tarfile`.
14016
14017- bpo-39413: The :func:`os.unsetenv` function is now also available on
14018  Windows.
14019
14020- bpo-39390: Fixed a regression with the `ignore` callback of
14021  :func:`shutil.copytree`. The argument types are now str and List[str]
14022  again.
14023
14024- bpo-39395: The :func:`os.putenv` and :func:`os.unsetenv` functions are now
14025  always available.
14026
14027- bpo-39406: If ``setenv()`` C function is available, :func:`os.putenv` is
14028  now implemented with ``setenv()`` instead of ``putenv()``, so Python
14029  doesn't have to handle the environment variable memory.
14030
14031- bpo-39396: Fix ``math.nextafter(-0.0, +0.0)`` on AIX 7.1.
14032
14033- bpo-29435: Allow :func:`tarfile.is_tarfile` to be used with file and
14034  file-like objects, like :func:`zipfile.is_zipfile`. Patch by William
14035  Woodruff.
14036
14037- bpo-39377: Removed ``encoding`` option from :func:`json.loads`.  It has
14038  been deprecated since Python 3.1.
14039
14040- bpo-39389: Write accurate compression level metadata in :mod:`gzip`
14041  archives, rather than always signaling maximum compression.
14042
14043- bpo-39366: The previously deprecated ``xpath()`` and ``xgtitle()`` methods
14044  of :class:`nntplib.NNTP` have been removed.
14045
14046- bpo-39357: Remove the *buffering* parameter of :class:`bz2.BZ2File`. Since
14047  Python 3.0, it was ignored and using it was emitting
14048  :exc:`DeprecationWarning`. Pass an open file object, to control how the
14049  file is opened. The *compresslevel* parameter becomes keyword-only.
14050
14051- bpo-39353: Deprecate binhex4 and hexbin4 standards. Deprecate the
14052  :mod:`binhex` module and the following :mod:`binascii` functions:
14053  :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`,
14054  :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`,
14055  :func:`~binascii.crc_hqx`.
14056
14057- bpo-39351: Remove ``base64.encodestring()`` and ``base64.decodestring()``,
14058  aliases deprecated since Python 3.1: use :func:`base64.encodebytes` and
14059  :func:`base64.decodebytes` instead.
14060
14061- bpo-39350: Remove ``fractions.gcd()`` function, deprecated since Python
14062  3.5 (:issue:`22486`): use :func:`math.gcd` instead.
14063
14064- bpo-39329: :class:`~smtplib.LMTP` constructor now has an optional
14065  *timeout* parameter. Patch by Dong-hee Na.
14066
14067- bpo-39313: Add a new ``exec_function`` option (*--exec-function* in the
14068  CLI) to ``RefactoringTool`` for making ``exec`` a function. Patch by
14069  Batuhan Taskaya.
14070
14071- bpo-39259: :class:`~ftplib.FTP_TLS` and :class:`~ftplib.FTP_TLS` now raise
14072  a :class:`ValueError` if the given timeout for their constructor is zero
14073  to prevent the creation of a non-blocking socket. Patch by Dong-hee Na.
14074
14075- bpo-39259: :class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise
14076  a :class:`ValueError` if the given timeout for their constructor is zero
14077  to prevent the creation of a non-blocking socket. Patch by Dong-hee Na.
14078
14079- bpo-39310: Add :func:`math.ulp`: return the value of the least significant
14080  bit of a float.
14081
14082- bpo-39297: Improved performance of importlib.metadata distribution
14083  discovery and resilients to inaccessible sys.path entries
14084  (importlib_metadata v1.4.0).
14085
14086- bpo-39259: :class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise
14087  a :class:`ValueError` if the given timeout for their constructor is zero
14088  to prevent the creation of a non-blocking socket. Patch by Dong-hee Na.
14089
14090- bpo-38901: When you specify prompt='.' or equivalently python -m venv
14091  --prompt . ... the basename of the current directory is used to set the
14092  created venv's prompt when it's activated.
14093
14094- bpo-39288: Add :func:`math.nextafter`: return the next floating-point
14095  value after *x* towards *y*.
14096
14097- bpo-39259: :class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a
14098  :class:`ValueError` if the given timeout for their constructor is zero to
14099  prevent the creation of a non-blocking socket. Patch by Dong-hee Na.
14100
14101- bpo-39242: Updated the Gmane domain from news.gmane.org to news.gmane.io
14102  which is used for examples of :class:`~nntplib.NNTP` news reader server
14103  and nntplib tests.
14104
14105- bpo-35292: Proxy the `SimpleHTTPRequestHandler.guess_type` to
14106  `mimetypes.guess_type` so the `mimetypes.init` is called lazily to avoid
14107  unnecessary costs when :mod:`http.server` module is imported.
14108
14109- bpo-39239: The :meth:`select.epoll.unregister` method no longer ignores
14110  the :data:`~errno.EBADF` error.
14111
14112- bpo-38907: In http.server script, restore binding to IPv4 on Windows.
14113
14114- bpo-39152: Fix ttk.Scale.configure([name]) to return configuration tuple
14115  for name or all options.  Giovanni Lombardo contributed part of the patch.
14116
14117- bpo-39198: If an exception were to be thrown in `Logger.isEnabledFor`
14118  (say, by asyncio timeouts or stopit) , the `logging` global lock may not
14119  be released appropriately, resulting in deadlock.  This change wraps that
14120  block of code with `try...finally` to ensure the lock is released.
14121
14122- bpo-39191: Perform a check for running loop before starting a new task in
14123  ``loop.run_until_complete()`` to fail fast; it prevents the side effect of
14124  new task spawning before exception raising.
14125
14126- bpo-38871: Correctly parenthesize filter-based statements that contain
14127  lambda expressions in mod:`lib2to3`. Patch by Dong-hee Na.
14128
14129- bpo-39142: A change was made to logging.config.dictConfig to avoid
14130  converting instances of named tuples to ConvertingTuple. It's assumed that
14131  named tuples are too specialised to be treated like ordinary tuples; if a
14132  user of named tuples requires ConvertingTuple functionality, they will
14133  have to implement that themselves in their named tuple class.
14134
14135- bpo-39158: ast.literal_eval() now supports empty sets.
14136
14137- bpo-39129: Fix import path for ``asyncio.TimeoutError``
14138
14139- bpo-39057: :func:`urllib.request.proxy_bypass_environment` now ignores
14140  leading dots and no longer ignores a trailing newline.
14141
14142- bpo-39056: Fixed handling invalid warning category in the -W option.  No
14143  longer import the re module if it is not needed.
14144
14145- bpo-39055: :func:`base64.b64decode` with ``validate=True`` raises now a
14146  binascii.Error if the input ends with a single ``\n``.
14147
14148- bpo-21600: Fix :func:`mock.patch.stopall` to stop active patches that were
14149  created with :func:`mock.patch.dict`.
14150
14151- bpo-39019: Implement dummy ``__class_getitem__`` for
14152  :class:`tempfile.SpooledTemporaryFile`.
14153
14154- bpo-39019: Implement dummy ``__class_getitem__`` for ``subprocess.Popen``,
14155  ``subprocess.CompletedProcess``
14156
14157- bpo-38914: Adjusted the wording of the warning issued by distutils'
14158  ``check`` command when the ``author`` and ``maintainer`` fields are
14159  supplied but no corresponding e-mail field (``author_email`` or
14160  ``maintainer_email``) is found. The wording now reflects the fact that
14161  these fields are suggested, but not required. Patch by Juergen Gmach.
14162
14163- bpo-38878: Fixed __subclasshook__ of :class:`os.PathLike` to return a
14164  correct result upon inheritance. Patch by Bar Harel.
14165
14166- bpo-38615: :class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now
14167  have an optional *timeout* parameter for their constructors. Also, the
14168  :meth:`~imaplib.IMAP4.open` method now has an optional *timeout* parameter
14169  with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL`
14170  and :class:`~imaplib.IMAP4_stream` were applied to this change. Patch by
14171  Dong-hee Na.
14172
14173- bpo-35182: Fixed :func:`Popen.communicate` subsequent call crash when the
14174  child process has already closed any piped standard stream, but still
14175  continues to be running. Patch by Andriy Maletsky.
14176
14177- bpo-38630: On Unix, :meth:`subprocess.Popen.send_signal` now polls the
14178  process status. Polling reduces the risk of sending a signal to the wrong
14179  process if the process completed, the :attr:`subprocess.Popen.returncode`
14180  attribute is still ``None``, and the pid has been reassigned (recycled) to
14181  a new different process.
14182
14183- bpo-38536: Removes trailing space in formatted currency with
14184  `international=True` and a locale with symbol following value. E.g.
14185  `locale.currency(12.34, international=True)` returned `'12,34 EUR '`
14186  instead of `'12,34 EUR'`.
14187
14188- bpo-38473: Use signature from inner mock for autospecced methods attached
14189  with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan.
14190
14191- bpo-38361: Fixed an issue where ``ident`` could include a leading path
14192  separator when :func:`syslog.openlog` was called without arguments.
14193
14194- bpo-38293: Add :func:`copy.copy` and :func:`copy.deepcopy` support to
14195  :func:`property` objects.
14196
14197- bpo-37958: Added the pstats.Stats.get_profile_dict() method to return the
14198  profile data as a StatsProfile instance.
14199
14200- bpo-28367: Termios magic constants for the following baud rates:   -
14201  B500000   - B576000   - B921600   - B1000000   - B1152000   - B1500000   -
14202  B2000000   - B2500000   - B3000000   - B3500000   - B4000000 Patch by
14203  Andrey Smirnov
14204
14205Documentation
14206-------------
14207
14208- bpo-39381: Mention in docs that :func:`asyncio.get_event_loop` implicitly
14209  creates new event loop only if called from the main thread.
14210
14211- bpo-38918: Add an entry for ``__module__`` in the "function" & "method"
14212  sections of the :mod:`inspect` docs' :ref:`inspect-types` table.
14213
14214- bpo-3530: In the :mod:`ast` module documentation, fix a misleading
14215  ``NodeTransformer`` example and add advice on when to use the
14216  ``fix_missing_locations`` function.
14217
14218Build
14219-----
14220
14221- bpo-39395: On non-Windows platforms, the :c:func:`setenv` and
14222  :c:func:`unsetenv` functions are now required to build Python.
14223
14224- bpo-39160: Updated the documentation in `./configure --help` to show
14225  default values, reference documentation where required and add additional
14226  explanation where needed.
14227
14228- bpo-39144: The ctags and etags build targets both include Modules/_ctypes
14229  and Python standard library source files.
14230
14231IDLE
14232----
14233
14234- bpo-39050: Make IDLE Settings dialog Help button work again.
14235
14236- bpo-34118: Tag memoryview, range, and tuple as classes, the same as list,
14237  etcetera, in the library manual built-in functions list.
14238
14239- bpo-32989: Add tests for editor newline_and_indent_event method. Remove
14240  dead code from pyparse find_good_parse_start method.
14241
14242C API
14243-----
14244
14245- bpo-39372: Clean header files of interfaces defined but with no
14246  implementation. The public API symbols being removed are:
14247  ``_PyBytes_InsertThousandsGroupingLocale``,
14248  ``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``,
14249  ``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``,
14250  ``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``,
14251  ``_PyAIterWrapper_Type``, ``PyNullImporter_Type``, ``PyCmpWrapper_Type``,
14252  ``PySortWrapper_Type``, ``PyNoArgsFunction``.
14253
14254- bpo-39164: Add a private ``_PyErr_GetExcInfo()`` function to retrieve
14255  exception information of the specified Python thread state.
14256
14257
14258What's New in Python 3.9.0 alpha 2?
14259===================================
14260
14261*Release date: 2019-12-18*
14262
14263Security
14264--------
14265
14266- bpo-38945: Newline characters have been escaped when performing uu
14267  encoding to prevent them from overflowing into to content section of the
14268  encoded file. This prevents malicious or accidental modification of data
14269  during the decoding process.
14270
14271- bpo-37228: Due to significant security concerns, the *reuse_address*
14272  parameter of :meth:`asyncio.loop.create_datagram_endpoint` is no longer
14273  supported. This is because of the behavior of ``SO_REUSEADDR`` in UDP. For
14274  more details, see the documentation for
14275  ``loop.create_datagram_endpoint()``. (Contributed by Kyle Stanley, Antoine
14276  Pitrou, and Yury Selivanov in :issue:`37228`.)
14277
14278- bpo-38804: Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by
14279  Ben Caller.
14280
14281Core and Builtins
14282-----------------
14283
14284- bpo-39028: Slightly improve the speed of keyword argument parsing with
14285  many kwargs by strengthening the assumption that kwargs are interned
14286  strings.
14287
14288- bpo-39080: Fix the value of *end_col_offset* for Starred Expression AST
14289  nodes when they are among the elements in the *args* attribute of Call AST
14290  nodes.
14291
14292- bpo-39031: When parsing an "elif" node, lineno and col_offset of the node
14293  now point to the "elif" keyword and not to its condition, making it
14294  consistent with the "if" node. Patch by Lysandros Nikolaou.
14295
14296- bpo-20443: In Python 3.9.0a1, sys.argv[0] was made an absolute path if a
14297  filename was specified on the command line. Revert this change, since most
14298  users expect sys.argv to be unmodified.
14299
14300- bpo-39008: :c:func:`PySys_Audit` now requires ``Py_ssize_t`` to be used
14301  for size arguments in the format string, regardless of whether
14302  ``PY_SSIZE_T_CLEAN`` was defined at include time.
14303
14304- bpo-38673: In REPL mode, don't switch to PS2 if the line starts with
14305  comment or whitespace. Based on work by Batuhan Taşkaya.
14306
14307- bpo-38922: Calling ``replace`` on a code object now raises the
14308  ``code.__new__`` audit event.
14309
14310- bpo-38920: Add audit hooks for when :func:`sys.excepthook` and
14311  :func:`sys.unraisablehook` are invoked.
14312
14313- bpo-38892: Improve documentation for audit events table and functions.
14314
14315- bpo-38852: Set the thread stack size to 8 Mb for debug builds on android
14316  platforms.
14317
14318- bpo-38858: Each Python subinterpreter now has its own "small integer
14319  singletons": numbers in [-5; 257] range. It is no longer possible to
14320  change the number of small integers at build time by overriding
14321  ``NSMALLNEGINTS`` and ``NSMALLPOSINTS`` macros: macros should now be
14322  modified manually in ``pycore_pystate.h`` header file.
14323
14324- bpo-36854: The garbage collector state becomes per interpreter
14325  (``PyInterpreterState.gc``), rather than being global
14326  (``_PyRuntimeState.gc``).
14327
14328- bpo-38835: The ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()``
14329  macros are empty: they have been doing nothing for the last year, so stop
14330  using them.
14331
14332- bpo-38328: Sped up the creation time of constant :class:`list` and
14333  :class:`set` displays. Patch by Brandt Bucher.
14334
14335- bpo-38707: ``MainThread.native_id`` is now correctly reset in child
14336  processes spawned using :class:`multiprocessing.Process`, instead of
14337  retaining the parent's value.
14338
14339- bpo-38629: Added ``__floor__`` and ``__ceil__`` methods to float object.
14340  Patch by Batuhan Taşkaya.
14341
14342- bpo-27145: int + int and int - int operators can now return small integer
14343  singletons. Patch by hongweipeng.
14344
14345- bpo-38021: Provide a platform tag for AIX that is sufficient for PEP425
14346  binary distribution identification. Patch by Michael Felt.
14347
14348- bpo-35409: Ignore GeneratorExit exceptions when throwing an exception into
14349  the aclose coroutine of an asynchronous generator.
14350
14351- bpo-33387: Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY,
14352  END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE
14353  and WITH_EXCEPT_START bytecodes. The compiler now generates different code
14354  for exceptional and non-exceptional branches for 'with' and 'try-except'
14355  statements. For 'try-finally' statements the 'finally' block is replicated
14356  for each exit from the 'try' body.
14357
14358Library
14359-------
14360
14361- bpo-39033: Fix :exc:`NameError` in :mod:`zipimport`. Patch by Karthikeyan
14362  Singaravelan.
14363
14364- bpo-39022: Update importlib.metadata to include improvements from
14365  importlib_metadata 1.3 including better serialization of EntryPoints and
14366  improved documentation for custom finders.
14367
14368- bpo-39006: Fix asyncio when the ssl module is missing: only check for
14369  ssl.SSLSocket instance if the ssl module is available.
14370
14371- bpo-38708: Fix a potential IndexError in email parser when parsing an
14372  empty msg-id.
14373
14374- bpo-38698: Add a new ``InvalidMessageID`` token to email parser to
14375  represent invalid Message-ID headers.  Also, add defects when there is
14376  remaining value after parsing the header.
14377
14378- bpo-38994: Implement ``__class_getitem__`` for ``os.PathLike``,
14379  ``pathlib.Path``.
14380
14381- bpo-38979: Return class from ``ContextVar.__class_getitem__`` to simplify
14382  subclassing.
14383
14384- bpo-38978: Implement ``__class_getitem__`` on asyncio objects (Future,
14385  Task, Queue). Patch by Batuhan Taskaya.
14386
14387- bpo-38916: :class:`array.array`: Remove ``tostring()`` and
14388  ``fromstring()`` methods. They were aliases to ``tobytes()`` and
14389  ``frombytes()``, deprecated since Python 3.2.
14390
14391- bpo-38986: Make repr of C accelerated TaskWakeupMethWrapper the same as of
14392  pure Python version.
14393
14394- bpo-38982: Fix asyncio ``PidfdChildWatcher``: handle ``waitpid()`` error.
14395  If ``waitpid()`` is called elsewhere, ``waitpid()`` call fails with
14396  :exc:`ChildProcessError`: use return code 255 in this case, and log a
14397  warning. It ensures that the pidfd file descriptor is closed if this error
14398  occurs.
14399
14400- bpo-38529: Drop too noisy asyncio warning about deletion of a stream
14401  without explicit ``.close()`` call.
14402
14403- bpo-27413: Added ability to pass through ``ensure_ascii`` options to
14404  json.dumps in the ``json.tool`` command-line interface.
14405
14406- bpo-38634: The :mod:`readline` module now detects if Python is linked to
14407  libedit at runtime on all platforms.  Previously, the check was only done
14408  on macOS.
14409
14410- bpo-33684: Fix ``json.tool`` failed to read a JSON file with non-ASCII
14411  characters when locale encoding is not UTF-8.
14412
14413- bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id.
14414
14415  parse_message_id() was improperly using a token defined inside an
14416  exception handler, which was raising `UnboundLocalError` on parsing an
14417  invalid value. Patch by Claudiu Popa.
14418
14419- bpo-38927: Use ``python -m pip`` instead of ``pip`` to upgrade
14420  dependencies in venv.
14421
14422- bpo-26730: Fix ``SpooledTemporaryFile.rollover()`` might corrupt the file
14423  when it is in text mode. Patch by Serhiy Storchaka.
14424
14425- bpo-38881: random.choices() now raises a ValueError when all the weights
14426  are zero.
14427
14428- bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for
14429  invalid input.
14430
14431  The previous code was raising a `KeyError` for both the Python and C
14432  implementation. This was caused by the specified index of an invalid input
14433  which did not exist in the memo structure, where the pickle stores what
14434  objects it has seen. The malformed input would have caused either a
14435  `BINGET` or `LONG_BINGET` load from the memo, leading to a `KeyError` as
14436  the determined index was bogus. Patch by Claudiu Popa
14437
14438- bpo-38688: Calling func:`shutil.copytree` to copy a directory tree from
14439  one directory to another subdirectory resulted in an endless loop and a
14440  RecursionError. A fix was added to consume an iterator and create the list
14441  of the entries to be copied, avoiding the recursion for newly created
14442  directories. Patch by Bruno P. Kinoshita.
14443
14444- bpo-38863: Improve :func:`is_cgi` function in :mod:`http.server`, which
14445  enables processing the case that cgi directory is a child of another
14446  directory other than root.
14447
14448- bpo-37838: :meth:`typing.get_type_hints` properly handles functions
14449  decorated with :meth:`functools.wraps`.
14450
14451- bpo-38870: Expose :func:`ast.unparse` as a function of the :mod:`ast`
14452  module that can be used to unparse an :class:`ast.AST` object and produce
14453  a string with code that would produce an equivalent :class:`ast.AST`
14454  object when parsed. Patch by Pablo Galindo and Batuhan Taskaya.
14455
14456- bpo-38859: AsyncMock now returns StopAsyncIteration on the exhaustion of a
14457  side_effects iterable. Since PEP-479 its Impossible to raise a
14458  StopIteration exception from a coroutine.
14459
14460- bpo-38857: AsyncMock fix for return values that are awaitable types.  This
14461  also covers side_effect iterable values that happened to be awaitable, and
14462  wraps callables that return an awaitable type. Before these awaitables
14463  were being awaited instead of being returned as is.
14464
14465- bpo-38834: :class:`typing.TypedDict` subclasses now track which keys are
14466  optional using the ``__required_keys__`` and ``__optional_keys__``
14467  attributes, to enable runtime validation by downstream projects.  Patch by
14468  Zac Hatfield-Dodds.
14469
14470- bpo-38821: Fix unhandled exceptions in :mod:`argparse` when
14471  internationalizing error messages for arguments with ``nargs`` set to
14472  special (non-integer) values. Patch by Federico Bond.
14473
14474- bpo-38820: Make Python compatible with OpenSSL 3.0.0.
14475  :func:`ssl.SSLSocket.getpeercert` no longer returns IPv6 addresses with a
14476  trailing new line.
14477
14478- bpo-38811: Fix an unhandled exception in :mod:`pathlib` when
14479  :meth:`os.link` is missing. Patch by Toke Høiland-Jørgensen.
14480
14481- bpo-38686: Added support for multiple ``qop`` values in
14482  :class:`urllib.request.AbstractDigestAuthHandler`.
14483
14484- bpo-38712: Add the Linux-specific :func:`signal.pidfd_send_signal`
14485  function, which allows sending a signal to a process identified by a file
14486  descriptor rather than a pid.
14487
14488- bpo-38348: Add ``-i`` and ``--indent`` (indentation level), and
14489  ``--no-type-comments`` (type comments) command line options to ast parsing
14490  tool.
14491
14492- bpo-37523: Change :class:`zipfile.ZipExtFile` to raise ``ValueError`` when
14493  trying to access the underlying file object after it has been closed. This
14494  new behavior is consistent with how accessing closed files is handled in
14495  other parts of Python.
14496
14497- bpo-38045: Improve the performance of :func:`enum._decompose` in
14498  :mod:`enum`. Patch by hongweipeng.
14499
14500- bpo-36820: Break cycle generated when saving an exception in socket.py,
14501  codeop.py and dyld.py as they keep alive not only the exception but user
14502  objects through the ``__traceback__`` attribute. Patch by Mario Corchero.
14503
14504- bpo-36406: Handle namespace packages in :mod:`doctest`. Patch by
14505  Karthikeyan Singaravelan.
14506
14507- bpo-34776: Fix dataclasses to support forward references in type
14508  annotations
14509
14510- bpo-20928: ElementTree supports recursive XInclude processing.  Patch by
14511  Stefan Behnel.
14512
14513- bpo-29636: Add whitespace options for formatting JSON with the
14514  ``json.tool`` CLI. The following mutually exclusive options are now
14515  supported: ``--indent`` for setting the indent level in spaces; ``--tab``
14516  for indenting with tabs; ``--no-indent`` for suppressing newlines; and
14517  ``--compact`` for suppressing all whitespace. The default behavior remains
14518  the same as ``--indent=4``.
14519
14520Documentation
14521-------------
14522
14523- bpo-38928: Correct when venv's ``upgrade_dependencies()`` and
14524  ``--upgrade-deps`` are added.
14525
14526- bpo-38899: Update documentation to state that to activate virtual
14527  environments under fish one should use `source`, not `.` as documented at
14528  https://fishshell.com/docs/current/cmds/source.html.
14529
14530- bpo-22377: Improves documentation of the values that
14531  :meth:`datetime.datetime.strptime` accepts for ``%Z``. Patch by Karl
14532  Dubost.
14533
14534Tests
14535-----
14536
14537- bpo-38546: Fix test_ressources_gced_in_workers() of
14538  test_concurrent_futures: explicitly stop the manager to prevent leaking a
14539  child process running in the background after the test completes.
14540
14541- bpo-38546: Multiprocessing and concurrent.futures tests now stop the
14542  resource tracker process when tests complete.
14543
14544- bpo-38614: Replace hardcoded timeout constants in tests with new
14545  :mod:`test.support` constants: :data:`~test.support.LOOPBACK_TIMEOUT`,
14546  :data:`~test.support.INTERNET_TIMEOUT`,
14547  :data:`~test.support.SHORT_TIMEOUT` and
14548  :data:`~test.support.LONG_TIMEOUT`. It becomes easier to adjust these four
14549  timeout constants for all tests at once, rather than having to adjust
14550  every single test file.
14551
14552- bpo-38547: Fix test_pty: if the process is the session leader, closing the
14553  master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when
14554  running the tests.
14555
14556- bpo-38992: Fix a test for :func:`math.fsum` that was failing due to
14557  constant folding.
14558
14559- bpo-38991: :mod:`test.support`:
14560  :func:`~test.support.run_python_until_end`,
14561  :func:`~test.support.assert_python_ok` and
14562  :func:`~test.support.assert_python_failure` functions no longer strip
14563  whitespaces from stderr. Remove ``test.support.strip_python_stderr()``
14564  function.
14565
14566- bpo-38965: Fix test_faulthandler on GCC 10. Use the "volatile" keyword in
14567  ``faulthandler._stack_overflow()`` to prevent tail call optimization on
14568  any compiler, rather than relying on compiler specific pragma.
14569
14570- bpo-38875: test_capi: trashcan tests now require the test "cpu" resource.
14571
14572- bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix
14573  on platforms lacking a functional bind() for named unix domain sockets.
14574
14575- bpo-38692: Skip the test_posix.test_pidfd_open() test if
14576  ``os.pidfd_open()`` fails with a :exc:`PermissionError`. This situation
14577  can happen in a Linux sandbox using a syscall whitelist which doesn't
14578  allow the ``pidfd_open()`` syscall yet.
14579
14580- bpo-38839: Fix some unused functions in tests. Patch by Adam Johnson.
14581
14582- bpo-38669: Raise :exc:`TypeError` when passing target as a string with
14583  :meth:`unittest.mock.patch.object`.
14584
14585- bpo-37957: test.regrtest now can receive a list of test patterns to ignore
14586  (using the -i/--ignore argument) or a file with a list of patterns to
14587  ignore (using the --ignore-file argument). Patch by Pablo Galindo.
14588
14589Build
14590-----
14591
14592- bpo-37404: :mod:`asyncio` now raises :exc:`TyperError` when calling
14593  incompatible methods with an :class:`ssl.SSLSocket` socket.  Patch by Ido
14594  Michael.
14595
14596- bpo-36500: Added an optional "regen" project to the Visual Studio solution
14597  that will regenerate all grammar, tokens, and opcodes.
14598
14599Windows
14600-------
14601
14602- bpo-39007: Add auditing events to functions in :mod:`winreg`.
14603
14604- bpo-33125: Add support for building and releasing Windows ARM64 packages.
14605
14606macOS
14607-----
14608
14609- bpo-37931: Fixed a crash on OSX dynamic builds that occurred when
14610  re-initializing the posix module after a Py_Finalize if the environment
14611  had changed since the previous `import posix`. Patch by Benoît Hudson.
14612
14613IDLE
14614----
14615
14616- bpo-38944: Escape key now closes IDLE completion windows.  Patch by Johnny
14617  Najera.
14618
14619- bpo-38943: Fix IDLE autocomplete windows not always appearing on some
14620  systems. Patch by Johnny Najera.
14621
14622- bpo-38862: 'Strip Trailing Whitespace' on the Format menu removes extra
14623  newlines at the end of non-shell files.
14624
14625- bpo-38636: Fix IDLE Format menu tab toggle and file indent width. These
14626  functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in
14627  3.7.5 and 3.8.0.
14628
14629C API
14630-----
14631
14632- bpo-38896: Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free
14633  list has been removed in Python 3.3.
14634
14635- bpo-37340: Remove ``PyMethod_ClearFreeList()`` and
14636  ``PyCFunction_ClearFreeList()`` functions: the free lists of bound method
14637  objects have been removed.
14638
14639- bpo-38835: Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()``
14640  macros of ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API).
14641
14642
14643What's New in Python 3.9.0 alpha 1?
14644===================================
14645
14646*Release date: 2019-11-19*
14647
14648Security
14649--------
14650
14651- bpo-38722: :mod:`runpy` now uses :meth:`io.open_code` to open code files.
14652  Patch by Jason Killen.
14653
14654- bpo-38622: Add additional audit events for the :mod:`ctypes` module.
14655
14656- bpo-38418: Fixes audit event for :func:`os.system` to be named
14657  ``os.system``.
14658
14659- bpo-38243: Escape the server title of
14660  :class:`xmlrpc.server.DocXMLRPCServer` when rendering the document page as
14661  HTML. (Contributed by Dong-hee Na in :issue:`38243`.)
14662
14663- bpo-38174: Update vendorized expat library version to 2.2.8, which
14664  resolves CVE-2019-15903.
14665
14666- bpo-37764: Fixes email._header_value_parser.get_unstructured going into an
14667  infinite loop for a specific case in which the email header does not have
14668  trailing whitespace, and the case in which it contains an invalid encoded
14669  word. Patch by Ashwin Ramaswami.
14670
14671- bpo-37461: Fix an infinite loop when parsing specially crafted email
14672  headers. Patch by Abhilash Raj.
14673
14674- bpo-37363: Adds audit events for the range of supported run commands (see
14675  :ref:`using-on-general`).
14676
14677- bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with
14678  additional text after the address and only quad-dotted notation without
14679  trailing whitespaces. Some inet_aton() implementations ignore whitespace
14680  and all data after whitespace, e.g. '127.0.0.1 whatever'.
14681
14682- bpo-37363: Adds audit events for :mod:`ensurepip`, :mod:`ftplib`,
14683  :mod:`glob`, :mod:`imaplib`, :mod:`nntplib`, :mod:`pdb`, :mod:`poplib`,
14684  :mod:`shutil`, :mod:`smtplib`, :mod:`sqlite3`, :mod:`subprocess`,
14685  :mod:`telnetlib`, :mod:`tempfile` and :mod:`webbrowser`, as well as
14686  :func:`os.listdir`, :func:`os.scandir` and :func:`breakpoint`.
14687
14688- bpo-37364: :func:`io.open_code` is now used when reading :file:`.pth`
14689  files.
14690
14691- bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer
14692
14693- bpo-34155: Fix parsing of invalid email addresses with more than one ``@``
14694  (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email
14695  address. Patch by maxking & jpic.
14696
14697Core and Builtins
14698-----------------
14699
14700- bpo-38631: Replace ``Py_FatalError()`` call with a regular
14701  :exc:`RuntimeError` exception in :meth:`float.__getformat__`.
14702
14703- bpo-38639: Optimized :func:`math.floor()`, :func:`math.ceil()` and
14704  :func:`math.trunc()` for floats.
14705
14706- bpo-38640: Fixed a bug in the compiler that was causing to raise in the
14707  presence of break statements and continue statements inside always false
14708  while loops. Patch by Pablo Galindo.
14709
14710- bpo-38613: Optimized some set operations (e.g. ``|``, ``^``, and ``-``) of
14711  ``dict_keys``. ``d.keys() | other`` was slower than ``set(d) | other`` but
14712  they are almost same performance for now.
14713
14714- bpo-28029: ``"".replace("", s, n)`` now returns ``s`` instead of an empty
14715  string for all non-zero ``n``.  There are similar changes for
14716  :class:`bytes` and :class:`bytearray` objects.
14717
14718- bpo-38535: Fixed line numbers and column offsets for AST nodes for calls
14719  without arguments in decorators.
14720
14721- bpo-38525: Fix a segmentation fault when using reverse iterators of empty
14722  ``dict`` objects. Patch by Dong-hee Na and Inada Naoki.
14723
14724- bpo-38465: :class:`bytearray`, :class:`~array.array` and
14725  :class:`~mmap.mmap` objects allow now to export more than ``2**31``
14726  buffers at a time.
14727
14728- bpo-38469: Fixed a bug where the scope of named expressions was not being
14729  resolved correctly in the presence of the *global* keyword. Patch by Pablo
14730  Galindo.
14731
14732- bpo-38437: Activate the ``GC_DEBUG`` macro for debug builds of the
14733  interpreter (when ``Py_DEBUG`` is set). Patch by Pablo Galindo.
14734
14735- bpo-38379: When the garbage collector makes a collection in which some
14736  objects resurrect (they are reachable from outside the isolated cycles
14737  after the finalizers have been executed), do not block the collection of
14738  all objects that are still unreachable. Patch by Pablo Galindo and Tim
14739  Peters.
14740
14741- bpo-38379: When cyclic garbage collection (gc) runs finalizers that
14742  resurrect unreachable objects, the current gc run ends, without collecting
14743  any cyclic trash.  However, the statistics reported by ``collect()`` and
14744  ``get_stats()`` claimed that all cyclic trash found was collected, and
14745  that the resurrected objects were collected.   Changed the stats to report
14746  that none were collected.
14747
14748- bpo-38392: In debug mode, :c:func:`PyObject_GC_Track` now calls
14749  ``tp_traverse()`` of the object type to ensure that the object is valid:
14750  test that objects visited by ``tp_traverse()`` are valid.
14751
14752- bpo-38210: Remove unnecessary intersection and update set operation in
14753  dictview with empty set. (Contributed by Dong-hee Na in :issue:`38210`.)
14754
14755- bpo-38402: Check the error from the system's underlying ``crypt`` or
14756  ``crypt_r``.
14757
14758- bpo-37474: On FreeBSD, Python no longer calls ``fedisableexcept()`` at
14759  startup to control the floating point control mode. The call became
14760  useless since FreeBSD 6: it became the default mode.
14761
14762- bpo-38006: Fix a bug due to the interaction of weakrefs and the cyclic
14763  garbage collector. We must clear any weakrefs in garbage in order to
14764  prevent their callbacks from executing and causing a crash.
14765
14766- bpo-38317: Fix warnings options priority: ``PyConfig.warnoptions`` has the
14767  highest priority, as stated in the :pep:`587`.
14768
14769- bpo-38310: Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX``
14770  opcode pairs in the main interpreter loop. Patch by Brandt Bucher.
14771
14772- bpo-36871: Improve error handling for the assert_has_calls and
14773  assert_has_awaits methods of mocks. Fixed a bug where any errors
14774  encountered while binding the expected calls to the mock's spec were
14775  silently swallowed, leading to misleading error output.
14776
14777- bpo-11410: Better control over symbol visibility is provided through use
14778  of the visibility attributes available in gcc >= 4.0, provided in a
14779  uniform way across POSIX and Windows. The POSIX build files have been
14780  updated to compile with -fvisibility=hidden, minimising exported symbols.
14781
14782- bpo-38219: Optimized the :class:`dict` constructor and the
14783  :meth:`~dict.update` method for the case when the argument is a dict.
14784
14785- bpo-38236: Python now dumps path configuration if it fails to import the
14786  Python codecs of the filesystem and stdio encodings.
14787
14788- bpo-38013: Allow to call ``async_generator_athrow().throw(...)`` even for
14789  non-started async generator helper. It fixes annoying warning at the end
14790  of :func:`asyncio.run` call.
14791
14792- bpo-38124: Fix an off-by-one error in PyState_AddModule that could cause
14793  out-of-bounds memory access.
14794
14795- bpo-38116: The select module is now PEP-384 compliant and no longer has
14796  static state
14797
14798- bpo-38113: ast module updated to PEP-384 and all statics removed
14799
14800- bpo-38076: The struct module is now PEP-384 compatible
14801
14802- bpo-38075: The random module is now PEP-384 compatible
14803
14804- bpo-38074: zlib module made PEP-384 compatible
14805
14806- bpo-38073: Make pwd extension module PEP-384 compatible
14807
14808- bpo-38072: grp module made PEP-384 compatible
14809
14810- bpo-38069: Make _posixsubprocess PEP-384 compatible
14811
14812- bpo-38071: Make termios extension module PEP-384 compatible
14813
14814- bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID.
14815
14816- bpo-36946: Fix possible signed integer overflow when handling slices.
14817  Patch by hongweipeng.
14818
14819- bpo-37994: Fixed silencing arbitrary errors if an attribute lookup fails
14820  in several sites. Only AttributeError should be silenced.
14821
14822- bpo-8425: Optimize set difference_update for the case when the other set
14823  is much larger than the base set.  (Suggested by Evgeny Kapun with code
14824  contributed by Michele Orrù).
14825
14826- bpo-37966: The implementation of :func:`~unicodedata.is_normalized` has
14827  been greatly sped up on strings that aren't normalized, by implementing
14828  the full normalization-quick-check algorithm from the Unicode standard.
14829
14830- bpo-37947: Adjust correctly the recursion level in the symtable generation
14831  for named expressions. Patch by Pablo Galindo.
14832
14833- bpo-37812: The ``CHECK_SMALL_INT`` macro used inside
14834  :file:`Object/longobject.c` has been replaced with an explicit ``return``
14835  at each call site.
14836
14837- bpo-37751: Fix :func:`codecs.lookup` to normalize the encoding name the
14838  same way than :func:`encodings.normalize_encoding`, except that
14839  :func:`codecs.lookup` also converts the name to lower case.
14840
14841- bpo-37830: Fixed compilation of :keyword:`break` and :keyword:`continue`
14842  in the :keyword:`finally` block when the corresponding :keyword:`try`
14843  block contains :keyword:`return` with a non-constant value.
14844
14845- bpo-20490: Improve import error message for partially initialized module
14846  on circular ``from`` imports - by Anthony Sottile.
14847
14848- bpo-37840: Fix handling of negative indices in
14849  :c:member:`~PySequenceMethods.sq_item` of :class:`bytearray`. Patch by
14850  Sergey Fedoseev.
14851
14852- bpo-37802: Slightly improve performance of
14853  :c:func:`PyLong_FromUnsignedLong`, :c:func:`PyLong_FromUnsignedLongLong`
14854  and :c:func:`PyLong_FromSize_t`. Patch by Sergey Fedoseev.
14855
14856- bpo-37409: Ensure explicit relative imports from interactive sessions and
14857  scripts (having no parent package) always raise ImportError, rather than
14858  treating the current module as the package. Patch by Ben Lewis.
14859
14860- bpo-32912: Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead
14861  of :exc:`DeprecationWarning` for invalid escape sequences in string and
14862  bytes literals.
14863
14864- bpo-37757: :pep:`572`: As described in the PEP, assignment expressions now
14865  raise :exc:`SyntaxError` when their interaction with comprehension scoping
14866  results in an ambiguous target scope.
14867
14868  The ``TargetScopeError`` subclass originally proposed by the PEP has been
14869  removed in favour of just raising regular syntax errors for the disallowed
14870  cases.
14871
14872- bpo-36279: Fix potential use of uninitialized memory in :func:`os.wait3`.
14873
14874- bpo-36311: Decoding bytes objects larger than 2GiB is faster and no longer
14875  fails when a multibyte characters spans a chunk boundary.
14876
14877- bpo-34880: The :keyword:`assert` statement now works properly if the
14878  :exc:`AssertionError` exception is being shadowed. Patch by Zackery Spytz.
14879
14880- bpo-37340: Removed object cache (``free_list``) for bound method objects.
14881  Temporary bound method objects are less used than before thanks to the
14882  ``LOAD_METHOD`` opcode and the ``_PyObject_VectorcallMethod`` C API.
14883
14884- bpo-37648: Fixed minor inconsistency in :meth:`list.__contains__`,
14885  :meth:`tuple.__contains__` and a few other places. The collection's item
14886  is now always at the left and the needle is on the right of ``==``.
14887
14888- bpo-37444: Update differing exception between :meth:`builtins.__import__`
14889  and :meth:`importlib.__import__`.
14890
14891- bpo-37619: When adding a wrapper descriptor from one class to a different
14892  class (for example, setting ``__add__ = str.__add__`` on an ``int``
14893  subclass), an exception is correctly raised when the operator is called.
14894
14895- bpo-37593: Swap the positions of the *posonlyargs* and *args* parameters
14896  in the constructor of :class:`ast.parameters` nodes.
14897
14898- bpo-37543: Optimized pymalloc for non PGO build.
14899
14900- bpo-37537: Compute allocated pymalloc blocks inside
14901  _Py_GetAllocatedBlocks().  This slows down _Py_GetAllocatedBlocks() but
14902  gives a small speedup to _PyObject_Malloc() and _PyObject_Free().
14903
14904- bpo-37467: Fix :func:`sys.excepthook` and :c:func:`PyErr_Display` if a
14905  filename is a bytes string. For example, for a SyntaxError exception where
14906  the filename attribute is a bytes string.
14907
14908- bpo-37433: Fix ``SyntaxError`` indicator printing too many spaces for
14909  multi-line strings - by Anthony Sottile.
14910
14911- bpo-37417: :meth:`bytearray.extend` now correctly handles errors that
14912  arise during iteration. Patch by Brandt Bucher.
14913
14914- bpo-37414: The undocumented ``sys.callstats()`` function has been removed.
14915  Since Python 3.7, it was deprecated and always returned ``None``. It
14916  required a special build option ``CALL_PROFILE`` which was already removed
14917  in Python 3.7.
14918
14919- bpo-37392: Remove ``sys.getcheckinterval()`` and
14920  ``sys.setcheckinterval()`` functions. They were deprecated since Python
14921  3.2. Use :func:`sys.getswitchinterval` and :func:`sys.setswitchinterval`
14922  instead. Remove also ``check_interval`` field of the
14923  ``PyInterpreterState`` structure.
14924
14925- bpo-37388: In development mode and in debug build, *encoding* and *errors*
14926  arguments are now checked on string encoding and decoding operations.
14927  Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`.
14928
14929  By default, for best performances, the *errors* argument is only checked
14930  at the first encoding/decoding error, and the *encoding* argument is
14931  sometimes ignored for empty strings.
14932
14933- bpo-37348: Optimized decoding short ASCII string with UTF-8 and ascii
14934  codecs. ``b"foo".decode()`` is about 15% faster.  Patch by Inada Naoki.
14935
14936- bpo-24214: Improved support of the surrogatepass error handler in the
14937  UTF-8 and UTF-16 incremental decoders.
14938
14939- bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and
14940  :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal
14941  newline") in the file mode. This flag was deprecated since Python 3.3.
14942
14943- bpo-35224: Reverse evaluation order of key: value in dict comprehensions
14944  as proposed in PEP 572. I.e. in ``{k: v for ...}``, ``k`` will be
14945  evaluated before ``v``.
14946
14947- bpo-37316: Fix the :c:func:`PySys_Audit` call in :class:`mmap.mmap`.
14948
14949- bpo-37300: Remove an unnecessary Py_XINCREF in classobject.c.
14950
14951- bpo-37269: Fix a bug in the peephole optimizer that was not treating
14952  correctly constant conditions with binary operators. Patch by Pablo
14953  Galindo.
14954
14955- bpo-20443: Python now gets the absolute path of the script filename
14956  specified on the command line (ex: "python3 script.py"): the __file__
14957  attribute of the __main__ module and sys.path[0] become an absolute path,
14958  rather than a relative path.
14959
14960- bpo-37257: Python's small object allocator (``obmalloc.c``) now allows (no
14961  more than) one empty arena to remain available for immediate reuse,
14962  without returning it to the OS.  This prevents thrashing in simple loops
14963  where an arena could be created and destroyed anew on each iteration.
14964
14965- bpo-37231: The dispatching of type slots to special methods (for example
14966  calling ``__mul__`` when doing ``x * y``) has been made faster.
14967
14968- bpo-36974: Implemented separate vectorcall functions for every calling
14969  convention of builtin functions and methods. This improves performance for
14970  calls.
14971
14972- bpo-37213: Handle correctly negative line offsets in the peephole
14973  optimizer. Patch by Pablo Galindo.
14974
14975- bpo-37219: Remove erroneous optimization for empty set differences.
14976
14977- bpo-15913: Implement :c:func:`PyBuffer_SizeFromFormat()` function
14978  (previously documented but not implemented): call :func:`struct.calcsize`.
14979  Patch by Joannah Nanjekye.
14980
14981- bpo-36922: Slot functions optimize any callable with
14982  ``Py_TPFLAGS_METHOD_DESCRIPTOR`` instead of only instances of
14983  ``function``.
14984
14985- bpo-36974: The slot ``tp_vectorcall_offset`` is inherited unconditionally
14986  to support ``super().__call__()`` when the base class uses vectorcall.
14987
14988- bpo-37160: :func:`threading.get_native_id` now also supports NetBSD.
14989
14990- bpo-37077: Add :func:`threading.get_native_id` support for AIX. Patch by
14991  M. Felt
14992
14993- bpo-36781: :func:`sum` has been optimized for boolean values.
14994
14995- bpo-34556: Add ``--upgrade-deps`` to venv module. Patch by Cooper Ry Lees
14996
14997- bpo-20523: ``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper
14998  and Dan Lidral-Porter.
14999
15000- bpo-35551: Updated encodings: - Removed the "tis260" encoding, which was
15001  an alias for the nonexistent "tactis" codec. - Added "mac_centeuro" as an
15002  alias for the mac_latin2 encoding.
15003
15004- bpo-19072: The :class:`classmethod` decorator can now wrap other
15005  descriptors such as property objects.  Adapted from a patch written by
15006  Graham Dumpleton.
15007
15008- bpo-27575: Improve speed of dictview intersection by directly using set
15009  intersection logic. Patch by David Su.
15010
15011- bpo-30773: Prohibit parallel running of aclose() / asend() / athrow(). Fix
15012  ag_running to reflect the actual running status of the AG.
15013
15014Library
15015-------
15016
15017- bpo-36589: The :func:`curses.update_lines_cols` function now returns
15018  ``None`` instead of ``1`` on success.
15019
15020- bpo-38807: Update :exc:`TypeError` messages for :meth:`os.path.join` to
15021  include :class:`os.PathLike` objects as acceptable input types.
15022
15023- bpo-38724: Add a repr for ``subprocess.Popen`` objects. Patch by Andrey
15024  Doroschenko.
15025
15026- bpo-38786: pydoc now recognizes and parses HTTPS URLs. Patch by python273.
15027
15028- bpo-38785: Prevent asyncio from crashing if parent ``__init__`` is not
15029  called from a constructor of object derived from ``asyncio.Future``.
15030
15031- bpo-38723: :mod:`pdb` now uses :meth:`io.open_code` to trigger auditing
15032  events.
15033
15034- bpo-27805: Allow opening pipes and other non-seekable files in append mode
15035  with :func:`open`.
15036
15037- bpo-38438: Simplify the :mod:`argparse` usage message for ``nargs="*"``.
15038
15039- bpo-38761: WeakSet is now registered as a collections.abc.MutableSet.
15040
15041- bpo-38716: logging: change RotatingHandler namer and rotator to
15042  class-level attributes. This stops __init__ from setting them to None in
15043  the case where a subclass defines them with eponymous methods.
15044
15045- bpo-38713: Add :data:`os.P_PIDFD` constant, which may be passed to
15046  :func:`os.waitid` to wait on a Linux process file descriptor.
15047
15048- bpo-38692: Add :class:`asyncio.PidfdChildWatcher`, a Linux-specific child
15049  watcher implementation that polls process file descriptors.
15050
15051- bpo-38692: Expose the Linux ``pidfd_open`` syscall as
15052  :func:`os.pidfd_open`.
15053
15054- bpo-38602: Added constants :data:`~fcntl.F_OFD_GETLK`,
15055  :data:`~fcntl.F_OFD_SETLK` and :data:`~fcntl.F_OFD_SETLKW` to the
15056  :mod:`fcntl` module. Patch by Dong-hee Na.
15057
15058- bpo-38334: Fixed seeking backward on an encrypted
15059  :class:`zipfile.ZipExtFile`.
15060
15061- bpo-38312: Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`,
15062  :func:`curses.get_tabsize`, and :func:`curses.set_tabsize` functions - by
15063  Anthony Sottile.
15064
15065- bpo-38586: Now :func:`~logging.config.fileConfig` correctly sets the .name
15066  of handlers loaded.
15067
15068- bpo-38565: Add new cache_parameters() method for functools.lru_cache() to
15069  better support pickling.
15070
15071- bpo-34679: asynci.ProactorEventLoop.close() now only calls
15072  signal.set_wakeup_fd() in the main thread.
15073
15074- bpo-31202: The case the result of :func:`pathlib.WindowsPath.glob` matches
15075  now the case of the pattern for literal parts.
15076
15077- bpo-36321: Remove misspelled attribute.  The 3.8 changelog noted that this
15078  would be removed in 3.9.
15079
15080- bpo-38521: Fixed erroneous equality comparison in statistics.NormalDist().
15081
15082- bpo-38493: Added :data:`~os.CLD_KILLED` and :data:`~os.CLD_STOPPED` for
15083  :attr:`si_code`. Patch by Dong-hee Na.
15084
15085- bpo-38478: Fixed a bug in :meth:`inspect.signature.bind` that was causing
15086  it to fail when handling a keyword argument with same name as
15087  positional-only parameter. Patch by Pablo Galindo.
15088
15089- bpo-33604: Fixed `hmac.new` and `hmac.HMAC` to raise TypeError instead of
15090  ValueError when the digestmod parameter, now required in 3.8, is omitted.
15091  Also clarified the hmac module documentation and docstrings.
15092
15093- bpo-38378: Parameters *out* and *in* of :func:`os.sendfile` was renamed to
15094  *out_fd* and *in_fd*.
15095
15096- bpo-38417: Added support for setting the umask in the child process to the
15097  subprocess module on POSIX systems.
15098
15099- bpo-38449: Revert PR 15522, which introduces a regression in
15100  :meth:`mimetypes.guess_type` due to improper handling of filenames as
15101  urls.
15102
15103- bpo-38431: Fix ``__repr__`` method for :class:`dataclasses.InitVar` to
15104  support typing objects, patch by Samuel Colvin.
15105
15106- bpo-38109: Add missing :data:`stat.S_IFDOOR`, :data:`stat.S_IFPORT`,
15107  :data:`stat.S_IFWHT`, :func:`stat.S_ISDOOR`, :func:`stat.S_ISPORT`, and
15108  :func:`stat.S_ISWHT` values to the Python implementation of :mod:`stat`.
15109
15110- bpo-38422: Clarify docstrings of pathlib suffix(es)
15111
15112- bpo-38405: Nested subclasses of :class:`typing.NamedTuple` are now
15113  pickleable.
15114
15115- bpo-38332: Prevent :exc:`KeyError` thrown by :func:`_encoded_words.decode`
15116  when given an encoded-word with invalid content-type encoding from
15117  propagating all the way to :func:`email.message.get`.
15118
15119- bpo-38371: Deprecated the ``split()`` method in
15120  :class:`_tkinter.TkappType` in favour of the ``splitlist()`` method which
15121  has more consistent and predicable behavior.
15122
15123- bpo-38341: Add :exc:`smtplib.SMTPNotSupportedError` to the :mod:`smtplib`
15124  exported names.
15125
15126- bpo-38319: sendfile() used in socket and shutil modules was raising
15127  OverflowError for files >= 2GiB on 32-bit architectures.  (patch by
15128  Giampaolo Rodola)
15129
15130- bpo-38242: Revert the new asyncio Streams API
15131
15132- bpo-13153: OS native encoding is now used for converting between Python
15133  strings and Tcl objects.  This allows to display, copy and paste to
15134  clipboard emoji and other non-BMP characters.  Converting strings from Tcl
15135  to Python and back now never fails (except MemoryError).
15136
15137- bpo-38019: Correctly handle pause/resume reading of closed asyncio unix
15138  pipe.
15139
15140- bpo-38163: Child mocks will now detect their type as either synchronous or
15141  asynchronous, asynchronous child mocks will be AsyncMocks and synchronous
15142  child mocks will be either MagicMock or Mock (depending on their parent
15143  type).
15144
15145- bpo-38161: Removes _AwaitEvent from AsyncMock.
15146
15147- bpo-38216: Allow the rare code that wants to send invalid http requests
15148  from the `http.client` library a way to do so.  The fixes for bpo-30458
15149  led to breakage for some projects that were relying on this ability to
15150  test their own behavior in the face of bad requests.
15151
15152- bpo-28286: Deprecate opening :class:`~gzip.GzipFile` for writing
15153  implicitly.  Always specify the *mode* argument for writing.
15154
15155- bpo-38108: Any synchronous magic methods on an AsyncMock now return a
15156  MagicMock. Any asynchronous magic methods on a MagicMock now return an
15157  AsyncMock.
15158
15159- bpo-38265: Update the *length* parameter of :func:`os.pread` to accept
15160  :c:type:`Py_ssize_t` instead of :c:expr:`int`.
15161
15162- bpo-38112: :mod:`compileall` has a higher default recursion limit and new
15163  command-line arguments for path manipulation, symlinks handling, and
15164  multiple optimization levels.
15165
15166- bpo-38248: asyncio: Fix inconsistent immediate Task cancellation
15167
15168- bpo-38237: The arguments for the builtin pow function are more
15169  descriptive. They can now also be passed in as keywords.
15170
15171- bpo-34002: Improve efficiency in parts of email package by changing
15172  while-pop to a for loop, using isdisjoint instead of set intersections.
15173
15174- bpo-38191: Constructors of :class:`~typing.NamedTuple` and
15175  :class:`~typing.TypedDict` types now accept arbitrary keyword argument
15176  names, including "cls", "self", "typename", "_typename", "fields" and
15177  "_fields".
15178
15179- bpo-38155: Add ``__all__`` to  :mod:`datetime`. Patch by Tahia Khan.
15180
15181- bpo-38185: Fixed case-insensitive string comparison in
15182  :class:`sqlite3.Row` indexing.
15183
15184- bpo-38136: Changes AsyncMock call count and await count to be two
15185  different counters. Now await count only counts when a coroutine has been
15186  awaited, not when it has been called, and vice-versa. Update the
15187  documentation around this.
15188
15189- bpo-37828: Fix default mock name in
15190  :meth:`unittest.mock.Mock.assert_called` exceptions. Patch by Abraham
15191  Toriz Cruz.
15192
15193- bpo-38175: Fix a memory leak in comparison of :class:`sqlite3.Row`
15194  objects.
15195
15196- bpo-33936: _hashlib no longer calls obsolete OpenSSL initialization
15197  function with OpenSSL 1.1.0+.
15198
15199- bpo-34706: Preserve subclassing in inspect.Signature.from_callable.
15200
15201- bpo-38153: Names of hashing algorithms from OpenSSL are now normalized to
15202  follow Python's naming conventions. For example OpenSSL uses sha3-512
15203  instead of sha3_512 or blake2b512 instead of blake2b.
15204
15205- bpo-38115: Fix a bug in dis.findlinestarts() where it would return invalid
15206  bytecode offsets. Document that a code object's co_lnotab can contain
15207  invalid bytecode offsets.
15208
15209- bpo-38148: Add slots to :mod:`asyncio` transport classes, which can reduce
15210  memory usage.
15211
15212- bpo-38142: The _hashlib OpenSSL wrapper extension module is now PEP-384
15213  compliant.
15214
15215- bpo-9216: hashlib constructors now support usedforsecurity flag to signal
15216  that a hashing algorithm is not used in a security context.
15217
15218- bpo-36991: Fixes a potential incorrect AttributeError exception escaping
15219  ZipFile.extract() in some unsupported input error situations.
15220
15221- bpo-38134: Remove obsolete copy of PBKDF2_HMAC_fast. All supported OpenSSL
15222  versions contain a fast implementation.
15223
15224- bpo-38132: The OpenSSL hashlib wrapper uses a simpler implementation.
15225  Several Macros and pointless caches are gone. The hash name now comes from
15226  OpenSSL's EVP. The algorithm name stays the same, except it is now always
15227  lower case.
15228
15229- bpo-38008: Fix parent class check in protocols to correctly identify the
15230  module that provides a builtin protocol, instead of assuming they all come
15231  from the :mod:`collections.abc` module
15232
15233- bpo-34037: For :mod:`asyncio`, add a new coroutine
15234  :meth:`loop.shutdown_default_executor`. The new coroutine provides an API
15235  to schedule an executor shutdown that waits on the threadpool to finish
15236  closing. Also, :func:`asyncio.run` has been updated to utilize the new
15237  coroutine. Patch by Kyle Stanley.
15238
15239- bpo-37405: Fixed regression bug for socket.getsockname() for non-CAN_ISOTP
15240  AF_CAN address family sockets by returning a 1-tuple instead of string.
15241
15242- bpo-38121: Update parameter names on functions in importlib.metadata
15243  matching the changes in the 0.22 release of importlib_metadata.
15244
15245- bpo-38110: The os.closewalk() implementation now uses the libc fdwalk()
15246  API on platforms where it is available.
15247
15248- bpo-38093: Fixes AsyncMock so it doesn't crash when used with
15249  AsyncContextManagers or AsyncIterators.
15250
15251- bpo-37488: Add warning to :meth:`datetime.utctimetuple`,
15252  :meth:`datetime.utcnow` and :meth:`datetime.utcfromtimestamp` .
15253
15254- bpo-35640: Allow passing a :term:`path-like object` as ``directory``
15255  argument to the :class:`http.server.SimpleHTTPRequestHandler` class. Patch
15256  by Géry Ogam.
15257
15258- bpo-38086: Update importlib.metadata with changes from `importlib_metadata
15259  0.21
15260  <https://gitlab.com/python-devs/importlib_metadata/blob/0.21/importlib_metadata/docs/changelog.rst>`_.
15261
15262- bpo-37251: Remove `__code__` check in AsyncMock that incorrectly evaluated
15263  function specs as async objects but failed to evaluate classes with
15264  `__await__` but no `__code__` attribute defined as async objects.
15265
15266- bpo-38037: Fix reference counters in the :mod:`signal` module.
15267
15268- bpo-38066: Hide internal asyncio.Stream methods: feed_eof(), feed_data(),
15269  set_exception() and set_transport().
15270
15271- bpo-38059: inspect.py now uses sys.exit() instead of exit()
15272
15273- bpo-38049: Added command-line interface for the :mod:`ast` module.
15274
15275- bpo-37953: In :mod:`typing`, improved the ``__hash__`` and ``__eq__``
15276  methods for :class:`ForwardReferences`.
15277
15278- bpo-38026: Fixed :func:`inspect.getattr_static` used ``isinstance`` while
15279  it should avoid dynamic lookup.
15280
15281- bpo-35923: Update :class:`importlib.machinery.BuiltinImporter` to use
15282  ``loader._ORIGIN`` instead of a hardcoded value. Patch by Dong-hee Na.
15283
15284- bpo-38010: In ``importlib.metadata`` sync with ``importlib_metadata``
15285  0.20, clarifying behavior of ``files()`` and fixing issue where only one
15286  requirement was returned for ``requires()`` on ``dist-info`` packages.
15287
15288- bpo-38006: weakref.WeakValueDictionary defines a local remove() function
15289  used as callback for weak references. This function was created with a
15290  closure. Modify the implementation to avoid the closure.
15291
15292- bpo-37995: Added the *indent* option to :func:`ast.dump` which allows it
15293  to produce a multiline indented output.
15294
15295- bpo-34410: Fixed a crash in the :func:`tee` iterator when re-enter it.
15296  RuntimeError is now raised in this case.
15297
15298- bpo-37140: Fix a ctypes regression of Python 3.8. When a ctypes.Structure
15299  is passed by copy to a function, ctypes internals created a temporary
15300  object which had the side effect of calling the structure finalizer
15301  (__del__) twice. The Python semantics requires a finalizer to be called
15302  exactly once. Fix ctypes internals to no longer call the finalizer twice.
15303
15304- bpo-37587: ``_json.scanstring`` is now up to 3x faster when there are many
15305  backslash escaped characters in the JSON string.
15306
15307- bpo-37834: Prevent shutil.rmtree exception when built on non-Windows
15308  system without fd system call support, like older versions of macOS.
15309
15310- bpo-10978: Semaphores and BoundedSemaphores can now release more than one
15311  waiting thread at a time.
15312
15313- bpo-37972: Subscripts to the `unittest.mock.call` objects now receive the
15314  same chaining mechanism as any other custom attributes, so that the
15315  following usage no longer raises a `TypeError`:
15316
15317  call().foo().__getitem__('bar')
15318
15319  Patch by blhsing
15320
15321- bpo-37965: Fix C compiler warning caused by
15322  distutils.ccompiler.CCompiler.has_function.
15323
15324- bpo-37964: Add ``F_GETPATH`` command to :mod:`fcntl`.
15325
15326- bpo-37960: ``repr()`` of buffered and text streams now silences only
15327  expected exceptions when get the value of "name" and "mode" attributes.
15328
15329- bpo-37961: Add a ``total_nframe`` field to the traces collected by the
15330  tracemalloc module. This field indicates the original number of frames
15331  before it was truncated.
15332
15333- bpo-37951: Most features of the subprocess module now work again in
15334  subinterpreters. Only *preexec_fn* is restricted in subinterpreters.
15335
15336- bpo-36205: Fix the rusage implementation of time.process_time() to
15337  correctly report the sum of the system and user CPU time.
15338
15339- bpo-37950: Fix :func:`ast.dump` when call with incompletely initialized
15340  node.
15341
15342- bpo-34679: Restores instantiation of Windows IOCP event loops from the
15343  non-main thread.
15344
15345- bpo-36917: Add default implementation of the
15346  :meth:`ast.NodeVisitor.visit_Constant` method which emits a deprecation
15347  warning and calls corresponding methody ``visit_Num()``, ``visit_Str()``,
15348  etc.
15349
15350- bpo-37798: Update test_statistics.py to verify that the statistics module
15351  works well for both C and Python implementations. Patch by Dong-hee Na
15352
15353- bpo-26589: Added a new status code to the http module: 451
15354  UNAVAILABLE_FOR_LEGAL_REASONS
15355
15356- bpo-37915: Fix a segmentation fault that appeared when comparing instances
15357  of ``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo
15358  Galindo.
15359
15360- bpo-32554: Deprecate having random.seed() call hash on arbitrary types.
15361
15362- bpo-9938: Add optional keyword argument ``exit_on_error`` for
15363  :class:`ArgumentParser`.
15364
15365- bpo-37851: The :mod:`faulthandler` module no longer allocates its
15366  alternative stack at Python startup. Now the stack is only allocated at
15367  the first faulthandler usage.
15368
15369- bpo-32793: Fix a duplicated debug message when
15370  :meth:`smtplib.SMTP.connect` is called.
15371
15372- bpo-37885: venv: Don't generate unset variable warning on deactivate.
15373
15374- bpo-37868: Fix dataclasses.is_dataclass when given an instance that never
15375  raises AttributeError in __getattr__.  That is, an object that returns
15376  something for __dataclass_fields__ even if it's not a dataclass.
15377
15378- bpo-37811: Fix ``socket`` module's ``socket.connect(address)`` function
15379  being unable to establish connection in case of interrupted system call.
15380  The problem was observed on all OSes which ``poll(2)`` system call can
15381  take only non-negative integers and -1 as a timeout value.
15382
15383- bpo-37863: Optimizations for Fraction.__hash__ suggested by Tim Peters.
15384
15385- bpo-21131: Fix ``faulthandler.register(chain=True)`` stack. faulthandler
15386  now allocates a dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just
15387  ``SIGSTKSZ`` bytes. Calling the previous signal handler in faulthandler
15388  signal handler uses more than ``SIGSTKSZ`` bytes of stack memory on some
15389  platforms.
15390
15391- bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() Patch by
15392  Dong-hee Na
15393
15394- bpo-37804: Remove the deprecated method `threading.Thread.isAlive()`.
15395  Patch by Dong-hee Na.
15396
15397- bpo-37819: Add Fraction.as_integer_ratio() to match the corresponding
15398  methods in bool, int, float, and decimal.
15399
15400- bpo-14465: Add an xml.etree.ElementTree.indent() function for
15401  pretty-printing XML trees. Contributed by Stefan Behnel.
15402
15403- bpo-37810: Fix :mod:`difflib` ``?`` hint in diff output when dealing with
15404  tabs.  Patch by Anthony Sottile.
15405
15406- bpo-37772: In ``zipfile.Path``, when adding implicit dirs, ensure that
15407  ancestral directories are added and that duplicates are excluded.
15408
15409- bpo-18578: Renamed and documented `test.bytecode_helper` as
15410  `test.support.bytecode_helper`. Patch by Joannah Nanjekye.
15411
15412- bpo-37785: Fix xgettext warnings in :mod:`argparse`.
15413
15414- bpo-34488: :meth:`writelines` method of :class:`io.BytesIO` is now
15415  slightly faster when many small lines are passed. Patch by Sergey
15416  Fedoseev.
15417
15418- bpo-37449: `ensurepip` now uses `importlib.resources.read_binary()` to
15419  read data instead of `pkgutil.get_data()`. Patch by Joannah Nanjekye.
15420
15421- bpo-28292: Mark calendar.py helper functions as being private.  The
15422  follows PEP 8 guidance to maintain the style conventions in the module and
15423  it addresses a known case of user confusion.
15424
15425- bpo-18049: Add definition of THREAD_STACK_SIZE for AIX in
15426  Python/thread_pthread.h The default thread stacksize caused crashes with
15427  the default recursion limit Patch by M Felt
15428
15429- bpo-37742: The logging.getLogger() API now returns the root logger when
15430  passed the name 'root', whereas previously it returned a non-root logger
15431  named 'root'. This could affect cases where user code explicitly wants a
15432  non-root logger named 'root', or instantiates a logger using
15433  logging.getLogger(__name__) in some top-level module called 'root.py'.
15434
15435- bpo-37738: Fix the implementation of curses ``addch(str, color_pair)``:
15436  pass the color pair to ``setcchar()``, instead of always passing 0 as the
15437  color pair.
15438
15439- bpo-37723: Fix performance regression on regular expression parsing with
15440  huge character sets. Patch by Yann Vaginay.
15441
15442- bpo-35943: The function :c:func:`PyImport_GetModule` now ensures any
15443  module it returns is fully initialized. Patch by Joannah Nanjekye.
15444
15445- bpo-32178: Fix IndexError in :mod:`email` package when trying to parse
15446  invalid address fields starting with ``:``.
15447
15448- bpo-37268: The :mod:`parser` module is deprecated and will be removed in
15449  future versions of Python.
15450
15451- bpo-11953: Completing WSA* error codes in :mod:`socket`.
15452
15453- bpo-37685: Fixed comparisons of :class:`datetime.timedelta` and
15454  :class:`datetime.timezone`.
15455
15456- bpo-37697: Synchronize ``importlib.metadata`` with `importlib_metadata
15457  0.19
15458  <https://gitlab.com/python-devs/importlib_metadata/-/milestones/20>`_,
15459  improving handling of EGG-INFO files and fixing a crash when entry point
15460  names contained colons.
15461
15462- bpo-37695: Correct :func:`curses.unget_wch` error message.  Patch by
15463  Anthony Sottile.
15464
15465- bpo-37689: Add :meth:`is_relative_to` in :class:`PurePath` to determine
15466  whether or not one path is relative to another.
15467
15468- bpo-29553: Fixed :meth:`argparse.ArgumentParser.format_usage` for mutually
15469  exclusive groups. Patch by Andrew Nester.
15470
15471- bpo-37691: Let math.dist() accept coordinates as sequences (or iterables)
15472  rather than just tuples.
15473
15474- bpo-37685: Fixed ``__eq__``, ``__lt__`` etc implementations in some
15475  classes. They now return :data:`NotImplemented` for unsupported type of
15476  the other operand. This allows the other operand to play role (for example
15477  the equality comparison with :data:`~unittest.mock.ANY` will return
15478  ``True``).
15479
15480- bpo-37354: Make Activate.ps1 Powershell script static to allow for signing
15481  it.
15482
15483- bpo-37664: Update wheels bundled with ensurepip (pip 19.2.3 and setuptools
15484  41.2.0)
15485
15486- bpo-37663: Bring consistency to venv shell activation scripts by always
15487  using __VENV_PROMPT__.
15488
15489- bpo-37642: Allowed the pure Python implementation of
15490  :class:`datetime.timezone` to represent sub-minute offsets close to
15491  minimum and maximum boundaries, specifically in the ranges (23:59, 24:00)
15492  and (-23:59, 24:00). Patch by Ngalim Siregar
15493
15494- bpo-36161: In :mod:`posix`, use ``ttyname_r`` instead of ``ttyname`` for
15495  thread safety.
15496
15497- bpo-36324: Make internal attributes for statistics.NormalDist() private.
15498
15499- bpo-37555: Fix `NonCallableMock._call_matcher` returning tuple instead of
15500  `_Call` object when `self._spec_signature` exists. Patch by Elizabeth
15501  Uselton
15502
15503- bpo-29446: Make `from tkinter import *` import only the expected objects.
15504
15505- bpo-16970: Adding a value error when an invalid value in passed to nargs
15506  Patch by Robert Leenders
15507
15508- bpo-34443: Exceptions from :mod:`enum` now use the ``__qualname`` of the
15509  enum class in the exception message instead of the ``__name__``.
15510
15511- bpo-37491: Fix ``IndexError`` when parsing email headers with unexpectedly
15512  ending bare-quoted string value. Patch by Abhilash Raj.
15513
15514- bpo-37587: Make json.loads faster for long strings. (Patch by Marco
15515  Paolini)
15516
15517- bpo-18378: Recognize "UTF-8" as a valid value for LC_CTYPE in
15518  locale._parse_localename.
15519
15520- bpo-37579: Return :exc:`NotImplemented` in Python implementation of
15521  ``__eq__`` for :class:`~datetime.timedelta` and :class:`~datetime.time`
15522  when the other object being compared is not of the same type to match C
15523  implementation. Patch by Karthikeyan Singaravelan.
15524
15525- bpo-21478: Record calls to parent when autospecced object is attached to a
15526  mock using :func:`unittest.mock.attach_mock`. Patch by Karthikeyan
15527  Singaravelan.
15528
15529- bpo-37531: "python3 -m test -jN --timeout=TIMEOUT" now kills a worker
15530  process if it runs longer than *TIMEOUT* seconds.
15531
15532- bpo-37482: Fix serialization of display name in originator or destination
15533  address fields with both encoded words and special chars.
15534
15535- bpo-36993: Improve error reporting for corrupt zip files with bad zip64
15536  extra data. Patch by Daniel Hillier.
15537
15538- bpo-37502: pickle.loads() no longer raises TypeError when the buffers
15539  argument is set to None
15540
15541- bpo-37520: Correct behavior for zipfile.Path.parent when the path object
15542  identifies a subdirectory.
15543
15544- bpo-18374: Fix the ``.col_offset`` attribute of nested :class:`ast.BinOp`
15545  instances which had a too large value in some situations.
15546
15547- bpo-37424: Fixes a possible hang when using a timeout on
15548  `subprocess.run()` while capturing output.  If the child process spawned
15549  its own children or otherwise connected its stdout or stderr handles with
15550  another process, we could hang after the timeout was reached and our child
15551  was killed when attempting to read final output from the pipes.
15552
15553- bpo-37421: Fix :func:`multiprocessing.util.get_temp_dir` finalizer: clear
15554  also the 'tempdir' configuration of the current process, so next call to
15555  ``get_temp_dir()`` will create a new temporary directory, rather than
15556  reusing the removed temporary directory.
15557
15558- bpo-37481: The distutils ``bdist_wininst`` command is deprecated in Python
15559  3.8, use ``bdist_wheel`` (wheel packages) instead.
15560
15561- bpo-37479: When `Enum.__str__` is overridden in a derived class, the
15562  override will be used by `Enum.__format__` regardless of whether mixin
15563  classes are present.
15564
15565- bpo-37440: http.client now enables TLS 1.3 post-handshake authentication
15566  for default context or if a cert_file is passed to HTTPSConnection.
15567
15568- bpo-37437: Update vendorized expat version to 2.2.7.
15569
15570- bpo-37428: SSLContext.post_handshake_auth = True no longer sets
15571  SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
15572  option is documented as ignored for clients, OpenSSL implicitly enables
15573  cert chain validation when the flag is set.
15574
15575- bpo-37420: :func:`os.sched_setaffinity` now correctly handles errors that
15576  arise during iteration over its ``mask`` argument. Patch by Brandt Bucher.
15577
15578- bpo-37412: The :func:`os.getcwdb` function now uses the UTF-8 encoding on
15579  Windows, rather than the ANSI code page: see :pep:`529` for the rationale.
15580  The function is no longer deprecated on Windows.
15581
15582- bpo-37406: The sqlite3 module now raises TypeError, rather than
15583  ValueError, if operation argument type is not str: execute(),
15584  executemany() and calling a connection.
15585
15586- bpo-29412: Fix IndexError in parsing a header value ending unexpectedly.
15587  Patch by Abhilash Raj.
15588
15589- bpo-36546: The *dist* argument for statistics.quantiles() is now
15590  positional only. The current name doesn't reflect that the argument can be
15591  either a dataset or a distribution.  Marking the parameter as positional
15592  avoids confusion and makes it possible to change the name later.
15593
15594- bpo-37394: Fix a bug that was causing the :mod:`queue` module to fail if
15595  the accelerator module was not available. Patch by Pablo Galindo.
15596
15597- bpo-37376: :mod:`pprint` now has support for
15598  :class:`types.SimpleNamespace`. Patch by Carl Bordum Hansen.
15599
15600- bpo-26967: An :class:`~argparse.ArgumentParser` with
15601  ``allow_abbrev=False`` no longer disables grouping of short flags, such as
15602  ``-vv``, but only disables abbreviation of long flags as documented. Patch
15603  by Zac Hatfield-Dodds.
15604
15605- bpo-37212: :func:`unittest.mock.call` now preserves the order of keyword
15606  arguments in repr output. Patch by Karthikeyan Singaravelan.
15607
15608- bpo-37372: Fix error unpickling datetime.time objects from Python 2 with
15609  seconds>=24. Patch by Justin Blanchard.
15610
15611- bpo-37345: Add formal support for UDPLITE sockets. Support was present
15612  before, but it is now easier to detect support with ``hasattr(socket,
15613  'IPPROTO_UDPLITE')`` and there are constants defined for each of the
15614  values needed: :py:obj:`socket.IPPROTO_UDPLITE`,
15615  :py:obj:`UDPLITE_SEND_CSCOV`, and :py:obj:`UDPLITE_RECV_CSCOV`. Patch by
15616  Gabe Appleton.
15617
15618- bpo-37358: Optimized ``functools.partial`` by using vectorcall.
15619
15620- bpo-37347: :meth:`sqlite3.Connection.create_aggregate`,
15621  :meth:`sqlite3.Connection.create_function`,
15622  :meth:`sqlite3.Connection.set_authorizer`,
15623  :meth:`sqlite3.Connection.set_progress_handler`
15624  :meth:`sqlite3.Connection.set_trace_callback` methods lead to segfaults if
15625  some of these methods are called twice with an equal object but not the
15626  same. Now callbacks are stored more carefully. Patch by Aleksandr Balezin.
15627
15628- bpo-37163: The *obj* argument of :func:`dataclasses.replace` is
15629  positional-only now.
15630
15631- bpo-37085: Add the optional Linux SocketCAN Broadcast Manager constants,
15632  used as flags to configure the BCM behaviour, in the socket module.  Patch
15633  by Karl Ding.
15634
15635- bpo-37328: ``HTMLParser.unescape`` is removed.  It was undocumented and
15636  deprecated since Python 3.4.
15637
15638- bpo-37305: Add .webmanifest -> application/manifest+json to list of
15639  recognized file types and content type headers
15640
15641- bpo-37320: ``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()``
15642  alias to ``sunau.open()``, and ``wave.openfp()`` alias to ``wave.open()``
15643  have been removed. They were deprecated since Python 3.7.
15644
15645- bpo-37315: Deprecated accepting floats with integral value (like ``5.0``)
15646  in :func:`math.factorial`.
15647
15648- bpo-37312: ``_dummy_thread`` and ``dummy_threading`` modules have been
15649  removed. These modules were deprecated since Python 3.7 which requires
15650  threading support.
15651
15652- bpo-33972: Email with single part but content-type set to ``multipart/*``
15653  doesn't raise AttributeError anymore.
15654
15655- bpo-37280: Use threadpool for reading from file for sendfile fallback
15656  mode.
15657
15658- bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in
15659  fallback mode.
15660
15661- bpo-19865: :func:`ctypes.create_unicode_buffer()` now also supports
15662  non-BMP characters on platforms with 16-bit :c:type:`wchar_t` (for
15663  example, Windows and AIX).
15664
15665- bpo-37266: In a subinterpreter, spawning a daemon thread now raises an
15666  exception. Daemon threads were never supported in subinterpreters.
15667  Previously, the subinterpreter finalization crashed with a Python fatal
15668  error if a daemon thread was still running.
15669
15670- bpo-37210: Allow pure Python implementation of :mod:`pickle` to work even
15671  when the C :mod:`_pickle` module is unavailable.
15672
15673- bpo-21872: Fix :mod:`lzma`: module decompresses data incompletely. When
15674  decompressing a FORMAT_ALONE format file, and it doesn't have the end
15675  marker, sometimes the last one to dozens bytes can't be output. Patch by
15676  Ma Lin.
15677
15678- bpo-35922: Fix :meth:`RobotFileParser.crawl_delay` and
15679  :meth:`RobotFileParser.request_rate` to return ``None`` rather than raise
15680  :exc:`AttributeError` when no relevant rule is defined in the robots.txt
15681  file.  Patch by Rémi Lapeyre.
15682
15683- bpo-35766: Change the format of feature_version to be a (major, minor)
15684  tuple.
15685
15686- bpo-36607: Eliminate :exc:`RuntimeError` raised by
15687  :func:`asyncio.all_tasks()` if internal tasks weak set is changed by
15688  another thread during iteration.
15689
15690- bpo-18748: :class:`_pyio.IOBase` destructor now does nothing if getting
15691  the ``closed`` attribute fails to better mimic :class:`_io.IOBase`
15692  finalizer.
15693
15694- bpo-36402: Fix a race condition at Python shutdown when waiting for
15695  threads. Wait until the Python thread state of all non-daemon threads get
15696  deleted (join all non-daemon threads), rather than just wait until
15697  non-daemon Python threads complete.
15698
15699- bpo-37206: Default values which cannot be represented as Python objects no
15700  longer improperly represented as ``None`` in function signatures.
15701
15702- bpo-37111: Added ``encoding`` and ``errors`` keyword parameters to
15703  ``logging.basicConfig``.
15704
15705- bpo-12144: Ensure cookies with ``expires`` attribute are handled in
15706  :meth:`CookieJar.make_cookies`.
15707
15708- bpo-34886: Fix an unintended ValueError from :func:`subprocess.run` when
15709  checking for conflicting `input` and `stdin` or `capture_output` and
15710  `stdout` or `stderr` args when they were explicitly provided but with
15711  `None` values within a passed in `**kwargs` dict rather than as passed
15712  directly by name. Patch contributed by Rémi Lapeyre.
15713
15714- bpo-37173: The exception message for ``inspect.getfile()`` now correctly
15715  reports the passed class rather than the builtins module.
15716
15717- bpo-37178: Give math.perm() a one argument form that means the same as
15718  math.factorial().
15719
15720- bpo-37178: For math.perm(n, k), let k default to n, giving the same result
15721  as factorial.
15722
15723- bpo-37165: Converted _collections._count_elements to use the Argument
15724  Clinic.
15725
15726- bpo-34767: Do not always create a :class:`collections.deque` in
15727  :class:`asyncio.Lock`.
15728
15729- bpo-37158: Speed-up statistics.fmean() by switching from a function to a
15730  generator.
15731
15732- bpo-34282: Remove ``Enum._convert`` method, deprecated in 3.8.
15733
15734- bpo-37150: `argparse._ActionsContainer.add_argument` now throws error, if
15735  someone accidentally pass FileType class object instead of instance of
15736  FileType as `type` argument
15737
15738- bpo-28724: The socket module now has the :func:`socket.send_fds` and
15739  :func:`socket.recv.fds` methods. Contributed by Joannah Nanjekye, Shinya
15740  Okano and Victor Stinner.
15741
15742- bpo-35621: Support running asyncio subprocesses when execution event loop
15743  in a thread on UNIX.
15744
15745- bpo-36520: Lengthy email headers with UTF-8 characters are now properly
15746  encoded when they are folded. Patch by Jeffrey Kintscher.
15747
15748- bpo-30835: Fixed a bug in email parsing where a message with invalid bytes
15749  in content-transfer-encoding of a multipart message can cause an
15750  AttributeError. Patch by Andrew Donnellan.
15751
15752- bpo-31163: pathlib.Path instance's rename and replace methods now return
15753  the new Path instance.
15754
15755- bpo-25068: :class:`urllib.request.ProxyHandler` now lowercases the keys of
15756  the passed dictionary.
15757
15758- bpo-26185: Fix :func:`repr` on empty :class:`ZipInfo` object. Patch by
15759  Mickaël Schoentgen.
15760
15761- bpo-21315: Email headers containing RFC2047 encoded words are parsed
15762  despite the missing whitespace, and a defect registered. Also missing
15763  trailing whitespace after encoded words is now registered as a defect.
15764
15765- bpo-31904: Port test_datetime to VxWorks: skip zoneinfo tests on VxWorks
15766
15767- bpo-35805: Add parser for Message-ID header and add it to default
15768  HeaderRegistry. This should prevent folding of Message-ID using RFC 2048
15769  encoded words.
15770
15771- bpo-36871: Ensure method signature is used instead of constructor
15772  signature of a class while asserting mock object against method calls.
15773  Patch by Karthikeyan Singaravelan.
15774
15775- bpo-35070: posix.getgrouplist() now works correctly when the user belongs
15776  to NGROUPS_MAX supplemental groups. Patch by Jeffrey Kintscher.
15777
15778- bpo-31783: Fix race condition in ThreadPoolExecutor when worker threads
15779  are created during interpreter shutdown.
15780
15781- bpo-36582: Fix ``UserString.encode()`` to correctly return ``bytes``
15782  rather than a ``UserString`` instance.
15783
15784- bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of
15785  copy.copy().
15786
15787  Patch by Gordon P. Hemsley
15788
15789- bpo-36564: Fix infinite loop in email header folding logic that would be
15790  triggered when an email policy's max_line_length is not long enough to
15791  include the required markup and any values in the message. Patch by Paul
15792  Ganssle
15793
15794- bpo-36543: Removed methods Element.getchildren(), Element.getiterator()
15795  and ElementTree.getiterator() and the xml.etree.cElementTree module.
15796
15797- bpo-36409: Remove the old plistlib API deprecated in Python 3.4
15798
15799- bpo-36302: distutils sorts source file lists so that Extension .so files
15800  build more reproducibly by default
15801
15802- bpo-36250: Ignore ``ValueError`` from ``signal`` with ``interaction`` in
15803  non-main thread.
15804
15805- bpo-36046: Added ``user``, ``group`` and ``extra_groups`` parameters to
15806  the subprocess.Popen constructor. Patch by Patrick McLean.
15807
15808- bpo-32627: Fix compile error when ``_uuid`` headers conflicting included.
15809
15810- bpo-35800: Deprecate ``smtpd.MailmanProxy`` ready for future removal.
15811
15812- bpo-35168: :attr:`shlex.shlex.punctuation_chars` is now a read-only
15813  property.
15814
15815- bpo-8538: Add support for boolean actions like ``--foo`` and ``--no-foo``
15816  to argparse. Patch contributed by Rémi Lapeyre.
15817
15818- bpo-20504: Fixes a bug in :mod:`cgi` module when a multipart/form-data
15819  request has no `Content-Length` header.
15820
15821- bpo-25988: The abstract base classes in :mod:`collections.abc` no longer
15822  are exposed in the regular :mod:`collections` module.
15823
15824- bpo-11122: Distutils won't check for rpmbuild in specified paths only.
15825
15826- bpo-34775: Division handling of PurePath now returns NotImplemented
15827  instead of raising a TypeError when passed something other than an
15828  instance of str or PurePath. Patch by Roger Aiudi.
15829
15830- bpo-34749: :func:`binascii.a2b_base64` is now up to 2 times faster. Patch
15831  by Sergey Fedoseev.
15832
15833- bpo-34519: Add additional aliases for HP Roman 8. Patch by Michael Osipov.
15834
15835- bpo-28009: Fix uuid.getnode() on platforms with '.' as MAC Addr delimiter
15836  as well fix for MAC Addr format that omits a leading 0 in MAC Addr values.
15837  Currently, AIX is the only know platform with these settings. Patch by
15838  Michael Felt.
15839
15840- bpo-30618: Add :meth:`~pathlib.Path.readlink`. Patch by Girts Folkmanis.
15841
15842- bpo-32498: Made :func:`urllib.parse.unquote()` accept bytes in addition to
15843  strings. Patch by Stein Karlsen.
15844
15845- bpo-33348: lib2to3 now recognizes expressions after ``*`` and `**` like in
15846  ``f(*[] or [])``.
15847
15848- bpo-32689: Update :func:`shutil.move` function to allow for Path objects
15849  to be used as source argument. Patch by Emily Morehouse and Maxwell
15850  "5.13b" McKinnon.
15851
15852- bpo-32820: Added __format__ to IPv4 and IPv6 classes.  Always outputs a
15853  fully zero- padded string. Supports b/x/n modifiers (bin/hex/native
15854  format).  Native format for IPv4 is bin, native format for IPv6 is hex.
15855  Also supports '#' and '_' modifiers.
15856
15857- bpo-27657: Fix urllib.parse.urlparse() with numeric paths. A string like
15858  "path:80" is no longer parsed as a path but as a scheme ("path") and a
15859  path ("80").
15860
15861- bpo-4963: Fixed non-deterministic behavior related to mimetypes extension
15862  mapping and module reinitialization.
15863
15864Documentation
15865-------------
15866
15867- bpo-21767: Explicitly mention abc support in functools.singledispatch
15868
15869- bpo-38816: Provides more details about the interaction between
15870  :c:func:`fork` and CPython's runtime, focusing just on the C-API.  This
15871  includes cautions about where :c:func:`fork` should and shouldn't be
15872  called.
15873
15874- bpo-38351: Modernize :mod:`email` examples from %-formatting to f-strings.
15875
15876- bpo-38778: Document the fact that :exc:`RuntimeError` is raised if
15877  :meth:`os.fork` is called in a subinterpreter.
15878
15879- bpo-38592: Add Brazilian Portuguese to the language switcher at Python
15880  Documentation website.
15881
15882- bpo-38294: Add list of no-longer-escaped chars to re.escape documentation
15883
15884- bpo-38053: Modernized the plistlib documentation
15885
15886- bpo-26868: Fix example usage of :c:func:`PyModule_AddObject` to properly
15887  handle errors.
15888
15889- bpo-36797: Fix a dead link in the distutils API Reference.
15890
15891- bpo-37977: Warn more strongly and clearly about pickle insecurity
15892
15893- bpo-37979: Added a link to dateutil.parser.isoparse in the
15894  datetime.fromisoformat documentation. Patch by Paul Ganssle
15895
15896- bpo-12707: Deprecate info(), geturl(), getcode() methods in favor of the
15897  headers, url, and status properties, respectively, for HTTPResponse and
15898  addinfourl. Also deprecate the code attribute of addinfourl in favor of
15899  the status attribute. Patch by Ashwin Ramaswami
15900
15901- bpo-37937: Mention ``frame.f_trace`` in :func:`sys.settrace` docs.
15902
15903- bpo-37878: Make :c:func:`PyThreadState_DeleteCurrent` Internal.
15904
15905- bpo-37759: Beginning edits to Whatsnew 3.8
15906
15907- bpo-37726: Stop recommending getopt in the tutorial for command line
15908  argument parsing and promote argparse.
15909
15910- bpo-32910: Remove implementation-specific behaviour of how venv's
15911  Deactivate works.
15912
15913- bpo-37256: Fix wording of arguments for :class:`Request` in
15914  :mod:`urllib.request`
15915
15916- bpo-37284: Add a brief note to indicate that any new
15917  ``sys.implementation`` required attributes must go through the PEP
15918  process.
15919
15920- bpo-30088: Documented that :class:`mailbox.Maildir` constructor doesn't
15921  attempt to verify the maildir folder layout correctness. Patch by
15922  Sviatoslav Sydorenko.
15923
15924- bpo-37521: Fix `importlib` examples to insert any newly created modules
15925  via importlib.util.module_from_spec() immediately into sys.modules instead
15926  of after calling loader.exec_module().
15927
15928  Thanks to Benjamin Mintz for finding the bug.
15929
15930- bpo-37456: Slash ('/') is now part of syntax.
15931
15932- bpo-37487: Fix PyList_GetItem index description to include 0.
15933
15934- bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John
15935  Shipman, New Mexico Tech, with a link to the archive.org copy.
15936
15937- bpo-37478: Added possible exceptions to the description of os.chdir().
15938
15939- bpo-34903: Documented that in :meth:`datetime.datetime.strptime()`, the
15940  leading zero in some two-digit formats is optional. Patch by Mike Gleen.
15941
15942- bpo-36260: Add decompression pitfalls to zipfile module documentation.
15943
15944- bpo-37004: In the documentation for difflib, a note was added explicitly
15945  warning that the results of SequenceMatcher's ratio method may depend on
15946  the order of the input strings.
15947
15948- bpo-36960: Restructured the :mod:`datetime` docs in the interest of making
15949  them more user-friendly and improving readability. Patch by Brad Solomon.
15950
15951- bpo-36487: Make C-API docs clear about what the "main" interpreter is.
15952
15953- bpo-23460: The documentation for decimal string formatting using the `:g`
15954  specifier has been updated to reflect the correct exponential notation
15955  cutoff point. Original patch contributed by Tuomas Suutari.
15956
15957- bpo-35803: Document and test that ``tempfile`` functions may accept a
15958  :term:`path-like object` for the ``dir`` argument.  Patch by Anthony
15959  Sottile.
15960
15961- bpo-33944: Added a note about the intended use of code in .pth files.
15962
15963- bpo-34293: Fix the Doc/Makefile regarding PAPER environment variable and
15964  PDF builds
15965
15966- bpo-25237: Add documentation for tkinter modules
15967
15968Tests
15969-----
15970
15971- bpo-38614: Fix test_communicate() of test_asyncio.test_subprocess: use
15972  ``support.LONG_TIMEOUT`` (5 minutes), instead of just 1 minute.
15973
15974- bpo-38614: Add timeout constants to :mod:`test.support`:
15975  :data:`~test.support.LOOPBACK_TIMEOUT`,
15976  :data:`~test.support.INTERNET_TIMEOUT`,
15977  :data:`~test.support.SHORT_TIMEOUT` and
15978  :data:`~test.support.LONG_TIMEOUT`.
15979
15980- bpo-38502: test.regrtest now uses process groups in the multiprocessing
15981  mode (-jN command line option) if process groups are available: if
15982  :func:`os.setsid` and :func:`os.killpg` functions are available.
15983
15984- bpo-35998: Fix a race condition in test_asyncio.test_start_tls_server_1().
15985  Previously, there was a race condition between the test main() function
15986  which replaces the protocol and the test ServerProto protocol which sends
15987  ANSWER once it gets HELLO. Now, only the test main() function is
15988  responsible to send data, ServerProto no longer sends data.
15989
15990- bpo-38470: Fix ``test_compileall.test_compile_dir_maxlevels()`` on Windows
15991  without long path support: only create 3 subdirectories instead of between
15992  20 and 100 subdirectories.
15993
15994- bpo-37531: On timeout, regrtest no longer attempts to call
15995  ``popen.communicate()`` again: it can hang until all child processes using
15996  stdout and stderr pipes completes. Kill the worker process and ignores its
15997  output. Change also the faulthandler timeout of the main process from 1
15998  minute to 5 minutes, for Python slowest buildbots.
15999
16000- bpo-38239: Fix test_gdb for Link Time Optimization (LTO) builds.
16001
16002- bpo-38275: test_ssl now handles disabled TLS/SSL versions better.
16003  OpenSSL's crypto policy and run-time settings are recognized and tests for
16004  disabled versions are skipped. Tests also accept more TLS minimum_versions
16005  for platforms that override OpenSSL's default with strict settings.
16006
16007- bpo-38271: The private keys for test_ssl were encrypted with 3DES in
16008  traditional PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are
16009  blocked by some strict crypto policies. Use PKCS#8 format with AES256
16010  encryption instead.
16011
16012- bpo-38270: test.support now has a helper function to check for
16013  availability of a hash digest function. Several tests are refactored avoid
16014  MD5 and use SHA256 instead. Other tests are marked to use MD5 and skipped
16015  when MD5 is disabled.
16016
16017- bpo-37123: Multiprocessing test test_mymanager() now also expects
16018  -SIGTERM, not only exitcode 0. BaseManager._finalize_manager() sends
16019  SIGTERM to the manager process if it takes longer than 1 second to stop,
16020  which happens on slow buildbots.
16021
16022- bpo-38212: Multiprocessing tests: increase
16023  test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds.
16024
16025- bpo-38117: Test with OpenSSL 1.1.1d
16026
16027- bpo-38018: Increase code coverage for multiprocessing.shared_memory.
16028
16029- bpo-37805: Add tests for json.dump(..., skipkeys=True). Patch by Dong-hee
16030  Na.
16031
16032- bpo-37531: Enhance regrtest multiprocess timeout: write a message when
16033  killing a worker process, catch popen.kill() and popen.wait() exceptions,
16034  put a timeout on the second call to popen.communicate().
16035
16036- bpo-37876: Add tests for ROT-13 codec.
16037
16038- bpo-36833: Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of
16039  the :mod:`datetime` module. Patch by Joannah Nanjekye.
16040
16041- bpo-37558: Fix test_shared_memory_cleaned_after_process_termination name
16042  handling
16043
16044- bpo-37526: Add :func:`test.support.catch_threading_exception`: context
16045  manager catching :class:`threading.Thread` exception using
16046  :func:`threading.excepthook`.
16047
16048- bpo-37421: test_concurrent_futures now explicitly stops the ForkServer
16049  instance if it's running.
16050
16051- bpo-37421: multiprocessing tests now stop the ForkServer instance if it's
16052  running: close the "alive" file descriptor to ask the server to stop and
16053  then remove its UNIX address.
16054
16055- bpo-37421: test_distutils.test_build_ext() is now able to remove the
16056  temporary directory on Windows: don't import the newly built C extension
16057  ("xx") in the current process, but test it in a separated process.
16058
16059- bpo-37421: test_concurrent_futures now cleans up multiprocessing to remove
16060  immediately temporary directories created by
16061  multiprocessing.util.get_temp_dir().
16062
16063- bpo-37421: test_winconsoleio doesn't leak a temporary file anymore: use
16064  tempfile.TemporaryFile() to remove it when the test completes.
16065
16066- bpo-37421: multiprocessing tests now explicitly call ``_run_finalizers()``
16067  to immediately remove temporary directories created by tests.
16068
16069- bpo-37421: urllib.request tests now call
16070  :func:`~urllib.request.urlcleanup` to remove temporary files created by
16071  ``urlretrieve()`` tests and to clear the ``_opener`` global variable set
16072  by ``urlopen()`` and functions calling indirectly ``urlopen()``.
16073
16074- bpo-37472: Remove ``Lib/test/outstanding_bugs.py``.
16075
16076- bpo-37199: Fix test failures when IPv6 is unavailable or disabled.
16077
16078- bpo-19696: Replace deprecated method "random.choose" with "random.choice"
16079  in "test_pkg_import.py".
16080
16081- bpo-37335: Remove no longer necessary code from c locale coercion tests
16082
16083- bpo-37421: Fix test_shutil to no longer leak temporary files.
16084
16085- bpo-37411: Fix test_wsgiref.testEnviron() to no longer depend on the
16086  environment variables (don't fail if "X" variable is set).
16087
16088- bpo-37400: Fix test_os.test_chown(): use os.getgroups() rather than
16089  grp.getgrall() to get groups. Rename also the test to test_chown_gid().
16090
16091- bpo-37359: Add --cleanup option to python3 -m test to remove
16092  ``test_python_*`` directories of previous failed jobs. Add "make
16093  cleantest" to run ``python3 -m test --cleanup``.
16094
16095- bpo-37362: test_gdb no longer fails if it gets an "unexpected" message on
16096  stderr: it now ignores stderr. The purpose of test_gdb is to test that
16097  python-gdb.py commands work as expected, not to test gdb.
16098
16099- bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1()
16100
16101- bpo-37278: Fix test_asyncio ProactorLoopCtrlC: join the thread to prevent
16102  leaking a running thread and leaking a reference.
16103
16104- bpo-37261: Fix :func:`test.support.catch_unraisable_exception`: its
16105  __exit__() method now ignores unraisable exception raised when clearing
16106  its ``unraisable`` attribute.
16107
16108- bpo-37069: regrtest now uses :func:`sys.unraisablehook` to mark a test as
16109  "environment altered" (ENV_CHANGED) if it emits an "unraisable exception".
16110  Moreover, regrtest logs a warning in this case.
16111
16112  Use ``python3 -m test --fail-env-changed`` to catch unraisable exceptions
16113  in tests.
16114
16115- bpo-37252: Fix assertions in ``test_close`` and
16116  ``test_events_mask_overflow`` devpoll tests.
16117
16118- bpo-37169: Rewrite ``_PyObject_IsFreed()`` unit tests.
16119
16120- bpo-37153: ``test_venv.test_multiprocessing()`` now explicitly calls
16121  ``pool.terminate()`` to wait until the pool completes.
16122
16123- bpo-34001: Make test_ssl pass with LibreSSL. LibreSSL handles minimum and
16124  maximum TLS version differently than OpenSSL.
16125
16126- bpo-36919: Make ``test_source_encoding.test_issue2301`` implementation
16127  independent. The test will work now for both CPython and IronPython.
16128
16129- bpo-30202: Update ``test.test_importlib.test_abc`` to test
16130  ``find_spec()``.
16131
16132- bpo-28009: Modify the test_uuid logic to test when a program is available
16133  AND can be used to obtain a MACADDR as basis for an UUID. Patch by M. Felt
16134
16135- bpo-34596: Fallback to a default reason when :func:`unittest.skip` is
16136  uncalled. Patch by Naitree Zhu.
16137
16138Build
16139-----
16140
16141- bpo-38809: On Windows, build scripts will now recognize and use python.exe
16142  from an active virtual env.
16143
16144- bpo-38684: Fix _hashlib build when Blake2 is disabled, but OpenSSL
16145  supports it.
16146
16147- bpo-38468: Misc/python-config.in now uses `getvar()` for all still
16148  existing `sysconfig.get_config_var()` calls. Patch by Joannah Nanjekye.
16149
16150- bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC
16151  implementation lacks atomic_uintptr_t type which is needed by Python.
16152
16153- bpo-38301: In Solaris family, we must be sure to use ``-D_REENTRANT``.
16154  Patch by Jesús Cea Avión.
16155
16156- bpo-36002: Locate ``llvm-profdata`` and ``llvm-ar`` binaries using
16157  ``AC_PATH_TOOL`` rather than ``AC_PATH_TARGET_TOOL``.
16158
16159- bpo-37936: The :file:`.gitignore` file systematically keeps "rooted", with
16160  a non-trailing slash, all the rules that are meant to apply to files in a
16161  specific place in the repo.  Previously, when the intended file to ignore
16162  happened to be at the root of the repo, we'd most often accidentally also
16163  ignore files and directories with the same name anywhere in the tree.
16164
16165- bpo-37760: The :file:`Tools/unicode/makeunicodedata.py` script, which is
16166  used for converting information from the Unicode Character Database into
16167  generated code and data used by the methods of :class:`str` and by the
16168  :mod:`unicodedata` module, now handles each character's data as a
16169  ``dataclass`` with named attributes, rather than a length-18 list of
16170  different fields.
16171
16172- bpo-37936: The :file:`.gitignore` file no longer applies to any files that
16173  are in fact tracked in the Git repository.  Patch by Greg Price.
16174
16175- bpo-37725: Change "clean" makefile target to also clean the program guided
16176  optimization (PGO) data.  Previously you would have to use "make clean"
16177  and "make profile-removal", or "make clobber".
16178
16179- bpo-37707: Mark some individual tests to skip when --pgo is used.  The
16180  tests marked increase the PGO task time significantly and likely don't
16181  help improve optimization of the final executable.
16182
16183- bpo-36044: Reduce the number of unit tests run for the PGO generation
16184  task.  This speeds up the task by a factor of about 15x.  Running the full
16185  unit test suite is slow.  This change may result in a slightly less
16186  optimized build since not as many code branches will be executed.  If you
16187  are willing to wait for the much slower build, the old behavior can be
16188  restored using './configure [..] PROFILE_TASK="-m test --pgo-extended"'.
16189  We make no guarantees as to which PGO task set produces a faster build.
16190  Users who care should run their own relevant benchmarks as results can
16191  depend on the environment, workload, and compiler tool chain.
16192
16193- bpo-37468: ``make install`` no longer installs ``wininst-*.exe`` files
16194  used by distutils bdist_wininst: bdist_wininst only works on Windows.
16195
16196- bpo-37189: Many ``PyRun_XXX()`` functions like :c:func:`PyRun_String` were
16197  no longer exported in ``libpython38.dll`` by mistake. Export them again to
16198  fix the ABI compatibility.
16199
16200- bpo-25361: Enables use of SSE2 instructions in Windows 32-bit build.
16201
16202- bpo-36210: Update optional extension module detection for AIX. ossaudiodev
16203  and spwd are not applicable for AIX, and are no longer reported as
16204  missing. 3rd-party packaging of ncurses (with ASIS support) conflicts with
16205  officially supported AIX curses library, so configure AIX to use
16206  libcurses.a. However, skip trying to build _curses_panel.
16207
16208  patch by M Felt
16209
16210Windows
16211-------
16212
16213- bpo-38589: Fixes HTML Help shortcut when Windows is not installed to C
16214  drive
16215
16216- bpo-38453: Ensure ntpath.realpath() correctly resolves relative paths.
16217
16218- bpo-38519: Restores the internal C headers that were missing from the
16219  nuget.org and Microsoft Store packages.
16220
16221- bpo-38492: Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime.
16222
16223- bpo-38344: Fix error message in activate.bat
16224
16225- bpo-38359: Ensures ``pyw.exe`` launcher reads correct registry key.
16226
16227- bpo-38355: Fixes ``ntpath.realpath`` failing on ``sys.executable``.
16228
16229- bpo-38117: Update bundled OpenSSL to 1.1.1d
16230
16231- bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual
16232  environment.
16233
16234- bpo-38133: Allow py.exe launcher to locate installations from the
16235  Microsoft Store and improve display of active virtual environments.
16236
16237- bpo-38114: The ``pip.ini`` is no longer included in the Nuget package.
16238
16239- bpo-32592: Set Windows 8 as the minimum required version for API support
16240
16241- bpo-36634: :func:`os.cpu_count` now returns active processors rather than
16242  maximum processors.
16243
16244- bpo-36634: venv activate.bat now works when the existing variables contain
16245  double quote characters.
16246
16247- bpo-38081: Prevent error calling :func:`os.path.realpath` on ``'NUL'``.
16248
16249- bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath.
16250
16251- bpo-38088: Fixes distutils not finding vcruntime140.dll with only the v142
16252  toolset installed.
16253
16254- bpo-37283: Ensure command-line and unattend.xml setting override
16255  previously detected states in Windows installer.
16256
16257- bpo-38030: Fixes :func:`os.stat` failing for block devices on Windows
16258
16259- bpo-38020: Fixes potential crash when calling :func:`os.readlink` (or
16260  indirectly through :func:`~os.path.realpath`) on a file that is not a
16261  supported link.
16262
16263- bpo-37705: Improve the implementation of ``winerror_to_errno()``.
16264
16265- bpo-37549: :func:`os.dup` no longer fails for standard streams on Windows
16266  7.
16267
16268- bpo-1311: The ``nul`` file on Windows now returns True from
16269  :func:`~os.path.exists` and a valid result from :func:`os.stat` with
16270  ``S_IFCHR`` set.
16271
16272- bpo-9949: Enable support for following symlinks in :func:`os.realpath`.
16273
16274- bpo-37834: Treat all name surrogate reparse points on Windows in
16275  :func:`os.lstat` and other reparse points as regular files in
16276  :func:`os.stat`.
16277
16278- bpo-36266: Add the module name in the formatted error message when DLL
16279  load fail happens during module import in
16280  ``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati.
16281
16282- bpo-25172: Trying to import the :mod:`crypt` module on Windows will result
16283  in an :exc:`ImportError` with a message explaining that the module isn't
16284  supported on Windows. On other platforms, if the underlying ``_crypt``
16285  module is not available, the ImportError will include a message explaining
16286  the problem.
16287
16288- bpo-37778: Fixes the icons used for file associations to the Microsoft
16289  Store package.
16290
16291- bpo-37734: Fix use of registry values to launch Python from Microsoft
16292  Store app.
16293
16294- bpo-37702: Fix memory leak on Windows in creating an SSLContext object or
16295  running ``urllib.request.urlopen('https://...')``.
16296
16297- bpo-37672: Switch Windows Store package's pip to use bundled
16298  :file:`pip.ini` instead of :envvar:`PIP_USER` variable.
16299
16300- bpo-10945: Officially drop support for creating bdist_wininst installers
16301  on non-Windows systems.
16302
16303- bpo-37445: Include the ``FORMAT_MESSAGE_IGNORE_INSERTS`` flag in
16304  ``FormatMessageW()`` calls.
16305
16306- bpo-37369: Fixes path for :data:`sys.executable` when running from the
16307  Microsoft Store.
16308
16309- bpo-37380: Don't collect unfinished processes with ``subprocess._active``
16310  on Windows to cleanup later. Patch by Ruslan Kuprieiev.
16311
16312- bpo-37351: Removes libpython38.a from standard Windows distribution.
16313
16314- bpo-35360: Update Windows builds to use SQLite 3.28.0.
16315
16316- bpo-37267: On Windows, :func:`os.dup` no longer creates an inheritable fd
16317  when handling a character file.
16318
16319- bpo-36779: Ensure ``time.tzname`` is correct on Windows when the active
16320  code page is set to CP_UTF7 or CP_UTF8.
16321
16322- bpo-32587: Make :data:`winreg.REG_MULTI_SZ` support zero-length strings.
16323
16324- bpo-28269: Replace use of :c:func:`strcasecmp` for the system function
16325  :c:func:`_stricmp`. Patch by Minmin Gong.
16326
16327- bpo-36590: Add native Bluetooth RFCOMM support to socket module.
16328
16329macOS
16330-----
16331
16332- bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer.
16333
16334- bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests
16335  optional
16336
16337- bpo-18049: Increase the default stack size of threads from 5MB to 16MB on
16338  macOS, to match the stack size of the main thread. This avoids crashes on
16339  deep recursion in threads.
16340
16341- bpo-34602: Avoid test suite failures on macOS by no longer calling
16342  resource.setrlimit to increase the process stack size limit at runtime.
16343  The runtime change is no longer needed since the interpreter is being
16344  built with a larger default stack size.
16345
16346- bpo-35360: Update macOS installer to use SQLite 3.28.0.
16347
16348- bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer.
16349
16350IDLE
16351----
16352
16353- bpo-26353: Stop adding newline when saving an IDLE shell window.
16354
16355- bpo-4630: Add an option to toggle IDLE's cursor blink for shell, editor,
16356  and output windows.  See Settings, General, Window Preferences, Cursor
16357  Blink. Patch by Zackery Spytz.
16358
16359- bpo-38598: Do not try to compile IDLE shell or output windows
16360
16361- bpo-36698: IDLE no longer fails when write non-encodable characters to
16362  stderr.  It now escapes them with a backslash, as the regular Python
16363  interpreter. Added the ``errors`` field to the standard streams.
16364
16365- bpo-35379: When exiting IDLE, catch any AttributeError.  One happens when
16366  EditorWindow.close is called twice.  Printing a traceback, when IDLE is
16367  run from a terminal, is useless and annoying.
16368
16369- bpo-38183: To avoid problems, test_idle ignores the user config directory.
16370  It no longer tries to create or access .idlerc or any files within. Users
16371  must run IDLE to discover problems with saving settings.
16372
16373- bpo-38077: IDLE no longer adds 'argv' to the user namespace when
16374  initializing it.  This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
16375
16376- bpo-38041: Shell restart lines now fill the window width, always start
16377  with '=', and avoid wrapping unnecessarily. The line will still wrap if
16378  the included file name is long relative to the width.
16379
16380- bpo-35771: To avoid occasional spurious test_idle failures on slower
16381  machines, increase the ``hover_delay`` in test_tooltip.
16382
16383- bpo-37824: Properly handle user input warnings in IDLE shell. Cease
16384  turning SyntaxWarnings into SyntaxErrors.
16385
16386- bpo-37929: IDLE Settings dialog now closes properly when there is no shell
16387  window.
16388
16389- bpo-37902: Add mousewheel scrolling for IDLE module, path, and stack
16390  browsers. Patch by George Zhang.
16391
16392- bpo-37849: Fixed completions list appearing too high or low when shown
16393  above the current line.
16394
16395- bpo-36419: Refactor IDLE autocomplete and improve testing.
16396
16397- bpo-37748: Reorder the Run menu.  Put the most common choice, Run Module,
16398  at the top.
16399
16400- bpo-37692: Improve highlight config sample with example shell interaction
16401  and better labels for shell elements.
16402
16403- bpo-37628: Settings dialog no longer expands with font size.
16404
16405- bpo-37627: Initialize the Customize Run dialog with the command line
16406  arguments most recently entered before.  The user can optionally edit
16407  before submitting them.
16408
16409- bpo-33610: Fix code context not showing the correct context when first
16410  toggled on.
16411
16412- bpo-37530: Optimize code context to reduce unneeded background activity.
16413  Font and highlight changes now occur along with text changes instead of
16414  after a random delay.
16415
16416- bpo-27452: Cleanup ``config.py`` by inlining ``RemoveFile`` and
16417  simplifying the handling of ``file`` in ``CreateConfigHandlers``.
16418
16419- bpo-37325: Fix tab focus traversal order for help source and custom run
16420  dialogs.
16421
16422- bpo-37321: Both subprocess connection error messages now refer to the
16423  'Startup failure' section of the IDLE doc.
16424
16425- bpo-17535: Add optional line numbers for IDLE editor windows.  Windows
16426  open without line numbers unless set otherwise in the General tab of the
16427  configuration dialog.
16428
16429- bpo-26806: To compensate for stack frames added by IDLE and avoid possible
16430  problems with low recursion limits, add 30 to limits in the user code
16431  execution process.  Subtract 30 when reporting recursion limits to make
16432  this addition mostly transparent.
16433
16434- bpo-37177: Properly 'attach' search dialogs to their main window so that
16435  they behave like other dialogs and do not get hidden behind their main
16436  window.
16437
16438- bpo-37039: Adjust "Zoom Height" to individual screens by momentarily
16439  maximizing the window on first use with a particular screen.  Changing
16440  screen settings may invalidate the saved height.  While a window is
16441  maximized, "Zoom Height" has no effect.
16442
16443- bpo-35763: Make calltip reminder about '/' meaning positional-only less
16444  obtrusive by only adding it when there is room on the first line.
16445
16446- bpo-5680: Add 'Run... Customized' to the Run menu to run a module with
16447  customized settings.  Any 'command line arguments' entered are added to
16448  sys.argv. One can suppress the normal Shell main module restart.
16449
16450- bpo-36390: Gather Format menu functions into format.py.  Combine
16451  paragraph.py, rstrip.py, and format methods from editor.py.
16452
16453Tools/Demos
16454-----------
16455
16456- bpo-38118: Update Valgrind suppression file to ignore a false alarm in
16457  :c:func:`PyUnicode_Decode` when using GCC builtin strcmp().
16458
16459- bpo-38347: pathfix.py: Assume all files that end on '.py' are Python
16460  scripts when working recursively.
16461
16462- bpo-37803: pdb's ``--help`` and ``--version`` long options now work.
16463
16464- bpo-37942: Improve ArgumentClinic converter for floats.
16465
16466- bpo-37704: Remove ``Tools/scripts/h2py.py``: use cffi to access a C API in
16467  Python.
16468
16469- bpo-37675: 2to3 now works when run from a zipped standard library.
16470
16471- bpo-37034: Argument Clinic now uses the argument name on errors with
16472  keyword-only argument instead of their position. Patch contributed by Rémi
16473  Lapeyre.
16474
16475- bpo-37064: Add option -k to pathscript.py script: preserve shebang flags.
16476  Add option -a to pathscript.py script: add flags.
16477
16478C API
16479-----
16480
16481- bpo-37633: Re-export some function compatibility wrappers for macros in
16482  ``pythonrun.h``.
16483
16484- bpo-38644: Provide :c:func:`Py_EnterRecursiveCall` and
16485  :c:func:`Py_LeaveRecursiveCall` as regular functions for the limited API.
16486  Previously, there were defined as macros, but these macros didn't work
16487  with the limited API which cannot access ``PyThreadState.recursion_depth``
16488  field. Remove ``_Py_CheckRecursionLimit`` from the stable ABI.
16489
16490- bpo-38650: The global variable :c:data:`PyStructSequence_UnnamedField` is
16491  now a constant and refers to a constant string.
16492
16493- bpo-38540: Fixed possible leak in :c:func:`PyArg_Parse` and similar
16494  functions for format units ``"es#"`` and ``"et#"`` when the macro
16495  :c:macro:`PY_SSIZE_T_CLEAN` is not defined.
16496
16497- bpo-38395: Fix a crash in :class:`weakref.proxy` objects due to incorrect
16498  lifetime management when calling some associated methods that may delete
16499  the last reference to object being referenced by the proxy. Patch by Pablo
16500  Galindo.
16501
16502- bpo-36389: The ``_PyObject_CheckConsistency()`` function is now also
16503  available in release mode. For example, it can be used to debug a crash in
16504  the ``visit_decref()`` function of the GC.
16505
16506- bpo-38266: Revert the removal of PyThreadState_DeleteCurrent() with
16507  documentation.
16508
16509- bpo-38303: Update audioop extension module to use the stable ABI
16510  (PEP-384). Patch by Tyler Kieft.
16511
16512- bpo-38234: :c:func:`Py_SetPath` now sets :data:`sys.executable` to the
16513  program full path (:c:func:`Py_GetProgramFullPath`) rather than to the
16514  program name (:c:func:`Py_GetProgramName`).
16515
16516- bpo-38234: Python ignored arguments passed to :c:func:`Py_SetPath`,
16517  :c:func:`Py_SetPythonHome` and :c:func:`Py_SetProgramName`: fix Python
16518  initialization to use specified arguments.
16519
16520- bpo-38205: The :c:func:`Py_UNREACHABLE` macro now calls
16521  :c:func:`Py_FatalError`.
16522
16523- bpo-38140: Make dict and weakref offsets opaque for C heap types by
16524  passing the offsets through PyMemberDef
16525
16526- bpo-15088: The C function ``PyGen_NeedsFinalizing`` has been removed. It
16527  was not documented, tested or used anywhere within CPython after the
16528  implementation of :pep:`442`. Patch by Joannah Nanjekye. (Patch by Joannah
16529  Nanjekye)
16530
16531- bpo-36763: Options added by ``PySys_AddXOption()`` are now handled the
16532  same way than ``PyConfig.xoptions`` and command line ``-X`` options.
16533
16534- bpo-37926: Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``.
16535
16536- bpo-37879: Fix subtype_dealloc to suppress the type decref when the base
16537  type is a C heap type
16538
16539- bpo-37645: Add :c:func:`_PyObject_FunctionStr` to get a user-friendly
16540  string representation of a function-like object. Patch by Jeroen Demeyer.
16541
16542- bpo-29548: The functions ``PyEval_CallObject``, ``PyEval_CallFunction``,
16543  ``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are
16544  deprecated. Use :c:func:`PyObject_Call` and its variants instead.
16545
16546- bpo-37151: ``PyCFunction_Call`` is now a deprecated alias of
16547  :c:func:`PyObject_Call`.
16548
16549- bpo-37540: The vectorcall protocol now requires that the caller passes
16550  only strings as keyword names.
16551
16552- bpo-37207: The vectorcall protocol is now enabled for ``type`` objects:
16553  set ``tp_vectorcall`` to a vectorcall function to be used instead of
16554  ``tp_new`` and ``tp_init`` when calling the class itself.
16555
16556- bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API.
16557
16558- bpo-37483: Add new function ``_PyObject_CallOneArg`` for calling an object
16559  with one positional argument.
16560
16561- bpo-36763: Add :func:`PyConfig_SetWideStringList` function.
16562
16563- bpo-37337: Add fast functions for calling methods:
16564  :c:func:`_PyObject_VectorcallMethod`, :c:func:`_PyObject_CallMethodNoArgs`
16565  and :c:func:`_PyObject_CallMethodOneArg`.
16566
16567- bpo-28805: The :const:`METH_FASTCALL` calling convention has been
16568  documented.
16569
16570- bpo-37221: The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to
16571  create code objects like :c:func:`PyCode_New`, but with an extra
16572  *posonlyargcount* parameter for indicating the number of positonal-only
16573  arguments.
16574
16575- bpo-37215: Fix dtrace issue introduce by bpo-36842
16576
16577- bpo-37194: Add a new public :c:func:`PyObject_CallNoArgs` function to the
16578  C API: call a callable Python object without any arguments. It is the most
16579  efficient way to call a callback without any argument. On x86-64, for
16580  example, ``PyObject_CallFunctionObjArgs(func, NULL)`` allocates 960 bytes
16581  on the stack per call, whereas ``PyObject_CallNoArgs(func)`` only
16582  allocates 624 bytes per call.
16583
16584- bpo-37170: Fix the cast on error in
16585  :c:func:`PyLong_AsUnsignedLongLongMask()`.
16586
16587- bpo-35381: Convert posixmodule.c statically allocated types
16588  ``DirEntryType`` and ``ScandirIteratorType`` to heap-allocated types.
16589
16590- bpo-34331: Use singular/plural noun in error message when instantiating an
16591  abstract class with non-overriden abstract method(s).
16592
16593
16594What's New in Python 3.8.0 beta 1?
16595==================================
16596
16597*Release date: 2019-06-04*
16598
16599Security
16600--------
16601
16602- bpo-35907: CVE-2019-9948: Avoid file reading by disallowing
16603  ``local-file://`` and ``local_file://`` URL schemes in
16604  ``URLopener().open()`` and ``URLopener().retrieve()`` of
16605  :mod:`urllib.request`.
16606
16607- bpo-33529: Prevent fold function used in email header encoding from
16608  entering infinite loop when there are too many non-ASCII characters in a
16609  header.
16610
16611- bpo-33164: Updated blake2 implementation which uses secure memset
16612  implementation provided by platform.
16613
16614Core and Builtins
16615-----------------
16616
16617- bpo-35814: Allow unpacking in the right hand side of annotated
16618  assignments. In particular, ``t: Tuple[int, ...] = x, y, *z`` is now
16619  allowed.
16620
16621- bpo-37126: All structseq objects are now tracked by the garbage collector.
16622  Patch by Pablo Galindo.
16623
16624- bpo-37122: Make the *co_argcount* attribute of code objects represent the
16625  total number of positional arguments (including positional-only
16626  arguments). The value of *co_posonlyargcount* can be used to distinguish
16627  which arguments are positional only, and the difference (*co_argcount* -
16628  *co_posonlyargcount*) is the number of positional-or-keyword arguments.
16629  Patch by Pablo Galindo.
16630
16631- bpo-20092: Constructors of :class:`int`, :class:`float` and
16632  :class:`complex` will now use the :meth:`~object.__index__` special
16633  method, if available and the corresponding method :meth:`~object.__int__`,
16634  :meth:`~object.__float__` or :meth:`~object.__complex__` is not available.
16635
16636- bpo-37087: Add native thread ID (TID) support to OpenBSD.
16637
16638- bpo-26219: Implemented per opcode cache mechanism and ``LOAD_GLOBAL``
16639  instruction use it. ``LOAD_GLOBAL`` is now about 40% faster. Contributed
16640  by Yury Selivanov, and Inada Naoki.
16641
16642- bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL.
16643
16644- bpo-37029: Freeing a great many small objects could take time quadratic in
16645  the number of arenas, due to using linear search to keep ``obmalloc.c``'s
16646  list of usable arenas sorted by order of number of free memory pools.
16647  This is accomplished without search now, leaving the worst-case time
16648  linear in the number of arenas.  For programs where this quite visibly
16649  matters (typically with more than 100 thousand small objects alive
16650  simultaneously), this can greatly reduce the time needed to release their
16651  memory.
16652
16653- bpo-26423: Fix possible overflow in ``wrap_lenfunc()`` when ``sizeof(long)
16654  < sizeof(Py_ssize_t)`` (e.g., 64-bit Windows).
16655
16656- bpo-37050: Improve the AST for "debug" f-strings, which use '=' to print
16657  out the source of the expression being evaluated.  Delete expr_text from
16658  the FormattedValue node, and instead use a Constant string node (possibly
16659  merged with adjacent constant expressions inside the f-string).
16660
16661- bpo-22385: The `bytes.hex`, `bytearray.hex`, and `memoryview.hex` methods
16662  as well as the `binascii.hexlify` and `b2a_hex` functions now have the
16663  ability to include an optional separator between hex bytes.  This
16664  functionality was inspired by MicroPython's hexlify implementation.
16665
16666- bpo-26836: Add :func:`os.memfd_create`.
16667
16668- bpo-37032: Added new ``replace()`` method to the code type
16669  (:class:`types.CodeType`).
16670
16671- bpo-37007: Implement :func:`socket.if_nameindex()`,
16672  :func:`socket.if_nametoindex()`, and :func:`socket.if_indextoname()` on
16673  Windows.
16674
16675- bpo-36829: :c:func:`PyErr_WriteUnraisable` now creates a traceback object
16676  if there is no current traceback. Moreover, call
16677  :c:func:`PyErr_NormalizeException` and :c:func:`PyException_SetTraceback`
16678  to normalize the exception value. Ignore any error.
16679
16680- bpo-36878: Only accept text after `# type: ignore` if the first character
16681  is ASCII. This is to disallow things like `# type: ignoreé`.
16682
16683- bpo-36878: Store text appearing after a `# type: ignore` comment in the
16684  AST. For example a type ignore like `# type: ignore[E1000]` will have the
16685  string `"[E1000]"` stored in its AST node.
16686
16687- bpo-2180: Treat line continuation at EOF as a ``SyntaxError`` by Anthony
16688  Sottile.
16689
16690- bpo-36907: Fix a crash when calling a C function with a keyword dict
16691  (``f(**kwargs)``) and changing the dict ``kwargs`` while that function is
16692  running.
16693
16694- bpo-36946: Fix possible signed integer overflow when handling slices.
16695
16696- bpo-36826: Add NamedExpression kind support to ast_unparse.c
16697
16698- bpo-1875: A :exc:`SyntaxError` is now raised if a code blocks that will be
16699  optimized away (e.g. if conditions that are always false) contains syntax
16700  errors. Patch by Pablo Galindo.
16701
16702- bpo-36027: Allow computation of modular inverses via three-argument
16703  ``pow``: the second argument is now permitted to be negative in the case
16704  where the first and third arguments are relatively prime.
16705
16706- bpo-36861: Update the Unicode database to version 12.1.0.
16707
16708- bpo-28866: Avoid caching attributes of classes which type defines mro() to
16709  avoid a hard cache invalidation problem.
16710
16711- bpo-36851: The ``FrameType`` stack is now correctly cleaned up if the
16712  execution ends with a return and the stack is not empty.
16713
16714- bpo-34616: The ``compile()`` builtin functions now support the
16715  ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag,  which allow to compile sources
16716  that  contains top-level ``await``, ``async with`` or ``async for``. This
16717  is useful to evaluate async-code from with an already async functions; for
16718  example in a custom REPL.
16719
16720- bpo-36842: Implement PEP 578, adding sys.audit, io.open_code and related
16721  APIs.
16722
16723- bpo-27639: Correct return type for UserList slicing operations. Patch by
16724  Michael Blahay, Erick Cervantes, and vaultah
16725
16726- bpo-36737: Move PyRuntimeState.warnings into per-interpreter state (via
16727  "module state").
16728
16729- bpo-36793: Removed ``__str__`` implementations from builtin types
16730  :class:`bool`, :class:`int`, :class:`float`, :class:`complex` and few
16731  classes from the standard library. They now inherit ``__str__()`` from
16732  :class:`object`.
16733
16734- bpo-36817: Add a ``=`` feature f-strings for debugging. This can precede
16735  ``!s``, ``!r``, or ``!a``. It produces the text of the expression,
16736  followed by an equal sign, followed by the repr of the value of the
16737  expression. So ``f'{3*9+15=}'`` would be equal to the string
16738  ``'3*9+15=42'``.  If ``=`` is specified, the default conversion is set to
16739  ``!r``, unless a format spec is given, in which case the formatting
16740  behavior is unchanged, and __format__ will be used.
16741
16742- bpo-24048: Save the live exception during import.c's ``remove_module()``.
16743
16744- bpo-27987: pymalloc returns memory blocks aligned by 16 bytes, instead of
16745  8 bytes, on 64-bit platforms to conform x86-64 ABI. Recent compilers
16746  assume this alignment more often. Patch by Inada Naoki.
16747
16748- bpo-36601: A long-since-meaningless check for ``getpid() == main_pid`` was
16749  removed from Python's internal C signal handler.
16750
16751- bpo-36594: Fix incorrect use of ``%p`` in format strings. Patch by Zackery
16752  Spytz.
16753
16754- bpo-36045: builtins.help() now prefixes `async` for async functions
16755
16756- bpo-36084: Add native thread ID (TID) to threading.Thread objects
16757  (supported platforms: Windows, FreeBSD, Linux, macOS)
16758
16759- bpo-36035: Added fix for broken symlinks in combination with pathlib
16760
16761- bpo-35983: Added new trashcan macros to deal with a double deallocation
16762  that could occur when the `tp_dealloc` of a subclass calls the
16763  `tp_dealloc` of a base class and that base class uses the trashcan
16764  mechanism. Patch by Jeroen Demeyer.
16765
16766- bpo-20602: Do not clear :data:`sys.flags` and :data:`sys.float_info`
16767  during shutdown. Patch by Zackery Spytz.
16768
16769- bpo-26826: Expose :func:`copy_file_range` as a low level API in the
16770  :mod:`os` module.
16771
16772- bpo-32388: Remove cross-version binary compatibility requirement in
16773  tp_flags.
16774
16775- bpo-31862: Port binascii to PEP 489 multiphase initialization. Patch by
16776  Marcel Plch.
16777
16778Library
16779-------
16780
16781- bpo-37128: Added :func:`math.perm`.
16782
16783- bpo-37120: Add SSLContext.num_tickets to control the number of TLSv1.3
16784  session tickets.
16785
16786- bpo-12202: Fix the error handling in
16787  :meth:`msilib.SummaryInformation.GetProperty`. Patch by Zackery Spytz.
16788
16789- bpo-26835: The fcntl module now contains file sealing constants for
16790  sealing of memfds.
16791
16792- bpo-29262: Add ``get_origin()`` and ``get_args()`` introspection helpers
16793  to ``typing`` module.
16794
16795- bpo-12639: :meth:`msilib.Directory.start_component()` no longer fails if
16796  *keyfile* is not ``None``.
16797
16798- bpo-36999: Add the ``asyncio.Task.get_coro()`` method to publicly expose
16799  the tasks's coroutine object.
16800
16801- bpo-35246: Make :func:`asyncio.create_subprocess_exec` accept path-like
16802  arguments.
16803
16804- bpo-35279: Change default *max_workers* of ``ThreadPoolExecutor`` from
16805  ``cpu_count() * 5`` to ``min(32, cpu_count() + 4)``.  Previous value was
16806  unreasonably large on many cores machines.
16807
16808- bpo-37076: :func:`_thread.start_new_thread` now logs uncaught exception
16809  raised by the function using :func:`sys.unraisablehook`, rather than
16810  :func:`sys.excepthook`, so the hook gets access to the function which
16811  raised the exception.
16812
16813- bpo-33725: On macOS, the :mod:`multiprocessing` module now uses *spawn*
16814  start method by default.
16815
16816- bpo-37054: Fix destructor :class:`_pyio.BytesIO` and
16817  :class:`_pyio.TextIOWrapper`: initialize their ``_buffer`` attribute as
16818  soon as possible (in the class body), because it's used by ``__del__()``
16819  which calls ``close()``.
16820
16821- bpo-37058: PEP 544: Add ``Protocol`` and ``@runtime_checkable`` to the
16822  ``typing`` module.
16823
16824- bpo-36933: The functions ``sys.set_coroutine_wrapper`` and
16825  ``sys.get_coroutine_wrapper`` that were deprecated and marked for removal
16826  in 3.8 have been removed.
16827
16828- bpo-37047: Handle late binding and attribute access in
16829  :class:`unittest.mock.AsyncMock` setup for autospeccing. Document newly
16830  implemented async methods in :class:`unittest.mock.MagicMock`.
16831
16832- bpo-37049: PEP 589: Add ``TypedDict`` to the ``typing`` module.
16833
16834- bpo-37046: PEP 586: Add ``Literal`` to the ``typing`` module.
16835
16836- bpo-37045: PEP 591: Add ``Final`` qualifier and ``@final`` decorator to
16837  the ``typing`` module.
16838
16839- bpo-37035: Don't log OSError based exceptions if a fatal error has
16840  occurred in asyncio transport. Peer can generate almost any OSError, user
16841  cannot avoid these exceptions by fixing own code. Errors are still
16842  propagated to user code, it's just logging them is pointless and pollute
16843  asyncio logs.
16844
16845- bpo-37001: :func:`symtable.symtable` now accepts the same input types for
16846  source code as the built-in :func:`compile` function. Patch by Dino
16847  Viehland.
16848
16849- bpo-37028: Implement asyncio REPL
16850
16851- bpo-37027: Return safe to use proxy socket object from
16852  transport.get_extra_info('socket')
16853
16854- bpo-32528: Make asyncio.CancelledError a BaseException.
16855
16856  This will address the common mistake many asyncio users make: an "except
16857  Exception" clause breaking Tasks cancellation.
16858
16859  In addition to this change, we stop inheriting asyncio.TimeoutError and
16860  asyncio.InvalidStateError from their concurrent.futures.* counterparts.
16861  There's no point for these exceptions to share the inheritance chain.
16862
16863- bpo-1230540: Add a new :func:`threading.excepthook` function which handles
16864  uncaught :meth:`threading.Thread.run` exception. It can be overridden to
16865  control how uncaught :meth:`threading.Thread.run` exceptions are handled.
16866
16867- bpo-36996: Handle :func:`unittest.mock.patch` used as a decorator on async
16868  functions.
16869
16870- bpo-37008: Add support for calling :func:`next` with the mock resulting
16871  from :func:`unittest.mock.mock_open`
16872
16873- bpo-27737: Allow whitespace only header encoding in ``email.header`` - by
16874  Batuhan Taskaya
16875
16876- bpo-36969: PDB command `args` now  display positional only arguments.
16877  Patch contributed by Rémi Lapeyre.
16878
16879- bpo-36969: PDB command `args` now  display keyword only arguments. Patch
16880  contributed by Rémi Lapeyre.
16881
16882- bpo-36983: Add missing names to ``typing.__all__``: ``ChainMap``,
16883  ``ForwardRef``, ``OrderedDict`` - by Anthony Sottile.
16884
16885- bpo-36972: Add SupportsIndex protocol to the typing module to allow type
16886  checking to detect classes that can be passed to `hex()`, `oct()` and
16887  `bin()`.
16888
16889- bpo-32972: Implement ``unittest.IsolatedAsyncioTestCase`` to help testing
16890  asyncio-based code.
16891
16892- bpo-36952: :func:`fileinput.input` and :class:`fileinput.FileInput`
16893  **bufsize** argument has been removed (was deprecated and ignored since
16894  Python 3.6), and as a result the **mode** and **openhook** arguments have
16895  been made keyword-only.
16896
16897- bpo-36952: Starting with Python 3.3, importing ABCs from
16898  :mod:`collections` is deprecated, and import should be done from
16899  :mod:`collections.abc`. Still being able to import from :mod:`collections`
16900  was marked for removal in 3.8, but has been delayed to 3.9; documentation
16901  and ``DeprecationWarning`` clarified.
16902
16903- bpo-36949: Implement __repr__ for WeakSet objects.
16904
16905- bpo-36948: Fix :exc:`NameError` in
16906  :meth:`urllib.request.URLopener.retrieve`. Patch by Karthikeyan
16907  Singaravelan.
16908
16909- bpo-33524: Fix the folding of email header when the max_line_length is 0
16910  or None and the header contains non-ascii characters.  Contributed by
16911  Licht Takeuchi (@Licht-T).
16912
16913- bpo-24564: :func:`shutil.copystat` now ignores :const:`errno.EINVAL` on
16914  :func:`os.setxattr` which may occur when copying files on filesystems
16915  without extended attributes support.
16916
16917  Original patch by Giampaolo Rodola, updated by Ying Wang.
16918
16919- bpo-36888: Python child processes can now access the status of their
16920  parent process using multiprocessing.process.parent_process
16921
16922- bpo-36921: Deprecate ``@coroutine`` for sake of ``async def``.
16923
16924- bpo-25652: Fix bug in ``__rmod__`` of ``UserString`` - by Batuhan Taskaya.
16925
16926- bpo-36916: Remove a message about an unhandled exception in a task when
16927  writer.write() is used without await and writer.drain() fails with an
16928  exception.
16929
16930- bpo-36889: Introduce :class:`asyncio.Stream` class that merges
16931  :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`
16932  functionality. :class:`asyncio.Stream` can work in readonly, writeonly and
16933  readwrite modes. Provide :func:`asyncio.connect`,
16934  :func:`asyncio.connect_unix`, :func:`asyncio.connect_read_pipe` and
16935  :func:`asyncio.connect_write_pipe` factories to open
16936  :class:`asyncio.Stream` connections. Provide :class:`asyncio.StreamServer`
16937  and :class:`UnixStreamServer` to serve servers with asyncio.Stream API.
16938  Modify :func:`asyncio.create_subprocess_shell` and
16939  :func:`asyncio.create_subprocess_exec` to use :class:`asyncio.Stream`
16940  instead of deprecated :class:`StreamReader` and :class:`StreamWriter`.
16941  Deprecate :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`.
16942  Deprecate usage of private classes, e.g.
16943  :class:`asyncio.FlowControlMixing` and
16944  :class:`asyncio.StreamReaderProtocol` outside of asyncio package.
16945
16946- bpo-36845: Added validation of integer prefixes to the construction of IP
16947  networks and interfaces in the ipaddress module.
16948
16949- bpo-23378: Add an extend action to argparser.
16950
16951- bpo-36867: Fix a bug making a SharedMemoryManager instance and its parent
16952  process use two separate resource_tracker processes.
16953
16954- bpo-23896: Adds a grammar to lib2to3.pygram that contains exec as a
16955  function not as statement.
16956
16957- bpo-36895: The function ``time.clock()`` was deprecated in 3.3 in favor of
16958  ``time.perf_counter()`` and marked for removal in 3.8, it has removed.
16959
16960- bpo-35545: Fix asyncio discarding IPv6 scopes when ensuring hostname
16961  resolutions internally
16962
16963- bpo-36887: Add new function :func:`math.isqrt` to compute integer square
16964  roots.
16965
16966- bpo-34632: Introduce the ``importlib.metadata`` module with (provisional)
16967  support for reading metadata from third-party packages.
16968
16969- bpo-36878: When using `type_comments=True` in `ast.parse`, treat `# type:
16970  ignore` followed by a non-alphanumeric character and then arbitrary text
16971  as a type ignore, instead of requiring nothing but whitespace or another
16972  comment. This is to permit formations such as `# type: ignore[E1000]`.
16973
16974- bpo-36778: ``cp65001`` encoding (Windows code page 65001) becomes an alias
16975  to ``utf_8`` encoding.
16976
16977- bpo-36867: The multiprocessing.resource_tracker replaces the
16978  multiprocessing.semaphore_tracker module. Other than semaphores,
16979  resource_tracker also tracks shared_memory segments.
16980
16981- bpo-30262: The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3`
16982  module are not exposed to the user.  Patch by Aviv Palivoda.
16983
16984- bpo-24538: In `shutil.copystat()`, first copy extended file attributes and
16985  then file permissions, since extended attributes can only be set on the
16986  destination while it is still writeable.
16987
16988- bpo-36829: Add new :func:`sys.unraisablehook` function which can be
16989  overridden to control how "unraisable exceptions" are handled. It is
16990  called when an exception has occurred but there is no way for Python to
16991  handle it. For example, when a destructor raises an exception or during
16992  garbage collection (:func:`gc.collect`).
16993
16994- bpo-36832: Introducing ``zipfile.Path``, a pathlib-compatible wrapper for
16995  traversing zip files.
16996
16997- bpo-36814: Fix an issue where os.posix_spawnp() would incorrectly raise a
16998  TypeError when file_actions is None.
16999
17000- bpo-33110: Handle exceptions raised by functions added by
17001  concurrent.futures add_done_callback correctly when the Future has already
17002  completed.
17003
17004- bpo-26903: Limit `max_workers` in `ProcessPoolExecutor` to 61 to work
17005  around a WaitForMultipleObjects limitation.
17006
17007- bpo-36813: Fix :class:`~logging.handlers.QueueListener` to call
17008  ``queue.task_done()`` upon stopping. Patch by Bar Harel.
17009
17010- bpo-36806: Forbid creation of asyncio stream objects like StreamReader,
17011  StreamWriter, Process, and their protocols outside of asyncio package.
17012
17013- bpo-36802: Provide both sync and async calls for StreamWriter.write() and
17014  StreamWriter.close()
17015
17016- bpo-36801: Properly handle SSL connection closing in asyncio
17017  StreamWriter.drain() call.
17018
17019- bpo-36785: Implement PEP 574 (pickle protocol 5 with out-of-band buffers).
17020
17021- bpo-36772: functools.lru_cache() can now be used as a straight decorator
17022  in addition to its existing usage as a function that returns a decorator.
17023
17024- bpo-6584: Add a :exc:`~gzip.BadGzipFile` exception to the :mod:`gzip`
17025  module.
17026
17027- bpo-36748: Optimized write buffering in C implementation of
17028  ``TextIOWrapper``. Writing ASCII string to ``TextIOWrapper`` with ascii,
17029  latin1, or utf-8 encoding is about 20% faster.  Patch by Inada Naoki.
17030
17031- bpo-8138: Don't mark ``wsgiref.simple_server.SimpleServer`` as
17032  multi-threaded since ``wsgiref.simple_server.WSGIServer`` is
17033  single-threaded.
17034
17035- bpo-22640: :func:`py_compile.compile` now supports silent mode. Patch by
17036  Joannah Nanjekye
17037
17038- bpo-29183: Fix double exceptions in :class:`wsgiref.handlers.BaseHandler`
17039  by calling its :meth:`~wsgiref.handlers.BaseHandler.close` method only
17040  when no exception is raised.
17041
17042- bpo-36548: Improved the repr of regular expression flags.
17043
17044- bpo-36542: The signature of Python functions can now be overridden by
17045  specifying the ``__text_signature__`` attribute.
17046
17047- bpo-36533: Reinitialize logging.Handler locks in forked child processes
17048  instead of attempting to acquire them all in the parent before forking
17049  only to be released in the child process.  The acquire/release pattern was
17050  leading to deadlocks in code that has implemented any form of chained
17051  logging handlers that depend upon one another as the lock acquisition
17052  order cannot be guaranteed.
17053
17054- bpo-35252: Throw a TypeError instead of an AssertionError when using an
17055  invalid type annotation with singledispatch.
17056
17057- bpo-35900: Allow reduction methods to return a 6-item tuple where the 6th
17058  item specifies a custom state-setting method that's called instead of the
17059  regular ``__setstate__`` method.
17060
17061- bpo-35900: enable custom reduction callback registration for functions and
17062  classes in _pickle.c, using the new Pickler's attribute
17063  ``reducer_override``
17064
17065- bpo-36368: Fix a bug crashing SharedMemoryManager instances in interactive
17066  sessions after a ctrl-c (KeyboardInterrupt) was sent
17067
17068- bpo-31904: Fix mmap fail for VxWorks
17069
17070- bpo-27497: :meth:`csv.DictWriter.writeheader` now returns the return value
17071  of the underlying :meth:`csv.Writer.writerow` method. Patch contributed by
17072  Ashish Nitin Patil.
17073
17074- bpo-36239: Parsing .mo files now ignores comments starting and ending with
17075  #-#-#-#-#.
17076
17077- bpo-26707: Enable plistlib to read and write binary plist files that were
17078  created as a KeyedArchive file. Specifically, this allows the plistlib to
17079  process 0x80 tokens as UID objects.
17080
17081- bpo-31904: Add posix module support for VxWorks.
17082
17083- bpo-35125: Asyncio: Remove inner callback on outer cancellation in shield
17084
17085- bpo-35721: Fix :meth:`asyncio.SelectorEventLoop.subprocess_exec()` leaks
17086  file descriptors if ``Popen`` fails and called with
17087  ``stdin=subprocess.PIPE``. Patch by Niklas Fiekas.
17088
17089- bpo-31855: :func:`unittest.mock.mock_open` results now respects the
17090  argument of read([size]). Patch contributed by Rémi Lapeyre.
17091
17092- bpo-35431: Implement :func:`math.comb` that returns binomial coefficient,
17093  that computes the number of ways to choose k items from n items without
17094  repetition and without order. Patch by Yash Aggarwal and Keller Fuchs.
17095
17096- bpo-26660: Fixed permission errors in
17097  :class:`~tempfile.TemporaryDirectory` clean up. Previously
17098  ``TemporaryDirectory.cleanup()`` failed when non-writeable or
17099  non-searchable files or directories were created inside a temporary
17100  directory.
17101
17102- bpo-34271: Add debugging helpers to ssl module. It's now possible to dump
17103  key material and to trace TLS protocol. The default and stdlib contexts
17104  also support SSLKEYLOGFILE env var.
17105
17106- bpo-26467: Added AsyncMock to support using unittest to mock asyncio
17107  coroutines. Patch by Lisa Roach.
17108
17109- bpo-33569: dataclasses.InitVar: Exposes the type used to create the init
17110  var.
17111
17112- bpo-34424: Fix serialization of messages containing encoded strings when
17113  the policy.linesep is set to a multi-character string. Patch by Jens
17114  Troeger.
17115
17116- bpo-34303: Performance of :func:`functools.reduce` is slightly improved.
17117  Patch by Sergey Fedoseev.
17118
17119- bpo-33361: Fix a bug in :class:`codecs.StreamRecoder` where seeking might
17120  leave old data in a buffer and break subsequent read calls. Patch by Ammar
17121  Askar.
17122
17123- bpo-22454: The :mod:`shlex` module now exposes :func:`shlex.join`, the
17124  inverse of :func:`shlex.split`. Patch by Bo Bayles.
17125
17126- bpo-31922: :meth:`asyncio.AbstractEventLoop.create_datagram_endpoint`: Do
17127  not connect UDP socket when broadcast is allowed. This allows to receive
17128  replies after a UDP broadcast.
17129
17130- bpo-24882: Change ThreadPoolExecutor to use existing idle threads before
17131  spinning up new ones.
17132
17133- bpo-31961: Added support for bytes and path-like objects in
17134  :func:`subprocess.Popen` on Windows.  The *args* parameter now accepts a
17135  :term:`path-like object` if *shell* is ``False`` and a sequence containing
17136  bytes and path-like objects. The *executable* parameter now accepts a
17137  bytes and :term:`path-like object`. The *cwd* parameter now accepts a
17138  bytes object. Based on patch by Anders Lorentsen.
17139
17140- bpo-33123: :class:`pathlib.Path.unlink` now accepts a *missing_ok*
17141  parameter to avoid a :exc:`FileNotFoundError` from being raised. Patch by
17142  Robert Buchholz.
17143
17144- bpo-32941: Allow :class:`mmap.mmap` objects to access the madvise() system
17145  call (through :meth:`mmap.mmap.madvise`).
17146
17147- bpo-22102: Added support for ZIP files with disks set to 0. Such files are
17148  commonly created by builtin tools on Windows when use ZIP64 extension.
17149  Patch by Francisco Facioni.
17150
17151- bpo-32515: trace.py can now run modules via python3 -m trace -t --module
17152  module_name
17153
17154- bpo-32299: Changed :func:`unittest.mock.patch.dict` to return the patched
17155  dictionary when used as context manager. Patch by Vadim Tsander.
17156
17157- bpo-27141: Added a ``__copy__()`` to ``collections.UserList`` and
17158  ``collections.UserDict`` in order to correctly implement shallow copying
17159  of the objects. Patch by Bar Harel.
17160
17161- bpo-31829: ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) are now
17162  escaped in protocol 0 pickles of Unicode strings. This allows to load them
17163  without loss from files open in text mode in Python 2.
17164
17165- bpo-23395: ``_thread.interrupt_main()`` now avoids setting the Python
17166  error status if the ``SIGINT`` signal is ignored or not handled by Python.
17167
17168Documentation
17169-------------
17170
17171- bpo-36896: Clarify that some types have unstable constructor signature
17172  between Python versions.
17173
17174- bpo-36686: Improve documentation of the stdin, stdout, and stderr
17175  arguments of the ``asyncio.subprocess_exec`` function to specify which
17176  values are supported. Also mention that decoding as text is not supported.
17177
17178  Add a few tests to verify that the various values passed to the std*
17179  arguments actually work.
17180
17181- bpo-36984: Improve version added references in ``typing`` module - by
17182  Anthony Sottile.
17183
17184- bpo-36868: What's new now mentions SSLContext.hostname_checks_common_name
17185  instead of SSLContext.host_flags.
17186
17187- bpo-35924: Add a note to the ``curses.addstr()`` documentation to warn
17188  that multiline strings can cause segfaults because of an ncurses bug.
17189
17190- bpo-36783: Added C API Documentation for Time_FromTimeAndFold and
17191  PyDateTime_FromDateAndTimeAndFold as per PEP 495. Patch by Edison
17192  Abahurire.
17193
17194- bpo-36797: More of the legacy distutils documentation has been either
17195  pruned, or else more clearly marked as being retained solely until the
17196  setuptools documentation covers it independently.
17197
17198- bpo-22865: Add detail to the documentation on the `pty.spawn` function.
17199
17200- bpo-35397: Remove deprecation and document urllib.parse.unwrap(). Patch
17201  contributed by Rémi Lapeyre.
17202
17203- bpo-32995: Added the context variable in glossary.
17204
17205- bpo-33519: Clarify that `copy()` is not part of the `MutableSequence` ABC.
17206
17207- bpo-33482: Make `codecs.StreamRecoder.writelines` take a list of bytes.
17208
17209- bpo-25735: Added documentation for func factorial to indicate that returns
17210  integer values
17211
17212- bpo-20285: Expand object.__doc__ (docstring) to make it clearer. Modify
17213  pydoc.py so that help(object) lists object methods (for other classes,
17214  help omits methods of the object base class.)
17215
17216Tests
17217-----
17218
17219- bpo-37069: Modify test_coroutines, test_cprofile, test_generators,
17220  test_raise, test_ssl and test_yield_from to use
17221  :func:`test.support.catch_unraisable_exception` rather than
17222  :func:`test.support.captured_stderr`.
17223
17224- bpo-37098: Fix test_memfd_create on older Linux Kernels.
17225
17226- bpo-37081: Test with OpenSSL 1.1.1c
17227
17228- bpo-36829: Add :func:`test.support.catch_unraisable_exception`: context
17229  manager catching unraisable exception using :func:`sys.unraisablehook`.
17230
17231- bpo-36915: The main regrtest process now always removes all temporary
17232  directories of worker processes even if they crash or if they are killed
17233  on KeyboardInterrupt (CTRL+c).
17234
17235- bpo-36719: "python3 -m test -jN ..." now continues the execution of next
17236  tests when a worker process crash (CHILD_ERROR state). Previously, the
17237  test suite stopped immediately. Use --failfast to stop at the first error.
17238
17239- bpo-36816: Update Lib/test/selfsigned_pythontestdotnet.pem to match
17240  self-signed.pythontest.net's new TLS certificate.
17241
17242- bpo-35925: Skip httplib and nntplib networking tests when they would
17243  otherwise fail due to a modern OS or distro with a default OpenSSL policy
17244  of rejecting connections to servers with weak certificates.
17245
17246- bpo-36782: Add tests for several C API functions in the :mod:`datetime`
17247  module. Patch by Edison Abahurire.
17248
17249- bpo-36342: Fix test_multiprocessing in test_venv if platform lacks
17250  functioning sem_open.
17251
17252Build
17253-----
17254
17255- bpo-36721: To embed Python into an application, a new ``--embed`` option
17256  must be passed to ``python3-config --libs --embed`` to get ``-lpython3.8``
17257  (link the application to libpython). To support both 3.8 and older, try
17258  ``python3-config --libs --embed`` first and fallback to ``python3-config
17259  --libs`` (without ``--embed``) if the previous command fails.
17260
17261  Add a pkg-config ``python-3.8-embed`` module to embed Python into an
17262  application: ``pkg-config python-3.8-embed --libs`` includes
17263  ``-lpython3.8``. To support both 3.8 and older, try ``pkg-config
17264  python-X.Y-embed --libs`` first and fallback to ``pkg-config python-X.Y
17265  --libs`` (without ``--embed``) if the previous command fails (replace
17266  ``X.Y`` with the Python version).
17267
17268  On the other hand, ``pkg-config python3.8 --libs`` no longer contains
17269  ``-lpython3.8``. C extensions must not be linked to libpython (except on
17270  Android, case handled by the script); this change is backward incompatible
17271  on purpose.
17272
17273- bpo-36786: "make install" now runs compileall in parallel.
17274
17275Windows
17276-------
17277
17278- bpo-36965: include of STATUS_CONTROL_C_EXIT without depending on MSC
17279  compiler
17280
17281- bpo-35926: Update to OpenSSL 1.1.1b for Windows.
17282
17283- bpo-29883: Add Windows support for UDP transports for the Proactor Event
17284  Loop. Patch by Adam Meily.
17285
17286- bpo-33407: The :c:macro:`Py_DEPRECATED()` macro has been implemented for
17287  MSVC.
17288
17289macOS
17290-----
17291
17292- bpo-36231: Support building Python on macOS without /usr/include
17293  installed. As of macOS 10.14, system header files are only available
17294  within an SDK provided by either the Command Line Tools or the Xcode app.
17295
17296IDLE
17297----
17298
17299- bpo-35610: Replace now redundant .context_use_ps1 with .prompt_last_line.
17300  This finishes change started in bpo-31858.
17301
17302- bpo-37038: Make idlelib.run runnable; add test clause.
17303
17304- bpo-36958: Print any argument other than None or int passed to SystemExit
17305  or sys.exit().
17306
17307- bpo-36807: When saving a file, call os.fsync() so bits are flushed to e.g.
17308  USB drive.
17309
17310- bpo-32411: In browser.py, remove extraneous sorting by line number since
17311  dictionary was created in line number order.
17312
17313Tools/Demos
17314-----------
17315
17316- bpo-37053: Handle strings like u"bar" correctly in
17317  Tools/parser/unparse.py. Patch by Chih-Hsuan Yen.
17318
17319C API
17320-----
17321
17322- bpo-36763: Implement the :pep:`587` "Python Initialization Configuration".
17323
17324- bpo-36379: Fix crashes when attempting to use the *modulo* parameter when
17325  ``__ipow__`` is implemented in C.
17326
17327- bpo-37107: Update :c:func:`PyObject_CallMethodObjArgs` and
17328  ``_PyObject_CallMethodIdObjArgs`` to use ``_PyObject_GetMethod`` to avoid
17329  creating a bound method object in many cases. Patch by Michael J.
17330  Sullivan.
17331
17332- bpo-36974: Implement :pep:`590`: Vectorcall: a fast calling protocol for
17333  CPython. This is a new protocol to optimize calls of custom callable
17334  objects.
17335
17336- bpo-36763: ``Py_Main()`` now returns the exitcode rather than calling
17337  ``Py_Exit(exitcode)`` when calling ``PyErr_Print()`` if the current
17338  exception type is ``SystemExit``.
17339
17340- bpo-36922: Add new type flag ``Py_TPFLAGS_METHOD_DESCRIPTOR`` for objects
17341  behaving like unbound methods. These are objects supporting the
17342  optimization given by the ``LOAD_METHOD``/``CALL_METHOD`` opcodes. See PEP
17343  590.
17344
17345- bpo-36728: The :c:func:`PyEval_ReInitThreads` function has been removed
17346  from the C API. It should not be called explicitly: use
17347  :c:func:`PyOS_AfterFork_Child` instead.
17348
17349
17350What's New in Python 3.8.0 alpha 4?
17351===================================
17352
17353*Release date: 2019-05-06*
17354
17355Security
17356--------
17357
17358- bpo-36742: Fixes mishandling of pre-normalization characters in
17359  urlsplit().
17360
17361- bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded
17362  whitespace or control characters through into the underlying http client
17363  request.  Such potentially malicious header injection URLs now cause an
17364  http.client.InvalidURL exception to be raised.
17365
17366- bpo-35755: :func:`shutil.which` now uses ``os.confstr("CS_PATH")`` if
17367  available and if the :envvar:`PATH` environment variable is not set.
17368  Remove also the current directory from :data:`posixpath.defpath`. On Unix,
17369  :func:`shutil.which` and the :mod:`subprocess` module no longer search the
17370  executable in the current directory if the :envvar:`PATH` environment
17371  variable is not set.
17372
17373Core and Builtins
17374-----------------
17375
17376- bpo-36722: In debug build, import now also looks for C extensions compiled
17377  in release mode and for C extensions compiled in the stable ABI.
17378
17379- bpo-32849: Fix Python Initialization code on FreeBSD to detect properly
17380  when stdin file descriptor (fd 0) is invalid.
17381
17382- bpo-36623: Remove parser headers and related function declarations that
17383  lack implementations after the removal of pgen.
17384
17385- bpo-20180: ``dict.pop()`` is now up to 33% faster thanks to Argument
17386  Clinic. Patch by Inada Naoki.
17387
17388- bpo-36611: Debug memory allocators: disable serialno field by default from
17389  debug hooks on Python memory allocators to reduce the memory footprint by
17390  5%. Enable :mod:`tracemalloc` to get the traceback where a memory block
17391  has been allocated when a fatal memory error is logged to decide where to
17392  put a breakpoint. Compile Python with ``PYMEM_DEBUG_SERIALNO`` defined to
17393  get back the field.
17394
17395- bpo-36588: On AIX, :attr:`sys.platform` doesn't contain the major version
17396  anymore. Always return ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``.
17397  Since older Python versions include the version number, it is recommended
17398  to always use ``sys.platform.startswith('aix')``. Contributed by M. Felt.
17399
17400- bpo-36549: Change str.capitalize to use titlecase for the first character
17401  instead of uppercase.
17402
17403- bpo-36540: Implement :pep:`570` (Python positional-only parameters). Patch
17404  by Pablo Galindo.
17405
17406- bpo-36475: :c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread`
17407  now terminate the current thread if called while the interpreter is
17408  finalizing, making them consistent with :c:func:`PyEval_RestoreThread`,
17409  :c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`.
17410
17411- bpo-36504: Fix signed integer overflow in _ctypes.c's
17412  ``PyCArrayType_new()``.
17413
17414- bpo-20844: Fix running script with encoding cookie and LF line ending may
17415  fail on Windows.
17416
17417- bpo-24214: Fixed support of the surrogatepass error handler in the UTF-8
17418  incremental decoder.
17419
17420- bpo-36452: Changing ``dict`` keys during iteration of the dict itself,
17421  ``keys()``, ``values()``, or ``items()`` will now be detected in certain
17422  corner cases where keys are deleted/added so that the number of keys isn't
17423  changed. A `RuntimeError` will be raised after ``len(dict)`` iterations.
17424  Contributed by Thomas Perl.
17425
17426- bpo-36459: Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's
17427  ``tok_nextc()``.
17428
17429- bpo-36433: Fixed TypeError message in classmethoddescr_call.
17430
17431- bpo-36430: Fix a possible reference leak in :func:`itertools.count`.
17432
17433- bpo-36440: Include node names in ``ParserError`` messages, instead of
17434  numeric IDs. Patch by A. Skrobov.
17435
17436- bpo-36143: Regenerate :mod:`keyword` from the Grammar and Tokens file
17437  using pgen. Patch by Pablo Galindo.
17438
17439- bpo-18372: Add missing :c:func:`PyObject_GC_Track` calls in the
17440  :mod:`pickle` module. Patch by Zackery Spytz.
17441
17442Library
17443-------
17444
17445- bpo-35952: Fix pythoninfo when the compiler is missing.
17446
17447- bpo-28238: The ``.find*()`` methods of xml.etree.ElementTree can now
17448  search for wildcards like ``{*}tag`` and ``{ns}*`` that match a tag in any
17449  namespace or all tags in a namespace.  Patch by Stefan Behnel.
17450
17451- bpo-26978: `pathlib.path.link_to()` is now implemented. It creates a hard
17452  link pointing to a path.
17453
17454- bpo-1613500: :class:`fileinput.FileInput` now uses the input file mode to
17455  correctly set the output file mode (previously it was hardcoded to
17456  ``'w'``)  when ``inplace=True`` is passed to its constructor.
17457
17458- bpo-36734: Fix compilation of ``faulthandler.c`` on HP-UX. Initialize
17459  ``stack_t current_stack`` to zero using ``memset()``.
17460
17461- bpo-13611: The xml.etree.ElementTree packages gained support for C14N 2.0
17462  serialisation. Patch by Stefan Behnel.
17463
17464- bpo-36669: Add missing matrix multiplication operator support to
17465  weakref.proxy.
17466
17467- bpo-36676: The XMLParser() in xml.etree.ElementTree provides namespace
17468  prefix context to the parser target if it defines the callback methods
17469  "start_ns()" and/or "end_ns()". Patch by Stefan Behnel.
17470
17471- bpo-36673: The TreeBuilder and XMLPullParser in xml.etree.ElementTree
17472  gained support for parsing comments and processing instructions. Patch by
17473  Stefan Behnel.
17474
17475- bpo-36650: The C version of functools.lru_cache() was treating calls with
17476  an empty ``**kwargs`` dictionary as being distinct from calls with no
17477  keywords at all. This did not result in an incorrect answer, but it did
17478  trigger an unexpected cache miss.
17479
17480- bpo-28552: Fix :mod:`distutils.sysconfig` if :data:`sys.executable` is
17481  ``None`` or an empty string: use :func:`os.getcwd` to initialize
17482  ``project_base``.  Fix also the distutils build command: don't use
17483  :data:`sys.executable` if it is ``None`` or an empty string.
17484
17485- bpo-35755: :func:`shutil.which` and
17486  :func:`distutils.spawn.find_executable` now use ``os.confstr("CS_PATH")``
17487  if available instead of :data:`os.defpath`, if the ``PATH`` environment
17488  variable is not set. Moreover, don't use ``os.confstr("CS_PATH")`` nor
17489  :data:`os.defpath` if the ``PATH`` environment variable is set to an empty
17490  string.
17491
17492- bpo-25430: improve performance of ``IPNetwork.__contains__()``
17493
17494- bpo-30485: Path expressions in xml.etree.ElementTree can now avoid
17495  explicit namespace prefixes for tags (or the "{namespace}tag" notation) by
17496  passing a default namespace with an empty string prefix.
17497
17498- bpo-36613: Fix :mod:`asyncio` wait() not removing callback if exception
17499
17500- bpo-36598: Fix ``isinstance`` check for Mock objects with spec when the
17501  code is executed under tracing. Patch by Karthikeyan Singaravelan.
17502
17503- bpo-18748: In development mode (:option:`-X` ``dev``) and in debug build,
17504  the :class:`io.IOBase` destructor now logs ``close()`` exceptions. These
17505  exceptions are silent by default in release mode.
17506
17507- bpo-36575: The ``_lsprof`` module now uses internal timer same to
17508  ``time.perf_counter()`` by default. ``gettimeofday(2)`` was used on Unix.
17509  New timer has better resolution on most Unix platforms and timings are no
17510  longer impacted by system clock updates since ``perf_counter()`` is
17511  monotonic. Patch by Inada Naoki.
17512
17513- bpo-33461: ``json.loads`` now emits ``DeprecationWarning`` when
17514  ``encoding`` option is specified.  Patch by Matthias Bussonnier.
17515
17516- bpo-36559: The random module now prefers the lean internal _sha512 module
17517  over hashlib for seed(version=2) to optimize import time.
17518
17519- bpo-17561: Set backlog=None as the default for socket.create_server.
17520
17521- bpo-34373: Fix :func:`time.mktime` error handling on AIX for year before
17522  1970.
17523
17524- bpo-36232: Improve error message when trying to open existing DBM database
17525  that actually doesn't exist. Patch by Marco Rougeth.
17526
17527- bpo-36546: Add statistics.quantiles()
17528
17529- bpo-36050: Optimized ``http.client.HTTPResponse.read()`` for large
17530  response. Patch by Inada Naoki.
17531
17532- bpo-36522: If *debuglevel* is set to >0 in :mod:`http.client`, print all
17533  values for headers with multiple values for the same header name. Patch by
17534  Matt Houglum.
17535
17536- bpo-36492: Deprecated passing required arguments like *func* as keyword
17537  arguments in functions which should accept arbitrary keyword arguments and
17538  pass them to other function. Arbitrary keyword arguments (even with names
17539  "self" and "func") can now be passed to these functions if the required
17540  arguments are passed as positional arguments.
17541
17542- bpo-27181: Add statistics.geometric_mean().
17543
17544- bpo-30427: ``os.path.normcase()`` relies on ``os.fspath()`` to check the
17545  type of its argument. Redundant checks have been removed from its
17546  ``posixpath.normcase()`` and ``ntpath.normcase()`` implementations. Patch
17547  by Wolfgang Maier.
17548
17549- bpo-36385: Stop rejecting IPv4 octets for being ambiguously octal. Leading
17550  zeros are ignored, and no longer are assumed to specify octal octets.
17551  Octets are always decimal numbers. Octets must still be no more than three
17552  digits, including leading zeroes.
17553
17554- bpo-36434: Errors during writing to a ZIP file no longer prevent to
17555  properly close it.
17556
17557- bpo-36407: Fixed wrong indentation writing for CDATA section in
17558  xml.dom.minidom. Patch by Vladimir Surjaninov.
17559
17560- bpo-36326: inspect.getdoc() can now find docstrings for member objects
17561  when __slots__ is a dictionary.
17562
17563- bpo-36366: Calling ``stop()`` on an unstarted or stopped
17564  :func:`unittest.mock.patch` object will now return `None` instead of
17565  raising :exc:`RuntimeError`, making the method idempotent. Patch by
17566  Karthikeyan Singaravelan.
17567
17568- bpo-36348: The :meth:`imap.IMAP4.logout` method no longer ignores silently
17569  arbitrary exceptions.
17570
17571- bpo-31904: Add time module support and fix test_time faiures for VxWorks.
17572
17573- bpo-36227: Added support for keyword arguments `default_namespace` and
17574  `xml_declaration` in functions ElementTree.tostring() and
17575  ElementTree.tostringlist().
17576
17577- bpo-36004: Added new alternate constructors
17578  :meth:`datetime.date.fromisocalendar` and
17579  :meth:`datetime.datetime.fromisocalendar`, which construct date objects
17580  from ISO year, week number and weekday; these are the inverse of each
17581  class's ``isocalendar`` method. Patch by Paul Ganssle.
17582
17583- bpo-35936: :mod:`modulefinder` no longer depends on the deprecated
17584  :mod:`imp` module, and the initializer for
17585  :class:`modulefinder.ModuleFinder` now has immutable default arguments.
17586  Patch by Brandt Bucher.
17587
17588- bpo-35376: :mod:`modulefinder` correctly handles modules that have the
17589  same name as a bad package. Patch by Brandt Bucher.
17590
17591- bpo-17396: :mod:`modulefinder` no longer crashes when encountering syntax
17592  errors in followed imports. Patch by Brandt Bucher.
17593
17594- bpo-35934: Added :meth:`~socket.create_server()` and
17595  :meth:`~socket.has_dualstack_ipv6()` convenience functions to automate the
17596  necessary tasks usually involved when creating a server socket, including
17597  accepting both IPv4 and IPv6 connections on the same socket.  (Contributed
17598  by Giampaolo Rodola in :issue:`17561`.)
17599
17600- bpo-23078: Add support for :func:`classmethod` and :func:`staticmethod` to
17601  :func:`unittest.mock.create_autospec`.  Initial patch by Felipe Ochoa.
17602
17603- bpo-35416: Fix potential resource warnings in distutils. Patch by Mickaël
17604  Schoentgen.
17605
17606- bpo-25451: Add transparency methods to :class:`tkinter.PhotoImage`.  Patch
17607  by Zackery Spytz.
17608
17609- bpo-35082: Don't return deleted attributes when calling dir on a
17610  :class:`unittest.mock.Mock`.
17611
17612- bpo-34547: :class:`wsgiref.handlers.BaseHandler` now handles abrupt client
17613  connection terminations gracefully. Patch by Petter Strandmark.
17614
17615- bpo-31658: :func:`xml.sax.parse` now supports :term:`path-like <path-like
17616  object>`. Patch by Mickaël Schoentgen.
17617
17618- bpo-34139: Remove stale unix datagram socket before binding
17619
17620- bpo-33530: Implemented Happy Eyeballs in `asyncio.create_connection()`.
17621  Added two new arguments, *happy_eyeballs_delay* and *interleave*, to
17622  specify Happy Eyeballs behavior.
17623
17624- bpo-33291: Do not raise AttributeError when calling the inspect functions
17625  isgeneratorfunction, iscoroutinefunction, isasyncgenfunction on a method
17626  created from an arbitrary callable. Instead, return False.
17627
17628- bpo-31310: Fix the multiprocessing.semaphore_tracker so it is reused by
17629  child processes
17630
17631- bpo-31292: Fix ``setup.py check --restructuredtext`` for files containing
17632  ``include`` directives.
17633
17634Documentation
17635-------------
17636
17637- bpo-36625: Remove obsolete comments from docstrings in fractions.Fraction
17638
17639- bpo-30840: Document relative imports
17640
17641- bpo-36523: Add docstring for io.IOBase.writelines().
17642
17643- bpo-36425: New documentation translation: `Simplified Chinese
17644  <https://docs.python.org/zh-cn/>`_.
17645
17646- bpo-36345: Avoid the duplication of code from ``Tools/scripts/serve.py``
17647  in using the :rst:dir:`literalinclude` directive for the basic
17648  wsgiref-based web server in the documentation of :mod:`wsgiref`.
17649  Contributed by Stéphane Wirtel.
17650
17651- bpo-36345: Using the code of the ``Tools/scripts/serve.py`` script as an
17652  example in the :mod:`wsgiref` documentation.  Contributed by Stéphane
17653  Wirtel.
17654
17655- bpo-36157: Added Documention for  PyInterpreterState_Main().
17656
17657- bpo-33043: Updates the docs.python.org page with the addition of a
17658  'Contributing to Docs' link at the end of the page (between 'Reporting
17659  Bugs' and 'About Documentation'). Updates the 'Found a Bug' page with
17660  additional links and information in the Documentation Bugs section.
17661
17662- bpo-35581: @typing.type_check_only now allows type stubs to mark functions
17663  and classes not available during runtime.
17664
17665- bpo-33832: Add glossary entry for 'magic method'.
17666
17667- bpo-32913: Added re.Match.groupdict example to regex HOWTO.
17668
17669Tests
17670-----
17671
17672- bpo-36719: regrtest now always detects uncollectable objects. Previously,
17673  the check was only enabled by ``--findleaks``. The check now also works
17674  with ``-jN/--multiprocess N``. ``--findleaks`` becomes a deprecated alias
17675  to ``--fail-env-changed``.
17676
17677- bpo-36725: When using multiprocessing mode (-jN), regrtest now better
17678  reports errors if a worker process fails, and it exits immediately on a
17679  worker thread failure or when interrupted.
17680
17681- bpo-36454: Change test_time.test_monotonic() to test only the lower bound
17682  of elapsed time after a sleep command rather than the upper bound. This
17683  prevents unnecessary test failures on slow buildbots. Patch by Victor
17684  Stinner.
17685
17686- bpo-32424: Improve test coverage for xml.etree.ElementTree. Patch by
17687  Gordon P. Hemsley.
17688
17689- bpo-32424: Fix typo in test_cyclic_gc() test for xml.etree.ElementTree.
17690  Patch by Gordon P. Hemsley.
17691
17692- bpo-36635: Add a new :mod:`_testinternalcapi` module to test the internal
17693  C API.
17694
17695- bpo-36629: Fix ``test_imap4_host_default_value()`` of ``test_imaplib``:
17696  catch also :data:`errno.ENETUNREACH` error.
17697
17698- bpo-36611: Fix ``test_sys.test_getallocatedblocks()`` when
17699  :mod:`tracemalloc` is enabled.
17700
17701- bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of
17702  reference count, allocated memory blocks, file descriptor count) during
17703  warmup, to ensure that everything is initialized before starting to hunt
17704  reference leaks.
17705
17706- bpo-36565: Fix reference hunting (``python3 -m test -R 3:3``) when Python
17707  has no built-in abc module.
17708
17709- bpo-31904: Port test_resource to VxWorks: skip tests cases setting
17710  RLIMIT_FSIZE and RLIMIT_CPU.
17711
17712- bpo-31904: Fix test_tabnanny on VxWorks: adjust ENOENT error message.
17713
17714- bpo-36436: Fix ``_testcapi.pymem_buffer_overflow()``: handle memory
17715  allocation failure.
17716
17717- bpo-31904: Fix test_utf8_mode on VxWorks: Python always use UTF-8 on
17718  VxWorks.
17719
17720- bpo-36341: Fix tests that may fail with PermissionError upon calling
17721  bind() on AF_UNIX sockets.
17722
17723Build
17724-----
17725
17726- bpo-36747: Remove the stale scriptsinstall Makefile target.
17727
17728- bpo-21536: On Unix, C extensions are no longer linked to libpython except
17729  on Android and Cygwin.
17730
17731  It is now possible for a statically linked Python to load a C extension
17732  built using a shared library Python.
17733
17734  When Python is embedded, ``libpython`` must not be loaded with
17735  ``RTLD_LOCAL``, but ``RTLD_GLOBAL`` instead. Previously, using
17736  ``RTLD_LOCAL``, it was already not possible to load C extensions which
17737  were not linked to ``libpython``, such as C extensions of the standard
17738  library built by the ``*shared*`` section of ``Modules/Setup``.
17739
17740  distutils, python-config and python-config.py have been modified.
17741
17742- bpo-36707: ``./configure --with-pymalloc`` no longer adds the ``m`` flag
17743  to SOABI (sys.implementation.cache_tag). Enabling or disabling pymalloc
17744  has no impact on the ABI.
17745
17746- bpo-36635: Change ``PyAPI_FUNC(type)``, ``PyAPI_DATA(type)`` and
17747  ``PyMODINIT_FUNC`` macros of ``pyport.h`` when ``Py_BUILD_CORE_MODULE`` is
17748  defined. The ``Py_BUILD_CORE_MODULE`` define must be now be used to build
17749  a C extension as a dynamic library accessing Python internals: export the
17750  PyInit_xxx() function in DLL exports on Windows.
17751
17752- bpo-31904: Don't build the ``_crypt`` extension on VxWorks.
17753
17754- bpo-36618: Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is
17755  detected. The pymalloc memory allocator aligns memory on 8 bytes. On
17756  x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS
17757  instruction which can lead to segmentation fault. Instruct clang that
17758  Python is limited to alignment on 8 bytes to use MOVUPS instruction
17759  instead: slower but don't trigger a SIGSEGV if the memory is not aligned
17760  on 16 bytes. Sadly, the flag must be added to ``CFLAGS`` and not just
17761  ``CFLAGS_NODIST``, since third party C extensions can have the same issue.
17762
17763- bpo-36605: ``make tags`` and ``make TAGS`` now also parse
17764  ``Modules/_io/*.c`` and ``Modules/_io/*.h``.
17765
17766- bpo-36465: Release builds and debug builds are now ABI compatible:
17767  defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS``
17768  macro, which introduces the only ABI incompatibility. The
17769  ``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function
17770  and the :envvar:`PYTHONDUMPREFS` environment variable, can be set using
17771  the new ``./configure --with-trace-refs`` build option.
17772
17773- bpo-36577: setup.py now correctly reports missing OpenSSL headers and
17774  libraries again.
17775
17776- bpo-36544: Fix regression introduced in bpo-36146 refactoring setup.py
17777
17778- bpo-36508: ``python-config --ldflags`` no longer includes flags of the
17779  ``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be
17780  used to build executables.
17781
17782- bpo-36503: Remove references to "aix3" and "aix4". Patch by M. Felt.
17783
17784Windows
17785-------
17786
17787- bpo-35920: Added platform.win32_edition() and platform.win32_is_iot().
17788  Added support for cross-compiling packages for Windows ARM32. Skip tests
17789  that are not expected to work on Windows IoT Core ARM32.
17790
17791- bpo-36649: Remove trailing spaces for registry keys when installed via the
17792  Store.
17793
17794- bpo-34144: Fixed activate.bat to correctly update codepage when chcp.com
17795  returns dots in output. Patch by Lorenz Mende.
17796
17797- bpo-36509: Added preset-iot layout for Windows IoT ARM containers. This
17798  layout doesn't contain UI components like tkinter or IDLE. It also doesn't
17799  contain files to support on-target builds since Windows ARM32 builds must
17800  be cross-compiled when using MSVC.
17801
17802- bpo-35941: enum_certificates function of the ssl module now returns
17803  certificates from all available certificate stores inside windows in a
17804  query instead of returning only certificates from the system wide
17805  certificate store. This includes certificates from these certificate
17806  stores: local machine, local machine enterprise, local machine group
17807  policy, current user, current user group policy, services, users.
17808  ssl.enum_crls() function is changed in the same way to return all
17809  certificate revocation lists inside the windows certificate revocation
17810  list stores.
17811
17812- bpo-36441: Fixes creating a venv when debug binaries are installed.
17813
17814- bpo-36085: Enable better DLL resolution on Windows by using safe DLL
17815  search paths and adding :func:`os.add_dll_directory`.
17816
17817- bpo-36010: Add the venv standard library module to the nuget distribution
17818  for Windows.
17819
17820- bpo-29515: Add the following socket module constants on Windows:
17821  IPPROTO_AH IPPROTO_CBT IPPROTO_DSTOPTS IPPROTO_EGP IPPROTO_ESP
17822  IPPROTO_FRAGMENT IPPROTO_GGP IPPROTO_HOPOPTS IPPROTO_ICLFXBM
17823  IPPROTO_ICMPV6 IPPROTO_IDP IPPROTO_IGMP IPPROTO_IGP IPPROTO_IPV4
17824  IPPROTO_IPV6 IPPROTO_L2TP IPPROTO_MAX IPPROTO_ND IPPROTO_NONE IPPROTO_PGM
17825  IPPROTO_PIM IPPROTO_PUP IPPROTO_RDP IPPROTO_ROUTING IPPROTO_SCTP
17826  IPPROTO_ST
17827
17828- bpo-35947: Added current version of libffi to cpython-source-deps. Change
17829  _ctypes to use current version of libffi on Windows.
17830
17831- bpo-34060: Report system load when running test suite on Windows. Patch by
17832  Ammar Askar. Based on prior work by Jeremy Kloth.
17833
17834- bpo-31512: With the Windows 10 Creators Update, non-elevated users can now
17835  create symlinks as long as the computer has Developer Mode enabled.
17836
17837macOS
17838-----
17839
17840- bpo-34602: Avoid failures setting macOS stack resource limit with
17841  resource.setrlimit. This reverts an earlier fix for bpo-18075 which forced
17842  a non-default stack size when building the interpreter executable on
17843  macOS.
17844
17845IDLE
17846----
17847
17848- bpo-36429: Fix starting IDLE with pyshell. Add idlelib.pyshell alias at
17849  top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__'
17850  command.
17851
17852Tools/Demos
17853-----------
17854
17855- bpo-14546: Fix the argument handling in Tools/scripts/lll.py.
17856
17857C API
17858-----
17859
17860- bpo-36763: Fix memory leak in :c:func:`Py_SetStandardStreamEncoding`:
17861  release memory if the function is called twice.
17862
17863- bpo-36641: :c:expr:`PyDoc_VAR(name)` and :c:expr:`PyDoc_STRVAR(name,str)`
17864  now create ``static const char name[]`` instead of ``static char name[]``.
17865  Patch by Inada Naoki.
17866
17867- bpo-36389: Change the value of ``CLEANBYTE``, ``DEADDYTE`` and
17868  ``FORBIDDENBYTE`` internal constants used by debug hooks on Python memory
17869  allocators (:c:func:`PyMem_SetupDebugHooks` function). Byte patterns
17870  ``0xCB``, ``0xDB`` and ``0xFB`` have been replaced with ``0xCD``, ``0xDD``
17871  and ``0xFD`` to use the same values than Windows CRT debug ``malloc()``
17872  and ``free()``.
17873
17874- bpo-36443: Since Python 3.7.0, calling :c:func:`Py_DecodeLocale` before
17875  :c:func:`Py_Initialize` produces mojibake if the ``LC_CTYPE`` locale is
17876  coerced and/or if the UTF-8 Mode is enabled by the user configuration. The
17877  LC_CTYPE coercion and UTF-8 Mode are now disabled by default to fix the
17878  mojibake issue. They must now be enabled explicitly (opt-in) using the new
17879  :c:func:`_Py_PreInitialize` API with ``_PyPreConfig``.
17880
17881- bpo-36025: Fixed an accidental change to the datetime C API where the
17882  arguments to the :c:func:`PyDate_FromTimestamp` function were incorrectly
17883  interpreted as a single timestamp rather than an arguments tuple, which
17884  causes existing code to start raising :exc:`TypeError`. The
17885  backwards-incompatible change was only present in alpha releases of Python
17886  3.8. Patch by Paul Ganssle.
17887
17888- bpo-35810: Modify ``PyObject_Init`` to correctly increase the refcount of
17889  heap- allocated Type objects. Also fix the refcounts of the heap-allocated
17890  types that were either doing this manually or not decreasing the type's
17891  refcount in tp_dealloc
17892
17893
17894What's New in Python 3.8.0 alpha 3?
17895===================================
17896
17897*Release date: 2019-03-25*
17898
17899Security
17900--------
17901
17902- bpo-36216: Changes urlsplit() to raise ValueError when the URL contains
17903  characters that decompose under IDNA encoding (NFKC-normalization) into
17904  characters that affect how the URL is parsed.
17905
17906- bpo-35121: Don't send cookies of domain A without Domain attribute to
17907  domain B when domain A is a suffix match of domain B while using a
17908  cookiejar with :class:`http.cookiejar.DefaultCookiePolicy` policy. Patch
17909  by Karthikeyan Singaravelan.
17910
17911Core and Builtins
17912-----------------
17913
17914- bpo-36421: Fix a possible double decref in _ctypes.c's
17915  ``PyCArrayType_new()``.
17916
17917- bpo-36412: Fix a possible crash when creating a new dictionary.
17918
17919- bpo-36398: Fix a possible crash in ``structseq_repr()``.
17920
17921- bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has
17922  two or more arcs with labels of the same type. Patch by Pablo Galindo.
17923
17924- bpo-36365: repr(structseq) is no longer limited to 512 bytes.
17925
17926- bpo-36374: Fix a possible null pointer dereference in
17927  ``merge_consts_recursive()``. Patch by Zackery Spytz.
17928
17929- bpo-36236: At Python initialization, the current directory is no longer
17930  prepended to :data:`sys.path` if it has been removed.
17931
17932- bpo-36352: Python initialization now fails with an error, rather than
17933  silently truncating paths, if a path is too long.
17934
17935- bpo-36301: Python initialization now fails if decoding ``pybuilddir.txt``
17936  configuration file fails at startup.
17937
17938- bpo-36333: Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane
17939  Wirtel.
17940
17941- bpo-36332: The builtin :func:`compile` can now handle AST objects that
17942  contain assignment expressions. Patch by Pablo Galindo.
17943
17944- bpo-36282: Improved error message for too much positional arguments in
17945  some builtin functions.
17946
17947- bpo-30040: New empty dict uses fewer memory for now.  It used more memory
17948  than empty dict created by ``dict.clear()``.  And empty dict creation and
17949  deletion is about 2x faster.  Patch by Inada Naoki.
17950
17951- bpo-36262: Fix an unlikely memory leak on conversion from string to float
17952  in the function ``_Py_dg_strtod()`` used by ``float(str)``,
17953  ``complex(str)``, :func:`pickle.load`, :func:`marshal.load`, etc.
17954
17955- bpo-36252: Update Unicode databases to version 12.0.0.
17956
17957- bpo-36218: Fix a segfault occurring when sorting a list of heterogeneous
17958  values. Patch contributed by Rémi Lapeyre and Elliot Gorokhovsky.
17959
17960- bpo-36188: Cleaned up left-over vestiges of Python 2 unbound method
17961  handling in method objects and documentation. Patch by Martijn Pieters
17962
17963- bpo-36124: Add a new interpreter-specific dict and expose it in the C-API
17964  via PyInterpreterState_GetDict().  This parallels PyThreadState_GetDict().
17965  However, extension modules should continue using PyModule_GetState() for
17966  their own internal per-interpreter state.
17967
17968- bpo-35975: Add a ``feature_version`` flag to ``ast.parse()`` (documented)
17969  and ``compile()`` (hidden) that allows tweaking the parser to support
17970  older versions of the grammar. In particular, if ``feature_version`` is 5
17971  or 6, the hacks for the ``async`` and ``await`` keyword from PEP 492 are
17972  reinstated. (For 7 or higher, these are unconditionally treated as
17973  keywords, but they are still special tokens rather than ``NAME`` tokens
17974  that the parser driver recognizes.)
17975
17976- bpo-31904: Use UTF-8 as the system encoding on VxWorks.
17977
17978- bpo-36048: The :meth:`~object.__index__` special method will be used
17979  instead of :meth:`~object.__int__` for implicit conversion of Python
17980  numbers to C integers.  Using the ``__int__()`` method in implicit
17981  conversions has been deprecated.
17982
17983- bpo-35808: Retire pgen and use a modified version of pgen2 to generate the
17984  parser. Patch by Pablo Galindo.
17985
17986Library
17987-------
17988
17989- bpo-36401: The class documentation created by pydoc now has a separate
17990  section for readonly properties.
17991
17992- bpo-36320: The typing.NamedTuple() class has deprecated the _field_types
17993  attribute in favor of the __annotations__ attribute which carried the same
17994  information. Also, both attributes were converted from OrderedDict to a
17995  regular dict.
17996
17997- bpo-34745: Fix :mod:`asyncio` ssl memory issues caused by circular
17998  references
17999
18000- bpo-36324: Add method to statistics.NormalDist for computing the inverse
18001  cumulative normal distribution.
18002
18003- bpo-36321: collections.namedtuple() misspelled the name of an attribute.
18004  To be consistent with typing.NamedTuple, the attribute name should have
18005  been "_field_defaults" instead of "_fields_defaults".  For backwards
18006  compatibility, both spellings are now created.  The misspelled version may
18007  be removed in the future.
18008
18009- bpo-36297: "unicode_internal" codec is removed.  It was deprecated since
18010  Python 3.3. Patch by Inada Naoki.
18011
18012- bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be
18013  found. Thanks to 'mental' for the bug report.
18014
18015- bpo-36268: Switch the default format used for writing tars with
18016  mod:`tarfile` to the modern POSIX.1-2001 pax standard, from the
18017  vendor-specific GNU. Contributed by C.A.M. Gerlach.
18018
18019- bpo-36285: Fix integer overflows in the array module. Patch by Stephan
18020  Hohe.
18021
18022- bpo-31904: Add _signal module support for VxWorks.
18023
18024- bpo-36272: :mod:`logging` does not silently ignore RecursionError anymore.
18025  Patch contributed by Rémi Lapeyre.
18026
18027- bpo-36280: Add a kind field to ast.Constant. It is 'u' if the literal has
18028  a 'u' prefix (i.e. a Python 2 style unicode literal), else None.
18029
18030- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles all
18031  exceptions.
18032
18033- bpo-36251: Fix format strings used for stderrprinter and re.Match reprs.
18034  Patch by Stephan Hohe.
18035
18036- bpo-36235: Fix ``CFLAGS`` in ``customize_compiler()`` of
18037  ``distutils.sysconfig``: when the ``CFLAGS`` environment variable is
18038  defined, don't override ``CFLAGS`` variable with the ``OPT`` variable
18039  anymore. Initial patch written by David Malcolm.
18040
18041- bpo-35807: Update ensurepip to install pip 19.0.3 and setuptools 40.8.0.
18042
18043- bpo-36139: Release GIL when closing :class:`~mmap.mmap` objects.
18044
18045- bpo-36179: Fix two unlikely reference leaks in _hashopenssl. The leaks
18046  only occur in out-of-memory cases.
18047
18048- bpo-36169: Add overlap() method to statistics.NormalDist.  Computes the
18049  overlapping coefficient for two normal distributions.
18050
18051- bpo-36103: Default buffer size used by ``shutil.copyfileobj()`` is changed
18052  from 16 KiB to 64 KiB on non-Windows platform to reduce system call
18053  overhead. Contributed by Inada Naoki.
18054
18055- bpo-36130: Fix ``pdb`` with ``skip=...`` when stepping into a frame
18056  without a ``__name__`` global.  Patch by Anthony Sottile.
18057
18058- bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry
18059  instead of a path string.
18060
18061- bpo-35178: Ensure custom :func:`warnings.formatwarning` function can
18062  receive `line` as positional argument. Based on patch by Tashrif Billah.
18063
18064- bpo-36106: Resolve potential name clash with libm's sinpi(). Patch by
18065  Dmitrii Pasechnik.
18066
18067- bpo-36091: Clean up reference to async generator in Lib/types. Patch by
18068  Henry Chen.
18069
18070- bpo-36043: :class:`FileCookieJar` supports :term:`path-like object`.
18071  Contributed by Stéphane Wirtel
18072
18073- bpo-35899: Enum has been fixed to correctly handle empty strings and
18074  strings with non-Latin characters (ie. 'α', 'א') without crashing.
18075  Original patch contributed by Maxwell. Assisted by Stéphane Wirtel.
18076
18077- bpo-21269: Add ``args`` and ``kwargs`` properties to mock call objects.
18078  Contributed by Kumar Akshay.
18079
18080- bpo-30670: `pprint.pp` has been added to pretty-print objects with
18081  dictionary keys being sorted with their insertion order by default.
18082  Parameter *sort_dicts* has been added to `pprint.pprint`, `pprint.pformat`
18083  and `pprint.PrettyPrinter`. Contributed by Rémi Lapeyre.
18084
18085- bpo-35843: Implement ``__getitem__`` for ``_NamespacePath``.  Patch by
18086  Anthony Sottile.
18087
18088- bpo-35802: Clean up code which checked presence of ``os.stat`` /
18089  ``os.lstat`` / ``os.chmod`` which are always present.  Patch by Anthony
18090  Sottile.
18091
18092- bpo-35715: Librates the return value of a ProcessPoolExecutor
18093  _process_worker after it's no longer needed to free memory
18094
18095- bpo-35493: Use :func:`multiprocessing.connection.wait` instead of polling
18096  each 0.2 seconds for worker updates in :class:`multiprocessing.Pool`.
18097  Patch by Pablo Galindo.
18098
18099- bpo-35661: Store the venv prompt in pyvenv.cfg.
18100
18101- bpo-35121: Don't set cookie for a request when the request path is a
18102  prefix match of the cookie's path attribute but doesn't end with "/".
18103  Patch by Karthikeyan Singaravelan.
18104
18105- bpo-21478: Calls to a child function created with
18106  :func:`unittest.mock.create_autospec` should propagate to the parent.
18107  Patch by Karthikeyan Singaravelan.
18108
18109- bpo-35198: Fix C++ extension compilation on AIX
18110
18111Documentation
18112-------------
18113
18114- bpo-36329: Declare the path of the Python binary for the usage of
18115  ``Tools/scripts/serve.py`` when executing ``make -C Doc/ serve``.
18116  Contributed by Stéphane Wirtel
18117
18118- bpo-36138: Improve documentation about converting datetime.timedelta to
18119  scalars.
18120
18121- bpo-21314: A new entry was added to the Core Language Section of the
18122  Programming FAQ, which explaines the usage of slash(/) in the signature of
18123  a function. Patch by Lysandros Nikolaou
18124
18125Tests
18126-----
18127
18128- bpo-36234: test_posix.PosixUidGidTests: add tests for invalid uid/gid type
18129  (str). Initial patch written by David Malcolm.
18130
18131- bpo-29571: Fix ``test_re.test_locale_flag()``:  use
18132  ``locale.getpreferredencoding()`` rather than ``locale.getlocale()`` to
18133  get the locale encoding. With some locales, ``locale.getlocale()`` returns
18134  the wrong encoding.
18135
18136- bpo-36123: Fix race condition in test_socket.
18137
18138Build
18139-----
18140
18141- bpo-36356: Fix leaks that led to build failure when configured with
18142  address sanitizer.
18143
18144- bpo-36146: Add ``TEST_EXTENSIONS`` constant to ``setup.py`` to allow to
18145  not build test extensions like ``_testcapi``.
18146
18147- bpo-36146: Fix setup.py on macOS: only add ``/usr/include/ffi`` to include
18148  directories of _ctypes, not for all extensions.
18149
18150- bpo-31904: Enable build system to cross-build for VxWorks RTOS.
18151
18152Windows
18153-------
18154
18155- bpo-36312: Fixed decoders for the following code pages: 50220, 50221,
18156  50222, 50225, 50227, 50229, 57002 through 57011, 65000 and 42.
18157
18158- bpo-36264: Don't honor POSIX ``HOME`` in ``os.path.expanduser`` on
18159  windows.  Patch by Anthony Sottile.
18160
18161- bpo-24643: Fix name collisions due to ``#define timezone _timezone`` in
18162  PC/pyconfig.h.
18163
18164IDLE
18165----
18166
18167- bpo-36405: Use dict unpacking in idlelib.
18168
18169- bpo-36396: Remove fgBg param of idlelib.config.GetHighlight(). This param
18170  was only used twice and changed the return type.
18171
18172- bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts
18173  with Linux dark themes (and slightly darken calltip background).
18174
18175- bpo-23205: For the grep module, add tests for findfiles, refactor
18176  findfiles to be a module-level function, and refactor findfiles to use
18177  os.walk.
18178
18179- bpo-23216: Add docstrings to IDLE search modules.
18180
18181- bpo-36152: Remove colorizer.ColorDelegator.close_when_done and the
18182  corresponding argument of .close().  In IDLE, both have always been None
18183  or False since 2007.
18184
18185- bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch
18186  by Kevin Walzer.
18187
18188- bpo-36096: Refactor class variables to instance variables in colorizer.
18189
18190- bpo-30348: Increase test coverage of idlelib.autocomplete by 30%. Patch by
18191  Louie Lu
18192
18193Tools/Demos
18194-----------
18195
18196- bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7.
18197
18198- bpo-32217: Fix freeze script on Windows.
18199
18200C API
18201-----
18202
18203- bpo-36381: Raise ``DeprecationWarning`` when '#' formats are used for
18204  building or parsing values without ``PY_SSIZE_T_CLEAN``.
18205
18206- bpo-36142: The whole coreconfig.h header is now excluded from
18207  Py_LIMITED_API. Move functions definitions into a new internal
18208  pycore_coreconfig.h header.
18209
18210
18211What's New in Python 3.8.0 alpha 2?
18212===================================
18213
18214*Release date: 2019-02-25*
18215
18216Core and Builtins
18217-----------------
18218
18219- bpo-36052: Raise a :exc:`SyntaxError` when assigning a value to
18220  `__debug__` with the Assignment Operator. Contributed by Stéphane Wirtel
18221  and Pablo Galindo.
18222
18223- bpo-36012: Doubled the speed of class variable writes.  When a non-dunder
18224  attribute was updated, there was an unnecessary call to update slots.
18225
18226- bpo-35942: The error message emitted when returning invalid types from
18227  ``__fspath__`` in interfaces that allow passing :class:`~os.PathLike`
18228  objects has been improved and now it does explain the origin of the error.
18229
18230- bpo-36016: ``gc.get_objects`` can now receive an optional parameter
18231  indicating a generation to get objects from. Patch by Pablo Galindo.
18232
18233- bpo-1054041: When the main interpreter exits due to an uncaught
18234  KeyboardInterrupt, the process now exits in the appropriate manner for its
18235  parent process to detect that a SIGINT or ^C terminated the process.  This
18236  allows shells and batch scripts to understand that the user has asked them
18237  to stop.
18238
18239- bpo-35992: Fix ``__class_getitem__()`` not being called on a class with a
18240  custom non-subscriptable metaclass.
18241
18242- bpo-35993: Fix a crash on fork when using subinterpreters. Contributed by
18243  Stéphane Wirtel
18244
18245- bpo-35991: Fix a potential double free in Modules/_randommodule.c.
18246
18247- bpo-35961: Fix a crash in slice_richcompare(): use strong references
18248  rather than stolen references for the two temporary internal tuples.
18249
18250- bpo-35911: Enable the creation of cell objects by adding a
18251  ``cell.__new__`` method, and expose the type ``cell`` in ``Lib/types.py``
18252  under the name CellType. Patch by Pierre Glaser.
18253
18254- bpo-12822: Use monotonic clock for ``pthread_cond_timedwait`` when
18255  ``pthread_condattr_setclock`` and ``CLOCK_MONOTONIC`` are available.
18256
18257- bpo-15248: The compiler emits now syntax warnings in the case when a comma
18258  is likely missed before tuple or list.
18259
18260- bpo-35886: The implementation of PyInterpreterState has been moved into
18261  the internal header files (guarded by Py_BUILD_CORE).
18262
18263- bpo-31506: Clarify the errors reported when ``object.__new__`` and
18264  ``object.__init__`` receive more than one argument. Contributed by Sanyam
18265  Khurana.
18266
18267- bpo-35724: Signal-handling is now guaranteed to happen relative to the
18268  main interpreter.
18269
18270- bpo-33608: We added a new internal _Py_AddPendingCall() that operates
18271  relative to the provided interpreter.  This allows us to use the existing
18272  implementation to ask another interpreter to do work that cannot be done
18273  in the current interpreter, like decref an object the other interpreter
18274  owns.  The existing Py_AddPendingCall() only operates relative to the main
18275  interpreter.
18276
18277- bpo-33989: Fix a possible crash in :meth:`list.sort` when sorting objects
18278  with ``ob_type->tp_richcompare == NULL``.  Patch by Zackery Spytz.
18279
18280Library
18281-------
18282
18283- bpo-35512: :func:`unittest.mock.patch.dict` used as a decorator with
18284  string target resolves the target during function call instead of during
18285  decorator construction. Patch by Karthikeyan Singaravelan.
18286
18287- bpo-36018: Add statistics.NormalDist, a tool for creating and manipulating
18288  normal distributions of random variable.  Features a composite class that
18289  treats the mean and standard deviation of measurement data as single
18290  entity.
18291
18292- bpo-35904: Added statistics.fmean() as a faster, floating point variant of
18293  the existing mean() function.
18294
18295- bpo-35918: Removed broken ``has_key`` method from
18296  multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre.
18297
18298- bpo-18283: Add support for bytes to :func:`shutil.which`.
18299
18300- bpo-35960: Fix :func:`dataclasses.field` throwing away empty mapping
18301  objects passed as metadata.
18302
18303- bpo-35500: Write expected and actual call parameters on separate lines in
18304  :meth:`unittest.mock.Mock.assert_called_with` assertion errors.
18305  Contributed by Susan Su.
18306
18307- bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles syntax
18308  errors.
18309
18310- bpo-24209: In http.server script, rely on getaddrinfo to bind to preferred
18311  address based on the bind parameter. Now default bind or binding to a name
18312  may bind to IPv6 or dual-stack, depending on the environment.
18313
18314- bpo-35321: Set ``__spec__.origin`` of  ``_frozen_importlib`` to frozen so
18315  that it matches the behavior of ``_frozen_importlib_external``.  Patch by
18316  Nina Zakharenko.
18317
18318- bpo-35378: Fix a reference issue inside :class:`multiprocessing.Pool` that
18319  caused the pool to remain alive if it was deleted without being closed or
18320  terminated explicitly. A new strong reference is added to the pool
18321  iterators to link the lifetime of the pool to the lifetime of its
18322  iterators so the pool does not get destroyed if a pool iterator is still
18323  alive.
18324
18325- bpo-34294: re module, fix wrong capturing groups in rare cases.
18326  :func:`re.search`, :func:`re.findall`, :func:`re.sub` and other functions
18327  that scan through string looking for a match, should reset capturing
18328  groups between two match attempts. Patch by Ma Lin.
18329
18330- bpo-35615: :mod:`weakref`: Fix a RuntimeError when copying a
18331  WeakKeyDictionary or a WeakValueDictionary, due to some keys or values
18332  disappearing while iterating.
18333
18334- bpo-35606: Implement :func:`math.prod` as analogous function to
18335  :func:`sum` that returns the product of a 'start' value (default: 1) times
18336  an iterable of numbers. Patch by Pablo Galindo.
18337
18338- bpo-32417: Performing arithmetic between :class:`datetime.datetime`
18339  subclasses and :class:`datetime.timedelta` now returns an object of the
18340  same type as the :class:`datetime.datetime` subclass. As a result,
18341  :meth:`datetime.datetime.astimezone` and alternate constructors like
18342  :meth:`datetime.datetime.now` and :meth:`datetime.fromtimestamp` called
18343  with a ``tz`` argument now *also* retain their subclass.
18344
18345- bpo-35153: Add *headers* optional keyword-only parameter to
18346  :class:`xmlrpc.client.ServerProxy`, :class:`xmlrpc.client.Transport` and
18347  :class:`xmlrpc.client.SafeTransport`.  Patch by Cédric Krier.
18348
18349- bpo-34572: Fix C implementation of pickle.loads to use importlib's locking
18350  mechanisms, and thereby avoid using partially loaded modules. Patch by Tim
18351  Burgess.
18352
18353Documentation
18354-------------
18355
18356- bpo-36083: Fix formatting of --check-hash-based-pycs options in the
18357  manpage Synopsis.
18358
18359- bpo-36007: Bump minimum sphinx version to 1.8.  Patch by Anthony Sottile.
18360
18361- bpo-22062: Update documentation and docstrings for pathlib. Original patch
18362  by Mike Short.
18363
18364Tests
18365-----
18366
18367- bpo-27313: Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa
18368  Tk.
18369
18370- bpo-36019: Add test.support.TEST_HTTP_URL and replace references of
18371  http://www.example.com by this new constant. Contributed by Stéphane
18372  Wirtel.
18373
18374- bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict
18375  crypto policy. Use older TLS version for minimum TLS version of the server
18376  SSL context if needed, to test TLS version older than default minimum TLS
18377  version.
18378
18379- bpo-35798: Added :func:`test.support.check_syntax_warning`.
18380
18381- bpo-35505: Make test_imap4_host_default_value independent on whether the
18382  local IMAP server is running.
18383
18384- bpo-35917: multiprocessing: provide unit tests for SyncManager and
18385  SharedMemoryManager classes + all the shareable types which are supposed
18386  to be supported by them.  (patch by Giampaolo Rodola)
18387
18388- bpo-35704: Skip ``test_shutil.test_unpack_archive_xztar`` to prevent a
18389  MemoryError on 32-bit AIX when MAXDATA setting is less than 0x20000000.
18390
18391  Patch by Michael Felt (aixtools)
18392
18393- bpo-34720: Assert m_state != NULL to mimic GC traversal functions that do
18394  not correctly handle module creation when the module state has not been
18395  created.
18396
18397Windows
18398-------
18399
18400- bpo-35976: Added ARM build support to Windows build files in PCBuild.
18401
18402- bpo-35692: ``pathlib`` no longer raises when checking file and directory
18403  existence on drives that are not ready
18404
18405- bpo-35872: Uses the base Python executable when invoking venv in a virtual
18406  environment
18407
18408- bpo-35873: Prevents venv paths being inherited by child processes
18409
18410- bpo-35299: Fix sysconfig detection of the source directory and distutils
18411  handling of pyconfig.h during PGO profiling
18412
18413IDLE
18414----
18415
18416- bpo-24310: IDLE -- Document settings dialog font tab sample.
18417
18418- bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code
18419  example block.
18420
18421- bpo-35689: Add docstrings and unittests for colorizer.py.
18422
18423
18424What's New in Python 3.8.0 alpha 1?
18425===================================
18426
18427*Release date: 2019-02-03*
18428
18429Security
18430--------
18431
18432- bpo-35746: [CVE-2019-5010] Fix a NULL pointer deref in ssl module. The
18433  cert parser did not handle CRL distribution points with empty DP or URI
18434  correctly. A malicious or buggy certificate can result into segfault.
18435  Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of
18436  Cisco.
18437
18438- bpo-34812: The :option:`-I` command line option (run Python in isolated
18439  mode) is now also copied by the :mod:`multiprocessing` and
18440  :mod:`distutils` modules when spawning child processes. Previously, only
18441  :option:`-E` and :option:`-s` options (enabled by :option:`-I`) were
18442  copied.
18443
18444- bpo-34791: The xml.sax and xml.dom.domreg no longer use environment
18445  variables to override parser implementations when
18446  sys.flags.ignore_environment is set by -E or -I arguments.
18447
18448- bpo-17239: The xml.sax and xml.dom.minidom parsers no longer processes
18449  external entities by default. External DTD and ENTITY declarations no
18450  longer load files or create network connections.
18451
18452- bpo-34623: CVE-2018-14647: The C accelerated _elementtree module now
18453  initializes hash randomization salt from _Py_HashSecret instead of
18454  libexpat's default CSPRNG.
18455
18456- bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds.
18457
18458- bpo-33871: Fixed sending the part of the file in :func:`os.sendfile` on
18459  macOS.  Using the *trailers* argument could cause sending more bytes from
18460  the input file than was specified.
18461
18462- bpo-32533: Fixed thread-safety of error handling in _ssl.
18463
18464- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970.
18465  X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new
18466  test ensures that NULL bytes are not allowed.
18467
18468- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
18469
18470- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
18471  backtracking. These regexes formed potential DOS vectors (REDOS). They
18472  have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
18473  by Jamie Davis.
18474
18475- bpo-28414: The ssl module now allows users to perform their own IDN
18476  en/decoding when using SNI.
18477
18478Core and Builtins
18479-----------------
18480
18481- bpo-35877: Make parenthesis optional for named expressions in while
18482  statement. Patch by Karthikeyan Singaravelan.
18483
18484- bpo-35814: Allow same right hand side expressions in annotated assignments
18485  as in normal ones. In particular, ``x: Tuple[int, int] = 1, 2`` (without
18486  parentheses on the right) is now allowed.
18487
18488- bpo-35766: Add the option to parse PEP 484 type comments in the ast
18489  module. (Off by default.) This is merging the key functionality of the
18490  third party fork thereof,
18491  [typed_ast](https://github.com/python/typed_ast).
18492
18493- bpo-35713: Reorganize Python initialization to get working exceptions and
18494  sys.stderr earlier.
18495
18496- bpo-33416: Add end line and end column position information to the Python
18497  AST nodes. This is a C-level backwards incompatible change.
18498
18499- bpo-35720: Fixed a minor memory leak in pymain_parse_cmdline_impl function
18500  in Modules/main.c
18501
18502- bpo-35634: ``func(**kwargs)`` will now raise an error when ``kwargs`` is a
18503  mapping containing multiple entries with the same key. An error was
18504  already raised when other keyword arguments are passed before ``**kwargs``
18505  since Python 3.6.
18506
18507- bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan
18508  Hohe.
18509
18510- bpo-35214: clang Memory Sanitizer build instrumentation was added to work
18511  around false positives from posix, socket, time, test_io, and
18512  test_faulthandler.
18513
18514- bpo-35560: Fix an assertion error in :func:`format` in debug build for
18515  floating point formatting with "n" format, zero padding and small width.
18516  Release build is not impacted. Patch by Karthikeyan Singaravelan.
18517
18518- bpo-35552: Format characters ``%s`` and ``%V`` in
18519  :c:func:`PyUnicode_FromFormat` and ``%s`` in :c:func:`PyBytes_FromFormat`
18520  no longer read memory past the limit if *precision* is specified.
18521
18522- bpo-35504: Fix segfaults and :exc:`SystemError`\ s when deleting certain
18523  attributes. Patch by Zackery Spytz.
18524
18525- bpo-35504: Fixed a SystemError when delete the characters_written
18526  attribute of an OSError.
18527
18528- bpo-35494: Improved syntax error messages for unbalanced parentheses in
18529  f-string.
18530
18531- bpo-35444: Fixed error handling in pickling methods when fail to look up
18532  builtin "getattr". Sped up pickling iterators.
18533
18534- bpo-35436: Fix various issues with memory allocation error handling.
18535  Patch by Zackery Spytz.
18536
18537- bpo-35423: Separate the signal handling trigger in the eval loop from the
18538  "pending calls" machinery. There is no semantic change and the difference
18539  in performance is insignificant.
18540
18541- bpo-35357: Internal attributes' names of unittest.mock._Call and
18542  unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with
18543  _mock_ in order to prevent clashes with widely used object attributes.
18544  Fixed minor typo in test function name.
18545
18546- bpo-35372: Fixed the code page decoder for input longer than 2 GiB
18547  containing undecodable bytes.
18548
18549- bpo-35336: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the
18550  C locale if the LC_CTYPE locale is "C".
18551
18552- bpo-31241: The *lineno* and *col_offset* attributes of AST nodes for list
18553  comprehensions, generator expressions and tuples are now point to the
18554  opening parenthesis or square brace. For tuples without parenthesis they
18555  point to the position of the first item.
18556
18557- bpo-33954: For :meth:`str.format`, :meth:`float.__format__` and
18558  :meth:`complex.__format__` methods for non-ASCII decimal point when using
18559  the "n" formatter.
18560
18561- bpo-35269: Fix a possible segfault involving a newly created coroutine.
18562  Patch by Zackery Spytz.
18563
18564- bpo-35224: Implement :pep:`572` (assignment expressions). Patch by Emily
18565  Morehouse.
18566
18567- bpo-32492: Speed up :class:`namedtuple` attribute access by 1.6x using a C
18568  fast-path for the name descriptors. Patch by Pablo Galindo.
18569
18570- bpo-35214: Fixed an out of bounds memory access when parsing a truncated
18571  unicode escape sequence at the end of a string such as ``'\N'``.  It would
18572  read one byte beyond the end of the memory allocation.
18573
18574- bpo-35214: The interpreter and extension modules have had annotations
18575  added so that they work properly under clang's Memory Sanitizer.  A new
18576  configure flag --with-memory-sanitizer has been added to make test builds
18577  of this nature easier to perform.
18578
18579- bpo-35193: Fix an off by one error in the bytecode peephole optimizer
18580  where it could read bytes beyond the end of bounds of an array when
18581  removing unreachable code. This bug was present in every release of Python
18582  3.6 and 3.7 until now.
18583
18584- bpo-35169: Improved error messages for forbidden assignments.
18585
18586- bpo-34022: Fix handling of hash-based bytecode files in :mod:`zipimport`.
18587  Patch by Elvis Pranskevichus.
18588
18589- bpo-28401: Debug builds will no longer to attempt to import extension
18590  modules built for the ABI as they were never compatible to begin with.
18591  Patch by Stefano Rivera.
18592
18593- bpo-29341: Clarify in the docstrings of :mod:`os` methods that path-like
18594  objects are also accepted as input parameters.
18595
18596- bpo-35050: :mod:`socket`: Fix off-by-one bug in length check for
18597  ``AF_ALG`` name and type.
18598
18599- bpo-29743: Raise :exc:`ValueError` instead of :exc:`OverflowError` in case
18600  of a negative ``_length_`` in a :class:`ctypes.Array` subclass.  Also
18601  raise :exc:`TypeError` instead of :exc:`AttributeError` for non-integer
18602  ``_length_``. Original patch by Oren Milman.
18603
18604- bpo-16806: Fix ``lineno`` and ``col_offset`` for multi-line string tokens.
18605
18606- bpo-35029: :exc:`SyntaxWarning` raised as an exception at code generation
18607  time will be now replaced with a :exc:`SyntaxError` for better error
18608  reporting.
18609
18610- bpo-34983: Expose :meth:`symtable.Symbol.is_nonlocal` in the symtable
18611  module. Patch by Pablo Galindo.
18612
18613- bpo-34974: :class:`bytes` and :class:`bytearray` constructors no longer
18614  convert unexpected exceptions (e.g. :exc:`MemoryError` and
18615  :exc:`KeyboardInterrupt`) to :exc:`TypeError`.
18616
18617- bpo-34939: Allow annotated names in module namespace that are declared
18618  global before the annotation happens. Patch by Pablo Galindo.
18619
18620- bpo-34973: Fixed crash in :func:`bytes` when the :class:`list` argument is
18621  mutated while it is iterated.
18622
18623- bpo-34876: The *lineno* and *col_offset* attributes of the AST for
18624  decorated function and class refer now to the position of the
18625  corresponding ``def``, ``async def`` and ``class`` instead of the position
18626  of the first decorator. This leads to more correct line reporting in
18627  tracing. This is the only case when the position of child AST nodes can
18628  precede the position of the parent AST node.
18629
18630- bpo-34879: Fix a possible null pointer dereference in bytesobject.c.
18631  Patch by Zackery Spytz.
18632
18633- bpo-34784: Fix the implementation of PyStructSequence_NewType in order to
18634  create heap allocated StructSequences.
18635
18636- bpo-32912: A :exc:`SyntaxWarning` is now emitted instead of a
18637  :exc:`DeprecationWarning` for invalid escape sequences in string and bytes
18638  literals.
18639
18640- bpo-34854: Fixed a crash in compiling string annotations containing a
18641  lambda with a keyword-only argument that doesn't have a default value.
18642
18643- bpo-34850: The compiler now produces a :exc:`SyntaxWarning` when identity
18644  checks (``is`` and ``is not``) are used with certain types of literals
18645  (e.g. strings, ints).  These can often work by accident in CPython, but
18646  are not guaranteed by the language spec.  The warning advises users to use
18647  equality tests (``==`` and ``!=``) instead.
18648
18649- bpo-34824: Fix a possible null pointer dereference in Modules/_ssl.c.
18650  Patch by Zackery Spytz.
18651
18652- bpo-30156: The C function ``property_descr_get()`` uses a "cached" tuple
18653  to optimize function calls. But this tuple can be discovered in debug mode
18654  with :func:`sys.getobjects()`. Remove the optimization, it's not really
18655  worth it and it causes 3 different crashes last years.
18656
18657- bpo-34762: Fix contextvars C API to use PyObject* pointer types.
18658
18659- bpo-34751: The hash function for tuples is now based on xxHash which gives
18660  better collision results on (formerly) pathological cases. Additionally,
18661  on 64-bit systems it improves tuple hashes in general. Patch by Jeroen
18662  Demeyer with substantial contributions by Tim Peters.
18663
18664- bpo-34735: Fix a memory leak in Modules/timemodule.c.  Patch by Zackery
18665  Spytz.
18666
18667- bpo-34683: Fixed a bug where some SyntaxError error pointed to locations
18668  that were off-by-one.
18669
18670- bpo-34651: Only allow the main interpreter to fork.  The avoids the
18671  possibility of affecting the main interpreter, which is critical to
18672  operation of the runtime.
18673
18674- bpo-34653: Remove unused function PyParser_SimpleParseStringFilename.
18675
18676- bpo-32236: Warn that line buffering is not supported if :func:`open` is
18677  called with binary mode and ``buffering=1``.
18678
18679- bpo-34641: Further restrict the syntax of the left-hand side of keyword
18680  arguments in function calls. In particular, ``f((keyword)=arg)`` is now
18681  disallowed.
18682
18683- bpo-34637: Make the *start* argument to *sum()* visible as a keyword
18684  argument.
18685
18686- bpo-1621: Do not assume signed integer overflow behavior (C undefined
18687  behavior) when performing set hash table resizing.
18688
18689- bpo-34588: Fix an off-by-one in the recursive call pruning feature of
18690  traceback formatting.
18691
18692- bpo-34485: On Windows, the LC_CTYPE is now set to the user preferred
18693  locale at startup. Previously, the LC_CTYPE locale was "C" at startup, but
18694  changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, "").
18695
18696- bpo-34485: Standard streams like sys.stdout now use the "surrogateescape"
18697  error handler, instead of "strict", on the POSIX locale (when the C locale
18698  is not coerced and the UTF-8 Mode is disabled).
18699
18700- bpo-34485: Fix the error handler of standard streams like sys.stdout:
18701  PYTHONIOENCODING=":" is now ignored instead of setting the error handler
18702  to "strict".
18703
18704- bpo-34485: Python now gets the locale encoding with C code to initialize
18705  the encoding of standard streams like sys.stdout. Moreover, the encoding
18706  is now initialized to the Python codec name to get a normalized encoding
18707  name and to ensure that the codec is loaded. The change avoids importing
18708  _bootlocale and _locale modules at startup by default.
18709
18710- bpo-34527: On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also
18711  forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
18712  the LC_CTYPE locale is "C".
18713
18714- bpo-34527: The UTF-8 Mode is now also enabled by the "POSIX" locale, not
18715  only by the "C" locale.
18716
18717- bpo-34403: On HP-UX with C or POSIX locale, sys.getfilesystemencoding()
18718  now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled
18719  and the C locale is not coerced).
18720
18721- bpo-34523: The Python filesystem encoding is now read earlier during the
18722  Python initialization.
18723
18724- bpo-12458: Tracebacks show now correct line number for subexpressions in
18725  multiline expressions. Tracebacks show now the line number of the first
18726  line for multiline expressions instead of the line number of the last
18727  subexpression.
18728
18729- bpo-34408: Prevent a null pointer dereference and resource leakage in
18730  ``PyInterpreterState_New()``.
18731
18732- bpo-34400: Fix undefined behavior in parsetok.c.  Patch by Zackery Spytz.
18733
18734- bpo-33073: Added as_integer_ratio to ints to make them more interoperable
18735  with floats.
18736
18737- bpo-34377: Update valgrind suppression list to use
18738  ``_PyObject_Free``/``_PyObject_Realloc`` instead of
18739  ``PyObject_Free``/``PyObject_Realloc``.
18740
18741- bpo-34353: Added the "socket" option in the `stat.filemode()` Python
18742  implementation to match the C implementation.
18743
18744- bpo-34320: Fix ``dict(od)`` didn't copy iteration order of OrderedDict.
18745
18746- bpo-34113: Fixed crash on debug builds when opcode stack was adjusted with
18747  negative numbers. Patch by Constantin Petrisor.
18748
18749- bpo-34100: Compiler now merges constants in tuples and frozensets
18750  recursively. Code attributes like ``co_names`` are merged too.
18751
18752- bpo-34151: Performance of list concatenation, repetition and slicing
18753  operations is slightly improved. Patch by Sergey Fedoseev.
18754
18755- bpo-34170: -X dev: it is now possible to override the memory allocator
18756  using PYTHONMALLOC even if the developer mode is enabled.
18757
18758- bpo-33237: Improved :exc:`AttributeError` message for partially
18759  initialized module.
18760
18761- bpo-34149: Fix min and max functions to get default behavior when key is
18762  None.
18763
18764- bpo-34125: Profiling of unbound built-in methods now works when
18765  ``**kwargs`` is given.
18766
18767- bpo-34141: Optimized pickling atomic types (None, bool, int, float, bytes,
18768  str).
18769
18770- bpo-34126: Fix crashes when profiling certain invalid calls of unbound
18771  methods. Patch by Jeroen Demeyer.
18772
18773- bpo-24618: Fixed reading invalid memory when create the code object with
18774  too small varnames tuple or too large argument counts.
18775
18776- bpo-34068: In :meth:`io.IOBase.close`, ensure that the
18777  :attr:`~io.IOBase.closed` attribute is not set with a live exception.
18778  Patch by Zackery Spytz and Serhiy Storchaka.
18779
18780- bpo-34087: Fix buffer overflow while converting unicode to numeric values.
18781
18782- bpo-34080: Fixed a memory leak in the compiler when it raised some
18783  uncommon errors during tokenizing.
18784
18785- bpo-34066: Disabled interruption by Ctrl-C between calling ``open()`` and
18786  entering a **with** block in ``with open()``.
18787
18788- bpo-34042: Fix dict.copy() to maintain correct total refcount (as reported
18789  by sys.gettotalrefcount()).
18790
18791- bpo-33418: Fix potential memory leak in function object when it creates
18792  reference cycle.
18793
18794- bpo-33985: Implement contextvars.ContextVar.name attribute.
18795
18796- bpo-33956: Update vendored Expat library copy to version 2.2.5.
18797
18798- bpo-24596: Decref the module object in :c:func:`PyRun_SimpleFileExFlags`
18799  before calling :c:func:`PyErr_Print()`.  Patch by Zackery Spytz.
18800
18801- bpo-33451: Close directly executed pyc files before calling
18802  ``PyEval_EvalCode()``.
18803
18804- bpo-1617161: The hash of :class:`BuiltinMethodType` instances (methods of
18805  built-in classes) now depends on the hash of the identity of *__self__*
18806  instead of its value. The hash and equality of :class:`ModuleType` and
18807  :class:`MethodWrapperType` instances (methods of user-defined classes and
18808  some methods of built-in classes like ``str.__add__``) now depend on the
18809  hash and equality of the identity of *__self__* instead of its value.
18810  :class:`MethodWrapperType` instances no longer support ordering.
18811
18812- bpo-33824: Fix "LC_ALL=C python3.7 -V": reset properly the command line
18813  parser when the encoding changes after reading the Python configuration.
18814
18815- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an
18816  object that hadn't all of its fields set to NULL.
18817
18818- bpo-33738: Seven macro incompatibilities with the Limited API were fixed,
18819  and the macros :c:func:`PyIter_Check`, :c:func:`PyIndex_Check` and
18820  :c:func:`PyExceptionClass_Name` were added as functions. A script for
18821  automatic macro checks was added.
18822
18823- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow()
18824  correctly
18825
18826- bpo-30167: ``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module
18827  in addition to ``__file__``.
18828
18829- bpo-33706: Fix a crash in Python initialization when parsing the command
18830  line options. Thanks Christoph Gohlke for the bug report and the fix!
18831
18832- bpo-33597: Reduce ``PyGC_Head`` size from 3 words to 2 words.
18833
18834- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
18835  shutdown even when there was a custom handler set previously. Patch by
18836  Philipp Kerling.
18837
18838- bpo-33622: Fixed a leak when the garbage collector fails to add an object
18839  with the ``__del__`` method or referenced by it into the
18840  :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
18841  exception is set and preserves it.
18842
18843- bpo-33462: Make dict and dict views reversible. Patch by Rémi Lapeyre.
18844
18845- bpo-23722: A :exc:`RuntimeError` is now raised when the custom metaclass
18846  doesn't provide the ``__classcell__`` entry in the namespace passed to
18847  ``type.__new__``.  A :exc:`DeprecationWarning` was emitted in Python
18848  3.6--3.7.
18849
18850- bpo-33499: Add :envvar:`PYTHONPYCACHEPREFIX` environment variable and
18851  :option:`-X` ``pycache_prefix`` command-line option to set an alternate
18852  root directory for writing module bytecode cache files.
18853
18854- bpo-25711: The :mod:`zipimport` module has been rewritten in pure Python.
18855
18856- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't
18857  crash if module_globals is not a dict.
18858
18859- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
18860
18861- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings
18862  and optimized parentheses in the string representation.
18863
18864- bpo-20104: Added support for the `setpgroup`, `resetids`, `setsigmask`,
18865  `setsigdef` and `scheduler` parameters of `posix_spawn`. Patch by Pablo
18866  Galindo.
18867
18868- bpo-33391: Fix a leak in set_symmetric_difference().
18869
18870- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for``
18871  statements outside of async functions.
18872
18873- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
18874
18875- bpo-33128: Fix a bug that causes PathFinder to appear twice on
18876  sys.meta_path. Patch by Pablo Galindo Salgado.
18877
18878- bpo-33331: Modules imported last are now cleared first at interpreter
18879  shutdown.
18880
18881- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in
18882  dictobject.c by adjusting how the internal struct _dictkeysobject shared
18883  keys structure is declared.
18884
18885- bpo-33305: Improved syntax error messages for invalid numerical literals.
18886
18887- bpo-33306: Improved syntax error messages for unbalanced parentheses.
18888
18889- bpo-33234: The list constructor will pre-size and not over-allocate when
18890  the input length is known.
18891
18892- bpo-33270: Intern the names for all anonymous code objects.  Patch by
18893  Zackery Spytz.
18894
18895- bpo-30455: The C and Python code and the documentation related to tokens
18896  are now generated from a single source file :file:`Grammar/Tokens`.
18897
18898- bpo-33176: Add a ``toreadonly()`` method to memoryviews.
18899
18900- bpo-33231: Fix potential memory leak in ``normalizestring()``.
18901
18902- bpo-33205: Change dict growth function from
18903  ``round_up_to_power_2(used*2+hashtable_size/2)`` to
18904  ``round_up_to_power_2(used*3)``.  Previously, dict is shrinked only when
18905  ``used == 0``. Now dict has more chance to be shrinked.
18906
18907- bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
18908  or ``__aexit__()`` return non-awaitable object.
18909
18910- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
18911  when copying from key-sharing dict.
18912
18913- bpo-33053: When using the -m switch, sys.path[0] is now explicitly
18914  expanded as the *starting* working directory, rather than being left as
18915  the empty path (which allows imports from the current working directory at
18916  the time of the import)
18917
18918- bpo-33138: Changed standard error message for non-pickleable and
18919  non-copyable types. It now says "cannot pickle" instead of "can't pickle"
18920  or "cannot serialize".
18921
18922- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when
18923  called with a non-class and an abstract base class as the first and second
18924  arguments, respectively. Patch by Josh Bronson.
18925
18926- bpo-33083: ``math.factorial`` no longer accepts arguments that are not
18927  int-like. Patch by Pablo Galindo.
18928
18929- bpo-33041: Added new opcode :opcode:`END_ASYNC_FOR` and fixes the
18930  following issues:
18931
18932  * Setting global :exc:`StopAsyncIteration` no longer breaks ``async for``
18933    loops.
18934  * Jumping into an ``async for`` loop is now disabled.
18935  * Jumping out of an ``async for`` loop no longer corrupts the stack.
18936
18937- bpo-25750: Fix rare Python crash due to bad refcounting in
18938  ``type_getattro()`` if a descriptor deletes itself from the class. Patch
18939  by Jeroen Demeyer.
18940
18941- bpo-33041: Fixed bytecode generation for "async for" with a complex
18942  target. A StopAsyncIteration raised on assigning or unpacking will be now
18943  propagated instead of stopping the iteration.
18944
18945- bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
18946
18947- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
18948  using PYTHONMALLOC env var). _PyGILState_Reinit() and
18949  _PyInterpreterState_Enable() now use the default RAW memory allocator to
18950  allocate a new interpreters mutex on fork.
18951
18952- bpo-32911: Due to unexpected compatibility issues discovered during
18953  downstream beta testing, reverted :issue:`29463`. ``docstring`` field is
18954  removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes
18955  which was added in 3.7a1.  Docstring expression is restored as a first
18956  statement in their body. Based on patch by Inada Naoki.
18957
18958- bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
18959
18960- bpo-32946: Importing names from already imported module with "from ...
18961  import ..." is now 30% faster if the module is not a package.
18962
18963- bpo-32932: Make error message more revealing when there are non-str
18964  objects in ``__all__``.
18965
18966- bpo-32925: Optimized iterating and containing test for literal lists
18967  consisting of non-constants: ``x in [a, b]`` and ``for x in [a, b]``. The
18968  case of all constant elements already was optimized.
18969
18970- bpo-32889: Update Valgrind suppression list to account for the rename of
18971  ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
18972
18973- bpo-32836: Don't use temporary variables in cases of list/dict/set
18974  comprehensions
18975
18976- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled()
18977  context manager).
18978
18979- bpo-32305: For namespace packages, ensure that both ``__file__`` and
18980  ``__spec__.origin`` are set to None.
18981
18982- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for
18983  namespace packages.
18984
18985- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by
18986  Stéphane Wirtel
18987
18988- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
18989  write out-of-bound errors when using customized decode error handlers.
18990
18991- bpo-32489: A :keyword:`continue` statement is now allowed in the
18992  :keyword:`finally` clause.
18993
18994- bpo-17611: Simplified the interpreter loop by moving the logic of
18995  unrolling the stack of blocks into the compiler. The compiler emits now
18996  explicit instructions for adjusting the stack of values and calling the
18997  cleaning up code for :keyword:`break`, :keyword:`continue` and
18998  :keyword:`return`.
18999
19000  Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`,
19001  :opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes
19002  :opcode:`ROT_FOUR`, :opcode:`BEGIN_FINALLY` and :opcode:`CALL_FINALLY` and
19003  :opcode:`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and
19004  :opcode:`WITH_CLEANUP_START`.
19005
19006- bpo-32285: New function unicodedata.is_normalized, which can check whether
19007  a string is in a specific normal form.
19008
19009- bpo-10544: Yield expressions are now disallowed in comprehensions and
19010  generator expressions except the expression for the outermost iterable.
19011
19012- bpo-32117: Iterable unpacking is now allowed without parentheses in yield
19013  and return statements, e.g. ``yield 1, 2, 3, *rest``. Thanks to David
19014  Cuthbert for the change and Jordan Chapman for added tests.
19015
19016- bpo-31902: Fix the ``col_offset`` attribute for ast nodes
19017  ``ast.AsyncFor``, ``ast.AsyncFunctionDef``, and ``ast.AsyncWith``.
19018  Previously, ``col_offset`` pointed to the keyword after ``async``.
19019
19020- bpo-25862: Fix assertion failures in the ``tell()`` method of
19021  ``io.TextIOWrapper``. Patch by Zackery Spytz.
19022
19023- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a
19024  ctypes structured data type. Patch by Eryk Sun and Oren Milman.
19025
19026- bpo-31577: Fix a crash in `os.utime()` in case of a bad ns argument. Patch
19027  by Oren Milman.
19028
19029- bpo-29832: Remove references to 'getsockaddrarg' from various socket error
19030  messages. Patch by Oren Milman.
19031
19032Library
19033-------
19034
19035- bpo-35845: Add 'order' parameter to memoryview.tobytes().
19036
19037- bpo-35864: The _asdict() method for collections.namedtuple now returns a
19038  regular dict instead of an OrderedDict.
19039
19040- bpo-35537: An ExitStack is now used internally within subprocess.Popen to
19041  clean up pipe file handles. No behavior change in normal operation. But if
19042  closing one handle were ever to cause an exception, the others will now be
19043  closed instead of leaked.  (patch by Giampaolo Rodola)
19044
19045- bpo-35847: RISC-V needed the CTYPES_PASS_BY_REF_HACK.  Fixes ctypes
19046  Structure test_pass_by_value.
19047
19048- bpo-35813: Shared memory submodule added to multiprocessing to avoid need
19049  for serialization between processes
19050
19051- bpo-35780: Fix lru_cache() errors arising in recursive, reentrant, or
19052  multi-threaded code. These errors could result in orphan links and in the
19053  cache being trapped in a state with fewer than the specified maximum
19054  number of links. Fix handling of negative maxsize which should have been
19055  treated as zero. Fix errors in toggling the "full" status flag. Fix
19056  misordering of links when errors are encountered.  Sync-up the C code and
19057  pure Python code for the space saving path in functions with a single
19058  positional argument. In this common case, the space overhead of an lru
19059  cache entry is reduced by almost half.  Fix counting of cache misses. In
19060  error cases, the miss count was out of sync with the actual number of
19061  times the underlying user function was called.
19062
19063- bpo-35537: :func:`os.posix_spawn` and :func:`os.posix_spawnp` now have a
19064  *setsid* parameter.
19065
19066- bpo-23846: :class:`asyncio.ProactorEventLoop` now catches and logs send
19067  errors when the self-pipe is full.
19068
19069- bpo-34323: :mod:`asyncio`: Enhance ``IocpProactor.close()`` log: wait 1
19070  second before the first log, then log every second. Log also the number of
19071  seconds since ``close()`` was called.
19072
19073- bpo-35674: Add a new :func:`os.posix_spawnp` function. Patch by Joannah
19074  Nanjekye.
19075
19076- bpo-35733: ``ast.Constant(boolean)`` no longer an instance of
19077  :class:`ast.Num`.  Patch by Anthony Sottile.
19078
19079- bpo-35726: QueueHandler.prepare() now makes a copy of the record before
19080  modifying and enqueueing it, to avoid affecting other handlers in the
19081  chain.
19082
19083- bpo-35719: Sped up multi-argument :mod:`math` functions atan2(),
19084  copysign(), remainder() and hypot() by 1.3--2.5 times.
19085
19086- bpo-35717: Fix KeyError exception raised when using enums and compile.
19087  Patch contributed by Rémi Lapeyre.
19088
19089- bpo-35699: Fixed detection of Visual Studio Build Tools 2017 in distutils
19090
19091- bpo-32710: Fix memory leaks in asyncio ProactorEventLoop on overlapped
19092  operation failure.
19093
19094- bpo-35702: The :data:`time.CLOCK_UPTIME_RAW` constant is now available for
19095  macOS 10.12.
19096
19097- bpo-32710: Fix a memory leak in asyncio in the ProactorEventLoop when
19098  ``ReadFile()`` or ``WSASend()`` overlapped operation fail immediately:
19099  release the internal buffer.
19100
19101- bpo-35682: Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to
19102  set the result of an internal future if it's already done.
19103
19104- bpo-35283: Add a deprecated warning for the
19105  :meth:`threading.Thread.isAlive` method. Patch by Dong-hee Na.
19106
19107- bpo-35664: Improve operator.itemgetter() performance by 33% with optimized
19108  argument handling and with adding a fast path for the common case of a
19109  single non-negative integer index into a tuple (which is the typical use
19110  case in the standard library).
19111
19112- bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in
19113  Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen.
19114
19115- bpo-35619: Improved support of custom data descriptors in :func:`help` and
19116  :mod:`pydoc`.
19117
19118- bpo-28503: The `crypt` module now internally uses the `crypt_r()` library
19119  function instead of `crypt()` when available.
19120
19121- bpo-35614: Fixed help() on metaclasses. Patch by Sanyam Khurana.
19122
19123- bpo-35568: Expose ``raise(signum)`` as `raise_signal`
19124
19125- bpo-35588: The floor division and modulo operations and the :func:`divmod`
19126  function on :class:`fractions.Fraction` types are 2--4x faster. Patch by
19127  Stefan Behnel.
19128
19129- bpo-35585: Speed-up building enums by value, e.g. http.HTTPStatus(200).
19130
19131- bpo-30561: random.gammavariate(1.0, beta) now computes the same result as
19132  random.expovariate(1.0 / beta).  This synchronizes the two algorithms and
19133  eliminates some idiosyncrasies in the old implementation.  It does however
19134  produce a difference stream of random variables than it used to.
19135
19136- bpo-35537: The :mod:`subprocess` module can now use the
19137  :func:`os.posix_spawn` function in some cases for better performance.
19138
19139- bpo-35526: Delaying the 'joke' of barry_as_FLUFL.mandatory to Python
19140  version 4.0
19141
19142- bpo-35523: Remove :mod:`ctypes` callback workaround: no longer create a
19143  callback at startup. Avoid SELinux alert on ``import ctypes`` and ``import
19144  uuid``.
19145
19146- bpo-31784: :func:`uuid.uuid1` now calls :func:`time.time_ns` rather than
19147  ``int(time.time() * 1e9)``.
19148
19149- bpo-35513: :class:`~unittest.runner.TextTestRunner` of
19150  :mod:`unittest.runner` now uses :func:`time.perf_counter` rather than
19151  :func:`time.time` to measure the execution time of a test:
19152  :func:`time.time` can go backwards, whereas :func:`time.perf_counter` is
19153  monotonic.
19154
19155- bpo-35502: Fixed reference leaks in
19156  :class:`xml.etree.ElementTree.TreeBuilder` in case of unfinished building
19157  of the tree (in particular when an error was raised during parsing XML).
19158
19159- bpo-35348: Make :func:`platform.architecture` parsing of ``file`` command
19160  output more reliable: add the ``-b`` option to the ``file`` command to
19161  omit the filename, force the usage of the C locale, and search also the
19162  "shared object" pattern.
19163
19164- bpo-35491: :mod:`multiprocessing`: Add ``Pool.__repr__()`` and enhance
19165  ``BaseProcess.__repr__()`` (add pid and parent pid) to ease debugging.
19166  Pool state constant values are now strings instead of integers, for
19167  example ``RUN`` value becomes ``'RUN'`` instead of ``0``.
19168
19169- bpo-35477: :meth:`multiprocessing.Pool.__enter__` now fails if the pool is
19170  not running: ``with pool:`` fails if used more than once.
19171
19172- bpo-31446: Copy command line that was passed to CreateProcessW since this
19173  function can change the content of the input buffer.
19174
19175- bpo-35471: Python 2.4 dropped MacOS 9 support. The macpath module was
19176  deprecated in Python 3.7. The module is now removed.
19177
19178- bpo-23057: Unblock Proactor event loop when keyboard interrupt is received
19179  on Windows
19180
19181- bpo-35052: Fix xml.dom.minidom cloneNode() on a document with an entity:
19182  pass the correct arguments to the user data handler of an entity.
19183
19184- bpo-20239: Allow repeated assignment deletion of
19185  :class:`unittest.mock.Mock` attributes. Patch by Pablo Galindo.
19186
19187- bpo-17185: Set ``__signature__`` on mock for :mod:`inspect` to get
19188  signature. Patch by Karthikeyan Singaravelan.
19189
19190- bpo-35445: Memory errors during creating posix.environ no longer ignored.
19191
19192- bpo-35415: Validate fileno= argument to socket.socket().
19193
19194- bpo-35424: :class:`multiprocessing.Pool` destructor now emits
19195  :exc:`ResourceWarning` if the pool is still running.
19196
19197- bpo-35330: When a :class:`Mock` instance was used to wrap an object, if
19198  `side_effect` is used in one of the mocks of it methods, don't call the
19199  original implementation and return the result of using the side effect the
19200  same way that it is done with return_value.
19201
19202- bpo-35346: Drop Mac OS 9 and Rhapsody support from the :mod:`platform`
19203  module. Rhapsody last release was in 2000. Mac OS 9 last release was in
19204  2001.
19205
19206- bpo-10496: :func:`~distutils.utils.check_environ` of
19207  :mod:`distutils.utils` now catches :exc:`KeyError` on calling
19208  :func:`pwd.getpwuid`: don't create the ``HOME`` environment variable in
19209  this case.
19210
19211- bpo-10496: :func:`posixpath.expanduser` now returns the input *path*
19212  unchanged if the ``HOME`` environment variable is not set and the current
19213  user has no home directory (if the current user identifier doesn't exist
19214  in the password database). This change fix the :mod:`site` module if the
19215  current user doesn't exist in the password database (if the user has no
19216  home directory).
19217
19218- bpo-35389: :func:`platform.libc_ver` now uses
19219  ``os.confstr('CS_GNU_LIBC_VERSION')`` if available and the *executable*
19220  parameter is not set.
19221
19222- bpo-35394: Add empty slots to asyncio abstract protocols.
19223
19224- bpo-35310: Fix a bug in :func:`select.select` where, in some cases, the
19225  file descriptor sequences were returned unmodified after a signal
19226  interruption, even though the file descriptors might not be ready yet.
19227  :func:`select.select` will now always return empty lists if a timeout has
19228  occurred.  Patch by Oran Avraham.
19229
19230- bpo-35380: Enable TCP_NODELAY on Windows for proactor asyncio event loop.
19231
19232- bpo-35341: Add generic version of ``collections.OrderedDict`` to the
19233  ``typing`` module. Patch by Ismo Toijala.
19234
19235- bpo-35371: Fixed possible crash in ``os.utime()`` on Windows when pass
19236  incorrect arguments.
19237
19238- bpo-35346: :func:`platform.uname` now redirects ``stderr`` to
19239  :data:`os.devnull` when running external programs like ``cmd /c ver``.
19240
19241- bpo-35066: Previously, calling the strftime() method on a datetime object
19242  with a trailing '%' in the format string would result in an exception.
19243  However, this only occurred when the datetime C module was being used; the
19244  python implementation did not match this behavior. Datetime is now PEP-399
19245  compliant, and will not throw an exception on a trailing '%'.
19246
19247- bpo-35345: The function `platform.popen` has been removed, it was
19248  deprecated since Python 3.3: use :func:`os.popen` instead.
19249
19250- bpo-35344: On macOS, :func:`platform.platform` now uses
19251  :func:`platform.mac_ver`, if it returns a non-empty release string, to get
19252  the macOS version rather than the darwin version.
19253
19254- bpo-35312: Make ``lib2to3.pgen2.parse.ParseError`` round-trip pickle-able.
19255  Patch by Anthony Sottile.
19256
19257- bpo-35308: Fix regression in ``webbrowser`` where default browsers may be
19258  preferred over browsers in the ``BROWSER`` environment variable.
19259
19260- bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff.
19261  Original patch by R. David Murray & Jairo Trad. Enhanced by Sanyam
19262  Khurana.
19263
19264- bpo-28604: :func:`locale.localeconv` now sets temporarily the ``LC_CTYPE``
19265  locale to the ``LC_MONETARY`` locale if the two locales are different and
19266  monetary strings are non-ASCII. This temporary change affects other
19267  threads.
19268
19269- bpo-35277: Update ensurepip to install pip 18.1 and setuptools 40.6.2.
19270
19271- bpo-24209: Adds IPv6 support when invoking http.server directly.
19272
19273- bpo-35226: Recursively check arguments when testing for equality of
19274  :class:`unittest.mock.call` objects and add note that tracking of
19275  parameters used to create ancestors of mocks in ``mock_calls`` is not
19276  possible.
19277
19278- bpo-29564: The warnings module now suggests to enable tracemalloc if the
19279  source is specified, the tracemalloc module is available, but tracemalloc
19280  is not tracing memory allocations.
19281
19282- bpo-35189: Modify the following fnctl function to retry if interrupted by
19283  a signal (EINTR): flock, lockf, fnctl
19284
19285- bpo-30064: Use add_done_callback() in sock_* asyncio API to unsubscribe
19286  reader/writer early on calcellation.
19287
19288- bpo-35186: Removed the "built with" comment added when ``setup.py upload``
19289  is used with either ``bdist_rpm`` or ``bdist_dumb``.
19290
19291- bpo-35152: Allow sending more than 2 GB at once on a multiprocessing
19292  connection on non-Windows systems.
19293
19294- bpo-35062: Fix incorrect parsing of
19295  :class:`_io.IncrementalNewlineDecoder`'s *translate* argument.
19296
19297- bpo-35065: Remove `StreamReaderProtocol._untrack_reader`. The call to
19298  `_untrack_reader` is currently performed too soon, causing the protocol to
19299  forget about the reader before `connection_lost` can run and feed the EOF
19300  to the reader.
19301
19302- bpo-34160: ElementTree and minidom now preserve the attribute order
19303  specified by the user.
19304
19305- bpo-35079: Improve difflib.SequenceManager.get_matching_blocks doc by
19306  adding 'non-overlapping' and changing '!=' to '<'.
19307
19308- bpo-33710: Deprecated ``l*gettext()`` functions and methods in the
19309  :mod:`gettext` module. They return encoded bytes instead of Unicode
19310  strings and are artifacts from Python 2 times. Also deprecated functions
19311  and methods related to setting the charset for ``l*gettext()`` functions
19312  and methods.
19313
19314- bpo-35017: :meth:`socketserver.BaseServer.serve_forever` now exits
19315  immediately if it's :meth:`~socketserver.BaseServer.shutdown` method is
19316  called while it is polling for new events.
19317
19318- bpo-35024: `importlib` no longer logs `wrote <bytecode path>` redundantly
19319  after `(created|could not create) <bytecode path>` is already logged.
19320  Patch by Quentin Agren.
19321
19322- bpo-35047: ``unittest.mock`` now includes mock calls in exception messages
19323  if ``assert_not_called``, ``assert_called_once``, or
19324  ``assert_called_once_with`` fails. Patch by Petter Strandmark.
19325
19326- bpo-31047: Fix ``ntpath.abspath`` regression where it didn't remove a
19327  trailing separator on Windows. Patch by Tim Graham.
19328
19329- bpo-35053: tracemalloc now tries to update the traceback when an object is
19330  reused from a "free list" (optimization for faster object creation, used
19331  by the builtin list type for example).
19332
19333- bpo-31553: Add the --json-lines option to json.tool. Patch by hongweipeng.
19334
19335- bpo-34794: Fixed a leak in Tkinter when pass the Python wrapper around
19336  Tcl_Obj back to Tcl/Tk.
19337
19338- bpo-34909: Enum: fix grandchildren subclassing when parent mixed with
19339  concrete data types.
19340
19341- bpo-35022: :class:`unittest.mock.MagicMock` now supports the
19342  ``__fspath__`` method (from :class:`os.PathLike`).
19343
19344- bpo-35008: Fixed references leaks when call the ``__setstate__()`` method
19345  of :class:`xml.etree.ElementTree.Element` in the C implementation for
19346  already initialized element.
19347
19348- bpo-23420: Verify the value for the parameter '-s' of the cProfile CLI.
19349  Patch by Robert Kuska
19350
19351- bpo-33947: dataclasses now handle recursive reprs without raising
19352  RecursionError.
19353
19354- bpo-34890: Make :func:`inspect.iscoroutinefunction`,
19355  :func:`inspect.isgeneratorfunction` and :func:`inspect.isasyncgenfunction`
19356  work with :func:`functools.partial`. Patch by Pablo Galindo.
19357
19358- bpo-34521: Use :func:`socket.CMSG_SPACE` to calculate ancillary data size
19359  instead of :func:`socket.CMSG_LEN` in
19360  :func:`multiprocessing.reduction.recvfds` as :rfc:`3542` requires the use
19361  of the former for portable applications.
19362
19363- bpo-31522: The `mailbox.mbox.get_string` function *from_* parameter can
19364  now successfully be set to a non-default value.
19365
19366- bpo-34970: Protect tasks weak set manipulation in ``asyncio.all_tasks()``
19367
19368- bpo-34969: gzip: Add --fast, --best on the gzip CLI, these parameters will
19369  be used for the fast compression method (quick) or the best method
19370  compress (slower, but smaller file). Also, change the default compression
19371  level to 6 (tradeoff).
19372
19373- bpo-16965: The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file
19374  with mode ``'rb'``.  Patch by Zackery Spytz.
19375
19376- bpo-34966: :mod:`pydoc` now supports aliases not only to methods defined
19377  in the end class, but also to inherited methods.  The docstring is not
19378  duplicated for aliases.
19379
19380- bpo-34926: :meth:`mimetypes.MimeTypes.guess_type` now accepts
19381  :term:`path-like object` in addition to url strings. Patch by Mayank
19382  Asthana.
19383
19384- bpo-23831: Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch
19385  by Juliette Monsel.
19386
19387- bpo-34941: Methods ``find()``, ``findtext()`` and ``findall()`` of the
19388  ``Element`` class in the :mod:`xml.etree.ElementTree` module are now able
19389  to find children which are instances of ``Element`` subclasses.
19390
19391- bpo-32680: :class:`smtplib.SMTP` objects now always have a `sock`
19392  attribute present
19393
19394- bpo-34769: Fix for async generators not finalizing when event loop is in
19395  debug mode and garbage collector runs in another thread.
19396
19397- bpo-34936: Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``.
19398  Patch by Juliette Monsel.
19399
19400- bpo-34829: Add methods ``selection_from``, ``selection_range``,
19401  ``selection_present`` and ``selection_to`` to the ``tkinter.Spinbox`` for
19402  consistency with the ``tkinter.Entry`` widget. Patch by Juliette Monsel.
19403
19404- bpo-34911: Added *secure_protocols* argument to
19405  *http.cookiejar.DefaultCookiePolicy* to allow for tweaking of protocols
19406  and also to add support by default for *wss*, the secure websocket
19407  protocol.
19408
19409- bpo-34922: Fixed integer overflow in the :meth:`~hashlib.shake.digest()`
19410  and :meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm in
19411  the :mod:`hashlib` module.
19412
19413- bpo-34925: 25% speedup in argument parsing for the functions in the bisect
19414  module.
19415
19416- bpo-34900: Fixed :meth:`unittest.TestCase.debug` when used to call test
19417  methods with subtests.  Patch by Bruno Oliveira.
19418
19419- bpo-34844: logging.Formatter enhancement - Ensure styles and fmt matches
19420  in logging.Formatter - Added validate method in each format style class:
19421  StrFormatStyle, PercentStyle, StringTemplateStyle. - This method is called
19422  in the constructor of logging.Formatter class - Also re-raise the KeyError
19423  in the format method of each style class, so it would a bit clear that
19424  it's an error with the invalid format fields.
19425
19426- bpo-34897: Adjust test.support.missing_compiler_executable check so that a
19427  nominal command name of "" is ignored. Patch by Michael Felt.
19428
19429- bpo-34871: Fix inspect module polluted ``sys.modules`` when parsing
19430  ``__text_signature__`` of callable.
19431
19432- bpo-34898: Add `mtime` argument to `gzip.compress` for reproducible
19433  output. Patch by Guo Ci Teo.
19434
19435- bpo-28441: On Cygwin and MinGW, ensure that ``sys.executable`` always
19436  includes the full filename in the path, including the ``.exe`` suffix
19437  (unless it is a symbolic link).
19438
19439- bpo-34866: Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS
19440  attacks harder by limiting the number of ``MiniFieldStorage`` objects
19441  created by ``FieldStorage``.
19442
19443- bpo-34711: http.server ensures it reports HTTPStatus.NOT_FOUND when the
19444  local path ends with "/" and is not a directory, even if the underlying OS
19445  (e.g. AIX) accepts such paths as a valid file reference. Patch by Michael
19446  Felt.
19447
19448- bpo-34872: Fix self-cancellation in C implementation of asyncio.Task
19449
19450- bpo-34849: Don't log waiting for ``selector.select`` in asyncio loop
19451  iteration. The waiting is pretty normal for any asyncio program, logging
19452  its time just adds a noise to logs without any useful information
19453  provided.
19454
19455- bpo-34022: The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer
19456  overrides the value of the *invalidation_mode* argument to
19457  :func:`py_compile.compile`, and determines its default value instead.
19458
19459- bpo-34819: Use a monotonic clock to compute timeouts in
19460  :meth:`Executor.map` and :func:`as_completed`, in order to prevent
19461  timeouts from deviating when the system clock is adjusted.
19462
19463- bpo-34758: Add .wasm -> application/wasm to list of recognized file types
19464  and content type headers
19465
19466- bpo-34789: :func:`xml.sax.make_parser` now accepts any iterable as its
19467  *parser_list* argument.  Patch by Andrés Delfino.
19468
19469- bpo-34334: In :class:`QueueHandler`, clear `exc_text` from
19470  :class:`LogRecord` to prevent traceback from being written twice.
19471
19472- bpo-34687: On Windows, asyncio now uses ProactorEventLoop, instead of
19473  SelectorEventLoop, by default.
19474
19475- bpo-5950: Support reading zip files with archive comments in
19476  :mod:`zipimport`.
19477
19478- bpo-32892: The parser now represents all constants as
19479  :class:`ast.Constant` instead of using specific constant AST types
19480  (``Num``, ``Str``, ``Bytes``, ``NameConstant`` and ``Ellipsis``). These
19481  classes are considered deprecated and will be removed in future Python
19482  versions.
19483
19484- bpo-34728: Add deprecation warning when `loop` is used in methods:
19485  `asyncio.sleep`, `asyncio.wait` and `asyncio.wait_for`.
19486
19487- bpo-34738: ZIP files created by :mod:`distutils` will now include entries
19488  for directories.
19489
19490- bpo-34659: Add an optional *initial* argument to itertools.accumulate().
19491
19492- bpo-29577: Support multiple mixin classes when creating Enums.
19493
19494- bpo-34670: Add SSLContext.post_handshake_auth and
19495  SSLSocket.verify_client_post_handshake for TLS 1.3's post handshake
19496  authentication feature.
19497
19498- bpo-32718: The Activate.ps1 script from venv works with PowerShell Core
19499  6.1 and is now available under all operating systems.
19500
19501- bpo-31177: Fix bug that prevented using :meth:`reset_mock
19502  <unittest.mock.Mock.reset_mock>` on mock instances with deleted attributes
19503
19504- bpo-34672: Add a workaround, so the ``'Z'`` :func:`time.strftime`
19505  specifier on the musl C library can work in some cases.
19506
19507- bpo-34666: Implement ``asyncio.StreamWriter.awrite`` and
19508  ``asyncio.StreamWriter.aclose()`` coroutines.  Methods are needed for
19509  providing a consistent stream API with control flow switched on by
19510  default.
19511
19512- bpo-6721: Acquire the logging module's commonly used internal locks while
19513  fork()ing to avoid deadlocks in the child process.
19514
19515- bpo-34658: Fix a rare interpreter unhandled exception state SystemError
19516  only seen when using subprocess with a preexec_fn while an after_parent
19517  handler has been registered with os.register_at_fork and the fork system
19518  call fails.
19519
19520- bpo-34652: Ensure :func:`os.lchmod` is never defined on Linux.
19521
19522- bpo-34638: Store a weak reference to stream reader to break strong
19523  references loop between reader and protocol.  It allows to detect and
19524  close the socket if the stream is deleted (garbage collected) without
19525  ``close()`` call.
19526
19527- bpo-34536: `Enum._missing_`:  raise `ValueError` if None returned and
19528  `TypeError` if non-member is returned.
19529
19530- bpo-34636: Speed up re scanning of many non-matching characters for \s \w
19531  and \d within bytes objects. (microoptimization)
19532
19533- bpo-24412: Add :func:`~unittest.addModuleCleanup()` and
19534  :meth:`~unittest.TestCase.addClassCleanup()` to unittest to support
19535  cleanups for :func:`~unittest.setUpModule()` and
19536  :meth:`~unittest.TestCase.setUpClass()`. Patch by Lisa Roach.
19537
19538- bpo-34630: Don't log SSL certificate errors in asyncio code (connection
19539  error logging is skipped already).
19540
19541- bpo-32490: Prevent filename duplication in :mod:`subprocess` exception
19542  messages.  Patch by Zackery Spytz.
19543
19544- bpo-34363: dataclasses.asdict() and .astuple() now handle namedtuples
19545  correctly.
19546
19547- bpo-34625: Update vendorized expat library version to 2.2.6.
19548
19549- bpo-32270: The subprocess module no longer mistakenly closes redirected
19550  fds even when they were in pass_fds when outside of the default {0, 1, 2}
19551  set.
19552
19553- bpo-34622: Create a dedicated ``asyncio.CancelledError``,
19554  ``asyncio.InvalidStateError`` and ``asyncio.TimeoutError`` exception
19555  classes.  Inherit them from corresponding exceptions from
19556  ``concurrent.futures`` package. Extract ``asyncio`` exceptions into a
19557  separate file.
19558
19559- bpo-34610: Fixed iterator of :class:`multiprocessing.managers.DictProxy`.
19560
19561- bpo-34421: Fix distutils logging for non-ASCII strings.  This caused
19562  installation issues on Windows.
19563
19564- bpo-34604: Fix possible mojibake in the error message of `pwd.getpwnam`
19565  and `grp.getgrnam` using string representation because of invisible
19566  characters or trailing whitespaces. Patch by William Grzybowski.
19567
19568- bpo-30977: Make uuid.UUID use ``__slots__`` to reduce its memory
19569  footprint. Based on original patch by Wouter Bolsterlee.
19570
19571- bpo-34574: OrderedDict iterators are not exhausted during pickling
19572  anymore. Patch by Sergey Fedoseev.
19573
19574- bpo-8110: Refactored :mod:`subprocess` to check for Windows-specific
19575  modules rather than ``sys.platform == 'win32'``.
19576
19577- bpo-34530: ``distutils.spawn.find_executable()`` now falls back on
19578  :data:`os.defpath` if the ``PATH`` environment variable is not set.
19579
19580- bpo-34563: On Windows, fix multiprocessing.Connection for very large read:
19581  fix _winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than
19582  INT_MAX (usually ``2**31-1``).
19583
19584- bpo-34558: Correct typo in Lib/ctypes/_aix.py
19585
19586- bpo-34282: Move ``Enum._convert`` to ``EnumMeta._convert_`` and fix enum
19587  members getting shadowed by parent attributes.
19588
19589- bpo-22872: When the queue is closed, :exc:`ValueError` is now raised by
19590  :meth:`multiprocessing.Queue.put` and :meth:`multiprocessing.Queue.get`
19591  instead of :exc:`AssertionError` and :exc:`OSError`, respectively. Patch
19592  by Zackery Spytz.
19593
19594- bpo-34515: Fix parsing non-ASCII identifiers in
19595  :mod:`lib2to3.pgen2.tokenize` (PEP 3131).
19596
19597- bpo-13312: Avoids a possible integer underflow (undefined behavior) in the
19598  time module's year handling code when passed a very low negative year
19599  value.
19600
19601- bpo-34472: Improved compatibility for streamed files in :mod:`zipfile`.
19602  Previously an optional signature was not being written and certain ZIP
19603  applications were not supported. Patch by Silas Sewell.
19604
19605- bpo-34454: Fix the .fromisoformat() methods of datetime types crashing
19606  when given unicode with non-UTF-8-encodable code points.  Specifically,
19607  datetime.fromisoformat() now accepts surrogate unicode code points used as
19608  the separator. Report and tests by Alexey Izbyshev, patch by Paul Ganssle.
19609
19610- bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks.
19611  Patch by Vladimir Matveev.
19612
19613- bpo-34171: Running the :mod:`trace` module no longer creates the
19614  ``trace.cover`` file.
19615
19616- bpo-34441: Fix crash when an ``ABC``-derived class with invalid
19617  ``__subclasses__`` is passed as the second argument to
19618  :func:`issubclass()`. Patch by Alexey Izbyshev.
19619
19620- bpo-34427: Fix infinite loop in ``a.extend(a)`` for ``MutableSequence``
19621  subclasses.
19622
19623- bpo-34412: Make :func:`signal.strsignal` work on HP-UX. Patch by Michael
19624  Osipov.
19625
19626- bpo-20849: shutil.copytree now accepts a new ``dirs_exist_ok`` keyword
19627  argument. Patch by Josh Bronson.
19628
19629- bpo-31715: Associate ``.mjs`` file extension with
19630  ``application/javascript`` MIME Type.
19631
19632- bpo-34384: :func:`os.readlink` now accepts :term:`path-like <path-like
19633  object>` and :class:`bytes` objects on Windows.
19634
19635- bpo-22602: The UTF-7 decoder now raises :exc:`UnicodeDecodeError` for
19636  ill-formed sequences starting with "+" (as specified in RFC 2152).  Patch
19637  by Zackery Spytz.
19638
19639- bpo-2122: The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns
19640  ``None`` on success, raises an exception on error under all platforms.
19641
19642- bpo-34341: Appending to the ZIP archive with the ZIP64 extension no longer
19643  grows the size of extra fields of existing entries.
19644
19645- bpo-34333: Fix %-formatting in :meth:`pathlib.PurePath.with_suffix` when
19646  formatting an error message.
19647
19648- bpo-18540: The :class:`imaplib.IMAP4` and :class:`imaplib.IMAP4_SSL`
19649  classes now resolve to the local host IP correctly when the default value
19650  of *host* parameter (``''``) is used.
19651
19652- bpo-26502: Implement ``traceback.FrameSummary.__len__()`` method to
19653  preserve compatibility with the old tuple API.
19654
19655- bpo-34318: :func:`~unittest.TestCase.assertRaises`,
19656  :func:`~unittest.TestCase.assertRaisesRegex`,
19657  :func:`~unittest.TestCase.assertWarns` and
19658  :func:`~unittest.TestCase.assertWarnsRegex` no longer success if the
19659  passed callable is None. They no longer ignore unknown keyword arguments
19660  in the context manager mode. A DeprecationWarning was raised in these
19661  cases since Python 3.5.
19662
19663- bpo-9372: Deprecate :meth:`__getitem__` methods of
19664  :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper`
19665  and :class:`fileinput.FileInput`.
19666
19667- bpo-33613: Fix a race condition in ``multiprocessing.semaphore_tracker``
19668  when the tracker receives SIGINT before it can register signal handlers
19669  for ignoring it.
19670
19671- bpo-34248: Report filename in the exception raised when the database file
19672  cannot be opened by :func:`dbm.gnu.open` and :func:`dbm.ndbm.open` due to
19673  OS-related error. Patch by Zsolt Cserna.
19674
19675- bpo-33089: Add math.dist() to compute the Euclidean distance between two
19676  points.
19677
19678- bpo-34246: :meth:`smtplib.SMTP.send_message` no longer modifies the
19679  content of the *mail_options* argument. Patch by Pablo S. Blum de Aguiar.
19680
19681- bpo-31047: Fix ``ntpath.abspath`` for invalid paths on windows. Patch by
19682  Franz Woellert.
19683
19684- bpo-32321: Add pure Python fallback for functools.reduce. Patch by Robert
19685  Wright.
19686
19687- bpo-34270: The default asyncio task class now always has a name which can
19688  be get or set using two new methods (:meth:`~asyncio.Task.get_name()` and
19689  :meth:`~asyncio.Task.set_name`) and is visible in the :func:`repr` output.
19690  An initial name can also be set using the new ``name`` keyword argument to
19691  :func:`asyncio.create_task` or the
19692  :meth:`~asyncio.AbstractEventLoop.create_task` method of the event loop.
19693  If no initial name is set, the default Task implementation generates a
19694  name like ``Task-1`` using a monotonic counter.
19695
19696- bpo-34263: asyncio's event loop will not pass timeouts longer than one day
19697  to epoll/select etc.
19698
19699- bpo-34035: Fix several AttributeError in zipfile seek() methods. Patch by
19700  Mickaël Schoentgen.
19701
19702- bpo-32215: Fix performance regression in :mod:`sqlite3` when a DML
19703  statement appeared in a different line than the rest of the SQL query.
19704
19705- bpo-34075: Deprecate passing non-ThreadPoolExecutor instances to
19706  :meth:`AbstractEventLoop.set_default_executor`.
19707
19708- bpo-34251: Restore ``msilib.Win64`` to preserve backwards compatibility
19709  since it's already used by :mod:`distutils`' ``bdist_msi`` command.
19710
19711- bpo-19891: Ignore errors caused by missing / non-writable homedir while
19712  writing history during exit of an interactive session.  Patch by Anthony
19713  Sottile.
19714
19715- bpo-33089: Enhanced math.hypot() to support more than two dimensions.
19716
19717- bpo-34228: tracemalloc: PYTHONTRACEMALLOC=0 environment variable and -X
19718  tracemalloc=0 command line option are now allowed to disable explicitly
19719  tracemalloc at startup.
19720
19721- bpo-13041: Use :func:`shutil.get_terminal_size` to calculate the terminal
19722  width correctly in the ``argparse.HelpFormatter`` class.  Initial patch by
19723  Zbyszek Jędrzejewski-Szmek.
19724
19725- bpo-34213: Allow frozen dataclasses to have a field named "object".
19726  Previously this conflicted with an internal use of "object".
19727
19728- bpo-34052: :meth:`sqlite3.Connection.create_aggregate`,
19729  :meth:`sqlite3.Connection.create_function`,
19730  :meth:`sqlite3.Connection.set_authorizer`,
19731  :meth:`sqlite3.Connection.set_progress_handler` methods raises TypeError
19732  when unhashable objects are passed as callable. These methods now don't
19733  pass such objects to SQLite API. Previous behavior could lead to
19734  segfaults. Patch by Sergey Fedoseev.
19735
19736- bpo-34197: Attributes *skipinitialspace*, *doublequote* and *strict* of
19737  the *dialect* attribute of the :mod:`csv` reader are now :class:`bool`
19738  instances instead of integers 0 or 1.
19739
19740- bpo-32788: Errors other than :exc:`TypeError` raised in methods
19741  ``__adapt__()`` and ``__conform__()`` in the :mod:`sqlite3` module are now
19742  propagated to the user.
19743
19744- bpo-21446: The :2to3fixer:`reload` fixer now uses :func:`importlib.reload`
19745  instead of deprecated :func:`imp.reload`.
19746
19747- bpo-940286: pydoc's ``Helper.showtopic()`` method now prints the cross
19748  references of a topic correctly.
19749
19750- bpo-34164: :func:`base64.b32decode` could raise UnboundLocalError or
19751  OverflowError for incorrect padding.  Now it always raises
19752  :exc:`base64.Error` in these cases.
19753
19754- bpo-33729: Fixed issues with arguments parsing in :mod:`hashlib`.
19755
19756- bpo-34097: ZipFile can zip files older than 1980-01-01 and newer than
19757  2107-12-31 using a new ``strict_timestamps`` parameter at the cost of
19758  setting the timestamp to the limit.
19759
19760- bpo-34108: Remove extraneous CR in 2to3 refactor.
19761
19762- bpo-34070: Make sure to only check if the handle is a tty, when opening a
19763  file with ``buffering=-1``.
19764
19765- bpo-27494: Reverted :issue:`27494`. 2to3 rejects now a trailing comma in
19766  generator expressions.
19767
19768- bpo-33967: functools.singledispatch now raises TypeError instead of
19769  IndexError when no positional arguments are passed.
19770
19771- bpo-34041: Add the parameter *deterministic* to the
19772  :meth:`sqlite3.Connection.create_function` method. Patch by Sergey
19773  Fedoseev.
19774
19775- bpo-34056: Ensure the loader shim created by ``imp.load_module`` always
19776  returns bytes from its ``get_data()`` function. This fixes using
19777  ``imp.load_module`` with :pep:`552` hash-based pycs.
19778
19779- bpo-34054: The multiprocessing module now uses the monotonic clock
19780  :func:`time.monotonic` instead of the system clock :func:`time.time` to
19781  implement timeout.
19782
19783- bpo-34043: Optimize tarfile uncompress performance about 15% when gzip is
19784  used.
19785
19786- bpo-34044: ``subprocess.Popen`` now copies the *startupinfo* argument to
19787  leave it unchanged: it will modify the copy, so that the same
19788  ``STARTUPINFO`` object can be used multiple times.
19789
19790- bpo-34010: Fixed a performance regression for reading streams with
19791  tarfile. The buffered read should use a list, instead of appending to a
19792  bytes object.
19793
19794- bpo-34019: webbrowser: Correct the arguments passed to Opera Browser when
19795  opening a new URL using the ``webbrowser`` module. Patch by Bumsik Kim.
19796
19797- bpo-34003: csv.DictReader now creates dicts instead of OrderedDicts. Patch
19798  by Michael Selik.
19799
19800- bpo-33978: Closed existing logging handlers before reconfiguration via
19801  fileConfig and dictConfig. Patch by Karthikeyan Singaravelan.
19802
19803- bpo-14117: Make minor tweaks to turtledemo. The 'wikipedia' example is now
19804  'rosette', describing what it draws.  The 'penrose' print output is
19805  reduced. The'1024' output of 'tree' is eliminated.
19806
19807- bpo-33974: Fixed passing lists and tuples of strings containing special
19808  characters ``"``, ``\``, ``{``, ``}`` and ``\n`` as options to
19809  :mod:`~tkinter.ttk` widgets.
19810
19811- bpo-27500: Fix getaddrinfo to resolve IPv6 addresses correctly.
19812
19813- bpo-24567: Improve random.choices() to handle subnormal input weights that
19814  could occasionally trigger an IndexError.
19815
19816- bpo-33871: Fixed integer overflow in :func:`os.readv`, :func:`os.writev`,
19817  :func:`os.preadv` and :func:`os.pwritev` and in :func:`os.sendfile` with
19818  *headers* or *trailers* arguments (on BSD-based OSes and macOS).
19819
19820- bpo-25007: Add :func:`copy.copy` and :func:`copy.deepcopy` support to zlib
19821  compressors and decompressors.  Patch by Zackery Spytz.
19822
19823- bpo-33929: multiprocessing: Fix a race condition in Popen of
19824  multiprocessing.popen_spawn_win32. The child process now duplicates the
19825  read end of pipe instead of "stealing" it. Previously, the read end of
19826  pipe was "stolen" by the child process, but it leaked a handle if the
19827  child process had been terminated before it could steal the handle from
19828  the parent process.
19829
19830- bpo-33899: Tokenize module now implicitly emits a NEWLINE when provided
19831  with input that does not have a trailing new line.  This behavior now
19832  matches what the C tokenizer does internally.  Contributed by Ammar Askar.
19833
19834- bpo-33897: Added a 'force' keyword argument to logging.basicConfig().
19835
19836- bpo-33695: :func:`shutil.copytree` uses :func:`os.scandir` function and
19837  all copy functions depending from it use cached :func:`os.stat` values.
19838  The speedup for copying a directory with 8000 files is around +9% on
19839  Linux, +20% on Windows and + 30% on a Windows SMB share. Also the number
19840  of :func:`os.stat` syscalls is reduced by 38% making
19841  :func:`shutil.copytree` especially faster on network filesystems.
19842  (Contributed by Giampaolo Rodola' in :issue:`33695`.)
19843
19844- bpo-33916: bz2 and lzma: When Decompressor.__init__() is called twice,
19845  free the old lock to not leak memory.
19846
19847- bpo-32568: Make select.epoll() and its documentation consistent regarding
19848  *sizehint* and *flags*.
19849
19850- bpo-33833: Fixed bug in asyncio where ProactorSocketTransport logs
19851  AssertionError if force closed during write.
19852
19853- bpo-33663: Convert content length to string before putting to header.
19854
19855- bpo-33721: :mod:`os.path` functions that return a boolean result like
19856  :func:`~os.path.exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`,
19857  :func:`~os.path.isfile`, :func:`~os.path.islink`, and
19858  :func:`~os.path.ismount`, and :mod:`pathlib.Path` methods that return a
19859  boolean result like :meth:`~pathlib.Path.exists()`,
19860  :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib.Path.is_file()`,
19861  :meth:`~pathlib.Path.is_mount()`, :meth:`~pathlib.Path.is_symlink()`,
19862  :meth:`~pathlib.Path.is_block_device()`,
19863  :meth:`~pathlib.Path.is_char_device()`, :meth:`~pathlib.Path.is_fifo()`,
19864  :meth:`~pathlib.Path.is_socket()` now return ``False`` instead of raising
19865  :exc:`ValueError` or its subclasses :exc:`UnicodeEncodeError` and
19866  :exc:`UnicodeDecodeError` for paths that contain characters or bytes
19867  unrepresentable at the OS level.
19868
19869- bpo-26544: Fixed implementation of :func:`platform.libc_ver`. It almost
19870  always returned version '2.9' for glibc.
19871
19872- bpo-33843: Remove deprecated ``cgi.escape``, ``cgi.parse_qs`` and
19873  ``cgi.parse_qsl``.
19874
19875- bpo-33842: Remove ``tarfile.filemode`` which is deprecated since Python
19876  3.3.
19877
19878- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
19879  Steve Weber.
19880
19881- bpo-33805: Improve error message of dataclasses.replace() when an InitVar
19882  is not specified
19883
19884- bpo-33687: Fix the call to ``os.chmod()`` for ``uu.decode()`` if a mode is
19885  given or decoded. Patch by Timo Furrer.
19886
19887- bpo-33812: Datetime instance d with non-None tzinfo, but with
19888  d.tzinfo.utcoffset(d) returning None is now treated as naive by the
19889  astimezone() method.
19890
19891- bpo-32108: In configparser, don't clear section when it is assigned to
19892  itself.
19893
19894- bpo-27397: Make email module properly handle invalid-length base64
19895  strings.
19896
19897- bpo-33578: Implement multibyte encoder/decoder state methods
19898
19899- bpo-30805: Avoid race condition with debug logging
19900
19901- bpo-33476: Fix _header_value_parser.py when address group is missing final
19902  ';'. Contributed by Enrique Perez-Terron
19903
19904- bpo-33694: asyncio: Fix a race condition causing data loss on
19905  pause_reading()/resume_reading() when using the ProactorEventLoop.
19906
19907- bpo-32493: Correct test for ``uuid_enc_be`` availability in
19908  ``configure.ac``. Patch by Michael Felt.
19909
19910- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and
19911  asyncio.WindowsProactorEventLoopPolicy.
19912
19913- bpo-33274: W3C DOM Level 1 specifies return value of
19914  Element.removeAttributeNode() as "The Attr node that was removed."
19915  xml.dom.minidom now complies with this requirement.
19916
19917- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0.
19918
19919- bpo-33165: Added a stacklevel parameter to logging calls to allow use of
19920  wrapper/helper functions for logging APIs.
19921
19922- bpo-33770: improve base64 exception message for encoded inputs of invalid
19923  length
19924
19925- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case
19926  of an unhandled error; mark SSLTransport as closed if it is aborted.
19927
19928- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
19929  operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
19930  performed on :class:`mmap.mmap` objects.  Patch by Zackery Spytz.
19931
19932- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake
19933  timeout
19934
19935- bpo-31014: Fixed creating a controller for :mod:`webbrowser` when a user
19936  specifies a path to an entry in the BROWSER environment variable.  Based
19937  on patch by John Still.
19938
19939- bpo-2504: Add gettext.pgettext() and variants.
19940
19941- bpo-33197: Add description property for _ParameterKind
19942
19943- bpo-32751: When cancelling the task due to a timeout,
19944  :meth:`asyncio.wait_for` will now wait until the cancellation is complete.
19945
19946- bpo-32684: Fix gather to propagate cancellation of itself even with
19947  return_exceptions.
19948
19949- bpo-33654: Support protocol type switching in SSLTransport.set_protocol().
19950
19951- bpo-33674: Pause the transport as early as possible to further reduce the
19952  risk of data_received() being called before connection_made().
19953
19954- bpo-33671: :func:`shutil.copyfile`, :func:`shutil.copy`,
19955  :func:`shutil.copy2`, :func:`shutil.copytree` and :func:`shutil.move` use
19956  platform-specific fast-copy syscalls on Linux and macOS in order to copy
19957  the file more efficiently. On Windows :func:`shutil.copyfile` uses a
19958  bigger default buffer size (1 MiB instead of 16 KiB) and a
19959  :func:`memoryview`-based variant of :func:`shutil.copyfileobj` is used.
19960  The speedup for copying a 512MiB file is about +26% on Linux, +50% on
19961  macOS and +40% on Windows. Also, much less CPU cycles are consumed.
19962  (Contributed by Giampaolo Rodola' in :issue:`25427`.)
19963
19964- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
19965  asyncio.sslproto: start immediately the handshake instead of using
19966  call_soon(). Previously, data_received() could be called before the
19967  handshake started, causing the handshake to hang or fail.
19968
19969- bpo-31647: Fixed bug where calling write_eof() on a
19970  _SelectorSocketTransport after it's already closed raises AttributeError.
19971
19972- bpo-32610: Make asyncio.all_tasks() return only pending tasks.
19973
19974- bpo-32410: Avoid blocking on file IO in sendfile fallback code
19975
19976- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
19977
19978- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
19979
19980- bpo-33654: Fix transport.set_protocol() to support switching between
19981  asyncio.Protocol and asyncio.BufferedProtocol.  Fix loop.start_tls() to
19982  work with asyncio.BufferedProtocols.
19983
19984- bpo-33652: Pickles of type variables and subscripted generics are now
19985  future-proof and compatible with older Python versions.
19986
19987- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD.
19988
19989- bpo-33238: Add ``InvalidStateError`` to :mod:`concurrent.futures`.
19990  ``Future.set_result`` and ``Future.set_exception`` now raise
19991  ``InvalidStateError`` if the futures are not pending or running. Patch by
19992  Jason Haydaman.
19993
19994- bpo-33618: Finalize and document preliminary and experimental TLS 1.3
19995  support with OpenSSL 1.1.1
19996
19997- bpo-33625: Release GIL on `grp.getgrnam`, `grp.getgrgid`, `pwd.getpwnam`
19998  and `pwd.getpwuid` if reentrant variants of these functions are available.
19999  Patch by William Grzybowski.
20000
20001- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__
20002
20003- bpo-11874: Use a better regex when breaking usage into wrappable parts.
20004  Avoids bogus assertion errors from custom metavar strings.
20005
20006- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
20007  that prevented the cache of parsed strings from clearing after finishing
20008  the decoding. Based on patch by c-fos.
20009
20010- bpo-33604: Remove HMAC default to md5 marked for removal in 3.8 (removal
20011  originally planned in 3.6, bump to 3.8 in PR 7062).
20012
20013- bpo-33582: Emit a deprecation warning for inspect.formatargspec
20014
20015- bpo-21145: Add ``functools.cached_property`` decorator, for computed
20016  properties cached for the life of the instance.
20017
20018- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
20019  OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
20020  enabled by default.
20021
20022- bpo-28556: Do not simplify arguments to `typing.Union`. Now
20023  `Union[Manager, Employee]` is not simplified to `Employee` at runtime.
20024  Such simplification previously caused several bugs and limited
20025  possibilities for introspection.
20026
20027- bpo-12486: :func:`tokenize.generate_tokens` is now documented as a public
20028  API to tokenize unicode strings. It was previously present but
20029  undocumented.
20030
20031- bpo-33540: Add a new ``block_on_close`` class attribute to
20032  ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`.
20033
20034- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
20035  locations
20036
20037- bpo-33109: argparse subparsers are once again not required by default,
20038  reverting the change in behavior introduced by bpo-26510 in 3.7.0a2.
20039
20040- bpo-33541: Remove unused private method ``_strptime.LocaleTime.__pad``
20041  (a.k.a. ``_LocaleTime__pad``).
20042
20043- bpo-33536: dataclasses.make_dataclass now checks for invalid field names
20044  and duplicate fields. Also, added a check for invalid field
20045  specifications.
20046
20047- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
20048  Windows. Patch by Zvi Effron
20049
20050- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in
20051  Windows proactor event loop.
20052
20053- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a
20054  string forward reference.
20055
20056- bpo-33516: :class:`unittest.mock.MagicMock` now supports the ``__round__``
20057  magic method.
20058
20059- bpo-28612: Added support for Site Maps to urllib's ``RobotFileParser`` as
20060  :meth:`RobotFileParser.site_maps()
20061  <urllib.robotparser.RobotFileParser.site_maps>`. Patch by Lady Red, based
20062  on patch by Peter Wirtz.
20063
20064- bpo-28167: Remove platform.linux_distribution, which was deprecated since
20065  3.5.
20066
20067- bpo-33504: Switch the default dictionary implementation for
20068  :mod:`configparser` from :class:`collections.OrderedDict` to the standard
20069  :class:`dict` type.
20070
20071- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x
20072  faster.
20073
20074- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in
20075  FieldStorage use the given errors (needed for Twisted).  Patch by Amber
20076  Brown.
20077
20078- bpo-29235: The :class:`cProfile.Profile` class can now be used as a
20079  context manager. Patch by Scott Sanderson.
20080
20081- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its
20082  members, instead of str.  This makes it more clear what each field
20083  actually represents.  This is especially true for the 'type' member.
20084
20085- bpo-26103: Correct ``inspect.isdatadescriptor`` to look for ``__set__`` or
20086  ``__delete__``.  Patch by Aaron Hall.
20087
20088- bpo-29209: Removed the ``doctype()`` method and the *html* parameter of
20089  the constructor of :class:`~xml.etree.ElementTree.XMLParser`.  The
20090  ``doctype()`` method defined in a subclass will no longer be called.
20091  Deprecated methods ``getchildren()`` and ``getiterator()`` in the
20092  :mod:`~xml.etree.ElementTree` module emit now a :exc:`DeprecationWarning`
20093  instead of :exc:`PendingDeprecationWarning`.
20094
20095- bpo-33453: Fix dataclasses to work if using literal string type
20096  annotations or if using PEP 563 "Postponed Evaluation of Annotations".
20097  Only specific string prefixes are detected for both ClassVar ("ClassVar"
20098  and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar").
20099
20100- bpo-28556: Minor fixes in typing module: add annotations to
20101  ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
20102  ``Generic.__new__``.  Original PRs by Paulius Šarka and Chad Dombrova.
20103
20104- bpo-33365: Print the header values besides the header keys instead just
20105  the header keys if *debuglevel* is set to >0 in :mod:`http.client`. Patch
20106  by Marco Strigl.
20107
20108- bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
20109
20110- bpo-33422: Fix trailing quotation marks getting deleted when looking up
20111  byte/string literals on pydoc. Patch by Andrés Delfino.
20112
20113- bpo-28167: The function ``platform.linux_distribution`` and
20114  ``platform.dist`` now trigger a ``DeprecationWarning`` and have been
20115  marked for removal in Python 3.8
20116
20117- bpo-33281: Fix ctypes.util.find_library regression on macOS.
20118
20119- bpo-33311: Text and html output generated by cgitb does not display
20120  parentheses if the current call is done directly in the module. Patch by
20121  Stéphane Blondon.
20122
20123- bpo-27300: The file classes in *tempfile* now accept an *errors* parameter
20124  that complements the already existing *encoding*.  Patch by Stephan Hohe.
20125
20126- bpo-32933: :func:`unittest.mock.mock_open` now supports iteration over the
20127  file contents. Patch by Tony Flury.
20128
20129- bpo-33217: Raise :exc:`TypeError` when looking up non-Enum objects in Enum
20130  classes and Enum members.
20131
20132- bpo-33197: Update error message when constructing invalid
20133  inspect.Parameters Patch by Dong-hee Na.
20134
20135- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
20136  object when it is called with a single argument.
20137
20138- bpo-33375: The warnings module now finds the Python file associated with a
20139  warning from the code object, rather than the frame's global namespace.
20140  This is consistent with how tracebacks and pdb find filenames, and should
20141  work better for dynamically executed code.
20142
20143- bpo-33336: ``imaplib`` now allows ``MOVE`` command in ``IMAP4.uid()`` (RFC
20144  6851: IMAP MOVE Extension) and potentially as a name of supported method
20145  of ``IMAP4`` object.
20146
20147- bpo-32455: Added *jump* parameter to :func:`dis.stack_effect`.
20148
20149- bpo-27485: Rename and deprecate undocumented functions in
20150  :func:`urllib.parse`.
20151
20152- bpo-33332: Add ``signal.valid_signals()`` to expose the POSIX sigfillset()
20153  functionality.
20154
20155- bpo-33251: `ConfigParser.items()` was fixed so that key-value pairs passed
20156  in via `vars` are not included in the resulting output.
20157
20158- bpo-33329: Fix multiprocessing regression on newer glibcs
20159
20160- bpo-33334: :func:`dis.stack_effect` now supports all defined opcodes
20161  including NOP and EXTENDED_ARG.
20162
20163- bpo-991266: Fix quoting of the ``Comment`` attribute of
20164  :class:`http.cookies.SimpleCookie`.
20165
20166- bpo-33131: Upgrade bundled version of pip to 10.0.1.
20167
20168- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
20169  object to a tree of tuples or lists with ``line_info=False`` and
20170  ``col_info=True``.
20171
20172- bpo-23403: lib2to3 now uses pickle protocol 4 for pre-computed grammars.
20173
20174- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings.
20175
20176- bpo-11594: Ensure line-endings are respected when using lib2to3.
20177
20178- bpo-33254: Have :func:`importlib.resources.contents` and
20179  :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable`
20180  instead of an :term:`iterator`.
20181
20182- bpo-33265: ``contextlib.ExitStack`` and ``contextlib.AsyncExitStack`` now
20183  use a method instead of a wrapper function for exit callbacks.
20184
20185- bpo-33263: Fix FD leak in `_SelectorSocketTransport`  Patch by Vlad
20186  Starostin.
20187
20188- bpo-33256: Fix display of ``<module>`` call in the html produced by
20189  ``cgitb.html()``. Patch by Stéphane Blondon.
20190
20191- bpo-33144: ``random.Random()`` and its subclassing mechanism got optimized
20192  to check only once at class/subclass instantiation time whether its
20193  ``getrandbits()`` method can be relied on by other methods, including
20194  ``randrange()``, for the generation of arbitrarily large random integers.
20195  Patch by Wolfgang Maier.
20196
20197- bpo-33185: Fixed regression when running pydoc with the :option:`-m`
20198  switch. (The regression was introduced in 3.7.0b3 by the resolution of
20199  :issue:`33053`)
20200
20201  This fix also changed pydoc to add ``os.getcwd()`` to :data:`sys.path`
20202  when necessary, rather than adding ``"."``.
20203
20204- bpo-29613: Added support for the ``SameSite`` cookie flag to the
20205  ``http.cookies`` module.
20206
20207- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache`
20208  when :meth:`importlib.machinery.invalidate_caches` is called.
20209
20210- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
20211  sequences consistently even when called from subclasses without a
20212  ``getrandbits()`` implementation.
20213
20214- bpo-33224: Update difflib.mdiff() for :pep:`479`.  Convert an uncaught
20215  StopIteration in a generator into a return-statement.
20216
20217- bpo-33209: End framing at the end of C implementation of
20218  :func:`pickle.Pickler.dump`.
20219
20220- bpo-32861: The urllib.robotparser's ``__str__`` representation now
20221  includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
20222  Also removes extra newlines that were being appended to the end of the
20223  string. Patch by Michael Lazar.
20224
20225- bpo-23403: ``DEFAULT_PROTOCOL`` in :mod:`pickle` was bumped to 4. Protocol
20226  4 is described in :pep:`3154` and available since Python 3.4. It offers
20227  better performance and smaller size compared to protocol 3 introduced in
20228  Python 3.0.
20229
20230- bpo-20104: Improved error handling and fixed a reference leak in
20231  :func:`os.posix_spawn()`.
20232
20233- bpo-33106: Deleting a key from a read-only dbm database raises module
20234  specific error instead of KeyError.
20235
20236- bpo-33175: In dataclasses, Field.__set_name__ now looks up the
20237  __set_name__ special method on the class, not the instance, of the default
20238  value.
20239
20240- bpo-32380: Create functools.singledispatchmethod to support generic single
20241  dispatch on descriptors and methods.
20242
20243- bpo-33141: Have Field objects pass through __set_name__ to their default
20244  values, if they have their own __set_name__.
20245
20246- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
20247  boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
20248  Khatri.
20249
20250- bpo-32873: Treat type variables and special typing forms as immutable by
20251  copy and pickle.  This fixes several minor issues and inconsistencies, and
20252  improves backwards compatibility with Python 3.6.
20253
20254- bpo-33134: When computing dataclass's __hash__, use the lookup table to
20255  contain the function which returns the __hash__ value.  This is an
20256  improvement over looking up a string, and then testing that string to see
20257  what to do.
20258
20259- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
20260
20261- bpo-32505: Raise TypeError if a member variable of a dataclass is of type
20262  Field, but doesn't have a type annotation.
20263
20264- bpo-33078: Fix the failure on OSX caused by the tests relying on
20265  sem_getvalue
20266
20267- bpo-33116: Add 'Field' to dataclasses.__all__.
20268
20269- bpo-32896: Fix an error where subclassing a dataclass with a field that
20270  uses a default_factory would generate an incorrect class.
20271
20272- bpo-33100: Dataclasses: If a field has a default value that's a
20273  MemberDescriptorType, then it's from that field being in __slots__, not an
20274  actual default value.
20275
20276- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow
20277  attributes to be added to the derived class.  Only attributes from the
20278  frozen dataclass cannot be assigned to.  Require all dataclasses in a
20279  hierarchy to be either all frozen or all non-frozen.
20280
20281- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during
20282  interpreter shutdown.
20283
20284- bpo-32968: Modulo and floor division involving Fraction and float should
20285  return float.
20286
20287- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py
20288
20289- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling
20290  error occurs.
20291
20292- bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
20293  and ``**kwargs`` in function signatures.
20294
20295- bpo-33056: FIX properly close leaking fds in
20296  concurrent.futures.ProcessPoolExecutor.
20297
20298- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
20299  threads when calling mmap.mmap(), os.urandom(), and random.seed().  Patch
20300  by Nir Soffer.
20301
20302- bpo-31804: Avoid failing in multiprocessing.Process if the standard
20303  streams are closed or None at exit.
20304
20305- bpo-33034: Providing an explicit error message when casting the port
20306  property to anything that is not an integer value using ``urlparse()`` and
20307  ``urlsplit()``. Patch by Matt Eaton.
20308
20309- bpo-30249: Improve struct.unpack_from() exception messages for problems
20310  with the buffer size and offset.
20311
20312- bpo-33037: Skip sending/receiving data after SSL transport closing.
20313
20314- bpo-27683: Fix a regression in :mod:`ipaddress` that result of
20315  :meth:`hosts` is empty when the network is constructed by a tuple
20316  containing an integer mask and only 1 bit left for addresses.
20317
20318- bpo-22674: Add the strsignal() function in the signal module that returns
20319  the system description of the given signal, as returned by strsignal(3).
20320
20321- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls,
20322  subclass)`` crashed when ``subclass`` is not a type object.
20323
20324- bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
20325
20326- bpo-32969: Expose several missing constants in zlib and fix corresponding
20327  documentation.
20328
20329- bpo-32056: Improved exceptions raised for invalid number of channels and
20330  sample width when read an audio file in modules :mod:`aifc`, :mod:`wave`
20331  and :mod:`sunau`.
20332
20333- bpo-32970: Improved disassembly of the MAKE_FUNCTION instruction.
20334
20335- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
20336  subprocess if another low descriptor is closed.
20337
20338- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen
20339  classes, and also disallow inheriting non-frozen from frozen classes. This
20340  restriction will be relaxed at a future date.
20341
20342- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
20343  by Joffrey Fuhrer.
20344
20345- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant,
20346  available with OpenSSL 1.1.0h or 1.1.1.
20347
20348- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now
20349  prohibited. The constructors were never documented, tested, or designed as
20350  public constructors. Users were suppose to use ssl.wrap_socket() or
20351  SSLContext.
20352
20353- bpo-32929: Remove the tri-state parameter "hash", and add the boolean
20354  "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a
20355  __hash__ exists, raise TypeError.  If unsafe_hash is False, add a __hash__
20356  based on the values of eq= and frozen=.  The unsafe_hash=False behavior is
20357  the same as the old hash=None behavior.  unsafe_hash=False is the default,
20358  just as hash=None used to be.
20359
20360- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3
20361  for future compatibility with OpenSSL 1.1.1.
20362
20363- bpo-32146: Document the interaction between frozen executables and the
20364  spawn and forkserver start methods in multiprocessing.
20365
20366- bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
20367
20368- bpo-32922: dbm.open() now encodes filename with the filesystem encoding
20369  rather than default encoding.
20370
20371- bpo-32759: Free unused arenas in multiprocessing.heap.
20372
20373- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
20374  syscall exists or not.
20375
20376- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and
20377  nt._getdiskusage now correctly convert from bytes.
20378
20379- bpo-21060: Rewrite confusing message from setup.py upload from "No dist
20380  file created in earlier command" to the more helpful "Must create and
20381  upload files in one command".
20382
20383- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
20384  :exc:`ValueError` instead of canceling the first scheduled function.
20385  Patch by Cheryl Sabella.
20386
20387- bpo-32852: Make sure sys.argv remains as a list when running trace.
20388
20389- bpo-31333: ``_abc`` module is added.  It is a speedup module with C
20390  implementations for various functions and methods in ``abc``.  Creating an
20391  ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC
20392  subclass are up to 1.5x faster. In addition, this makes Python start-up up
20393  to 10% faster.
20394
20395  Note that the new implementation hides internal registry and caches,
20396  previously accessible via private attributes ``_abc_registry``,
20397  ``_abc_cache``, and ``_abc_negative_cache``.  There are three debugging
20398  helper methods that can be used instead ``_dump_registry``,
20399  ``_abc_registry_clear``, and ``_abc_caches_clear``.
20400
20401- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored
20402  cancellation after notifying and cancelling a conditional lock. Patch by
20403  Bar Harel.
20404
20405- bpo-32819: ssl.match_hostname() has been simplified and no longer depends
20406  on re and ipaddress module for wildcard and IP addresses. Error reporting
20407  for invalid wildcards has been improved.
20408
20409- bpo-19675: ``multiprocessing.Pool`` no longer leaks processes if its
20410  initialization fails.
20411
20412- bpo-32394: socket: Remove
20413  TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version
20414  Windows during run-time.
20415
20416- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
20417  (Contributed by Oren Milman)
20418
20419- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
20420  only the last field is quoted.  Patch by Jake Davis.
20421
20422- bpo-30688: Added support of ``\N{name}`` escapes in regular expressions.
20423  Based on patch by Jonathan Eunice.
20424
20425- bpo-32792: collections.ChainMap() preserves the order of the underlying
20426  mappings.
20427
20428- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which
20429  contain set operations. Sets starting with '[' or containing '--', '&&',
20430  '~~' or '||' will be interpreted differently in regular expressions in
20431  future versions. Currently they emit warnings. fnmatch.translate() now
20432  avoids producing patterns containing such sets by accident.
20433
20434- bpo-32622: Implement native fast sendfile for Windows proactor event loop.
20435
20436- bpo-32777: Fix a rare but potential pre-exec child process deadlock in
20437  subprocess on POSIX systems when marking file descriptors inheritable on
20438  exec in the child process.  This bug appears to have been introduced in
20439  3.4.
20440
20441- bpo-32647: The ctypes module used to depend on indirect linking for
20442  dlopen. The shared extension is now explicitly linked against libdl on
20443  platforms with dl.
20444
20445- bpo-32749: A :mod:`dbm.dumb` database opened with flags 'r' is now
20446  read-only. :func:`dbm.dumb.open` with flags 'r' and 'w' no longer creates
20447  a database if it does not exist.
20448
20449- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method.
20450
20451- bpo-32691: Use mod_spec.parent when running modules with pdb
20452
20453- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
20454  and locking the same lock multiple times, without it being free. Patch by
20455  Bar Harel.
20456
20457- bpo-32727: Do not include name field in SMTP envelope from address. Patch
20458  by Stéphane Wirtel
20459
20460- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version /
20461  minimum_version attributes. The new API wraps OpenSSL 1.1
20462  https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html
20463  feature.
20464
20465- bpo-24334: Internal implementation details of ssl module were cleaned up.
20466  The SSLSocket has one less layer of indirection. Owner and session
20467  information are now handled by the SSLSocket and SSLObject constructor.
20468  Channel binding implementation has been simplified.
20469
20470- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
20471  chunk is not found. Patch by Zackery Spytz.
20472
20473- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`.  Patch by Alan D
20474  Moore.
20475
20476- bpo-32512: :mod:`profile` CLI accepts `-m module_name` as an alternative
20477  to script path.
20478
20479- bpo-8525: help() on a type now displays builtin subclasses. This is
20480  intended primarily to help with notification of more specific exception
20481  subclasses.
20482
20483  Patch by Sanyam Khurana.
20484
20485- bpo-31639: http.server now exposes a ThreadingHTTPServer class and uses it
20486  when the module is run with ``-m`` to cope with web browsers pre-opening
20487  sockets.
20488
20489- bpo-29877: compileall: import ProcessPoolExecutor only when needed,
20490  preventing hangs on low resource platforms
20491
20492- bpo-32221: Various functions returning tuple containing IPv6 addresses now
20493  omit ``%scope`` part since the same information is already encoded in
20494  *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom`
20495  when it receives multicast packet since useless resolving of network
20496  interface name is omitted.
20497
20498- bpo-32147: :func:`binascii.unhexlify` is now up to 2 times faster. Patch
20499  by Sergey Fedoseev.
20500
20501- bpo-30693: The TarFile class now recurses directories in a reproducible
20502  way.
20503
20504- bpo-30693: The ZipFile class now recurses directories in a reproducible
20505  way.
20506
20507- bpo-31680: Added :data:`curses.ncurses_version`.
20508
20509- bpo-31908: Fix output of cover files for ``trace`` module command-line
20510  tool. Previously emitted cover files only when ``--missing`` option was
20511  used. Patch by Michael Selik.
20512
20513- bpo-31608: Raise a ``TypeError`` instead of crashing if a
20514  ``collections.deque`` subclass returns a non-deque from ``__new__``. Patch
20515  by Oren Milman.
20516
20517- bpo-31425: Add support for sockets of the AF_QIPCRTR address family,
20518  supported by the Linux kernel. This is used to communicate with services,
20519  such as GPS or radio, running on Qualcomm devices. Patch by Bjorn
20520  Andersson.
20521
20522- bpo-22005: Implemented unpickling instances of
20523  :class:`~datetime.datetime`, :class:`~datetime.date` and
20524  :class:`~datetime.time` pickled by Python 2. ``encoding='latin1'`` should
20525  be used for successful decoding.
20526
20527- bpo-27645: :class:`sqlite3.Connection` now exposes a
20528  :class:`~sqlite3.Connection.backup` method, if the underlying SQLite
20529  library is at version 3.6.11 or higher.  Patch by Lele Gaifax.
20530
20531- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`.  Patch by Segev Finer.
20532
20533- bpo-31508: Removed support of arguments in
20534  `tkinter.ttk.Treeview.selection`. It was deprecated in 3.6.  Use
20535  specialized methods like `selection_set` for changing the selection.
20536
20537- bpo-29456: Fix bugs in hangul normalization: u1176, u11a7 and u11c3
20538
20539Documentation
20540-------------
20541
20542- bpo-21257: Document :func:`http.client.parse_headers`.
20543
20544- bpo-34764: Improve example of iter() with 2nd sentinel argument.
20545
20546- bpo-35564: Explicitly set master_doc variable in conf.py for compliance
20547  with Sphinx 2.0
20548
20549- bpo-35511: Specified that profile.Profile class doesn't not support enable
20550  or disable methods. Also, elaborated that Profile object as a context
20551  manager is only supported in cProfile module.
20552
20553- bpo-10536: Enhance the gettext docs. Patch by Éric Araujo
20554
20555- bpo-35089: Remove mention of ``typing.io`` and ``typing.re``. Their types
20556  should be imported from ``typing`` directly.
20557
20558- bpo-35038: Fix the documentation about an unexisting `f_restricted`
20559  attribute in the frame object. Patch by Stéphane Wirtel
20560
20561- bpo-35042: Replace PEP XYZ by the pep role and allow to use the direct
20562  links to the PEPs.
20563
20564- bpo-35044: Fix the documentation with the role ``exc`` for the
20565  appropriated exception. Patch by Stéphane Wirtel
20566
20567- bpo-35035: Rename documentation for :mod:`email.utils` to
20568  ``email.utils.rst``.
20569
20570- bpo-34967: Use app.add_object_type() instead of the deprecated Sphinx
20571  function app.description_unit()
20572
20573- bpo-34913: Add documentation about the new command line interface of the
20574  gzip module.
20575
20576- bpo-32174: chm document displays non-ASCII charaters properly on some MBCS
20577  Windows systems.
20578
20579- bpo-11233: Create availability directive for documentation.  Original
20580  patch by Georg Brandl.
20581
20582- bpo-34790: Document how passing coroutines to asyncio.wait() can be
20583  confusing.
20584
20585- bpo-34552: Make clear that ``==`` operator sometimes is equivalent to
20586  `is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where
20587  they make sense.
20588
20589- bpo-28617: Fixed info in the stdtypes docs concerning the types that
20590  support membership tests.
20591
20592- bpo-20177: Migrate datetime.date.fromtimestamp to Argument Clinic. Patch
20593  by Tim Hoffmann.
20594
20595- bpo-34065: Fix wrongly written basicConfig documentation markup syntax
20596
20597- bpo-33460: replaced ellipsis with correct error codes in tutorial chapter
20598  3.
20599
20600- bpo-33847: Add '@' operator entry to index.
20601
20602- bpo-33409: Clarified the relationship between :pep:`538`'s
20603  PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode.
20604
20605- bpo-33197: Add versionadded tag to the documentation of
20606  ParameterKind.description
20607
20608- bpo-17045: Improve the C-API doc for PyTypeObject.  This includes adding
20609  several quick-reference tables and a lot of missing slot/typedef entries.
20610  The existing entries were also cleaned up with a slightly more consistent
20611  format.
20612
20613- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`,
20614  :func:`asyncio.start_server` and their UNIX socket counterparts.
20615
20616- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on
20617  timeout.
20618
20619- bpo-32436: Document :pep:`567` changes to asyncio.
20620
20621- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal
20622  to 3.8.
20623
20624- bpo-33594: Document ``getargspec``, ``from_function`` and ``from_builtin``
20625  as deprecated in their respective docstring, and include version since
20626  deprecation in DeprecationWarning message.
20627
20628- bpo-33503: Fix broken pypi link
20629
20630- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
20631
20632- bpo-33487: BZ2file now emit a DeprecationWarning when buffering=None is
20633  passed, the deprecation message and documentation also now explicitly
20634  state it is deprecated since 3.0.
20635
20636- bpo-33378: Add Korean language switcher for https://docs.python.org/3/
20637
20638- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
20639  just any value.
20640
20641- bpo-33201: Modernize documentation for writing C extension types.
20642
20643- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
20644  ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
20645  missed in the document.
20646
20647- bpo-33126: Document PyBuffer_ToContiguous().
20648
20649- bpo-27212: Modify documentation for the :func:`islice` recipe to consume
20650  initial values up to the start index.
20651
20652- bpo-28247: Update :mod:`zipapp` documentation to describe how to make
20653  standalone applications.
20654
20655- bpo-18802: Documentation changes for ipaddress.  Patch by Jon Foster and
20656  Berker Peksag.
20657
20658- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
20659  implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
20660
20661- bpo-28124: The ssl module function ssl.wrap_socket() has been
20662  de-emphasized and deprecated in favor of the more secure and efficient
20663  SSLContext.wrap_socket() method.
20664
20665- bpo-17232: Clarify docs for -O and -OO.  Patch by Terry Reedy.
20666
20667- bpo-32436: Add documentation for the contextvars module (PEP 567).
20668
20669- bpo-32800: Update link to w3c doc for xml default namespaces.
20670
20671- bpo-11015: Update :mod:`test.support` documentation.
20672
20673- bpo-32613: Update the faq/windows.html to use the py command from PEP 397
20674  instead of python.
20675
20676- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
20677  method raises :exc:`AttributeError`.
20678
20679- bpo-32614: Modify RE examples in documentation to use raw strings to
20680  prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
20681  the deprecation.
20682
20683- bpo-20709: Remove the paragraph where we explain that os.utime() does not
20684  support a directory as path under Windows. Patch by Jan-Philip Gehrcke
20685
20686- bpo-32722: Remove the bad example in the tutorial of the Generator
20687  Expression. Patch by Stéphane Wirtel
20688
20689- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses.
20690
20691- bpo-30607: Use the externalized ``python-docs-theme`` package when
20692  building the documentation.
20693
20694- bpo-8243: Add a note about curses.addch and curses.addstr exception
20695  behavior when writing outside a window, or pad.
20696
20697- bpo-32337: Update documentation related with ``dict`` order.
20698
20699- bpo-25041: Document ``AF_PACKET`` in the :mod:`socket` module.
20700
20701- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
20702  flags for ssl.SSLContext.verify_mode.
20703
20704Tests
20705-----
20706
20707- bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs
20708  filesystem. Fix the function testing if the filesystem supports sparse
20709  files: create a file which contains data and "holes", instead of creating
20710  a file which contains no data. tmpfs effective block size is a page size
20711  (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64,
20712  ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch
20713  holes of 4 KiB.
20714
20715- bpo-35045: Make ssl tests less strict and also accept TLSv1 as system
20716  default. The changes unbreaks test_min_max_version on Fedora 29.
20717
20718- bpo-32710: ``test_asyncio/test_sendfile.py`` now resets the event loop
20719  policy using :func:`tearDownModule` as done in other tests, to prevent a
20720  warning when running tests on Windows.
20721
20722- bpo-33717: test.pythoninfo now logs information of all clocks, not only
20723  time.time() and time.perf_counter().
20724
20725- bpo-35488: Add a test to pathlib's Path.match() to verify it does not
20726  support glob-style ** recursive pattern matching.
20727
20728- bpo-31731: Fix a race condition in ``check_interrupted_write()`` of
20729  test_io: create directly the thread with SIGALRM signal blocked, rather
20730  than blocking the signal later from the thread. Previously, it was
20731  possible that the thread gets the signal before the signal is blocked.
20732
20733- bpo-35424: Fix test_multiprocessing_main_handling: use
20734  :class:`multiprocessing.Pool` with a context manager and then explicitly
20735  join the pool.
20736
20737- bpo-35519: Rename :mod:`test.bisect` module to :mod:`test.bisect_cmd` to
20738  avoid conflict with :mod:`bisect` module when running directly a test like
20739  ``./python Lib/test/test_xmlrpc.py``.
20740
20741- bpo-35513: Replace :func:`time.time` with :func:`time.monotonic` in tests
20742  to measure time delta.
20743
20744- bpo-34279: :func:`test.support.run_unittest` no longer raise
20745  :exc:`TestDidNotRun` if the test result contains skipped tests. The
20746  exception is now only raised if no test have been run and no test have
20747  been skipped.
20748
20749- bpo-35412: Add testcase to ``test_future4``: check unicode literal.
20750
20751- bpo-26704: Added test demonstrating double-patching of an instance method.
20752  Patch by Anthony Sottile.
20753
20754- bpo-33725: test_multiprocessing_fork may crash on recent versions of
20755  macOS.  Until the issue is resolved, skip the test on macOS.
20756
20757- bpo-35352: Modify test_asyncio to use the certificate set from the test
20758  directory.
20759
20760- bpo-35317: Fix ``mktime()`` overflow error in ``test_email``: run
20761  ``test_localtime_daylight_true_dst_true()`` and
20762  ``test_localtime_daylight_false_dst_true()`` with a specific timezone.
20763
20764- bpo-21263: After several reports that test_gdb does not work properly on
20765  macOS and since gdb is not shipped by default anymore, test_gdb is now
20766  skipped on macOS when LLVM Clang has been used to compile Python. Patch by
20767  Lysandros Nikolaou
20768
20769- bpo-34279: regrtest issue a warning when no tests have been executed in a
20770  particular test file. Also, a new final result state is issued if no test
20771  have been executed across all test files. Patch by Pablo Galindo.
20772
20773- bpo-34962: make docstest in Doc now passes., and is enforced in CI
20774
20775- bpo-23596: Use argparse for the command line of the gzip module. Patch by
20776  Antony Lee
20777
20778- bpo-34537: Fix ``test_gdb.test_strings()`` when ``LC_ALL=C`` and GDB was
20779  compiled with Python 3.6 or earlier.
20780
20781- bpo-34587: test_socket: Remove RDSTest.testCongestion(). The test tries to
20782  fill the receiver's socket buffer and expects an error. But the RDS
20783  protocol doesn't require that. Moreover, the Linux implementation of RDS
20784  expects that the producer of the messages reduces its rate, it's not the
20785  role of the receiver to trigger an error. The test fails on Fedora 28 by
20786  design, so just remove it.
20787
20788- bpo-34661: Fix test_shutil if unzip doesn't support -t.
20789
20790- bpo-34200: Fixed non-deterministic flakiness of test_pkg by not using the
20791  scary test.support.module_cleanup() logic to save and restore sys.modules
20792  contents between test cases.
20793
20794- bpo-34569: The experimental PEP 554 data channels now correctly pass
20795  negative PyLong objects between subinterpreters on 32-bit systems. Patch
20796  by Michael Felt.
20797
20798- bpo-34594: Fix usage of hardcoded ``errno`` values in the tests.
20799
20800- bpo-34579: Fix test_embed for AIX Patch by Michael Felt
20801
20802- bpo-34542: Use 3072 RSA keys and SHA-256 signature for test certs and
20803  keys.
20804
20805- bpo-11193: Remove special condition for AIX in
20806  `test_subprocess.test_undecodable_env`
20807
20808- bpo-34347: Fix `test_utf8_mode.test_cmd_line` for AIX
20809
20810- bpo-34490: On AIX with AF_UNIX family sockets getsockname() does not
20811  provide 'sockname', so skip calls to transport.get_extra_info('sockname')
20812
20813- bpo-34391: Fix ftplib test for TLS 1.3 by reading from data socket.
20814
20815- bpo-11192: Fix `test_socket` on AIX 6.1 and later IPv6 zone id supports
20816  only supported by inet_pton6_zone() Switch to runtime-based
20817  platform.system() to establish current platform  rather than build-time
20818  based sys.platform()
20819
20820- bpo-34399: Update all RSA keys and DH params to use at least 2048 bits.
20821
20822- bpo-34373: Fix ``test_mktime`` and ``test_pthread_getcpuclickid`` tests
20823  for AIX Add range checking for ``_PyTime_localtime`` for AIX Patch by
20824  Michael Felt
20825
20826- bpo-11191: Skip the distutils test 'test_search_cpp' when using XLC as
20827  compiler patch by aixtools (Michael Felt)
20828
20829- Improved an error message when mock assert_has_calls fails.
20830
20831- bpo-33746: Fix test_unittest when run in verbose mode.
20832
20833- bpo-33901: Fix test_dbm_gnu on macOS with gdbm 1.15: add a larger value to
20834  make sure that the file size changes.
20835
20836- bpo-33873: Fix a bug in ``regrtest`` that caused an extra test to run if
20837  --huntrleaks/-R was used. Exit with error in case that invalid parameters
20838  are specified to --huntrleaks/-R (at least one warmup run and one
20839  repetition must be used).
20840
20841- bpo-33562: Check that a global asyncio event loop policy is not left
20842  behind by any tests.
20843
20844- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
20845  might be due to running on ZFS.
20846
20847- bpo-32962: Fixed test_gdb when Python is compiled with flags -mcet
20848  -fcf-protection -O0.
20849
20850- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when
20851  the interpreter is built with ``--enable-shared``.
20852
20853- bpo-32872: Avoid regrtest compatibility issue with namespace packages.
20854
20855- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
20856  of ``KqueueSelector`` loop was not being closed.
20857
20858- bpo-32663: Making sure the `SMTPUTF8SimTests` class of tests gets run in
20859  test_smtplib.py.
20860
20861- bpo-27643: Test_C test case needs "signed short" bitfields, but the IBM
20862  XLC compiler (on AIX) does not support this Skip the code and test when
20863  AIX and XLC are used
20864
20865  Applicable to Python2-2.7 and later
20866
20867- bpo-19417: Add test_bdb.py.
20868
20869- bpo-31809: Add tests to verify connection with secp ECDH curves.
20870
20871Build
20872-----
20873
20874- bpo-34691: The _contextvars module is now built into the core Python
20875  library on Windows.
20876
20877- bpo-35683: Improved Azure Pipelines build steps and now verifying layouts
20878  correctly
20879
20880- bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj
20881
20882- bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4
20883  instead of sun when compiling.
20884
20885- bpo-35499: ``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with
20886  ``CFLAGS``. It now adds profile-guided optimization (PGO) flags to
20887  ``CFLAGS_NODIST``: existing ``CFLAGS_NODIST`` flags are kept.
20888
20889- bpo-35257: Avoid leaking the linker flags from Link Time Optimizations
20890  (LTO) into distutils when compiling C extensions.
20891
20892- bpo-35351: When building Python with clang and LTO, LTO flags are no
20893  longer passed into CFLAGS to build third-party C extensions through
20894  distutils.
20895
20896- bpo-35139: Fix a compiler error when statically linking `pyexpat` in
20897  `Modules/Setup`.
20898
20899- bpo-35059: PCbuild: Set InlineFunctionExpansion to OnlyExplicitInline
20900  ("/Ob1" option) in pyproject.props in Debug mode to expand functions
20901  marked as inline. This change should make Python compiled in Debug mode a
20902  little bit faster on Windows.
20903
20904- bpo-35011: Restores the use of pyexpatns.h to isolate our embedded copy of
20905  the expat C library so that its symbols do not conflict at link or dynamic
20906  loading time with an embedding application or other extension modules with
20907  their own version of libexpat.
20908
20909- bpo-28015: Have --with-lto works correctly with clang.
20910
20911- bpo-34765: Update the outdated install-sh file to the latest revision from
20912  automake v1.16.1
20913
20914- bpo-34585: Check for floating-point byte order in configure.ac using
20915  compilation tests instead of executing code, so that these checks work in
20916  cross-compiled builds.
20917
20918- bpo-34710: Fixed SSL module build with OpenSSL & pedantic CFLAGS.
20919
20920- bpo-34582: Add JUnit XML output for regression tests and update Azure
20921  DevOps builds.
20922
20923- bpo-34081: Make Sphinx warnings as errors in the Docs Makefile.
20924
20925- bpo-34555: Fix for case where it was not possible to have both
20926  ``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined.
20927
20928- bpo-33015: Fix an undefined behaviour in the pthread implementation of
20929  :c:func:`PyThread_start_new_thread`: add a function wrapper to always
20930  return ``NULL``.
20931
20932- bpo-34245: The Python shared library is now installed with write
20933  permission (mode 0755), which is the standard way of installing such
20934  libraries.
20935
20936- bpo-34121: Fix detection of C11 atomic support on clang.
20937
20938- bpo-32430: Rename Modules/Setup.dist to Modules/Setup, and remove the
20939  necessity to copy the former manually to the latter when updating the
20940  local source tree.
20941
20942- bpo-30345: Add -g to LDFLAGS when compiling with LTO to get debug symbols.
20943
20944- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
20945  ``OPT``. This option emitted annoying warnings when building extension
20946  modules written in C++.
20947
20948- bpo-33614: Ensures module definition files for the stable ABI on Windows
20949  are correctly regenerated.
20950
20951- bpo-33648: The --with-c-locale-warning configuration flag has been
20952  removed. It has had no effect for about a year.
20953
20954- bpo-33522: Enable CI builds on Visual Studio Team Services at
20955  https://python.visualstudio.com/cpython
20956
20957- bpo-33512: configure's check for "long double" has been simplified
20958
20959- bpo-33483: C compiler is now correctly detected from the standard
20960  environment variables. --without-gcc and --with-icc options have been
20961  removed.
20962
20963- bpo-33394: Enable the verbose build for extension modules, when GNU make
20964  is passed macros on the command line.
20965
20966- bpo-33393: Update config.guess and config.sub files.
20967
20968- bpo-33377: Add new triplets for mips r6 and riscv variants (used in
20969  extension suffixes).
20970
20971- bpo-32232: By default, modules configured in `Modules/Setup` are no longer
20972  built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that
20973  preprocessor definition include it in their individual entries.
20974
20975- bpo-33182: The embedding tests can once again be built with clang 6.0
20976
20977- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
20978
20979- bpo-33012: gcc 8 has added a new warning heuristic to detect invalid
20980  function casts and a stock python build seems to hit that warning quite
20981  often.  The most common is the cast of a METH_NOARGS function (that uses
20982  just one argument) to a PyCFunction. Fix this by adding a dummy argument
20983  to all functions that implement METH_NOARGS.
20984
20985- bpo-32898: Fix the python debug build when using COUNT_ALLOCS.
20986
20987- bpo-29442: Replace optparse with argparse in setup.py
20988
20989Windows
20990-------
20991
20992- bpo-35890: Fix API calling consistency of GetVersionEx and wcstok.
20993
20994- bpo-32560: The ``py`` launcher now forwards its ``STARTUPINFO`` structure
20995  to child processes.
20996
20997- bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows
20998
20999- bpo-35811: Avoid propagating venv settings when launching via py.exe
21000
21001- bpo-35797: Fix default executable used by the multiprocessing module
21002
21003- bpo-35758: Allow building on ARM with MSVC.
21004
21005- bpo-29734: Fix handle leaks in os.stat on Windows.
21006
21007- bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport
21008  restrictions.
21009
21010- bpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple
21011  times.
21012
21013- bpo-35402: Update Windows build to use Tcl and Tk 8.6.9
21014
21015- bpo-35401: Updates Windows build to OpenSSL 1.1.0j
21016
21017- bpo-34977: venv on Windows will now use a python.exe redirector rather
21018  than copying the actual binaries from the base environment.
21019
21020- bpo-34977: Adds support for building a Windows App Store package
21021
21022- bpo-35067: Remove _distutils_findvs module and use vswhere.exe instead.
21023
21024- bpo-32557: Allow shutil.disk_usage to take a file path on Windows
21025
21026- bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp.
21027
21028- bpo-34603: Fix returning structs from functions produced by MSVC
21029
21030- bpo-34581: Guard MSVC-specific code in socketmodule.c with ``#ifdef
21031  _MSC_VER``.
21032
21033- bpo-34532: Fixes exit code of list version arguments for py.exe.
21034
21035- bpo-34062: Fixed the '--list' and '--list-paths' arguments for the py.exe
21036  launcher
21037
21038- bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash.
21039
21040- bpo-34011: A suite of code has been changed which copied across DLLs and
21041  init.tcl from the running Python location into a venv being created. These
21042  copies are needed only when running from a Python source build, and the
21043  copying code is now only run when that is the case, rather than whenever a
21044  venv is created.
21045
21046- bpo-34006: Revert line length limit for Windows help docs. The line-length
21047  limit is not needed because the pages appear in a separate app rather than
21048  on a browser tab.  It can also interact badly with the DPI setting.
21049
21050- bpo-31546: Restore running PyOS_InputHook while waiting for user input at
21051  the prompt. The restores integration of interactive GUI windows (such as
21052  Matplotlib figures) with the prompt on Windows.
21053
21054- bpo-30237: Output error when ReadConsole is canceled by
21055  CancelSynchronousIo instead of crashing.
21056
21057- bpo-33895: GIL is released while calling functions that acquire Windows
21058  loader lock.
21059
21060- bpo-33720: Reduces maximum marshal recursion depth on release builds.
21061
21062- bpo-29097: Fix bug where :meth:`datetime.fromtimestamp` erroneously throws
21063  an :exc:`OSError` on Windows for values between 0 and 86400. Patch by
21064  Ammar Askar.
21065
21066- bpo-33316: PyThread_release_lock always fails
21067
21068- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h.
21069
21070- bpo-32890: Fix usage of GetLastError() instead of errno in os.execve() and
21071  os.truncate().
21072
21073- bpo-33016: Fix potential use of uninitialized memory in
21074  nt._getfinalpathname
21075
21076- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
21077  directory is set to a UNC path.
21078
21079- bpo-32901: Update Tcl and Tk versions to 8.6.8
21080
21081- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
21082
21083- bpo-32409: Ensures activate.bat can handle Unicode contents.
21084
21085- bpo-32457: Improves handling of denormalized executable path when
21086  launching Python.
21087
21088- bpo-32370: Use the correct encoding for ipconfig output in the uuid
21089  module. Patch by Segev Finer.
21090
21091- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
21092  treating the ``PrintNameOffset`` field of the reparse data buffer as a
21093  number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
21094
21095- bpo-1104: Correctly handle string length in
21096  ``msilib.SummaryInfo.GetProperty()`` to prevent it from truncating the
21097  last character.
21098
21099macOS
21100-----
21101
21102- bpo-35401: Update macOS installer to use OpenSSL 1.1.0j.
21103
21104- bpo-35025: Properly guard the use of the ``CLOCK_GETTIME`` et al. macros
21105  in ``timemodule`` on macOS.
21106
21107- bpo-24658: On macOS, fix reading from and writing into a file with a size
21108  larger than 2 GiB.
21109
21110- bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds.
21111
21112- bpo-33635: In macOS stat on some file descriptors (/dev/fd/3 f.e) will
21113  result in bad file descriptor OSError. Guard against this exception was
21114  added in is_dir, is_file and similar methods. DirEntry.is_dir can also
21115  throw this exception so _RecursiveWildcardSelector._iterate_directories
21116  was also extended with the same error ignoring pattern.
21117
21118- bpo-13631: The .editrc file in user's home directory is now processed
21119  correctly during the readline initialization through editline emulation on
21120  macOS.
21121
21122- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h.
21123
21124- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS
21125  10.6+ installer. The 10.9+ installer variant already does this.  This
21126  means that the Python 3.7 provided by the python.org macOS installers no
21127  longer need or use any external versions of Tcl/Tk, either system-provided
21128  or user-installed, such as ActiveTcl.
21129
21130- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
21131
21132- bpo-31903: In :mod:`_scproxy`, drop the GIL when calling into
21133  ``SystemConfiguration`` to avoid deadlocks.
21134
21135IDLE
21136----
21137
21138- bpo-35770: IDLE macosx deletes Options => Configure IDLE. It previously
21139  deleted Window => Zoom Height by mistake. (Zoom Height is now on the
21140  Options menu).  On Mac, the settings dialog is accessed via Preferences on
21141  the IDLE menu.
21142
21143- bpo-35769: Change IDLE's new file name from 'Untitled' to 'untitled'
21144
21145- bpo-35660: Fix imports in idlelib.window.
21146
21147- bpo-35641: Proper format `calltip` when the function has no docstring.
21148
21149- bpo-33987: Use ttk Frame for ttk widgets.
21150
21151- bpo-34055: Fix erroneous 'smart' indents and newlines in IDLE Shell.
21152
21153- bpo-35591: Find Selection now works when selection not found.
21154
21155- bpo-35196: Speed up squeezer line counting.
21156
21157- bpo-35598: Update config_key: use PEP 8 names and ttk widgets, make some
21158  objects global, and add tests.
21159
21160- bpo-28097: Add Previous/Next History entries to Shell menu.
21161
21162- bpo-35208: Squeezer now properly counts wrapped lines before newlines.
21163
21164- bpo-35555: Gray out Code Context menu entry when it's not applicable.
21165
21166- bpo-35521: Document the IDLE editor code context feature. Add some
21167  internal references within the IDLE doc.
21168
21169- bpo-22703: The Code Context menu label now toggles between Show/Hide Code
21170  Context. The Zoom Height menu now toggles between Zoom/Restore Height.
21171  Zoom Height has moved from the Window menu to the Options menu.
21172
21173- bpo-35213: Where appropriate, use 'macOS' in idlelib.
21174
21175- bpo-34864: On macOS, warn if the system preference "Prefer tabs when
21176  opening documents" is set to "Always".
21177
21178- bpo-34864: Document two IDLE on MacOS issues. The System Preferences Dock
21179  "prefer tabs always" setting disables some IDLE features.  Menus are a bit
21180  different than as described for Windows and Linux.
21181
21182- bpo-35202: Remove unused imports from lib/idlelib
21183
21184- bpo-33000: Document that IDLE's shell has no line limit. A program that
21185  runs indefinitely can overfill memory.
21186
21187- bpo-23220: Explain how IDLE's Shell displays output.
21188
21189- bpo-35099: Improve the doc about IDLE running user code.   The section is
21190  renamed from "IDLE -- console differences" is renamed "Running user code".
21191  It mostly covers the implications of using custom sys.stdxxx objects.
21192
21193- bpo-35097: Add IDLE doc subsection explaining editor windows. Topics
21194  include opening, title and status bar, .py* extension, and running.
21195
21196- bpo-35093: Document the IDLE document viewer in the IDLE doc. Add a
21197  paragraph in "Help and preferences", "Help sources" subsection.
21198
21199- bpo-35088: Update idlelib.help.copy_string docstring. We now use git and
21200  backporting instead of hg and forward merging.
21201
21202- bpo-35087: Update idlelib help files for the current doc build. The main
21203  change is the elimination of chapter-section numbers.
21204
21205- bpo-34548: Use configured color theme for read-only text views.
21206
21207- bpo-1529353: Enable "squeezing" of long outputs in the shell, to avoid
21208  performance degradation and to clean up the history without losing it.
21209  Squeezed outputs may be copied, viewed in a separate window, and
21210  "unsqueezed".
21211
21212- bpo-34047: Fixed mousewheel scrolling direction on macOS.
21213
21214- bpo-34275: Make IDLE calltips always visible on Mac. Some MacOS-tk
21215  combinations need .update_idletasks(). Patch by Kevin Walzer.
21216
21217- bpo-34120: Fix unresponsiveness after closing certain windows and dialogs.
21218
21219- bpo-33975: Avoid small type when running htests. Since part of the purpose
21220  of human-viewed tests is to determine that widgets look right, it is
21221  important that they look the same for testing as when running IDLE.
21222
21223- bpo-33905: Add test for idlelib.stackview.StackBrowser.
21224
21225- bpo-33924: Change mainmenu.menudefs key 'windows' to 'window'. Every other
21226  menudef key is lowercase version of main menu entry.
21227
21228- bpo-33906: Rename idlelib.windows as window Match Window on the main menu
21229  and remove last plural module name.
21230
21231- bpo-33917: Fix and document idlelib/idle_test/template.py. The revised
21232  file compiles, runs, and tests OK.  idle_test/README.txt explains how to
21233  use it to create new IDLE test files.
21234
21235- bpo-33904: IDLE: In rstrip, rename class RstripExtension as Rstrip
21236
21237- bpo-33907: For consistency and clarity, rename an IDLE module and classes.
21238  Module calltips and its class CallTips are now calltip and Calltip. In
21239  module calltip_w, class CallTip is now CalltipWindow.
21240
21241- bpo-33856: Add "help" in the welcome message of IDLE
21242
21243- bpo-33839: IDLE: refactor ToolTip and CallTip and add documentation and
21244  tests
21245
21246- bpo-33855: Minimally test all IDLE modules. Add missing files, import
21247  module, instantiate classes, and check coverage. Check existing files.
21248
21249- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
21250  Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
21251  unchanged, and a monitor resolution greater than 96 DPI, this should make
21252  text and lines sharper.  It should otherwise have no effect.
21253
21254- bpo-33768: Clicking on a context line moves that line to the top of the
21255  editor window.
21256
21257- bpo-33763: IDLE: Use read-only text widget for code context instead of
21258  label widget.
21259
21260- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
21261  and scrollbar slider moved text by a fixed number of pixels, resulting in
21262  partial lines at the top of the editor box.  The change also applies to
21263  the shell and grep output windows, but not to read-only text views.
21264
21265- bpo-33679: Enable theme-specific color configuration for Code Context. Use
21266  the Highlights tab to see the setting for built-in themes or add settings
21267  to custom themes.
21268
21269- bpo-33642: Display up to maxlines non-blank lines for Code Context. If
21270  there is no current context, show a single blank line.
21271
21272- bpo-33628: IDLE: Cleanup codecontext.py and its test.
21273
21274- bpo-33564: IDLE's code context now recognizes async as a block opener.
21275
21276- bpo-21474: Update word/identifier definition from ascii to unicode. In
21277  text and entry boxes, this affects selection by double-click, movement
21278  left/right by control-left/right, and deletion left/right by
21279  control-BACKSPACE/DEL.
21280
21281- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
21282  prefix cannot be paired with either 'r' or 'f'. Consistently color as much
21283  of the prefix, starting at the right, as is valid. Revise and extend
21284  colorizer test.
21285
21286- bpo-32984: Set ``__file__`` while running a startup file.  Like Python,
21287  IDLE optionally runs one startup file in the Shell window before
21288  presenting the first interactive input prompt.  For IDLE, ``-s`` runs a
21289  file named in environmental variable  :envvar:`IDLESTARTUP` or
21290  :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``.  Python sets
21291  ``__file__`` to the startup file name before running the file and unsets
21292  it before the first prompt.  IDLE now does the same when run normally,
21293  without the ``-n`` option.
21294
21295- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
21296
21297- bpo-32916: Change ``str`` to ``code`` in pyparse.
21298
21299- bpo-32905: Remove unused code in pyparse module.
21300
21301- bpo-32874: Add tests for pyparse.
21302
21303- bpo-32837: Using the system and place-dependent default encoding for
21304  open() is a bad idea for IDLE's system and location-independent files.
21305
21306- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
21307  test test_file_buttons() only looks at initial ascii-only lines, but
21308  failed on systems where open() defaults to 'ascii' because readline()
21309  internally reads and decodes far enough ahead to encounter a non-ascii
21310  character in CREDITS.txt.
21311
21312- bpo-32831: Add docstrings and tests for codecontext.
21313
21314- bpo-32765: Update configdialog General tab docstring to add new widgets to
21315  the widget list.
21316
21317Tools/Demos
21318-----------
21319
21320- bpo-35884: Add a benchmark script for timing various ways to access
21321  variables: ``Tools/scripts/var_access_benchmark.py``.
21322
21323- bpo-34989: python-gdb.py now handles errors on computing the line number
21324  of a Python frame.
21325
21326- bpo-20260: Argument Clinic now has non-bitwise unsigned int converters.
21327
21328- bpo-32962: python-gdb now catches ``UnicodeDecodeError`` exceptions when
21329  calling ``string()``.
21330
21331- bpo-32962: python-gdb now catches ValueError on read_var(): when Python
21332  has no debug symbols for example.
21333
21334- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
21335  docstrings and translatable strings, and rejects bytes literals and
21336  f-string expressions.
21337
21338- bpo-31920: Fixed handling directories as arguments in the ``pygettext``
21339  script. Based on patch by Oleg Krasnikov.
21340
21341- bpo-29673: Fix pystackv and pystack gdbinit macros.
21342
21343- bpo-25427: Remove the pyvenv script in favor of ``python3 -m venv`` in
21344  order to lower confusion as to what Python interpreter a virtual
21345  environment will be created for.
21346
21347- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
21348  automatic backup creation (files with ``~`` suffix).
21349
21350- bpo-32222: Fix pygettext not extracting docstrings for functions with type
21351  annotated arguments. Patch by Toby Harradine.
21352
21353- bpo-31583: Fix 2to3 for using with --add-suffix option but without
21354  --output-dir option for relative path to files in current directory.
21355
21356C API
21357-----
21358
21359- bpo-35713: The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini`
21360  functions have been removed. They did nothing since Python 2.7.4 and
21361  Python 3.2.0, were excluded from the limited API (stable ABI), and were
21362  not documented.
21363
21364- bpo-33817: Fixed :c:func:`_PyBytes_Resize` for empty bytes objects.
21365
21366- bpo-35322: Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and
21367  :c:func:`PyUnicode_EncodeFSDefault` on error handling.
21368
21369- bpo-35059: The following C macros have been converted to static inline
21370  functions: :c:func:`Py_INCREF`, :c:func:`Py_DECREF`, :c:func:`Py_XINCREF`,
21371  :c:func:`Py_XDECREF`, :c:func:`PyObject_INIT`,
21372  :c:func:`PyObject_INIT_VAR`.
21373
21374- bpo-35296: ``make install`` now also installs the internal API:
21375  ``Include/internal/*.h`` header files.
21376
21377- bpo-35081: Internal APIs surrounded by ``#ifdef Py_BUILD_CORE`` have been
21378  moved from ``Include/*.h`` headers to new header files
21379  ``Include/internal/pycore_*.h``.
21380
21381- bpo-35259: Conditionally declare :c:func:`Py_FinalizeEx()` (new in 3.6)
21382  based on Py_LIMITED_API. Patch by Arthur Neufeld.
21383
21384- bpo-35081: The :c:func:`_PyObject_GC_TRACK` and
21385  :c:func:`_PyObject_GC_UNTRACK` macros have been removed from the public C
21386  API.
21387
21388- bpo-35134: Creation of a new ``Include/cpython/`` subdirectory.
21389
21390- bpo-34725: Adds _Py_SetProgramFullPath so embedders may override
21391  sys.executable
21392
21393- bpo-34910: Ensure that :c:func:`PyObject_Print` always returns ``-1`` on
21394  error.  Patch by Zackery Spytz.
21395
21396- bpo-34523: Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8
21397  encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero.
21398
21399- bpo-34193: Fix pluralization in TypeError messages in getargs.c and
21400  typeobject.c: '1 argument' instead of '1 arguments' and '1 element'
21401  instead of '1 elements'.
21402
21403- bpo-34127: Return grammatically correct error message based on argument
21404  count. Patch by Karthikeyan Singaravelan.
21405
21406- bpo-23927: Fixed :exc:`SystemError` in
21407  :c:func:`PyArg_ParseTupleAndKeywords` when the ``w*`` format unit is used
21408  for optional parameter.
21409
21410- bpo-32455: Added :c:func:`PyCompile_OpcodeStackEffectWithJump`.
21411
21412- bpo-34008: Py_Main() can again be called after Py_Initialize(), as in
21413  Python 3.6.
21414
21415- bpo-32500: Fixed error messages for :c:func:`PySequence_Size`,
21416  :c:func:`PySequence_GetItem`, :c:func:`PySequence_SetItem` and
21417  :c:func:`PySequence_DelItem` called with a mapping and
21418  :c:func:`PyMapping_Size` called with a sequence.
21419
21420- bpo-33818: :c:func:`PyExceptionClass_Name` will now return ``const char
21421  *`` instead of ``char *``.
21422
21423- bpo-33042: Embedding applications may once again call
21424  PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to
21425  calling Py_Initialize.
21426
21427- bpo-32374: Document that m_traverse for multi-phase initialized modules
21428  can be called with m_state=NULL, and add a sanity check
21429
21430- bpo-30863: :c:func:`PyUnicode_AsWideChar` and
21431  :c:func:`PyUnicode_AsWideCharString` no longer cache the ``wchar_t*``
21432  representation of string objects.
21433
21434
21435What's New in Python 3.7.0 final?
21436=================================
21437
21438*Release date: 2018-06-27*
21439
21440Library
21441-------
21442
21443- bpo-33851: Fix :func:`ast.get_docstring` for a node that lacks a
21444  docstring.
21445
21446C API
21447-----
21448
21449- bpo-33932: Calling Py_Initialize() twice does nothing, instead of failing
21450  with a fatal error: restore the Python 3.6 behaviour.
21451
21452
21453What's New in Python 3.7.0 release candidate 1?
21454===============================================
21455
21456*Release date: 2018-06-12*
21457
21458Core and Builtins
21459-----------------
21460
21461- bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an
21462  object that hadn't all of its fields set to NULL.
21463
21464- bpo-33706: Fix a crash in Python initialization when parsing the command
21465  line options. Thanks Christoph Gohlke for the bug report and the fix!
21466
21467- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
21468  shutdown even when there was a custom handler set previously. Patch by
21469  Philipp Kerling.
21470
21471- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
21472
21473Library
21474-------
21475
21476- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
21477  Steve Weber.
21478
21479- bpo-33812: Datetime instance d with non-None tzinfo, but with
21480  d.tzinfo.utcoffset(d) returning None is now treated as naive by the
21481  astimezone() method.
21482
21483- bpo-30805: Avoid race condition with debug logging
21484
21485- bpo-33694: asyncio: Fix a race condition causing data loss on
21486  pause_reading()/resume_reading() when using the ProactorEventLoop.
21487
21488- bpo-32493: Correct test for ``uuid_enc_be`` availability in
21489  ``configure.ac``. Patch by Michael Felt.
21490
21491- bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and
21492  asyncio.WindowsProactorEventLoopPolicy.
21493
21494- bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0.
21495
21496- bpo-33770: improve base64 exception message for encoded inputs of invalid
21497  length
21498
21499- bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case
21500  of an unhandled error; mark SSLTransport as closed if it is aborted.
21501
21502- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
21503  operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
21504  performed on :class:`mmap.mmap` objects.  Patch by Zackery Spytz.
21505
21506- bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake
21507  timeout
21508
21509- bpo-11874: Use a better regex when breaking usage into wrappable parts.
21510  Avoids bogus assertion errors from custom metavar strings.
21511
21512- bpo-33582: Emit a deprecation warning for inspect.formatargspec
21513
21514Documentation
21515-------------
21516
21517- bpo-33409: Clarified the relationship between :pep:`538`'s
21518  PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode.
21519
21520- bpo-33736: Improve the documentation of :func:`asyncio.open_connection`,
21521  :func:`asyncio.start_server` and their UNIX socket counterparts.
21522
21523- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
21524  flags for ssl.SSLContext.verify_mode.
21525
21526Build
21527-----
21528
21529- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
21530  ``OPT``. This option emitted annoying warnings when building extension
21531  modules written in C++.
21532
21533Windows
21534-------
21535
21536- bpo-33720: Reduces maximum marshal recursion depth on release builds.
21537
21538IDLE
21539----
21540
21541- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
21542  Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
21543  unchanged, and a monitor resolution greater than 96 DPI, this should make
21544  text and lines sharper.  It should otherwise have no effect.
21545
21546- bpo-33768: Clicking on a context line moves that line to the top of the
21547  editor window.
21548
21549- bpo-33763: IDLE: Use read-only text widget for code context instead of
21550  label widget.
21551
21552- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
21553  and scrollbar slider moved text by a fixed number of pixels, resulting in
21554  partial lines at the top of the editor box.  The change also applies to
21555  the shell and grep output windows, but not to read-only text views.
21556
21557- bpo-33679: Enable theme-specific color configuration for Code Context. Use
21558  the Highlights tab to see the setting for built-in themes or add settings
21559  to custom themes.
21560
21561- bpo-33642: Display up to maxlines non-blank lines for Code Context. If
21562  there is no current context, show a single blank line.
21563
21564
21565What's New in Python 3.7.0 beta 5?
21566==================================
21567
21568*Release date: 2018-05-30*
21569
21570Core and Builtins
21571-----------------
21572
21573- bpo-33622: Fixed a leak when the garbage collector fails to add an object
21574  with the ``__del__`` method or referenced by it into the
21575  :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
21576  exception is set and preserves it.
21577
21578- bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't
21579  crash if module_globals is not a dict.
21580
21581- bpo-20104: The new `os.posix_spawn` added in 3.7.0b1 was removed as we are
21582  still working on what the API should look like.  Expect this in 3.8
21583  instead.
21584
21585- bpo-33475: Fixed miscellaneous bugs in converting annotations to strings
21586  and optimized parentheses in the string representation.
21587
21588- bpo-33391: Fix a leak in set_symmetric_difference().
21589
21590- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
21591
21592- bpo-32911: Due to unexpected compatibility issues discovered during
21593  downstream beta testing, reverted :issue:`29463`. ``docstring`` field is
21594  removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes
21595  which was added in 3.7a1.  Docstring expression is restored as a first
21596  statement in their body. Based on patch by Inada Naoki.
21597
21598- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a
21599  ctypes structured data type. Patch by Eryk Sun and Oren Milman.
21600
21601Library
21602-------
21603
21604- bpo-32751: When cancelling the task due to a timeout,
21605  :meth:`asyncio.wait_for` will now wait until the cancellation is complete.
21606
21607- bpo-32684: Fix gather to propagate cancellation of itself even with
21608  return_exceptions.
21609
21610- bpo-33654: Support protocol type switching in SSLTransport.set_protocol().
21611
21612- bpo-33674: Pause the transport as early as possible to further reduce the
21613  risk of data_received() being called before connection_made().
21614
21615- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
21616  asyncio.sslproto: start immediately the handshake instead of using
21617  call_soon(). Previously, data_received() could be called before the
21618  handshake started, causing the handshake to hang or fail.
21619
21620- bpo-31647: Fixed bug where calling write_eof() on a
21621  _SelectorSocketTransport after it's already closed raises AttributeError.
21622
21623- bpo-32610: Make asyncio.all_tasks() return only pending tasks.
21624
21625- bpo-32410: Avoid blocking on file IO in sendfile fallback code
21626
21627- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
21628
21629- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
21630
21631- bpo-33654: Fix transport.set_protocol() to support switching between
21632  asyncio.Protocol and asyncio.BufferedProtocol.  Fix loop.start_tls() to
21633  work with asyncio.BufferedProtocols.
21634
21635- bpo-33652: Pickles of type variables and subscripted generics are now
21636  future-proof and compatible with older Python versions.
21637
21638- bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD.
21639
21640- bpo-33618: Finalize and document preliminary and experimental TLS 1.3
21641  support with OpenSSL 1.1.1
21642
21643- bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__
21644
21645- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
21646  that prevented the cache of parsed strings from clearing after finishing
21647  the decoding. Based on patch by c-fos.
21648
21649- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
21650  OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
21651  enabled by default.
21652
21653- bpo-28556: Do not simplify arguments to `typing.Union`. Now
21654  `Union[Manager, Employee]` is not simplified to `Employee` at runtime.
21655  Such simplification previously caused several bugs and limited
21656  possibilities for introspection.
21657
21658- bpo-33540: Add a new ``block_on_close`` class attribute to
21659  ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`.
21660
21661- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
21662  locations
21663
21664- bpo-33109: argparse subparsers are once again not required by default,
21665  reverting the change in behavior introduced by bpo-26510 in 3.7.0a2.
21666
21667- bpo-33536: dataclasses.make_dataclass now checks for invalid field names
21668  and duplicate fields. Also, added a check for invalid field
21669  specifications.
21670
21671- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
21672  Windows. Patch by Zvi Effron
21673
21674- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in
21675  Windows proactor event loop.
21676
21677- Fix failure in `typing.get_type_hints()` when ClassVar was provided as a
21678  string forward reference.
21679
21680- bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x
21681  faster.
21682
21683- bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in
21684  FieldStorage use the given errors (needed for Twisted).  Patch by Amber
21685  Brown.
21686
21687- bpo-33495: Change dataclasses.Fields repr to use the repr of each of its
21688  members, instead of str.  This makes it more clear what each field
21689  actually represents.  This is especially true for the 'type' member.
21690
21691- bpo-33453: Fix dataclasses to work if using literal string type
21692  annotations or if using PEP 563 "Postponed Evaluation of Annotations".
21693  Only specific string prefixes are detected for both ClassVar ("ClassVar"
21694  and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar").
21695
21696- bpo-28556: Minor fixes in typing module: add annotations to
21697  ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
21698  ``Generic.__new__``.  Original PRs by Paulius Šarka and Chad Dombrova.
21699
21700- bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
21701
21702- bpo-33422: Fix trailing quotation marks getting deleted when looking up
21703  byte/string literals on pydoc. Patch by Andrés Delfino.
21704
21705- bpo-28167: The function ``platform.linux_distribution`` and
21706  ``platform.dist`` now trigger a ``DeprecationWarning`` and have been
21707  marked for removal in Python 3.8
21708
21709- bpo-33197: Update error message when constructing invalid
21710  inspect.Parameters Patch by Dong-hee Na.
21711
21712- bpo-33263: Fix FD leak in `_SelectorSocketTransport`  Patch by Vlad
21713  Starostin.
21714
21715- bpo-32861: The urllib.robotparser's ``__str__`` representation now
21716  includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
21717  Patch by Michael Lazar.
21718
21719- bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant,
21720  available with OpenSSL 1.1.0h or 1.1.1.
21721
21722- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`.  Patch by Segev Finer.
21723
21724Documentation
21725-------------
21726
21727- bpo-23859: Document that `asyncio.wait()` does not cancel its futures on
21728  timeout.
21729
21730- bpo-32436: Document :pep:`567` changes to asyncio.
21731
21732- bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal
21733  to 3.8.
21734
21735- bpo-33503: Fix broken pypi link
21736
21737- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
21738
21739Tests
21740-----
21741
21742- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
21743  might be due to running on ZFS.
21744
21745- bpo-32604: Remove the _xxsubinterpreters module (meant for testing) and
21746  associated helpers.  This module was originally added recently in 3.7b1.
21747
21748Build
21749-----
21750
21751- bpo-33614: Ensures module definition files for the stable ABI on Windows
21752  are correctly regenerated.
21753
21754- bpo-33522: Enable CI builds on Visual Studio Team Services at
21755  https://python.visualstudio.com/cpython
21756
21757- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing
21758  warnings about function casts like casting to PyCFunction in method
21759  definition lists.
21760
21761macOS
21762-----
21763
21764- bpo-13631: The .editrc file in user's home directory is now processed
21765  correctly during the readline initialization through editline emulation on
21766  macOS.
21767
21768IDLE
21769----
21770
21771- bpo-33628: IDLE: Cleanup codecontext.py and its test.
21772
21773- bpo-33564: IDLE's code context now recognizes async as a block opener.
21774
21775- bpo-32831: Add docstrings and tests for codecontext.
21776
21777
21778What's New in Python 3.7.0 beta 4?
21779==================================
21780
21781*Release date: 2018-05-02*
21782
21783Core and Builtins
21784-----------------
21785
21786- bpo-33363: Raise a SyntaxError for ``async with`` and ``async for``
21787  statements outside of async functions.
21788
21789- bpo-33128: Fix a bug that causes PathFinder to appear twice on
21790  sys.meta_path. Patch by Pablo Galindo Salgado.
21791
21792- bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in
21793  dictobject.c by adjusting how the internal struct _dictkeysobject shared
21794  keys structure is declared.
21795
21796- bpo-33231: Fix potential memory leak in ``normalizestring()``.
21797
21798- bpo-33205: Change dict growth function from
21799  ``round_up_to_power_2(used*2+hashtable_size/2)`` to
21800  ``round_up_to_power_2(used*3)``.  Previously, dict is shrinked only when
21801  ``used == 0``. Now dict has more chance to be shrinked.
21802
21803- bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
21804  or ``__aexit__()`` return non-awaitable object.
21805
21806- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
21807  when copying from key-sharing dict.
21808
21809Library
21810-------
21811
21812- bpo-33281: Fix ctypes.util.find_library regression on macOS.
21813
21814- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
21815  object when it is called with a single argument.
21816
21817- bpo-33329: Fix multiprocessing regression on newer glibcs
21818
21819- bpo-991266: Fix quoting of the ``Comment`` attribute of
21820  :class:`http.cookies.SimpleCookie`.
21821
21822- bpo-33131: Upgrade bundled version of pip to 10.0.1.
21823
21824- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
21825  object to a tree of tuples or lists with ``line_info=False`` and
21826  ``col_info=True``.
21827
21828- bpo-33266: lib2to3 now recognizes ``rf'...'`` strings.
21829
21830- bpo-11594: Ensure line-endings are respected when using lib2to3.
21831
21832- bpo-33254: Have :func:`importlib.resources.contents` and
21833  :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable`
21834  instead of an :term:`iterator`.
21835
21836- bpo-33256: Fix display of ``<module>`` call in the html produced by
21837  ``cgitb.html()``. Patch by Stéphane Blondon.
21838
21839- bpo-33185: Fixed regression when running pydoc with the :option:`-m`
21840  switch. (The regression was introduced in 3.7.0b3 by the resolution of
21841  :issue:`33053`) This fix also changed pydoc to add ``os.getcwd()`` to
21842  :data:`sys.path` when necessary, rather than adding ``"."``.
21843
21844- bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache`
21845  when :meth:`importlib.machinery.invalidate_caches` is called.
21846
21847- bpo-33217: Deprecate looking up non-Enum objects in Enum classes and Enum
21848  members (will raise :exc:`TypeError` in 3.8+).
21849
21850- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
21851  sequences consistently even when called from subclasses without a
21852  ``getrandbits()`` implementation.
21853
21854- bpo-33224: Update difflib.mdiff() for :pep:`479`.  Convert an uncaught
21855  StopIteration in a generator into a return-statement.
21856
21857- bpo-33209: End framing at the end of C implementation of
21858  :func:`pickle.Pickler.dump`.
21859
21860- bpo-20104: Improved error handling and fixed a reference leak in
21861  :func:`os.posix_spawn()`.
21862
21863- bpo-33175: In dataclasses, Field.__set_name__ now looks up the
21864  __set_name__ special method on the class, not the instance, of the default
21865  value.
21866
21867- bpo-33097: Raise RuntimeError when ``executor.submit`` is called during
21868  interpreter shutdown.
21869
21870- bpo-31908: Fix output of cover files for ``trace`` module command-line
21871  tool. Previously emitted cover files only when ``--missing`` option was
21872  used. Patch by Michael Selik.
21873
21874Documentation
21875-------------
21876
21877- bpo-33378: Add Korean language switcher for https://docs.python.org/3/
21878
21879- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
21880  just any value.
21881
21882- bpo-33201: Modernize documentation for writing C extension types.
21883
21884- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
21885  ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
21886  missed in the document.
21887
21888- bpo-8243: Add a note about curses.addch and curses.addstr exception
21889  behavior when writing outside a window, or pad.
21890
21891- bpo-32337: Update documentation related with ``dict`` order.
21892
21893Tests
21894-----
21895
21896- bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when
21897  the interpreter is built with ``--enable-shared``.
21898
21899Build
21900-----
21901
21902- bpo-33394: Enable the verbose build for extension modules, when GNU make
21903  is passed macros on the command line.
21904
21905- bpo-33393: Update config.guess and config.sub files.
21906
21907- bpo-33377: Add new triplets for mips r6 and riscv variants (used in
21908  extension suffixes).
21909
21910- bpo-32232: By default, modules configured in `Modules/Setup` are no longer
21911  built with `-DPy_BUILD_CORE`. Instead, modules that specifically need that
21912  preprocessor definition include it in their individual entries.
21913
21914- bpo-33182: The embedding tests can once again be built with clang 6.0
21915
21916Windows
21917-------
21918
21919- bpo-33184: Update Windows installer to use OpenSSL 1.1.0h.
21920
21921macOS
21922-----
21923
21924- bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h.
21925
21926IDLE
21927----
21928
21929- bpo-21474: Update word/identifier definition from ascii to unicode. In
21930  text and entry boxes, this affects selection by double-click, movement
21931  left/right by control-left/right, and deletion left/right by
21932  control-BACKSPACE/DEL.
21933
21934- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
21935  prefix cannot be paired with either 'r' or 'f'. Consistently color as much
21936  of the prefix, starting at the right, as is valid. Revise and extend
21937  colorizer test.
21938
21939Tools/Demos
21940-----------
21941
21942- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
21943  docstrings and translatable strings, and rejects bytes literals and
21944  f-string expressions.
21945
21946- bpo-31920: Fixed handling directories as arguments in the ``pygettext``
21947  script. Based on patch by Oleg Krasnikov.
21948
21949- bpo-29673: Fix pystackv and pystack gdbinit macros.
21950
21951- bpo-31583: Fix 2to3 for using with --add-suffix option but without
21952  --output-dir option for relative path to files in current directory.
21953
21954
21955What's New in Python 3.7.0 beta 3?
21956==================================
21957
21958*Release date: 2018-03-29*
21959
21960Security
21961--------
21962
21963- bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970.
21964  X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new
21965  test ensures that NULL bytes are not allowed.
21966
21967- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
21968
21969- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
21970  backtracking. These regexes formed potential DOS vectors (REDOS). They
21971  have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
21972  by Jamie Davis.
21973
21974Core and Builtins
21975-----------------
21976
21977- bpo-33053: When using the -m switch, sys.path[0] is now explicitly
21978  expanded as the *starting* working directory, rather than being left as
21979  the empty path (which allows imports from the current working directory at
21980  the time of the import)
21981
21982- bpo-33018: Improve consistency of errors raised by ``issubclass()`` when
21983  called with a non-class and an abstract base class as the first and second
21984  arguments, respectively. Patch by Josh Bronson.
21985
21986- bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
21987
21988- bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
21989
21990- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
21991  using PYTHONMALLOC env var). _PyGILState_Reinit() and
21992  _PyInterpreterState_Enable() now use the default RAW memory allocator to
21993  allocate a new interpreters mutex on fork.
21994
21995- bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
21996
21997- bpo-32836: Don't use temporary variables in cases of list/dict/set
21998  comprehensions
21999
22000Library
22001-------
22002
22003- bpo-33141: Have Field objects pass through __set_name__ to their default
22004  values, if they have their own __set_name__.
22005
22006- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
22007  boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
22008  Khatri.
22009
22010- bpo-32873: Treat type variables and special typing forms as immutable by
22011  copy and pickle.  This fixes several minor issues and inconsistencies, and
22012  improves backwards compatibility with Python 3.6.
22013
22014- bpo-33134: When computing dataclass's __hash__, use the lookup table to
22015  contain the function which returns the __hash__ value.  This is an
22016  improvement over looking up a string, and then testing that string to see
22017  what to do.
22018
22019- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
22020
22021- bpo-32505: Raise TypeError if a member variable of a dataclass is of type
22022  Field, but doesn't have a type annotation.
22023
22024- bpo-33078: Fix the failure on OSX caused by the tests relying on
22025  sem_getvalue
22026
22027- bpo-33116: Add 'Field' to dataclasses.__all__.
22028
22029- bpo-32896: Fix an error where subclassing a dataclass with a field that
22030  uses a default_factory would generate an incorrect class.
22031
22032- bpo-33100: Dataclasses: If a field has a default value that's a
22033  MemberDescriptorType, then it's from that field being in __slots__, not an
22034  actual default value.
22035
22036- bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow
22037  attributes to be added to the derived class.  Only attributes from the
22038  frozen dataclass cannot be assigned to.  Require all dataclasses in a
22039  hierarchy to be either all frozen or all non-frozen.
22040
22041- bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py
22042
22043- bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling
22044  error occurs.
22045
22046- bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
22047  and ``**kwargs`` in function signatures.
22048
22049- bpo-33056: FIX properly close leaking fds in
22050  concurrent.futures.ProcessPoolExecutor.
22051
22052- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
22053  threads when calling mmap.mmap(), os.urandom(), and random.seed().  Patch
22054  by Nir Soffer.
22055
22056- bpo-31804: Avoid failing in multiprocessing.Process if the standard
22057  streams are closed or None at exit.
22058
22059- bpo-33037: Skip sending/receiving data after SSL transport closing.
22060
22061- bpo-27683: Fix a regression in :mod:`ipaddress` that result of
22062  :meth:`hosts` is empty when the network is constructed by a tuple
22063  containing an integer mask and only 1 bit left for addresses.
22064
22065- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls,
22066  subclass)`` crashed when ``subclass`` is not a type object.
22067
22068- bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
22069
22070- bpo-32969: Expose several missing constants in zlib and fix corresponding
22071  documentation.
22072
22073- bpo-32056: Improved exceptions raised for invalid number of channels and
22074  sample width when read an audio file in modules :mod:`aifc`, :mod:`wave`
22075  and :mod:`sunau`.
22076
22077- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
22078  subprocess if another low descriptor is closed.
22079
22080- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
22081  :exc:`ValueError` instead of canceling the first scheduled function.
22082  Patch by Cheryl Sabella.
22083
22084- bpo-31639: http.server now exposes a ThreadedHTTPServer class and uses it
22085  when the module is run with ``-m`` to cope with web browsers pre-opening
22086  sockets.
22087
22088- bpo-27645: :class:`sqlite3.Connection` now exposes a
22089  :class:`~sqlite3.Connection.backup` method, if the underlying SQLite
22090  library is at version 3.6.11 or higher.  Patch by Lele Gaifax.
22091
22092Documentation
22093-------------
22094
22095- bpo-33126: Document PyBuffer_ToContiguous().
22096
22097- bpo-27212: Modify documentation for the :func:`islice` recipe to consume
22098  initial values up to the start index.
22099
22100- bpo-28247: Update :mod:`zipapp` documentation to describe how to make
22101  standalone applications.
22102
22103- bpo-18802: Documentation changes for ipaddress.  Patch by Jon Foster and
22104  Berker Peksag.
22105
22106- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
22107  implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
22108
22109Tests
22110-----
22111
22112- bpo-32872: Avoid regrtest compatibility issue with namespace packages.
22113
22114- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
22115  of ``KqueueSelector`` loop was not being closed.
22116
22117- bpo-19417: Add test_bdb.py.
22118
22119Build
22120-----
22121
22122- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
22123
22124Windows
22125-------
22126
22127- bpo-33016: Fix potential use of uninitialized memory in
22128  nt._getfinalpathname
22129
22130- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
22131  directory is set to a UNC path.
22132
22133macOS
22134-----
22135
22136- bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS
22137  10.6+ installer. The 10.9+ installer variant already does this.  This
22138  means that the Python 3.7 provided by the python.org macOS installers no
22139  longer need or use any external versions of Tcl/Tk, either system-provided
22140  or user-installed, such as ActiveTcl.
22141
22142IDLE
22143----
22144
22145- bpo-32984: Set ``__file__`` while running a startup file.  Like Python,
22146  IDLE optionally runs one startup file in the Shell window before
22147  presenting the first interactive input prompt.  For IDLE, ``-s`` runs a
22148  file named in environmental variable  :envvar:`IDLESTARTUP` or
22149  :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``.  Python sets
22150  ``__file__`` to the startup file name before running the file and unsets
22151  it before the first prompt.  IDLE now does the same when run normally,
22152  without the ``-n`` option.
22153
22154- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
22155
22156Tools/Demos
22157-----------
22158
22159- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
22160  automatic backup creation (files with ``~`` suffix).
22161
22162C API
22163-----
22164
22165- bpo-33042: Embedding applications may once again call
22166  PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to
22167  calling Py_Initialize.
22168
22169- bpo-32374: Document that m_traverse for multi-phase initialized modules
22170  can be called with m_state=NULL, and add a sanity check
22171
22172
22173What's New in Python 3.7.0 beta 2?
22174==================================
22175
22176*Release date: 2018-02-27*
22177
22178Security
22179--------
22180
22181- bpo-28414: The ssl module now allows users to perform their own IDN
22182  en/decoding when using SNI.
22183
22184Core and Builtins
22185-----------------
22186
22187- bpo-32889: Update Valgrind suppression list to account for the rename of
22188  ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
22189
22190- bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled()
22191  context manager).
22192
22193- bpo-32305: For namespace packages, ensure that both ``__file__`` and
22194  ``__spec__.origin`` are set to None.
22195
22196- bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for
22197  namespace packages.
22198
22199- bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by
22200  Stéphane Wirtel
22201
22202- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
22203  write out-of-bound errors when using customized decode error handlers.
22204
22205Library
22206-------
22207
22208- bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen
22209  classes, and also disallow inheriting non-frozen from frozen classes. This
22210  restriction will be relaxed at a future date.
22211
22212- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
22213  by Joffrey Fuhrer.
22214
22215- bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now
22216  prohibited. The constructors were never documented, tested, or designed as
22217  public constructors. Users were suppose to use ssl.wrap_socket() or
22218  SSLContext.
22219
22220- bpo-32929: Remove the tri-state parameter "hash", and add the boolean
22221  "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a
22222  __hash__ exists, raise TypeError.  If unsafe_hash is False, add a __hash__
22223  based on the values of eq= and frozen=.  The unsafe_hash=False behavior is
22224  the same as the old hash=None behavior.  unsafe_hash=False is the default,
22225  just as hash=None used to be.
22226
22227- bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3
22228  for future compatibility with OpenSSL 1.1.1.
22229
22230- bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
22231
22232- bpo-32922: dbm.open() now encodes filename with the filesystem encoding
22233  rather than default encoding.
22234
22235- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
22236  syscall exists or not.
22237
22238- bpo-32556: nt._getfinalpathname, nt._getvolumepathname and
22239  nt._getdiskusage now correctly convert from bytes.
22240
22241- bpo-25988: Emit a :exc:`DeprecationWarning` when using or importing an ABC
22242  directly from :mod:`collections` rather than from :mod:`collections.abc`.
22243
22244- bpo-21060: Rewrite confusing message from setup.py upload from "No dist
22245  file created in earlier command" to the more helpful "Must create and
22246  upload files in one command".
22247
22248- bpo-32852: Make sure sys.argv remains as a list when running trace.
22249
22250- bpo-31333: ``_abc`` module is added.  It is a speedup module with C
22251  implementations for various functions and methods in ``abc``.  Creating an
22252  ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC
22253  subclass are up to 1.5x faster. In addition, this makes Python start-up up
22254  to 10% faster. Note that the new implementation hides internal registry
22255  and caches, previously accessible via private attributes
22256  ``_abc_registry``, ``_abc_cache``, and ``_abc_negative_cache``.  There are
22257  three debugging helper methods that can be used instead
22258  ``_dump_registry``, ``_abc_registry_clear``, and ``_abc_caches_clear``.
22259
22260- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored
22261  cancellation after notifying and cancelling a conditional lock. Patch by
22262  Bar Harel.
22263
22264- bpo-32819: ssl.match_hostname() has been simplified and no longer depends
22265  on re and ipaddress module for wildcard and IP addresses. Error reporting
22266  for invalid wildcards has been improved.
22267
22268- bpo-32394: socket: Remove
22269  TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version
22270  Windows during run-time.
22271
22272- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
22273  (Contributed by Oren Milman)
22274
22275- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
22276  only the last field is quoted.  Patch by Jake Davis.
22277
22278- bpo-32792: collections.ChainMap() preserves the order of the underlying
22279  mappings.
22280
22281- bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which
22282  contain set operations. Sets starting with '[' or containing '--', '&&',
22283  '~~' or '||' will be interpreted differently in regular expressions in
22284  future versions. Currently they emit warnings. fnmatch.translate() now
22285  avoids producing patterns containing such sets by accident.
22286
22287- bpo-32622: Implement native fast sendfile for Windows proactor event loop.
22288
22289- bpo-32777: Fix a rare but potential pre-exec child process deadlock in
22290  subprocess on POSIX systems when marking file descriptors inheritable on
22291  exec in the child process.  This bug appears to have been introduced in
22292  3.4.
22293
22294- bpo-32647: The ctypes module used to depend on indirect linking for
22295  dlopen. The shared extension is now explicitly linked against libdl on
22296  platforms with dl.
22297
22298- bpo-32741: Implement ``asyncio.TimerHandle.when()`` method.
22299
22300- bpo-32691: Use mod_spec.parent when running modules with pdb
22301
22302- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
22303  and locking the same lock multiple times, without it being free. Patch by
22304  Bar Harel.
22305
22306- bpo-32727: Do not include name field in SMTP envelope from address. Patch
22307  by Stéphane Wirtel
22308
22309- bpo-31453: Add TLSVersion constants and SSLContext.maximum_version /
22310  minimum_version attributes. The new API wraps OpenSSL 1.1
22311  https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html
22312  feature.
22313
22314- bpo-24334: Internal implementation details of ssl module were cleaned up.
22315  The SSLSocket has one less layer of indirection. Owner and session
22316  information are now handled by the SSLSocket and SSLObject constructor.
22317  Channel binding implementation has been simplified.
22318
22319- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
22320  chunk is not found. Patch by Zackery Spytz.
22321
22322- bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`.  Patch by Alan D
22323  Moore.
22324
22325- bpo-32221: Various functions returning tuple containing IPv6 addresses now
22326  omit ``%scope`` part since the same information is already encoded in
22327  *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom`
22328  when it receives multicast packet since useless resolving of network
22329  interface name is omitted.
22330
22331- bpo-30693: The TarFile class now recurses directories in a reproducible
22332  way.
22333
22334- bpo-30693: The ZipFile class now recurses directories in a reproducible
22335  way.
22336
22337Documentation
22338-------------
22339
22340- bpo-28124: The ssl module function ssl.wrap_socket() has been
22341  de-emphasized and deprecated in favor of the more secure and efficient
22342  SSLContext.wrap_socket() method.
22343
22344- bpo-17232: Clarify docs for -O and -OO.  Patch by Terry Reedy.
22345
22346- bpo-32436: Add documentation for the contextvars module (PEP 567).
22347
22348- bpo-32800: Update link to w3c doc for xml default namespaces.
22349
22350- bpo-11015: Update :mod:`test.support` documentation.
22351
22352- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
22353  method raises :exc:`AttributeError`.
22354
22355- bpo-32614: Modify RE examples in documentation to use raw strings to
22356  prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
22357  the deprecation.
22358
22359- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses.
22360
22361Tests
22362-----
22363
22364- bpo-31809: Add tests to verify connection with secp ECDH curves.
22365
22366Build
22367-----
22368
22369- bpo-32898: Fix the python debug build when using COUNT_ALLOCS.
22370
22371Windows
22372-------
22373
22374- bpo-32901: Update Tcl and Tk versions to 8.6.8
22375
22376- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
22377
22378- bpo-32409: Ensures activate.bat can handle Unicode contents.
22379
22380- bpo-32457: Improves handling of denormalized executable path when
22381  launching Python.
22382
22383- bpo-32370: Use the correct encoding for ipconfig output in the uuid
22384  module. Patch by Segev Finer.
22385
22386- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
22387  treating the ``PrintNameOffset`` field of the reparse data buffer as a
22388  number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
22389
22390macOS
22391-----
22392
22393- bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
22394
22395IDLE
22396----
22397
22398- bpo-32916: Change ``str`` to ``code`` in pyparse.
22399
22400- bpo-32905: Remove unused code in pyparse module.
22401
22402- bpo-32874: Add tests for pyparse.
22403
22404- bpo-32837: Using the system and place-dependent default encoding for
22405  open() is a bad idea for IDLE's system and location-independent files.
22406
22407- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
22408  test test_file_buttons() only looks at initial ascii-only lines, but
22409  failed on systems where open() defaults to 'ascii' because readline()
22410  internally reads and decodes far enough ahead to encounter a non-ascii
22411  character in CREDITS.txt.
22412
22413- bpo-32765: Update configdialog General tab docstring to add new widgets to
22414  the widget list.
22415
22416Tools/Demos
22417-----------
22418
22419- bpo-32222: Fix pygettext not extracting docstrings for functions with type
22420  annotated arguments. Patch by Toby Harradine.
22421
22422
22423What's New in Python 3.7.0 beta 1?
22424==================================
22425
22426*Release date: 2018-01-30*
22427
22428Core and Builtins
22429-----------------
22430
22431- bpo-32703: Fix coroutine's ResourceWarning when there's an active error
22432  set when it's being finalized.
22433
22434- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
22435  over (next command) native coroutines. Patch by Pablo Galindo.
22436
22437- bpo-28685: Optimize list.sort() and sorted() by using type specialized
22438  comparisons when possible.
22439
22440- bpo-32685: Improve suggestion when the Python 2 form of print statement is
22441  either present on the same line as the header of a compound statement or
22442  else terminated by a semi-colon instead of a newline. Patch by Nitish
22443  Chandra.
22444
22445- bpo-32697: Python now explicitly preserves the definition order of
22446  keyword-only parameters.  It's always preserved their order, but this
22447  behavior was never guaranteed before; this behavior is now guaranteed and
22448  tested.
22449
22450- bpo-32690: The locals() dictionary now displays in the lexical order that
22451  variables were defined.  Previously, the order was reversed.
22452
22453- bpo-32677: Add ``.isascii()`` method to ``str``, ``bytes`` and
22454  ``bytearray``. It can be used to test that string contains only ASCII
22455  characters.
22456
22457- bpo-32670: Enforce :pep:`479` for all code. This means that manually
22458  raising a StopIteration exception from a generator is prohibited for all
22459  code, regardless of whether 'from __future__ import generator_stop' was
22460  used or not.
22461
22462- bpo-32591: Added built-in support for tracking the origin of coroutine
22463  objects; see sys.set_coroutine_origin_tracking_depth and
22464  CoroutineType.cr_origin. This replaces the asyncio debug mode's use of
22465  coroutine wrapping for native coroutine objects.
22466
22467- bpo-31368: Expose preadv and pwritev system calls in the os module. Patch
22468  by Pablo Galindo
22469
22470- bpo-32544: ``hasattr(obj, name)`` and ``getattr(obj, name, default)`` are
22471  about 4 times faster than before when ``name`` is not found and ``obj``
22472  doesn't override ``__getattr__`` or ``__getattribute__``.
22473
22474- bpo-26163: Improved frozenset() hash to create more distinct hash values
22475  when faced with datasets containing many similar values.
22476
22477- bpo-32550: Remove the STORE_ANNOTATION bytecode.
22478
22479- bpo-20104: Expose posix_spawn as a low level API in the os module.
22480  (removed before 3.7.0rc1)
22481
22482- bpo-24340: Fixed estimation of the code stack size.
22483
22484- bpo-32436: Implement :pep:`567` Context Variables.
22485
22486- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or
22487  ``items()`` no longer raises ``RecursionError``; OrderedDict similarly.
22488  Instead, use ``...``, as for other recursive structures.  Patch by Ben
22489  North.
22490
22491- bpo-20891: Py_Initialize() now creates the GIL. The GIL is no longer
22492  created "on demand" to fix a race condition when PyGILState_Ensure() is
22493  called in a non-Python thread.
22494
22495- bpo-32028: Leading whitespace is now correctly ignored when generating
22496  suggestions for converting Py2 print statements to Py3 builtin print
22497  function calls. Patch by Sanyam Khurana.
22498
22499- bpo-31179: Make dict.copy() up to 5.5 times faster.
22500
22501- bpo-31113: Get rid of recursion in the compiler for normal control flow.
22502
22503Library
22504-------
22505
22506- bpo-25988: Deprecate exposing the contents of collections.abc in the
22507  regular collections module.
22508
22509- bpo-31429: The default cipher suite selection of the ssl module now uses a
22510  blacklist approach rather than a hard-coded whitelist. Python no longer
22511  re-enables ciphers that have been blocked by OpenSSL security update.
22512  Default cipher suite selection can be configured on compile time.
22513
22514- bpo-30306: contextlib.contextmanager now releases the arguments passed to
22515  the underlying generator as soon as the context manager is entered.
22516  Previously it would keep them alive for as long as the context manager was
22517  alive, even when not being used as a function decorator. Patch by Martin
22518  Teichmann.
22519
22520- bpo-21417: Added support for setting the compression level for
22521  zipfile.ZipFile.
22522
22523- bpo-32251: Implement asyncio.BufferedProtocol (provisional API).
22524
22525- bpo-32513: In dataclasses, allow easier overriding of dunder methods
22526  without specifying decorator parameters.
22527
22528- bpo-32660: :mod:`termios` makes available ``FIONREAD``, ``FIONCLEX``,
22529  ``FIOCLEX``, ``FIOASYNC`` and ``FIONBIO`` also under Solaris/derivatives.
22530
22531- bpo-27931: Fix email address header parsing error when the username is an
22532  empty quoted string. Patch by Xiang Zhang.
22533
22534- bpo-32659: Under Solaris and derivatives, :class:`os.stat_result` provides
22535  a st_fstype attribute.
22536
22537- bpo-32662: Implement Server.start_serving(), Server.serve_forever(), and
22538  Server.is_serving() methods.  Add 'start_serving' keyword parameter to
22539  loop.create_server() and loop.create_unix_server().
22540
22541- bpo-32391: Implement :meth:`asyncio.StreamWriter.wait_closed` and
22542  :meth:`asyncio.StreamWriter.is_closing` methods
22543
22544- bpo-32643: Make Task._step, Task._wakeup and Future._schedule_callbacks
22545  methods private.
22546
22547- bpo-32630: Refactor decimal module to use contextvars to store decimal
22548  context.
22549
22550- bpo-32622: Add :meth:`asyncio.AbstractEventLoop.sendfile` method.
22551
22552- bpo-32304: distutils' upload command no longer corrupts tar files ending
22553  with a CR byte, and no longer tries to convert CR to CRLF in any of the
22554  upload text fields.
22555
22556- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware
22557  address is encountered.
22558
22559- bpo-32596: ``concurrent.futures`` imports ``ThreadPoolExecutor`` and
22560  ``ProcessPoolExecutor`` lazily (using :pep:`562`). It makes ``import
22561  asyncio`` about 15% faster because asyncio uses only
22562  ``ThreadPoolExecutor`` by default.
22563
22564- bpo-31801: Add ``_ignore_`` to ``Enum`` so temporary variables can be used
22565  during class construction without being turned into members.
22566
22567- bpo-32576: Use queue.SimpleQueue() in places where it can be invoked from
22568  a weakref callback.
22569
22570- bpo-32574: Fix memory leak in asyncio.Queue, when the queue has limited
22571  size and it is full, the cancelation of queue.put() can cause a memory
22572  leak. Patch by: José Melero.
22573
22574- bpo-32521: The nis module is now compatible with new libnsl and headers
22575  location.
22576
22577- bpo-32467: collections.abc.ValuesView now inherits from
22578  collections.abc.Collection.
22579
22580- bpo-32473: Improve ABCMeta._dump_registry() output readability
22581
22582- bpo-32102: New argument ``capture_output`` for subprocess.run
22583
22584- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
22585  library in nis module.
22586
22587- bpo-32493: UUID module fixes build for FreeBSD/OpenBSD
22588
22589- bpo-32503: Pickling with protocol 4 no longer creates too small frames.
22590
22591- bpo-29237: Create enum for pstats sorting options
22592
22593- bpo-32454: Add close(fd) function to the socket module.
22594
22595- bpo-25942: The subprocess module is now more graceful when handling a
22596  Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a
22597  Popen context manager.  It now waits a short amount of time for the child
22598  (presumed to have also gotten the SIGINT) to exit, before continuing the
22599  KeyboardInterrupt exception handling.  This still includes a SIGKILL in
22600  the call() and run() APIs, but at least the child had a chance first.
22601
22602- bpo-32433: The hmac module now has hmac.digest(), which provides an
22603  optimized HMAC digest.
22604
22605- bpo-28134: Sockets now auto-detect family, type and protocol from file
22606  descriptor by default.
22607
22608- bpo-32404: Fix bug where :meth:`datetime.datetime.fromtimestamp` did not
22609  call __new__ in :class:`datetime.datetime` subclasses.
22610
22611- bpo-32403: Improved speed of :class:`datetime.date` and
22612  :class:`datetime.datetime` alternate constructors.
22613
22614- bpo-32228: Ensure that ``truncate()`` preserves the file position (as
22615  reported by ``tell()``) after writes longer than the buffer size.
22616
22617- bpo-32410: Implement ``loop.sock_sendfile`` for asyncio event loop.
22618
22619- bpo-22908: Added seek and tell to the ZipExtFile class. This only works if
22620  the file object used to open the zipfile is seekable.
22621
22622- bpo-32373: Add socket.getblocking() method.
22623
22624- bpo-32248: Add :mod:`importlib.resources` and
22625  :class:`importlib.abc.ResourceReader` as the unified API for reading
22626  resources contained within packages.  Loaders wishing to support resource
22627  reading must implement the :meth:`get_resource_reader()` method.
22628  File-based and zipimport-based loaders both implement these APIs.
22629  :class:`importlib.abc.ResourceLoader` is deprecated in favor of these new
22630  APIs.
22631
22632- bpo-32320: collections.namedtuple() now supports default values.
22633
22634- bpo-29302: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya
22635  Kulakov.
22636
22637- bpo-31961: *Removed in Python 3.7.0b2.* The *args* argument of
22638  subprocess.Popen can now be a :term:`path-like object`. If *args* is given
22639  as a sequence, it's first element can now be a :term:`path-like object` as
22640  well.
22641
22642- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the
22643  ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
22644  ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII
22645  or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the
22646  ``LC_CTYPE`` locale. This temporary change affects other threads. Same
22647  change for the :meth:`str.format` method when formatting a number
22648  (:class:`int`, :class:`float`, :class:`float` and subclasses) with the
22649  ``n`` type (ex: ``'{:n}'.format(1234)``).
22650
22651- bpo-31853: Use super().method instead of socket.method in SSLSocket.  They
22652  were there most likely for legacy reasons.
22653
22654- bpo-31399: The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host()
22655  and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses.
22656  Subject common name fallback can be disabled with
22657  SSLContext.hostname_checks_common_name.
22658
22659- bpo-14976: Add a queue.SimpleQueue class, an unbounded FIFO queue with a
22660  reentrant C implementation of put().
22661
22662Documentation
22663-------------
22664
22665- bpo-32724: Add references to some commands in the documentation of Pdb.
22666  Patch by Stéphane Wirtel
22667
22668- bpo-32649: Complete the C API documentation, profiling and tracing part
22669  with the newly added per-opcode events.
22670
22671- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and
22672  their C-API counterparts regarding which type of events are received in
22673  each function. Patch by Pablo Galindo Salgado.
22674
22675Tests
22676-----
22677
22678- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
22679
22680- bpo-28414: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003
22681  internationalized host names are working since bpo-31399 has landed. IDNA
22682  2008 are still broken.
22683
22684- bpo-32604: Add a new "_xxsubinterpreters" extension module that exposes
22685  the existing subinterpreter C-API and a new cross-interpreter data sharing
22686  mechanism. The module is primarily intended for more thorough testing of
22687  the existing subinterpreter support. Note that the _xxsubinterpreters
22688  module has been removed in 3.7.0rc1.
22689
22690- bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode.
22691
22692- bpo-32549: On Travis CI, Python now Compiles and uses a local copy of
22693  OpenSSL 1.1.0g for testing.
22694
22695Build
22696-----
22697
22698- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided
22699  instead of libcrypt at the system.
22700
22701- bpo-32598: Use autoconf to detect OpenSSL libs, headers and supported
22702  features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL
22703  and falls back to manual search.
22704
22705- bpo-32593: Drop support of FreeBSD 9 and older.
22706
22707- bpo-29708: If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set,
22708  :mod:`py_compile` will always create hash-based ``.pyc`` files.
22709
22710Windows
22711-------
22712
22713- bpo-32588: Create standalone _distutils_findvs module and add missing
22714  _queue module to installer.
22715
22716- bpo-29911: Ensure separate Modify and Uninstall buttons are displayed.
22717
22718- bpo-32507: Use app-local UCRT install rather than the proper update for
22719  old versions of Windows.
22720
22721macOS
22722-----
22723
22724- bpo-32726: Provide an additional, more modern macOS installer variant that
22725  supports macOS 10.9+ systems in 64-bit mode only.  Upgrade the supplied
22726  third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0.  The 10.9+
22727  installer now links with and supplies its own copy of Tcl/Tk 8.6.
22728
22729- bpo-28440: No longer add /Library/Python/3.x/site-packages to sys.path for
22730  macOS framework builds to avoid future conflicts.
22731
22732C API
22733-----
22734
22735- bpo-32681: Fix uninitialized variable 'res' in the C implementation of
22736  os.dup2. Patch by Stéphane Wirtel
22737
22738- bpo-10381: Add C API access to the ``datetime.timezone`` constructor and
22739  ``datetime.timzone.UTC`` singleton.
22740
22741
22742What's New in Python 3.7.0 alpha 4?
22743===================================
22744
22745*Release date: 2018-01-08*
22746
22747Core and Builtins
22748-----------------
22749
22750- bpo-31975: The default warning filter list now starts with a
22751  "default::DeprecationWarning:__main__" entry, so deprecation warnings are
22752  once again shown by default in single-file scripts and at the interactive
22753  prompt.
22754
22755- bpo-32226: ``__class_getitem__`` is now an automatic class method.
22756
22757- bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in
22758  libc.a
22759
22760- bpo-32390: Fix the compilation failure on AIX after the f_fsid field has
22761  been added to the object returned by os.statvfs() (issue #32143). Original
22762  patch by Michael Felt.
22763
22764- bpo-32379: Make MRO computation faster when a class inherits from a single
22765  base.
22766
22767- bpo-32259: The error message of a TypeError raised when unpack
22768  non-iterable is now more specific.
22769
22770- bpo-27169: The ``__debug__`` constant is now optimized out at compile
22771  time. This fixes also bpo-22091.
22772
22773- bpo-32329: The :option:`-R` option now turns on hash randomization when
22774  the :envvar:`PYTHONHASHSEED` environment variable is set to ``0``.
22775  Previously, the option was ignored. Moreover,
22776  ``sys.flags.hash_randomization`` is now properly set to 0 when hash
22777  randomization is turned off by ``PYTHONHASHSEED=0``.
22778
22779- bpo-30416: The optimizer is now protected from spending much time doing
22780  complex calculations and consuming much memory for creating large
22781  constants in constant folding. Increased limits for constants that can be
22782  produced in constant folding.
22783
22784- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in
22785  socketmodule on Windows.
22786
22787- bpo-30579: Implement TracebackType.__new__ to allow Python-level creation
22788  of traceback objects, and make TracebackType.tb_next mutable.
22789
22790- bpo-32260: Don't byte swap the input keys to the SipHash algorithm on
22791  big-endian platforms. This should ensure siphash gives consistent results
22792  across platforms.
22793
22794- bpo-31506: Improve the error message logic for object.__new__ and
22795  object.__init__. Patch by Sanyam Khurana.
22796
22797- bpo-20361: ``-b`` and ``-bb`` now inject ``'default::BytesWarning'`` and
22798  ``error::BytesWarning`` entries into ``sys.warnoptions``, ensuring that
22799  they take precedence over any other warning filters configured via the
22800  ``-W`` option or the ``PYTHONWARNINGS`` environment variable.
22801
22802- bpo-32230: `-X dev` now injects a ``'default'`` entry into
22803  sys.warnoptions, ensuring that it behaves identically to actually passing
22804  ``-Wdefault`` at the command line.
22805
22806- bpo-29240: Add a new UTF-8 mode: implementation of the :pep:`540`.
22807
22808- bpo-32226: :pep:`560`: Add support for ``__mro_entries__`` and
22809  ``__class_getitem__``. Implemented by Ivan Levkivskyi.
22810
22811- bpo-32225: :pep:`562`: Add support for module ``__getattr__`` and
22812  ``__dir__``. Implemented by Ivan Levkivskyi.
22813
22814- bpo-31901: The `atexit` module now has its callback stored per
22815  interpreter.
22816
22817- bpo-31650: Implement :pep:`552` (Deterministic pycs). Python now supports
22818  invalidating bytecode cache files bashed on a source content hash rather
22819  than source last-modified time.
22820
22821- bpo-29469: Move constant folding from bytecode layer to AST layer.
22822  Original patch by Eugene Toder.
22823
22824Library
22825-------
22826
22827- bpo-32506: Now that dict is defined as keeping insertion order, drop
22828  OrderedDict and just use plain dict.
22829
22830- bpo-32279: Add params to dataclasses.make_dataclasses(): init, repr, eq,
22831  order, hash, and frozen.  Pass them through to dataclass().
22832
22833- bpo-32278: Make type information optional on dataclasses.make_dataclass().
22834  If omitted, the string 'typing.Any' is used.
22835
22836- bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is
22837  a dataclass or an instance of one.
22838
22839- bpo-32468: Improve frame repr() to mention filename, code name and current
22840  line number.
22841
22842- bpo-23749: asyncio: Implement loop.start_tls()
22843
22844- bpo-32441: Return the new file descriptor (i.e., the second argument) from
22845  ``os.dup2``. Previously, ``None`` was always returned.
22846
22847- bpo-32422: ``functools.lru_cache`` uses less memory (3 words for each
22848  cached key) and takes about 1/3 time for cyclic GC.
22849
22850- bpo-31721: Prevent Python crash from happening when Future._log_traceback
22851  is set to True manually.  Now it can only be set to False, or a ValueError
22852  is raised.
22853
22854- bpo-32415: asyncio: Add Task.get_loop() and Future.get_loop()
22855
22856- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on
22857  interpreter shutdown.
22858
22859- bpo-32363: Make asyncio.Task.set_exception() and set_result() raise
22860  NotImplementedError. Task._step() and Future.__await__() raise proper
22861  exceptions when they are in an invalid state, instead of raising an
22862  AssertionError.
22863
22864- bpo-32357: Optimize asyncio.iscoroutine() and loop.create_task() for
22865  non-native coroutines (e.g. async/await compiled with Cython).
22866  'loop.create_task(python_coroutine)' used to be 20% faster than
22867  'loop.create_task(cython_coroutine)'.  Now, the latter is as fast.
22868
22869- bpo-32356: asyncio.transport.resume_reading() and pause_reading() are now
22870  idempotent. New transport.is_reading() method is added.
22871
22872- bpo-32355: Optimize asyncio.gather(); now up to 15% faster.
22873
22874- bpo-32351: Use fastpath in asyncio.sleep if delay<0 (2x boost)
22875
22876- bpo-32348: Optimize asyncio.Future schedule/add/remove callback.  The
22877  optimization shows 3-6% performance improvements of async/await code.
22878
22879- bpo-32331: Fix socket.settimeout() and socket.setblocking() to keep
22880  socket.type as is. Fix socket.socket() constructor to reset any bit flags
22881  applied to socket's type.  This change only affects OSes that have
22882  SOCK_NONBLOCK and/or SOCK_CLOEXEC.
22883
22884- bpo-32248: Add :class:`importlib.abc.ResourceReader` as an ABC for loaders
22885  to provide a unified API for reading resources contained within packages.
22886  Also add :mod:`importlib.resources` as the port of
22887  ``importlib_resources``.
22888
22889- bpo-32311: Implement asyncio.create_task(coro) shortcut
22890
22891- bpo-32327: Convert asyncio functions that were documented as coroutines to
22892  coroutines. Affected functions: loop.sock_sendall, loop.sock_recv,
22893  loop.sock_accept, loop.getaddrinfo, loop.getnameinfo.
22894
22895- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id
22896  (scope) to lower case for scoped IPv6 addresses in hostnames now.
22897
22898- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary
22899  compatible with CRT v140.
22900
22901- bpo-29711: Fix ``stop_serving`` in asyncio proactor loop kill all
22902  listening servers
22903
22904- bpo-32308: :func:`re.sub()` now replaces empty matches adjacent to a
22905  previous non-empty match.
22906
22907- bpo-29970: Abort asyncio SSLProtocol connection if handshake not complete
22908  within 10 seconds.
22909
22910- bpo-32314: Implement asyncio.run().
22911
22912- bpo-17852: Revert incorrect fix based on misunderstanding of
22913  _Py_PyAtExit() semantics.
22914
22915- bpo-32296: Implement asyncio._get_running_loop() and get_event_loop() in
22916  C. This makes them 4x faster.
22917
22918- bpo-32250: Implement ``asyncio.current_task()`` and
22919  ``asyncio.all_tasks()``. Add helpers intended to be used by alternative
22920  task implementations: ``asyncio._register_task``, ``asyncio._enter_task``,
22921  ``asyncio._leave_task`` and ``asyncio._unregister_task``. Deprecate
22922  ``asyncio.Task.current_task()`` and ``asyncio.Task.all_tasks()``.
22923
22924- bpo-32255: A single empty field is now always quoted when written into a
22925  CSV file. This allows to distinguish an empty row from a row consisting of
22926  a single empty field. Patch by Licht Takeuchi.
22927
22928- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on
22929  platforms where ``chmod(..., follow_symlinks=False)`` is not supported.
22930  Patch by Anthony Sottile.
22931
22932- bpo-30050: New argument warn_on_full_buffer to signal.set_wakeup_fd lets
22933  you control whether Python prints a warning on stderr when the wakeup fd
22934  buffer overflows.
22935
22936- bpo-29137: The ``fpectl`` library has been removed. It was never enabled
22937  by default, never worked correctly on x86-64, and it changed the Python
22938  ABI in ways that caused unexpected breakage of C extensions.
22939
22940- bpo-32273: Move asyncio.test_utils to test.test_asyncio.
22941
22942- bpo-32272: Remove asyncio.async() function.
22943
22944- bpo-32269: Add asyncio.get_running_loop() function.
22945
22946- bpo-32265: All class and static methods of builtin types now are correctly
22947  classified by inspect.classify_class_attrs() and grouped in pydoc ouput.
22948  Added types.ClassMethodDescriptorType for unbound class methods of builtin
22949  types.
22950
22951- bpo-32253: Deprecate ``yield from lock``, ``await lock``, ``with (yield
22952  from lock)`` and ``with await lock`` for asyncio synchronization
22953  primitives.
22954
22955- bpo-22589: Changed MIME type of .bmp from 'image/x-ms-bmp' to 'image/bmp'
22956
22957- bpo-32193: Convert asyncio to use *async/await* syntax. Old styled ``yield
22958  from`` is still supported too.
22959
22960- bpo-32206: Add support to run modules with pdb
22961
22962- bpo-32227: ``functools.singledispatch`` now supports registering
22963  implementations using type annotations.
22964
22965- bpo-15873: Added new alternate constructors
22966  :meth:`datetime.datetime.fromisoformat`,
22967  :meth:`datetime.time.fromisoformat` and
22968  :meth:`datetime.date.fromisoformat` as the inverse operation of each
22969  classes's respective ``isoformat`` methods.
22970
22971- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
22972  list'.
22973
22974- bpo-32143: os.statvfs() includes the f_fsid field from statvfs(2)
22975
22976- bpo-26439: Fix ctypes.util.find_library() for AIX by implementing
22977  ctypes._aix.find_library() Patch by: Michael Felt
22978
22979- bpo-31993: The pickler now uses less memory when serializing large bytes
22980  and str objects into a file.  Pickles created with protocol 4 will require
22981  less memory for unpickling large bytes and str objects.
22982
22983- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
22984
22985- bpo-31778: ast.literal_eval() is now more strict. Addition and subtraction
22986  of arbitrary numbers no longer allowed.
22987
22988- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now
22989  works even if the ``os`` module still is not imported.
22990
22991- bpo-30241: Add contextlib.AbstractAsyncContextManager. Patch by Jelle
22992  Zijlstra.
22993
22994- bpo-31699: Fix deadlocks in
22995  :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or
22996  results cause pickling or unpickling errors. This should make sure that
22997  calls to the :class:`ProcessPoolExecutor` API always eventually return.
22998
22999- bpo-15216: ``TextIOWrapper.reconfigure()`` supports changing *encoding*,
23000  *errors*, and *newline*.
23001
23002Documentation
23003-------------
23004
23005- bpo-32418: Add get_loop() method to Server and AbstractServer classes.
23006
23007Tests
23008-----
23009
23010- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core
23011  dump files when testing crashes. getrlimit() returns zero on success.
23012
23013- bpo-32002: Adjust C locale coercion testing for the empty locale and POSIX
23014  locale cases to more readily adjust to platform dependent behaviour.
23015
23016Windows
23017-------
23018
23019- bpo-19764: Implement support for `subprocess.Popen(close_fds=True)` on
23020  Windows. Patch by Segev Finer.
23021
23022Tools/Demos
23023-----------
23024
23025- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
23026  pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
23027  lib2to3 work when run from a zipfile.
23028
23029C API
23030-----
23031
23032- bpo-32030: Py_Initialize() doesn't reset the memory allocators to default
23033  if the ``PYTHONMALLOC`` environment variable is not set.
23034
23035- bpo-29084: Undocumented C API for OrderedDict has been excluded from the
23036  limited C API. It was added by mistake and actually never worked in the
23037  limited C API.
23038
23039- bpo-32264: Moved the pygetopt.h header into internal/, since it has no
23040  public APIs.
23041
23042- bpo-32241: :c:func:`Py_SetProgramName` and :c:func:`Py_SetPythonHome` now
23043  take the ``const wchar *`` arguments instead of ``wchar *``.
23044
23045
23046What's New in Python 3.7.0 alpha 3?
23047===================================
23048
23049*Release date: 2017-12-05*
23050
23051Core and Builtins
23052-----------------
23053
23054- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code
23055  object constructor based on freevars and cellvars, rather than needing to
23056  be set correctly by the caller. This ensures it will be cleared
23057  automatically when additional cell references are injected into a modified
23058  code object and function.
23059
23060- bpo-10544: Yield expressions are now deprecated in comprehensions and
23061  generator expressions. They are still permitted in the definition of the
23062  outermost iterable, as that is evaluated directly in the enclosing scope.
23063
23064- bpo-32137: The repr of deeply nested dict now raises a RecursionError
23065  instead of crashing due to a stack overflow.
23066
23067- bpo-32096: Revert memory allocator changes in the C API: move structures
23068  back from _PyRuntime to Objects/obmalloc.c. The memory allocators are once
23069  again initialized statically, and so PyMem_RawMalloc() and
23070  Py_DecodeLocale() can be called before _PyRuntime_Initialize().
23071
23072- bpo-32043: Add a new "developer mode": new "-X dev" command line option to
23073  enable debug checks at runtime.
23074
23075- bpo-32023: SyntaxError is now correctly raised when a generator expression
23076  without parenthesis is used instead of an inheritance list in a class
23077  definition. The duplication of the parentheses can be omitted only on
23078  calls.
23079
23080- bpo-32012: SyntaxError is now correctly raised when a generator expression
23081  without parenthesis is passed as an argument, but followed by a trailing
23082  comma. A generator expression always needs to be directly inside a set of
23083  parentheses and cannot have a comma on either side.
23084
23085- bpo-28180: A new internal ``_Py_SetLocaleFromEnv(category)`` helper
23086  function has been added in order to improve the consistency of behaviour
23087  across different ``libc`` implementations (e.g. Android doesn't support
23088  setting the locale from the environment by default).
23089
23090- bpo-31949: Fixed several issues in printing tracebacks
23091  (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now
23092  suppresses printing tracebacks. Setting sys.tracebacklimit to None now
23093  causes using the default limit. Setting sys.tracebacklimit to an integer
23094  larger than LONG_MAX now means using the limit LONG_MAX rather than the
23095  default limit. Fixed integer overflows in the case of more than ``2**31``
23096  traceback items on Windows. Fixed output errors handling.
23097
23098- bpo-30696: Fix the interactive interpreter looping endlessly when no
23099  memory.
23100
23101- bpo-20047: Bytearray methods partition() and rpartition() now accept only
23102  bytes-like objects as separator, as documented.  In particular they now
23103  raise TypeError rather of returning a bogus result when an integer is
23104  passed as a separator.
23105
23106- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of
23107  ``__import__()`` or the ``__all__`` attribute of the module contain bytes
23108  instances.
23109
23110- bpo-31845: Environment variables are once more read correctly at
23111  interpreter startup.
23112
23113- bpo-28936: Ensure that lexically first syntax error involving a parameter
23114  and ``global`` or ``nonlocal`` is detected first at a given scope. Patch
23115  by Ivan Levkivskyi.
23116
23117- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in
23118  codecs.escape_decode() when decode an escaped non-ascii byte.
23119
23120- bpo-31618: The per-frame tracing logic added in 3.7a1 has been altered so
23121  that ``frame->f_lineno`` is updated before either ``"line"`` or
23122  ``"opcode"`` events are emitted. Previously, opcode events were emitted
23123  first, and therefore would occasionally see stale line numbers on the
23124  frame. The behavior of this feature has changed slightly as a result: when
23125  both ``f_trace_lines`` and ``f_trace_opcodes`` are enabled, line events
23126  now occur first.
23127
23128- bpo-28603: Print the full context/cause chain of exceptions on interpreter
23129  exit, even if an exception in the chain is unhashable or compares equal to
23130  later ones. Patch by Zane Bitter.
23131
23132- bpo-31786: Fix timeout rounding in the select module to round correctly
23133  negative timeouts between -1.0 and 0.0. The functions now block waiting
23134  for events as expected. Previously, the call was incorrectly non-blocking.
23135  Patch by Pablo Galindo.
23136
23137- bpo-31781: Prevent crashes when calling methods of an uninitialized
23138  ``zipimport.zipimporter`` object. Patch by Oren Milman.
23139
23140- bpo-30399: Standard repr() of BaseException with a single argument no
23141  longer contains redundant trailing comma.
23142
23143- bpo-31626: Fixed a bug in debug memory allocator.  There was a write to
23144  freed memory after shrinking a memory block.
23145
23146- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be
23147  raised by `_PySys_SetObjectId()`, for example when no memory.
23148
23149Library
23150-------
23151
23152- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
23153  instances of generic classes, improve interaction of ``__init_subclass__``
23154  with generics. Original PRs by Ivan Levkivskyi.
23155
23156- bpo-32214: PEP 557, Data Classes. Provides a decorator which adds
23157  boilerplate methods to classes which use type annotations so specify
23158  fields.
23159
23160- bpo-27240: The header folding algorithm for the new email policies has
23161  been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182.  In
23162  particular, RFC2231 folding is now done correctly.
23163
23164- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL
23165  when getting the file size. Fixed hang of all threads with inaccessible
23166  NFS server. Patch by Nir Soffer.
23167
23168- bpo-32101: Add :attr:`sys.flags.dev_mode` flag
23169
23170- bpo-32154: The ``asyncio.windows_utils.socketpair()`` function has been
23171  removed: use directly :func:`socket.socketpair` which is available on all
23172  platforms since Python 3.5 (before, it wasn't available on Windows).
23173  ``asyncio.windows_utils.socketpair()`` was just an alias to
23174  ``socket.socketpair`` on Python 3.5 and newer.
23175
23176- bpo-32089: warnings: In development (-X dev) and debug mode (pydebug
23177  build), use the "default" action for ResourceWarning, rather than the
23178  "always" action, in the default warnings filters.
23179
23180- bpo-32107: ``uuid.getnode()`` now preferentially returns universally
23181  administered MAC addresses if available, over locally administered MAC
23182  addresses.  This makes a better guarantee for global uniqueness of UUIDs
23183  returned from ``uuid.uuid1()``.  If only locally administered MAC
23184  addresses are available, the first such one found is returned.
23185
23186- bpo-23033: Wildcard is now supported in hostname when it is one and only
23187  character in the left most segment of hostname in second argument of
23188  :meth:`ssl.match_hostname`.  Patch by Mandeep Singh.
23189
23190- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return
23191  ``None`` when the value of property is ``VT_EMPTY``.  Initial patch by
23192  Mark Mc Mahon.
23193
23194- bpo-28334: Use :func:`os.path.expanduser` to find the ``~/.netrc`` file in
23195  :class:`netrc.netrc`.  If it does not exist, :exc:`FileNotFoundError` is
23196  raised.  Patch by Dimitri Merejkowsky.
23197
23198- bpo-32121: Made ``tracemalloc.Traceback`` behave more like the traceback
23199  module, sorting the frames from oldest to most recent.
23200  ``Traceback.format()`` now accepts negative *limit*, truncating the result
23201  to the ``abs(limit)`` oldest frames. To get the old behaviour, one can use
23202  the new *most_recent_first* argument to ``Traceback.format()``. (Patch by
23203  Jesse Bakker.)
23204
23205- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the
23206  :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>`
23207  method. Initial patch by Robin Wellner.
23208
23209- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception
23210  message when it couldn't open or create an MSI file.  Initial patch by
23211  William Tisäter.
23212
23213- bpo-19610: ``setup()`` now warns about invalid types for some fields. The
23214  ``distutils.dist.Distribution`` class now warns when ``classifiers``,
23215  ``keywords`` and ``platforms`` fields are not specified as a list or a
23216  string.
23217
23218- bpo-32071: Added the ``-k`` command-line option to ``python -m unittest``
23219  to run only tests that match the given pattern(s).
23220
23221- bpo-10049: Added *nullcontext* no-op context manager to contextlib. This
23222  provides a simpler and faster alternative to ExitStack() when handling
23223  optional context managers.
23224
23225- bpo-28684: The new test.support.skip_unless_bind_unix_socket() decorator
23226  is used here to skip asyncio tests that fail because the platform lacks a
23227  functional bind() function for unix domain sockets (as it is the case for
23228  non root users on the recent Android versions that run now SELinux in
23229  enforcing mode).
23230
23231- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n*
23232  characters/bytes for non-negative *n*. This makes it compatible with
23233  ``read()`` methods of other file-like objects.
23234
23235- bpo-27535: The warnings module doesn't leak memory anymore in the hidden
23236  warnings registry for the "ignore" action of warnings filters.
23237  warn_explicit() function doesn't add the warning key to the registry
23238  anymore for the "ignore" action.
23239
23240- bpo-32088: warnings:  When Python is build is debug mode (``Py_DEBUG``),
23241  :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning` and
23242  :exc:`ImportWarning` warnings are now displayed by default.
23243
23244- bpo-1647489: Fixed searching regular expression patterns that could match
23245  an empty string. Non-empty string can now be correctly found after
23246  matching an empty string.
23247
23248- bpo-25054: Added support of splitting on a pattern that could match an
23249  empty string.
23250
23251- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
23252  Identical objects will be saved only once. Equal references will be load
23253  as identical objects. Added support for saving and loading recursive data
23254  structures.
23255
23256- bpo-32069: Drop legacy SSL transport from asyncio, ssl.MemoryBIO is always
23257  used anyway.
23258
23259- bpo-32066: asyncio: Support pathlib.Path in create_unix_connection; sock
23260  arg should be optional
23261
23262- bpo-32046: Updates 2to3 to convert from operator.isCallable(obj) to
23263  callable(obj). Patch by Dong-hee Na.
23264
23265- bpo-32018: inspect.signature should follow :pep:`8`, if the parameter has
23266  an annotation and a default value. Patch by Dong-hee Na.
23267
23268- bpo-32025: Add time.thread_time() and time.thread_time_ns()
23269
23270- bpo-32037: Integers that fit in a signed 32-bit integer will be now
23271  pickled with protocol 0 using the INT opcode.  This will decrease the size
23272  of a pickle, speed up pickling and unpickling, and make these integers be
23273  unpickled as int instances in Python 2.
23274
23275- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError
23276  pickleable.
23277
23278- bpo-32015: Fixed the looping of asyncio in the case of reconnection the
23279  socket during waiting async read/write from/to the socket.
23280
23281- bpo-32011: Restored support of loading marshal files with the TYPE_INT64
23282  code. These files can be produced in Python 2.7.
23283
23284- bpo-28369: Enhance add_reader/writer check that socket is not used by some
23285  transport. Before, only cases when add_reader/writer were called with an
23286  int FD were supported.  Now the check is implemented correctly for all
23287  file-like objects.
23288
23289- bpo-31976: Fix race condition when flushing a file is slow, which can
23290  cause a segfault if closing the file from another thread.
23291
23292- bpo-31985: Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp.
23293  Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in
23294  each of the three modules had been pointing to that module's open function
23295  as a matter of backwards compatibility, though it had been both untested
23296  and undocumented.
23297
23298- bpo-21862: cProfile command line now accepts `-m module_name` as an
23299  alternative to script path. Patch by Sanyam Khurana.
23300
23301- bpo-31970: Reduce performance overhead of asyncio debug mode.
23302
23303- bpo-31843: *database* argument of sqlite3.connect() now accepts a
23304  :term:`path-like object`, instead of just a string.
23305
23306- bpo-31945: Add Configurable *blocksize* to ``HTTPConnection`` and
23307  ``HTTPSConnection`` for improved upload throughput.  Patch by Nir Soffer.
23308
23309- bpo-31943: Add a ``cancelled()`` method to :class:`asyncio.Handle`.  Patch
23310  by Marat Sharafutdinov.
23311
23312- bpo-9678: Fixed determining the MAC address in the uuid module: Using
23313  ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
23314  OpenBSD. Based on patch by Takayuki Shimizukawa.
23315
23316- bpo-30057: Fix potential missed signal in signal.signal().
23317
23318- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian
23319  platforms. Patch by Jack O'Connor.
23320
23321- bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor
23322
23323- bpo-31927: Fixed compilation of the socket module on NetBSD 8.  Fixed
23324  assertion failure or reading arbitrary data when parse a AF_BLUETOOTH
23325  address on NetBSD and DragonFly BSD.
23326
23327- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse()
23328  when the size of types chtype or mmask_t is less than the size of C long.
23329  curses.box() now accepts characters as arguments.  Based on patch by Steve
23330  Fink.
23331
23332- bpo-31917: Add 3 new clock identifiers: :data:`time.CLOCK_BOOTTIME`,
23333  :data:`time.CLOCK_PROF` and :data:`time.CLOCK_UPTIME`.
23334
23335- bpo-31897: plistlib now catches more errors when read binary plists and
23336  raises InvalidFileException instead of unexpected exceptions.
23337
23338- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
23339  by Masayuki Yamamoto.
23340
23341- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and
23342  NetBSD. Fixed the comparison of the kqueue_event objects.
23343
23344- bpo-31891: Fixed building the curses module on NetBSD.
23345
23346- bpo-31884: added required constants to subprocess module for setting
23347  priority on windows
23348
23349- bpo-28281: Remove year (1-9999) limits on the Calendar.weekday() function.
23350  Patch by Mark Gollahon.
23351
23352- bpo-31702: crypt.mksalt() now allows to specify the number of rounds for
23353  SHA-256 and SHA-512 hashing.
23354
23355- bpo-30639: :func:`inspect.getfile` no longer computes the repr of unknown
23356  objects to display in an error message, to protect against badly behaved
23357  custom reprs.
23358
23359- bpo-30768: Fix the pthread+semaphore implementation of
23360  PyThread_acquire_lock_timed() when called with timeout > 0 and
23361  intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a
23362  signal (EINTR). See also the :pep:`475`.
23363
23364- bpo-31854: Add ``mmap.ACCESS_DEFAULT`` constant.
23365
23366- bpo-31834: Use optimized code for BLAKE2 only with SSSE3+. The pure SSE2
23367  implementation is slower than the pure C reference implementation.
23368
23369- bpo-28292: Calendar.itermonthdates() will now consistently raise an
23370  exception when a date falls outside of the 0001-01-01 through 9999-12-31
23371  range.  To support applications that cannot tolerate such exceptions, the
23372  new methods itermonthdays3() and itermonthdays4() are added.  The new
23373  methods return tuples and are not restricted by the range supported by
23374  datetime.date.
23375
23376- bpo-28564: The shutil.rmtree() function has been sped up to 20--40%. This
23377  was done using the os.scandir() function.
23378
23379- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id()
23380  method and pickle.Unpickler subclass with the persistent_load() method no
23381  longer create reference cycles.
23382
23383- bpo-31653: Don't release the GIL if we can acquire a multiprocessing
23384  semaphore immediately.
23385
23386- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed
23387  or None.
23388
23389- bpo-20825: Add `subnet_of` and `superset_of` containment tests to
23390  :class:`ipaddress.IPv6Network` and :class:`ipaddress.IPv4Network`. Patch
23391  by Michel Albert and Cheryl Sabella.
23392
23393- bpo-31827: Remove the os.stat_float_times() function. It was introduced in
23394  Python 2.3 for backward compatibility with Python 2.2, and was deprecated
23395  since Python 3.1.
23396
23397- bpo-31756: Add a ``subprocess.Popen(text=False)`` keyword argument to
23398  `subprocess` functions to be more explicit about when the library should
23399  attempt to decode outputs into text. Patch by Andrew Clegg.
23400
23401- bpo-31819: Add AbstractEventLoop.sock_recv_into().
23402
23403- bpo-31457: If nested log adapters are used, the inner ``process()``
23404  methods are no longer omitted.
23405
23406- bpo-31457: The ``manager`` property on LoggerAdapter objects is now
23407  properly settable.
23408
23409- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire()
23410  and socket.socket.settimeout() to round correctly negative timeouts
23411  between -1.0 and 0.0. The functions now block waiting for events as
23412  expected. Previously, the call was incorrectly non-blocking. Patch by
23413  Pablo Galindo.
23414
23415- bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
23416  DeprecationWarning warning.
23417
23418- bpo-31800: Extended support for parsing UTC offsets. strptime '%z' can now
23419  parse the output generated by datetime.isoformat, including seconds and
23420  microseconds.
23421
23422- bpo-28603: traceback: Fix a TypeError that occurred during printing of
23423  exception tracebacks when either the current exception or an exception in
23424  its context/cause chain is unhashable. Patch by Zane Bitter.
23425
23426- bpo-30541: Add new function to seal a mock and prevent the automatically
23427  creation of child mocks. Patch by Mario Corchero.
23428
23429- bpo-31784: Implement the :pep:`564`, add new 6 new functions with
23430  nanosecond resolution to the :mod:`time` module:
23431  :func:`~time.clock_gettime_ns`, :func:`~time.clock_settime_ns`,
23432  :func:`~time.monotonic_ns`, :func:`~time.perf_counter_ns`,
23433  :func:`~time.process_time_ns`, :func:`~time.time_ns`.
23434
23435- bpo-30143: 2to3 now generates a code that uses abstract collection classes
23436  from collections.abc rather than collections.
23437
23438- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a
23439  ``sqlite3.Cursor`` object more than once. Patch by Oren Milman.
23440
23441- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the
23442  ``Cursor`` object is uninitialized. Patch by Oren Milman.
23443
23444- bpo-31752: Fix possible crash in timedelta constructor called with custom
23445  integers.
23446
23447- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get
23448  pollers timeout
23449
23450- bpo-31690: Allow the flags re.ASCII, re.LOCALE, and re.UNICODE to be used
23451  as group flags for regular expressions.
23452
23453- bpo-30349: FutureWarning is now emitted if a regular expression contains
23454  character set constructs that will change semantically in the future
23455  (nested sets and set operations).
23456
23457- bpo-31664: Added support for the Blowfish hashing in the crypt module.
23458
23459- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in
23460  asyncio module. This method was previously modifying a wrong reference to
23461  the protocol.
23462
23463- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
23464  earlier.
23465
23466- bpo-31307: Allow use of bytes objects for arguments to
23467  :meth:`configparser.ConfigParser.read`. Patch by Vincent Michel.
23468
23469- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for
23470  arbitrary negative timeouts on all OSes where it can only be a
23471  non-negative integer or -1. Patch by Riccardo Coccioli.
23472
23473- bpo-31310: multiprocessing's semaphore tracker should be launched again if
23474  crashed.
23475
23476- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and
23477  other user interruptions. If it crashes, restart it when necessary.
23478
23479- bpo-31245: Added support for AF_UNIX socket in asyncio
23480  `create_datagram_endpoint`.
23481
23482- bpo-30553: Add HTTP/2 status code 421 (Misdirected Request) to
23483  :class:`http.HTTPStatus`. Patch by Vitor Pereira.
23484
23485Documentation
23486-------------
23487
23488- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket
23489  versionadded marker.
23490
23491Tests
23492-----
23493
23494- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on
23495  APFS.
23496
23497- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5.
23498  The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged
23499  into the kernel 4.5.
23500
23501- bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV and
23502  remove the test.support.requires_android_level decorator.
23503
23504- bpo-32136: The runtime embedding tests have been split out from
23505  ``Lib/test/test_capi.py`` into a new ``Lib/test/test_embed.py`` file.
23506
23507- bpo-28668: test.support.requires_multiprocessing_queue is removed. Skip
23508  tests with test.support.import_module('multiprocessing.synchronize')
23509  instead when the semaphore implementation is broken or missing.
23510
23511- bpo-32126: Skip test_get_event_loop_new_process in
23512  test.test_asyncio.test_events when sem_open() is not functional.
23513
23514- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the
23515  names sample to always test the same files. It prevents false alarms when
23516  hunting reference leaks.
23517
23518Build
23519-----
23520
23521- bpo-28538: Revert the previous changes, the if_nameindex structure is
23522  defined by Unified Headers.
23523
23524- bpo-28762: Revert the last commit, the F_LOCK macro is defined by Android
23525  Unified Headers.
23526
23527- bpo-29040: Support building Android with Unified Headers. The first NDK
23528  release to support Unified Headers is android-ndk-r14.
23529
23530- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the
23531  sysroot paths when cross-compiling.
23532
23533- bpo-31957: Fixes Windows SDK version detection when building for Windows.
23534
23535- bpo-31609: Fixes quotes in PCbuild/clean.bat
23536
23537- bpo-31934: Abort the build when building out of a not clean source tree.
23538
23539- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when
23540  there was more than one function and/or method in a .c file with the same
23541  name.
23542
23543- bpo-28791: Update Windows builds to use SQLite 3.21.0.
23544
23545- bpo-28791: Update OS X installer to use SQLite 3.21.0.
23546
23547- bpo-28643: Record profile-opt build progress with stamp files.
23548
23549- bpo-31866: Finish removing support for AtheOS.
23550
23551Windows
23552-------
23553
23554- bpo-1102: Return ``None`` when ``View.Fetch()`` returns
23555  ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by
23556  Anthony Tuininga.
23557
23558- bpo-31944: Fixes Modify button in Apps and Features dialog.
23559
23560- bpo-20486: Implement the ``Database.Close()`` method to help closing MSI
23561  database objects.
23562
23563- bpo-31857: Make the behavior of USE_STACKCHECK deterministic in a
23564  multi-threaded environment.
23565
23566macOS
23567-----
23568
23569- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m
23570
23571IDLE
23572----
23573
23574- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event
23575  handling is driven by IDLE's run loop, a confusing and distracting
23576  queue.EMPTY traceback context is no longer added to tk event exception
23577  tracebacks.  The traceback is now the same as when event handling is
23578  driven by user code.  Patch based on a suggestion by Serhiy Storchaka.
23579
23580- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet
23581  in configdialog was replaced by ttk.Notebook.
23582
23583- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
23584  mostly by Cheryl Sabella.
23585
23586- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor
23587  and output windows only see an empty last prompt line.  This simplifies
23588  the code and fixes a minor bug when newline is inserted. Sys.ps1, if
23589  present, is read on Shell start-up, but is not set or changed.
23590
23591- bpo-31860: The font sample in the IDLE configuration dialog is now
23592  editable. Changes persist while IDLE remains open
23593
23594- bpo-31836: Test_code_module now passes if run after test_idle, which sets
23595  ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not.
23596  Test_code_module now properly tests both behaviors.  Ditto for ps2.
23597
23598- bpo-28603: Fix a TypeError that caused a shell restart when printing a
23599  traceback that includes an exception that is unhashable. Patch by Zane
23600  Bitter.
23601
23602- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample.
23603  Even if one selects a font that defines a limited subset of the unicode
23604  Basic Multilingual Plane, tcl/tk will use other fonts that define a
23605  character. The expanded example give users of non-Latin characters a
23606  better idea of what they might see in IDLE's shell and editors. To make
23607  room for the expanded sample, frames on the Font tab are re-arranged.  The
23608  Font/Tabs help explains a bit about the additions.
23609
23610Tools/Demos
23611-----------
23612
23613- bpo-32159: Remove CVS and Subversion tools: remove svneol.py and
23614  treesync.py scripts. CPython migrated from CVS to Subversion, to
23615  Mercurial, and then to Git. CVS and Subversion are no longer used to
23616  develop CPython.
23617
23618- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
23619  remove the ``LOCALE`` option since it doesn't work with string patterns in
23620  Python 3. Patch by Christoph Sarnowski.
23621
23622C API
23623-----
23624
23625- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in
23626  a non-Python thread before PyEval_InitThreads(), only call
23627  PyEval_InitThreads() after calling PyThreadState_New() to fix a crash.
23628
23629- bpo-32125: The ``Py_UseClassExceptionsFlag`` flag has been removed. It was
23630  deprecated and wasn't used anymore since Python 2.0.
23631
23632- bpo-25612: Move the current exception state from the frame object to the
23633  co-routine. This simplifies the interpreter and fixes a couple of obscure
23634  bugs caused by having swap exception state when entering or exiting a
23635  generator.
23636
23637- bpo-23699: Add Py_RETURN_RICHCOMPARE macro to reduce boilerplate code in
23638  rich comparison functions.
23639
23640- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and
23641  `PyErr_NormalizeException()` does not use it anymore. This singleton is
23642  persistent and its members being never cleared may cause a segfault during
23643  finalization of the interpreter. See also issue #22898.
23644
23645
23646What's New in Python 3.7.0 alpha 2?
23647===================================
23648
23649*Release date: 2017-10-16*
23650
23651Core and Builtins
23652-----------------
23653
23654- bpo-31558: ``gc.freeze()`` is a new API that allows for moving all objects
23655  currently tracked by the garbage collector to a permanent generation,
23656  effectively removing them from future collection events. This can be used
23657  to protect those objects from having their PyGC_Head mutated. In effect,
23658  this enables great copy-on-write stability at fork().
23659
23660- bpo-31642: Restored blocking "from package import module" by setting
23661  sys.modules["package.module"] to None.
23662
23663- bpo-31708: Allow use of asynchronous generator expressions in synchronous
23664  functions.
23665
23666- bpo-31709: Drop support of asynchronous __aiter__.
23667
23668- bpo-30404: The -u option now makes the stdout and stderr streams
23669  unbuffered rather than line-buffered.
23670
23671- bpo-31619: Fixed a ValueError when convert a string with large number of
23672  underscores to integer with binary base.
23673
23674- bpo-31602: Fix an assertion failure in `zipimporter.get_source()` in case
23675  of a bad `zlib.decompress()`. Patch by Oren Milman.
23676
23677- bpo-31592: Fixed an assertion failure in Python parser in case of a bad
23678  `unicodedata.normalize()`. Patch by Oren Milman.
23679
23680- bpo-31588: Raise a `TypeError` with a helpful error message when class
23681  creation fails due to a metaclass with a bad ``__prepare__()`` method.
23682  Patch by Oren Milman.
23683
23684- bpo-31574: Importlib was instrumented with two dtrace probes to profile
23685  import timing.
23686
23687- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad
23688  ``__name__`` global. Patch by Oren Milman.
23689
23690- bpo-31506: Improved the error message logic for object.__new__ and
23691  object.__init__.
23692
23693- bpo-31505: Fix an assertion failure in `json`, in case
23694  `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren
23695  Milman.
23696
23697- bpo-31492: Fix assertion failures in case of failing to import from a
23698  module with a bad ``__name__`` attribute, and in case of failing to access
23699  an attribute of such a module. Patch by Oren Milman.
23700
23701- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the
23702  argument has a bad ``__abs__()`` method. Patch by Oren Milman.
23703
23704- bpo-31336: Speed up class creation by 10-20% by reducing the overhead in
23705  the necessary special method lookups.  Patch by Stefan Behnel.
23706
23707- bpo-31415: Add ``-X importtime`` option to show how long each import
23708  takes. It can be used to optimize application's startup time.  Support the
23709  :envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this.
23710
23711- bpo-31410: Optimized calling wrapper and classmethod descriptors.
23712
23713- bpo-31353: :pep:`553` - Add a new built-in called ``breakpoint()`` which
23714  calls ``sys.breakpointhook()``.  By default this imports ``pdb`` and calls
23715  ``pdb.set_trace()``, but users may override ``sys.breakpointhook()`` to
23716  call whatever debugger they want.  The original value of the hook is saved
23717  in ``sys.__breakpointhook__``.
23718
23719- bpo-17852: Maintain a list of open buffered files, flush them before
23720  exiting the interpreter.  Based on a patch from Armin Rigo.
23721
23722- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when
23723  spec.name is not a string. Patch by Oren Milman.
23724
23725- bpo-31311: Fix a crash in the ``__setstate__()`` method of
23726  `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman.
23727
23728- bpo-31293: Fix crashes in true division and multiplication of a timedelta
23729  object by a float with a bad as_integer_ratio() method. Patch by Oren
23730  Milman.
23731
23732- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the
23733  return value of the received loader's get_source() has a bad splitlines()
23734  method. Patch by Oren Milman.
23735
23736- bpo-30406: Make ``async`` and ``await`` proper keywords, as specified in
23737  :pep:`492`.
23738
23739Library
23740-------
23741
23742- bpo-30058: Fixed buffer overflow in select.kqueue.control().
23743
23744- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII
23745  characters. Now it uses ``-i`` regular expression local flag to avoid
23746  non-ASCII characters.
23747
23748- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM
23749  exceptions.
23750
23751- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of
23752  `Element.text` and `Element.tail`. Patch by Oren Milman.
23753
23754- bpo-31671: Now ``re.compile()`` converts passed RegexFlag to normal int
23755  object before compiling. bm_regex_compile benchmark shows 14% performance
23756  improvements.
23757
23758- bpo-30397: The types of compiled regular objects and match objects are now
23759  exposed as `re.Pattern` and `re.Match`.  This adds information in pydoc
23760  output for the re module.
23761
23762- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split()
23763  when pass a string larger than 2 GiB.
23764
23765- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo().
23766
23767- bpo-31648: Improvements to path predicates in ElementTree: Allow
23768  whitespace around predicate parts, i.e. "[a = 'text']" instead of
23769  requiring the less readable "[a='text']". Add support for text comparison
23770  of the current node, like "[.='text']". Patch by Stefan Behnel.
23771
23772- bpo-30806: Fix the string representation of a netrc object.
23773
23774- bpo-31638: Add optional argument ``compressed`` to
23775  ``zipapp.create_archive``, and add option ``--compress`` to the command
23776  line interface of ``zipapp``.
23777
23778- bpo-25351: Avoid venv activate failures with undefined variables
23779
23780- bpo-20519: Avoid ctypes use (if possible) and improve import time for
23781  uuid.
23782
23783- bpo-28293: The regular expression cache is no longer completely dumped
23784  when it is full.
23785
23786- bpo-31596: Added pthread_getcpuclockid() to the time module
23787
23788- bpo-27494: Make 2to3 accept a trailing comma in generator expressions. For
23789  example, ``set(x for x in [],)`` is now allowed.
23790
23791- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby()
23792  iterators.
23793
23794- bpo-30346: An iterator produced by itertools.groupby() iterator now
23795  becomes exhausted after advancing the groupby iterator.
23796
23797- bpo-31556: Cancel asyncio.wait_for future faster if timeout <= 0
23798
23799- bpo-31540: Allow passing a context object in
23800  :class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free
23801  job resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier
23802  to improve memory usage when a worker waits for new jobs.
23803
23804- bpo-31516: ``threading.current_thread()`` should not return a dummy thread
23805  at shutdown.
23806
23807- bpo-31525: In the sqlite module, require the sqlite3_prepare_v2 API. Thus,
23808  the sqlite module now requires sqlite version at least 3.3.9.
23809
23810- bpo-26510: argparse subparsers are now required by default.  This matches
23811  behaviour in Python 2. For optional subparsers, use the new parameter
23812  ``add_subparsers(required=False)``. Patch by Anthony Sottile. (As of
23813  3.7.0rc1, the default was changed to not required as had been the case
23814  since Python 3.3.)
23815
23816- bpo-27541: Reprs of subclasses of some collection and iterator classes
23817  (`bytearray`, `array.array`, `collections.deque`,
23818  `collections.defaultdict`, `itertools.count`, `itertools.repeat`) now
23819  contain actual type name insteads of hardcoded name of the base class.
23820
23821- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
23822  bootstrapping has failed.
23823
23824- bpo-31389: ``pdb.set_trace()`` now takes an optional keyword-only argument
23825  ``header``. If given, this is printed to the console just before debugging
23826  begins.
23827
23828Documentation
23829-------------
23830
23831- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline
23832  documentation example code. Patch by Brad Smith.
23833
23834- bpo-30085: The operator functions without double underscores are preferred
23835  for clarity. The one with underscores are only kept for
23836  back-compatibility.
23837
23838Build
23839-----
23840
23841- bpo-31696: Improve compiler version information in :data:`sys.version`
23842  when Python is built with Clang.
23843
23844- bpo-31625: Stop using ranlib on static libraries. Instead, we assume ar
23845  supports the 's' flag.
23846
23847- bpo-31624: Remove support for BSD/OS.
23848
23849- bpo-22140: Prevent double substitution of prefix in python-config.sh.
23850
23851- bpo-31569: Correct PCBuild/ case to PCbuild/ in build scripts and
23852  documentation.
23853
23854- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing
23855  changed.
23856
23857IDLE
23858----
23859
23860- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget
23861  instead of an flist with a root widget opens the option of creating a
23862  browser frame that is only part of a window.  Passing a full file name
23863  instead of pieces assumed to come from a .py file opens the possibility of
23864  browsing python files that do not end in .py.
23865
23866- bpo-31649: IDLE - Make _htest, _utest parameters keyword only.
23867
23868- bpo-31559: Remove test order dependence in idle_test.test_browser.
23869
23870- bpo-31459: Rename IDLE's module browser from Class Browser to Module
23871  Browser. The original module-level class and method browser became a
23872  module browser, with the addition of module-level functions, years ago.
23873  Nested classes and functions were added yesterday.  For
23874  back-compatibility, the virtual event <<open-class-browser>>, which
23875  appears on the Keys tab of the Settings dialog, is not changed. Patch by
23876  Cheryl Sabella.
23877
23878- bpo-31500: Default fonts now are scaled on HiDPI displays.
23879
23880- bpo-1612262: IDLE module browser now shows nested classes and functions.
23881  Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
23882  respectively.
23883
23884C API
23885-----
23886
23887- bpo-28280: Make `PyMapping_Keys()`, `PyMapping_Values()` and
23888  `PyMapping_Items()` always return a `list` (rather than a `list` or a
23889  `tuple`). Patch by Oren Milman.
23890
23891- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between
23892  Py_GetPath() and Py_SetPath()
23893
23894- bpo-25658: Implement :pep:`539` for Thread Specific Storage (TSS) API: it
23895  is a new Thread Local Storage (TLS) API to CPython which would supersede
23896  use of the existing TLS API within the CPython interpreter, while
23897  deprecating the existing API. PEP written by Erik M. Bray, patch by
23898  Masayuki Yamamoto.
23899
23900
23901What's New in Python 3.7.0 alpha 1?
23902===================================
23903
23904*Release date: 2017-09-19*
23905
23906Security
23907--------
23908
23909- bpo-29781: SSLObject.version() now correctly returns None when handshake
23910  over BIO has not been performed yet.
23911
23912- bpo-29505: Add fuzz tests for float(str), int(str), unicode(str); for
23913  oss-fuzz.
23914
23915- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
23916  get security fixes.
23917
23918- bpo-30730: Prevent environment variables injection in subprocess on
23919  Windows.  Prevent passing other environment variables and command
23920  arguments.
23921
23922- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
23923  security vulnerabilities including: CVE-2017-9233 (External entity
23924  infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
23925  CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
23926  CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
23927  CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
23928  impact Python, since Python already gets entropy from the OS to set the
23929  expat secret using ``XML_SetHashSalt()``.
23930
23931- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
23932  example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
23933  ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
23934  authentication (``login@host``).
23935
23936- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
23937  CVE-2016-0718 and CVE-2016-4472. See
23938  https://sourceforge.net/p/expat/bugs/537/ for more information.
23939
23940Core and Builtins
23941-----------------
23942
23943- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case
23944  the class has an attribute whose name is specified in ``_anonymous_`` but
23945  not in ``_fields_``. Patch by Oren Milman.
23946
23947- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in
23948  case the env argument has a bad keys() method. Patch by Oren Milman.
23949
23950- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case
23951  of an exception with a bad ``__module__`` attribute. Patch by Oren Milman.
23952
23953- bpo-31416: Fix assertion failures in case of a bad warnings.filters or
23954  warnings.defaultaction. Patch by Oren Milman.
23955
23956- bpo-28411: Change direct usage of PyInterpreterState.modules to
23957  PyImport_GetModuleDict(). Also introduce more uniformity in other code
23958  that deals with sys.modules. This helps reduce complications when working
23959  on sys.modules.
23960
23961- bpo-28411: Switch to the abstract API when dealing with
23962  ``PyInterpreterState.modules``. This allows later support for all dict
23963  subclasses and other Mapping implementations.  Also add a
23964  ``PyImport_GetModule()`` function to reduce a bunch of duplicated code.
23965
23966- bpo-31411: Raise a TypeError instead of SystemError in case
23967  warnings.onceregistry is not a dictionary. Patch by Oren Milman.
23968
23969- bpo-31344: For finer control of tracing behaviour when testing the
23970  interpreter, two new frame attributes have been added to control the
23971  emission of particular trace events: ``f_trace_lines`` (``True`` by
23972  default) to turn off per-line trace events; and ``f_trace_opcodes``
23973  (``False`` by default) to turn on per-opcode trace events.
23974
23975- bpo-31373: Fix several possible instances of undefined behavior due to
23976  floating-point demotions.
23977
23978- bpo-30465: Location information (``lineno`` and ``col_offset``) in
23979  f-strings is now (mostly) correct.  This fixes tools like flake8 from
23980  showing warnings on the wrong line (typically the first line of the file).
23981
23982- bpo-30860: Consolidate CPython's global runtime state under a single
23983  struct.  This improves discoverability of the runtime state.
23984
23985- bpo-31347: Fix possible undefined behavior in _PyObject_FastCall_Prepend.
23986
23987- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev().
23988  GNU C libray plans to remove the functions from sys/types.h.
23989
23990- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on
23991  Windows, when the return value of ``pathname.replace('/','\\')`` isn't a
23992  string. Patch by Oren Milman.
23993
23994- bpo-31271: Fix an assertion failure in the write() method of
23995  `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch
23996  by Oren Milman.
23997
23998- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the
23999  decoder's state is invalid. Patch by Oren Milman.
24000
24001- bpo-30721: ``print`` now shows correct usage hint for using Python 2
24002  redirection syntax.  Patch by Sanyam Khurana.
24003
24004- bpo-31070: Fix a race condition in importlib _get_module_lock().
24005
24006- bpo-30747: Add a non-dummy implementation of _Py_atomic_store and
24007  _Py_atomic_load on MSVC.
24008
24009- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
24010  doesn't call ``PyObject_GC_UnTrack()``.
24011
24012- bpo-31071: Avoid masking original TypeError in call with * unpacking when
24013  other arguments are passed.
24014
24015- bpo-30978: str.format_map() now passes key lookup exceptions through.
24016  Previously any exception was replaced with a KeyError exception.
24017
24018- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
24019
24020- bpo-30876: Relative import from unloaded package now reimports the package
24021  instead of failing with SystemError.  Relative import from non-package now
24022  fails with ImportError rather than SystemError.
24023
24024- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from
24025  signal handler, to avoid calling signal-unsafe functions. The tests I'm
24026  adding here fail without the rest of the patch, on Linux and OS X. This
24027  means our signal delivery logic had defects (some signals could be lost).
24028
24029- bpo-30765: Avoid blocking in pthread_mutex_lock() when
24030  PyThread_acquire_lock() is asked not to block.
24031
24032- bpo-31161: Make sure the 'Missing parentheses' syntax error message is
24033  only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
24034
24035- bpo-30814: Fixed a race condition when import a submodule from a package.
24036
24037- bpo-30736: The internal unicodedata database has been upgraded to Unicode
24038  10.0.
24039
24040- bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to
24041  avoid crashes.
24042
24043- bpo-30597: ``print`` now shows expected input in custom error message when
24044  used as a Python 2 statement. Patch by Sanyam Khurana.
24045
24046- bpo-30682: Removed a too-strict assertion that failed for certain
24047  f-strings, such as eval("f'\\\n'") and eval("f'\\\r'").
24048
24049- bpo-30501: The compiler now produces more optimal code for complex
24050  condition expressions in the "if", "while" and "assert" statement, the
24051  "if" expression, and generator expressions and comprehensions.
24052
24053- bpo-28180: Implement :pep:`538` (legacy C locale coercion). This means
24054  that when a suitable coercion target locale is available, both the core
24055  interpreter and locale-aware C extensions will assume the use of UTF-8 as
24056  the default text encoding, rather than ASCII.
24057
24058- bpo-30486: Allows setting cell values for __closure__. Patch by Lisa
24059  Roach.
24060
24061- bpo-30537: itertools.islice now accepts integer-like objects (having an
24062  __index__ method) as start, stop, and slice arguments
24063
24064- bpo-25324: Tokens needed for parsing in Python moved to C. ``COMMENT``,
24065  ``NL`` and ``ENCODING``. This way the tokens and tok_names in the token
24066  module don't get changed when you import the tokenize module.
24067
24068- bpo-29104: Fixed parsing backslashes in f-strings.
24069
24070- bpo-27945: Fixed various segfaults with dict when input collections are
24071  mutated during searching, inserting or comparing.  Based on patches by
24072  Duane Griffin and Tim Mitchell.
24073
24074- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
24075  non-interned attribute names.  Based on patch by Eryk Sun.
24076
24077- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the
24078  middle of resuming a chain of nested 'yield from' or 'await' calls, it's
24079  now correctly delivered to the innermost frame.
24080
24081- bpo-28974: ``object.__format__(x, '')`` is now equivalent to ``str(x)``
24082  rather than ``format(str(self), '')``.
24083
24084- bpo-30024: Circular imports involving absolute imports with binding a
24085  submodule to a name are now supported.
24086
24087- bpo-12414: sys.getsizeof() on a code object now returns the sizes which
24088  includes the code struct and sizes of objects which it references. Patch
24089  by Dong-hee Na.
24090
24091- bpo-29839: len() now raises ValueError rather than OverflowError if
24092  __len__() returned a large negative integer.
24093
24094- bpo-11913: README.rst is now included in the list of distutils standard
24095  READMEs and therefore included in source distributions.
24096
24097- bpo-29914: Fixed default implementations of __reduce__ and
24098  __reduce_ex__(). object.__reduce__() no longer takes arguments,
24099  object.__reduce_ex__() now requires one argument.
24100
24101- bpo-29949: Fix memory usage regression of set and frozenset object.
24102
24103- bpo-29935: Fixed error messages in the index() method of tuple, list and
24104  deque when pass indices of wrong type.
24105
24106- bpo-29816: Shift operation now has less opportunity to raise
24107  OverflowError. ValueError always is raised rather than OverflowError for
24108  negative counts. Shifting zero with non-negative count always returns
24109  zero.
24110
24111- bpo-24821: Fixed the slowing down to 25 times in the searching of some
24112  unlucky Unicode characters.
24113
24114- bpo-29102: Add a unique ID to PyInterpreterState.  This makes it easier to
24115  identify each subinterpreter.
24116
24117- bpo-29894: The deprecation warning is emitted if __complex__ returns an
24118  instance of a strict subclass of complex.  In a future versions of Python
24119  this can be an error.
24120
24121- bpo-29859: Show correct error messages when any of the pthread_* calls in
24122  thread_pthread.h fails.
24123
24124- bpo-29849: Fix a memory leak when an ImportError is raised during from
24125  import.
24126
24127- bpo-28856: Fix an oversight that %b format for bytes should support
24128  objects follow the buffer protocol.
24129
24130- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused
24131  a regression by revealing an inconsistency in how sys.path is initialized
24132  when executing ``__main__`` from a zipfile, directory, or other import
24133  location. The interpreter now consistently avoids ever adding the import
24134  location's parent directory to ``sys.path``, and ensures no other
24135  ``sys.path`` entries are inadvertently modified when inserting the import
24136  location named on the command line.
24137
24138- bpo-29568: Escaped percent "%%" in the format string for classic string
24139  formatting no longer allows any characters between two percents.
24140
24141- bpo-29714: Fix a regression that bytes format may fail when containing
24142  zero bytes inside.
24143
24144- bpo-29695: bool(), float(), list() and tuple() no longer take keyword
24145  arguments. The first argument of int() can now be passes only as
24146  positional argument.
24147
24148- bpo-28893: Set correct __cause__ for errors about invalid awaitables
24149  returned from __aiter__ and __anext__.
24150
24151- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
24152  :exc:`OverflowError`.
24153
24154- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra.  Patch by Brian
24155  Coleman.
24156
24157- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It
24158  should raise TypeError when kwargs is not a dict.  But it might cause segv
24159  when args=NULL and kwargs is not a dict.
24160
24161- bpo-28598: Support __rmod__ for subclasses of str being called before
24162  str.__mod__. Patch by Martijn Pieters.
24163
24164- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by
24165  Matthieu Dartiailh.
24166
24167- bpo-29602: Fix incorrect handling of signed zeros in complex constructor
24168  for complex subclasses and for inputs having a __complex__ method. Patch
24169  by Serhiy Storchaka.
24170
24171- bpo-29347: Fixed possibly dereferencing undefined pointers when creating
24172  weakref objects.
24173
24174- bpo-29463: Add ``docstring`` field to Module, ClassDef, FunctionDef, and
24175  AsyncFunctionDef ast nodes.  docstring is not first stmt in their body
24176  anymore.  It affects ``co_firstlineno`` and ``co_lnotab`` of code object
24177  for module and class. (Reverted in :issue:`32911`.)
24178
24179- bpo-29438: Fixed use-after-free problem in key sharing dict.
24180
24181- bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from
24182  ... import ...``.
24183
24184- bpo-29546: Improve from-import error message with location
24185
24186- bpo-29478: If max_line_length=None is specified while using the Compat32
24187  policy, it is no longer ignored.  Patch by Mircea Cosbuc.
24188
24189- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
24190
24191- bpo-29337: Fixed possible BytesWarning when compare the code objects.
24192  Warnings could be emitted at compile time.
24193
24194- bpo-29327: Fixed a crash when pass the iterable keyword argument to
24195  sorted().
24196
24197- bpo-29034: Fix memory leak and use-after-free in os module
24198  (path_converter).
24199
24200- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
24201
24202- bpo-29049: Call _PyObject_GC_TRACK() lazily when calling Python function.
24203  Calling function is up to 5% faster.
24204
24205- bpo-28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
24206  whitespace, not only spaces.  Patch by Robert Xiao.
24207
24208- bpo-28932: Do not include <sys/random.h> if it does not exist.
24209
24210- bpo-25677: Correct the positioning of the syntax error caret for indented
24211  blocks. Based on patch by Michael Layzell.
24212
24213- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
24214  form.
24215
24216- bpo-18896: Python function can now have more than 255 parameters.
24217  collections.namedtuple() now supports tuples with more than 255 elements.
24218
24219- bpo-28596: The preferred encoding is UTF-8 on Android. Patch written by
24220  Chi Hsuan Yen.
24221
24222- bpo-22257: Clean up interpreter startup (see :pep:`432`).
24223
24224- bpo-26919: On Android, operating system data is now always encoded/decoded
24225  to/from UTF-8, instead of the locale encoding to avoid inconsistencies
24226  with os.fsencode() and os.fsdecode() which are already using UTF-8.
24227
24228- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
24229  bug triggerable by a monkey-patched len() function.
24230
24231- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
24232  not convert combined table into split table. Patch written by INADA Naoki.
24233
24234- bpo-28739: f-string expressions are no longer accepted as docstrings and
24235  by ast.literal_eval() even if they do not include expressions.
24236
24237- bpo-28512: Fixed setting the offset attribute of SyntaxError by
24238  PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
24239
24240- bpo-28918: Fix the cross compilation of xxlimited when Python has been
24241  built with Py_DEBUG defined.
24242
24243- bpo-23722: Rather than silently producing a class that doesn't support
24244  zero-argument ``super()`` in methods, failing to pass the new
24245  ``__classcell__`` namespace entry up to ``type.__new__`` now results in a
24246  ``DeprecationWarning`` and a class that supports zero-argument
24247  ``super()``.
24248
24249- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of
24250  a descriptor that is used inside that class no longer prevents calling the
24251  __set_name__ method of other descriptors.
24252
24253- bpo-28799: Remove the ``PyEval_GetCallStats()`` function and deprecate the
24254  untested and undocumented ``sys.callstats()`` function. Remove the
24255  ``CALL_PROFILE`` special build: use the :func:`sys.setprofile` function,
24256  :mod:`cProfile` or :mod:`profile` to profile function calls.
24257
24258- bpo-12844: More than 255 arguments can now be passed to a function.
24259
24260- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if
24261  the next instruction is YIELD_FROM. Regression introduced by WORDCODE
24262  (issue #26647).
24263
24264- bpo-28774: Fix error position of the unicode error in ASCII and Latin1
24265  encoders when a string returned by the error handler contains multiple
24266  non-encodable characters (non-ASCII for the ASCII codec, characters out of
24267  the U+0000-U+00FF range for Latin1).
24268
24269- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict.
24270  Improve speed of dict literal with constant keys up to 30%.
24271
24272- bpo-28532: Show sys.version when -V option is supplied twice.
24273
24274- bpo-27100: The with-statement now checks for __enter__ before it checks
24275  for __exit__. This gives less confusing error messages when both methods
24276  are missing. Patch by Jonathan Ellington.
24277
24278- bpo-28746: Fix the set_inheritable() file descriptor method on platforms
24279  that do not have the ioctl FIOCLEX and FIONCLEX commands.
24280
24281- bpo-26920: Fix not getting the locale's charset upon initializing the
24282  interpreter, on platforms that do not have langinfo.
24283
24284- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
24285  when decode astral characters.  Patch by Xiang Zhang.
24286
24287- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%.
24288
24289- bpo-19398: Extra slash no longer added to sys.path components in case of
24290  empty compile-time PYTHONPATH components.
24291
24292- bpo-28621: Sped up converting int to float by reusing faster bits counting
24293  implementation.  Patch by Adrian Wielgosik.
24294
24295- bpo-28580: Optimize iterating split table values. Patch by Xiang Zhang.
24296
24297- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch
24298  by Xiang Zhang.
24299
24300- bpo-28128: Deprecation warning for invalid str and byte escape sequences
24301  now prints better information about where the error occurs. Patch by
24302  Serhiy Storchaka and Eric Smith.
24303
24304- bpo-28509: dict.update() no longer allocate unnecessary large memory.
24305
24306- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
24307  build.
24308
24309- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused
24310  keeping unreachable code.
24311
24312- bpo-28214: Improved exception reporting for problematic __set_name__
24313  attributes.
24314
24315- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
24316  loss in PyTraceBack_Here().
24317
24318- bpo-28183: Optimize and cleanup dict iteration.
24319
24320- bpo-26081: Added C implementation of asyncio.Future. Original patch by
24321  Yury Selivanov.
24322
24323- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
24324  Patch by Xiang Zhang.
24325
24326- bpo-28376: The type of long range iterator is now registered as Iterator.
24327  Patch by Oren Milman.
24328
24329- bpo-28376: Creating instances of range_iterator by calling range_iterator
24330  type now is disallowed.  Calling iter() on range instance is the only way.
24331  Patch by Oren Milman.
24332
24333- bpo-26906: Resolving special methods of uninitialized type now causes
24334  implicit initialization of the type instead of a fail.
24335
24336- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
24337  patch by Niklas Koep.
24338
24339- bpo-24098: Fixed possible crash when AST is changed in process of
24340  compiling it.
24341
24342- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when
24343  hashes have same lower bits.
24344
24345- bpo-28350: String constants with null character no longer interned.
24346
24347- bpo-26617: Fix crash when GC runs during weakref callbacks.
24348
24349- bpo-27942: String constants now interned recursively in tuples and
24350  frozensets.
24351
24352- bpo-28289: ImportError.__init__ now resets not specified attributes.
24353
24354- bpo-21578: Fixed misleading error message when ImportError called with
24355  invalid keyword args.
24356
24357- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch
24358  by Soumya Sharma.
24359
24360- bpo-28086: Single var-positional argument of tuple subtype was passed
24361  unscathed to the C-defined function.  Now it is converted to exact tuple.
24362
24363- bpo-28214: Now __set_name__ is looked up on the class instead of the
24364  instance.
24365
24366- bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
24367  syscall fails with EPERM, for example when blocked by SECCOMP.
24368
24369- bpo-28192: Don't import readline in isolated mode.
24370
24371- bpo-27441: Remove some redundant assignments to ob_size in longobject.c.
24372  Thanks Oren Milman.
24373
24374- bpo-27222: Clean up redundant code in long_rshift function. Thanks Oren
24375  Milman.
24376
24377- Upgrade internal unicode databases to Unicode version 9.0.0.
24378
24379- bpo-28131: Fix a regression in zipimport's compile_source().  zipimport
24380  should use the same optimization level as the interpreter.
24381
24382- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
24383  optimize memcpy().
24384
24385- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a
24386  "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
24387
24388- bpo-26182: Raise DeprecationWarning when async and await keywords are used
24389  as variable/attribute/class/function name.
24390
24391- bpo-26182: Fix a refleak in code that raises DeprecationWarning.
24392
24393- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle
24394  StopAsyncIteration propagation properly.
24395
24396- bpo-26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes.
24397
24398Library
24399-------
24400
24401- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference
24402  cycle.
24403
24404- bpo-31482: ``random.seed()`` now works with bytes in version=1
24405
24406- bpo-28556: typing.get_type_hints now finds the right globalns for classes
24407  and modules by default (when no ``globalns`` was specified by the caller).
24408
24409- bpo-28556: Speed improvements to the ``typing`` module.  Original PRs by
24410  Ivan Levkivskyi and Mitar.
24411
24412- bpo-31544: The C accelerator module of ElementTree ignored exceptions
24413  raised when looking up TreeBuilder target methods in XMLParser().
24414
24415- bpo-31234: socket.create_connection() now fixes manually a reference
24416  cycle: clear the variable storing the last exception on success.
24417
24418- bpo-31457: LoggerAdapter objects can now be nested.
24419
24420- bpo-31431: SSLContext.check_hostname now automatically sets
24421  SSLContext.verify_mode to ssl.CERT_REQUIRED instead of failing with a
24422  ValueError.
24423
24424- bpo-31233: socketserver.ThreadingMixIn now keeps a list of non-daemonic
24425  threads to wait until all these threads complete in server_close().
24426
24427- bpo-28638: Changed the implementation strategy for
24428  collections.namedtuple() to substantially reduce the use of exec() in
24429  favor of precomputed methods. As a result, the *verbose* parameter and
24430  *_source* attribute are no longer supported.  The benefits include 1)
24431  having a smaller memory footprint for applications using multiple named
24432  tuples, 2) faster creation of the named tuple class (approx 4x to 6x
24433  depending on how it is measured), and 3) minor speed-ups for instance
24434  creation using __new__, _make, and _replace.  (The primary patch
24435  contributor is Jelle Zijlstra with further improvements by INADA Naoki,
24436  Serhiy Storchaka, and Raymond Hettinger.)
24437
24438- bpo-31400: Improves SSL error handling to avoid losing error numbers.
24439
24440- bpo-27629: Make return types of SSLContext.wrap_bio() and
24441  SSLContext.wrap_socket() customizable.
24442
24443- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a
24444  context cannot be instantiated.
24445
24446- bpo-28182: The SSL module now raises SSLCertVerificationError when OpenSSL
24447  fails to verify the peer's certificate. The exception contains more
24448  information about the error.
24449
24450- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of
24451  data. This fixes support for all bytes-like object. It is also more
24452  efficient and avoids costly copies.
24453
24454- bpo-14191: A new function
24455  ``argparse.ArgumentParser.parse_intermixed_args`` provides the ability to
24456  parse command lines where there user intermixes options and positional
24457  arguments.
24458
24459- bpo-31178: Fix string concatenation bug in rare error path in the
24460  subprocess module
24461
24462- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up
24463  to 10% faster.
24464
24465- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
24466  partial characters for UTF-8 input (libexpat bug 115):
24467  https://github.com/libexpat/libexpat/issues/115
24468
24469- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
24470
24471- bpo-1198569: ``string.Template`` subclasses can optionally define
24472  ``braceidpattern`` if they want to specify different placeholder patterns
24473  inside and outside the braces.  If None (the default) it falls back to
24474  ``idpattern``.
24475
24476- bpo-31326: concurrent.futures.ProcessPoolExecutor.shutdown() now
24477  explicitly closes the call queue. Moreover, shutdown(wait=True) now also
24478  join the call queue thread, to prevent leaking a dangling thread.
24479
24480- bpo-27144: The ``map()`` and ``as_completed()`` iterators in
24481  ``concurrent.futures`` now avoid keeping a reference to yielded objects.
24482
24483- bpo-31281: Fix ``fileinput.FileInput(files, inplace=True)`` when ``files``
24484  contain ``pathlib.Path`` objects.
24485
24486- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
24487  types.
24488
24489- bpo-27584: ``AF_VSOCK`` has been added to the socket interface which
24490  allows communication between virtual machines and their host.
24491
24492- bpo-22536: The subprocess module now sets the filename when
24493  FileNotFoundError is raised on POSIX systems due to the executable or cwd
24494  not being found.
24495
24496- bpo-29741: Update some methods in the _pyio module to also accept integer
24497  types. Patch by Oren Milman.
24498
24499- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor
24500  now breaks a reference cycle between an exception object and the WorkItem
24501  object.
24502
24503- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using
24504  sys.exc_info() in code handling exceptions.
24505
24506- bpo-23835: configparser: reading defaults in the ``ConfigParser()``
24507  constructor is now using ``read_dict()``, making its behavior consistent
24508  with the rest of the parser.  Non-string keys and values in the defaults
24509  dictionary are now being implicitly converted to strings.  Patch by James
24510  Tocknell.
24511
24512- bpo-31238: pydoc: the stop() method of the private ServerThread class now
24513  waits until DocServer.serve_until_quit() completes and then explicitly
24514  sets its docserver attribute to None to break a reference cycle.
24515
24516- bpo-5001: Many asserts in `multiprocessing` are now more informative, and
24517  some error types have been changed to more specific ones.
24518
24519- bpo-31109: Convert zipimport to use Argument Clinic.
24520
24521- bpo-30102: The ssl and hashlib modules now call
24522  OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function
24523  detects CPU features and enables optimizations on some CPU architectures
24524  such as POWER8. Patch is based on research from Gustavo Serra Scalet.
24525
24526- bpo-18966: Non-daemonic threads created by a multiprocessing.Process are
24527  now joined on child exit.
24528
24529- bpo-31183: `dis` now works with asynchronous generator and coroutine
24530  objects. Patch by George Collins based on diagnosis by Luciano Ramalho.
24531
24532- bpo-5001: There are a number of uninformative asserts in the
24533  `multiprocessing` module, as noted in issue 5001. This change fixes two of
24534  the most potentially problematic ones, since they are in error-reporting
24535  code, in the `multiprocessing.managers.convert_to_error` function. (It
24536  also makes more informative a ValueError message.) The only potentially
24537  problematic change is that the AssertionError is now a TypeError; however,
24538  this should also help distinguish it from an AssertionError being
24539  *reported* by the function/its caller (such as in issue 31169). - Patch by
24540  Allen W. Smith (drallensmith on github).
24541
24542- bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
24543
24544- bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all
24545  child processes completed to prevent leaking zombie processes.
24546
24547- bpo-31072: Add an ``include_file`` parameter to
24548  ``zipapp.create_archive()``
24549
24550- bpo-24700: Optimize array.array comparison. It is now from 10x up to 70x
24551  faster when comparing arrays holding values of the same integer type.
24552
24553- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu
24554  classes. Call the parent destroy() method even if the used attribute
24555  doesn't exist. The LabeledScale.destroy() method now also explicitly
24556  clears label and scale attributes to help the garbage collector to destroy
24557  all widgets.
24558
24559- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for
24560  classes whose name begins with an underscore. Patch by Shane Harvey.
24561
24562- bpo-31080: Allow `logging.config.fileConfig` to accept kwargs and/or args.
24563
24564- bpo-30897: ``pathlib.Path`` objects now include an ``is_mount()`` method
24565  (only implemented on POSIX).  This is similar to ``os.path.ismount(p)``.
24566  Patch by Cooper Ry Lees.
24567
24568- bpo-31061: Fixed a crash when using asyncio and threads.
24569
24570- bpo-30987: Added support for CAN ISO-TP protocol in the socket module.
24571
24572- bpo-30522: Added a ``setStream`` method to ``logging.StreamHandler`` to
24573  allow the stream to be set after creation.
24574
24575- bpo-30502: Fix handling of long oids in ssl.  Based on patch by Christian
24576  Heimes.
24577
24578- bpo-5288: Support tzinfo objects with sub-minute offsets.
24579
24580- bpo-30919: Fix shared memory performance regression in multiprocessing in
24581  3.x. Shared memory used anonymous memory mappings in 2.x, while 3.x mmaps
24582  actual files. Try to be careful to do as little disk I/O as possible.
24583
24584- bpo-26732: Fix too many fds in processes started with the "forkserver"
24585  method. A child process would inherit as many fds as the number of
24586  still-running children.
24587
24588- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
24589  builtin functions.  Patch by Aaron Gallagher.
24590
24591- bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
24592
24593- bpo-19896: Fix multiprocessing.sharedctypes to recognize typecodes ``'q'``
24594  and ``'Q'``.
24595
24596- bpo-30946: Remove obsolete code in readline module for platforms where GNU
24597  readline is older than 2.1 or where select() is not available.
24598
24599- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across
24600  instances of ``OptionMenu``.
24601
24602- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
24603  thread completes, even if the thread was started by the same process which
24604  created the queue.
24605
24606- bpo-29854: Fix segfault in readline when using readline's history-size
24607  option.  Patch by Nir Soffer.
24608
24609- bpo-30794: Added multiprocessing.Process.kill method to terminate using
24610  the SIGKILL signal on Unix.
24611
24612- bpo-30319: socket.close() now ignores ECONNRESET error.
24613
24614- bpo-30828: Fix out of bounds write in
24615  `asyncio.CFuture.remove_done_callback()`.
24616
24617- bpo-30302: Use keywords in the ``repr`` of ``datetime.timedelta``.
24618
24619- bpo-30807: signal.setitimer() may disable the timer when passed a tiny
24620  value. Tiny values (such as 1e-6) are valid non-zero values for
24621  setitimer(), which is specified as taking microsecond-resolution
24622  intervals. However, on some platform, our conversion routine could convert
24623  1e-6 into a zero interval, therefore disabling the timer instead of
24624  (re-)scheduling it.
24625
24626- bpo-30441: Fix bug when modifying os.environ while iterating over it
24627
24628- bpo-29585: Avoid importing ``sysconfig`` from ``site`` to improve startup
24629  speed. Python startup is about 5% faster on Linux and 30% faster on macOS.
24630
24631- bpo-29293: Add missing parameter "n" on
24632  multiprocessing.Condition.notify(). The doc claims
24633  multiprocessing.Condition behaves like threading.Condition, but its
24634  notify() method lacked the optional "n" argument (to specify the number of
24635  sleepers to wake up) that threading.Condition.notify() accepts.
24636
24637- bpo-30532: Fix email header value parser dropping folding white space in
24638  certain cases.
24639
24640- bpo-30596: Add a ``close()`` method to ``multiprocessing.Process``.
24641
24642- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash
24643  functions such as md5 are not available in the linked OpenSSL library.  As
24644  in some special FIPS-140 build environments.
24645
24646- bpo-29169: Update zlib to 1.2.11.
24647
24648- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
24649  contains CR or LF. Patch by Dong-hee Na.
24650
24651- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
24652  with bytes-like argument.
24653
24654- bpo-30746: Prohibited the '=' character in environment variable names in
24655  ``os.putenv()`` and ``os.spawn*()``.
24656
24657- bpo-30664: The description of a unittest subtest now preserves the order
24658  of keyword arguments of TestCase.subTest().
24659
24660- bpo-21071: struct.Struct.format type is now :class:`str` instead of
24661  :class:`bytes`.
24662
24663- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to
24664  have a non repr() based thread name by default when no thread_name_prefix
24665  is supplied. They will now identify themselves as
24666  "ThreadPoolExecutor-y_n".
24667
24668- bpo-29755: Fixed the lgettext() family of functions in the gettext module.
24669  They now always return bytes.
24670
24671- bpo-30616: Functional API of enum allows to create empty enums. Patched by
24672  Dong-hee Na
24673
24674- bpo-30038: Fix race condition between signal delivery and wakeup file
24675  descriptor. Patch by Nathaniel Smith.
24676
24677- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings.
24678
24679- bpo-24744: pkgutil.walk_packages function now raises ValueError if *path*
24680  is a string. Patch by Sanyam Khurana.
24681
24682- bpo-24484: Avoid race condition in multiprocessing cleanup.
24683
24684- bpo-30589: Fix multiprocessing.Process.exitcode to return the opposite of
24685  the signal number when the process is killed by a signal (instead of 255)
24686  when using the "forkserver" method.
24687
24688- bpo-28994: The traceback no longer displayed for SystemExit raised in a
24689  callback registered by atexit.
24690
24691- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
24692  called.
24693
24694- bpo-30645: Fix path calculation in `imp.load_package()`, fixing it for
24695  cases when a package is only shipped with bytecodes. Patch by Alexandru
24696  Ardelean.
24697
24698- bpo-11822: The dis.dis() function now is able to disassemble nested code
24699  objects.
24700
24701- bpo-30624: selectors does not take KeyboardInterrupt and SystemExit into
24702  account, leaving a fd in a bad state in case of error. Patch by Giampaolo
24703  Rodola'.
24704
24705- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader
24706  in non-blocking mode if it succeeded to acquire the lock but the acquire
24707  took longer than the timeout.
24708
24709- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
24710  support for ContextManager on all versions. Original PRs by Jelle Zijlstra
24711  and Ivan Levkivskyi
24712
24713- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a
24714  bytes instance with misplaced inline modifier.  Patch by Roy Williams.
24715
24716- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
24717  implementation. Patch by Michaël Sghaïer.
24718
24719- bpo-29743: Closing transport during handshake process leaks open socket.
24720  Patch by Nikolay Kim
24721
24722- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
24723  Sornay.
24724
24725- bpo-30014: modify() method of poll(), epoll() and devpoll() based classes
24726  of selectors module is around 10% faster.  Patch by Giampaolo Rodola'.
24727
24728- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
24729  EINVAL on stdin.write() if the child process is still running but closed
24730  the pipe.
24731
24732- bpo-30463: Addded empty __slots__ to abc.ABC.  This allows subclassers to
24733  deny __dict__ and __weakref__ creation.  Patch by Aaron Hall.
24734
24735- bpo-30520: Loggers are now pickleable.
24736
24737- bpo-30557: faulthandler now correctly filters and displays exception codes
24738  on Windows
24739
24740- bpo-30526: Add TextIOWrapper.reconfigure() and a
24741  TextIOWrapper.write_through attribute.
24742
24743- bpo-30245: Fix possible overflow when organize struct.pack_into error
24744  message.  Patch by Yuan Liu.
24745
24746- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
24747  handle IPv6 addresses.
24748
24749- bpo-16500: Allow registering at-fork handlers.
24750
24751- bpo-30470: Deprecate invalid ctypes call protection on Windows.  Patch by
24752  Mariatta Wijaya.
24753
24754- bpo-30414: multiprocessing.Queue._feed background running thread do not
24755  break from main loop on exception.
24756
24757- bpo-30003: Fix handling escape characters in HZ codec.  Based on patch by
24758  Ma Lin.
24759
24760- bpo-30149: inspect.signature() now supports callables with
24761  variable-argument parameters wrapped with partialmethod. Patch by Dong-hee
24762  Na.
24763
24764- bpo-30436: importlib.find_spec() raises ModuleNotFoundError instead of
24765  AttributeError if the specified parent module is not a package (i.e. lacks
24766  a __path__ attribute).
24767
24768- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
24769  and *forkserver* start methods.
24770
24771- bpo-30375: Warnings emitted when compile a regular expression now always
24772  point to the line in the user code.  Previously they could point into
24773  inners of the re module if emitted from inside of groups or conditionals.
24774
24775- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
24776  (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
24777  This error occurs sometimes on SSL connections.
24778
24779- bpo-29196: Removed previously deprecated in Python 2.4 classes Plist, Dict
24780  and _InternalDict in the plistlib module.  Dict values in the result of
24781  functions readPlist() and readPlistFromBytes() are now normal dicts.  You
24782  no longer can use attribute access to access items of these dictionaries.
24783
24784- bpo-9850: The :mod:`macpath` is now deprecated and will be removed in
24785  Python 3.8.
24786
24787- bpo-30299: Compiling regular expression in debug mode on CPython now
24788  displays the compiled bytecode in human readable form.
24789
24790- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
24791  coroutine and the coroutine returned without any more ``await``.
24792
24793- bpo-30266: contextlib.AbstractContextManager now supports
24794  anti-registration by setting __enter__ = None or __exit__ = None,
24795  following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
24796
24797- bpo-30340: Enhanced regular expressions optimization. This increased the
24798  performance of matching some patterns up to 25 times.
24799
24800- bpo-30298: Weaken the condition of deprecation warnings for inline
24801  modifiers. Now allowed several subsequential inline modifiers at the start
24802  of the pattern (e.g. ``'(?i)(?s)...'``).  In verbose mode whitespaces and
24803  comments now are allowed before and between inline modifiers (e.g. ``'(?x)
24804  (?i) (?s)...'``).
24805
24806- bpo-30285: Optimized case-insensitive matching and searching of regular
24807  expressions.
24808
24809- bpo-29990: Fix range checking in GB18030 decoder.  Original patch by Ma
24810  Lin.
24811
24812- bpo-29979: rewrite cgi.parse_multipart, reusing the FieldStorage class and
24813  making its results consistent with those of FieldStorage for
24814  multipart/form-data requests. Patch by Pierre Quentel.
24815
24816- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
24817  Misusing them could cause memory leaks or crashes.  Now scanner and
24818  encoder objects are completely initialized in the __new__ methods.
24819
24820- bpo-30215: Compiled regular expression objects with the re.LOCALE flag no
24821  longer depend on the locale at compile time.  Only the locale at matching
24822  time affects the result of matching.
24823
24824- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
24825  when Ctrl-C is received.
24826
24827- bpo-30103: binascii.b2a_uu() and uu.encode() now support using ``'`'`` as
24828  zero instead of space.
24829
24830- bpo-28556: Various updates to typing module: add typing.NoReturn type, use
24831  WrapperDescriptorType, minor bug-fixes.  Original PRs by Jim
24832  Fasarakis-Hilliard and Ivan Levkivskyi.
24833
24834- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
24835
24836- bpo-30228: The seek() and tell() methods of io.FileIO now set the internal
24837  seekable attribute to avoid one syscall on open() (in buffered or text
24838  mode).
24839
24840- bpo-30190: unittest's assertAlmostEqual and assertNotAlmostEqual provide a
24841  better message in case of failure which includes the difference between
24842  left and right arguments.  (patch by Giampaolo Rodola')
24843
24844- bpo-30101: Add support for curses.A_ITALIC.
24845
24846- bpo-29822: inspect.isabstract() now works during __init_subclass__.  Patch
24847  by Nate Soares.
24848
24849- bpo-29960: Preserve generator state when _random.Random.setstate() raises
24850  an exception. Patch by Bryan Olson.
24851
24852- bpo-30070: Fixed leaks and crashes in errors handling in the parser
24853  module.
24854
24855- bpo-22352: Column widths in the output of dis.dis() are now adjusted for
24856  large line numbers and instruction offsets.
24857
24858- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
24859  readline() or __next__() respectively return non-sizeable object. Fixed
24860  possible other errors caused by not checking results of PyObject_Size(),
24861  PySequence_Size(), or PyMapping_Size().
24862
24863- bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle
24864  Zijlstra.
24865
24866- bpo-10076: Compiled regular expression and match objects in the re module
24867  now support copy.copy() and copy.deepcopy() (they are considered atomic).
24868
24869- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
24870  is present.
24871
24872- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
24873  Patch by Armin Rigo.
24874
24875- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
24876  contextlib.contextmanager.  Patch by Siddharth Velankar.
24877
24878- bpo-26187: Test that sqlite3 trace callback is not called multiple times
24879  when schema is changing.  Indirectly fixed by switching to use
24880  sqlite3_prepare_v2() in bpo-9303.  Patch by Aviv Palivoda.
24881
24882- bpo-30017: Allowed calling the close() method of the zip entry writer
24883  object multiple times.  Writing to a closed writer now always produces a
24884  ValueError.
24885
24886- bpo-29998: Pickling and copying ImportError now preserves name and path
24887  attributes.
24888
24889- bpo-29995: re.escape() now escapes only regex special characters.
24890
24891- bpo-29962: Add math.remainder operation, implementing remainder as
24892  specified in IEEE 754.
24893
24894- bpo-29649: Improve struct.pack_into() exception messages for problems with
24895  the buffer size and offset.  Patch by Andrew Nester.
24896
24897- bpo-29654: Support If-Modified-Since HTTP header (browser cache).  Patch
24898  by Pierre Quentel.
24899
24900- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
24901  Patch by Sanjay Sundaresan.
24902
24903- bpo-29953: Fixed memory leaks in the replace() method of datetime and time
24904  objects when pass out of bound fold argument.
24905
24906- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
24907  long runs of empty iterables.
24908
24909- bpo-10030: Sped up reading encrypted ZIP files by 2 times.
24910
24911- bpo-29204: Element.getiterator() and the html parameter of XMLParser()
24912  were deprecated only in the documentation (since Python 3.2 and 3.4
24913  correspondingly). Now using them emits a deprecation warning.
24914
24915- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
24916  and wrong types.
24917
24918- bpo-25996: Added support of file descriptors in os.scandir() on Unix.
24919  os.fwalk() is sped up by 2 times by using os.scandir().
24920
24921- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
24922  exception at the very first of an iterable may swallow the exception or
24923  make the program hang. Patch by Davin Potts and Xiang Zhang.
24924
24925- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
24926  reference cycle to not keep objects alive longer than expected.
24927
24928- bpo-29901: The zipapp module now supports general path-like objects, not
24929  just pathlib.Path.
24930
24931- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
24932  the OS gives priority to errors such as EACCES over EEXIST.
24933
24934- bpo-29861: Release references to tasks, their arguments and their results
24935  as soon as they are finished in multiprocessing.Pool.
24936
24937- bpo-19930: The mode argument of os.makedirs() no longer affects the file
24938  permission bits of newly created intermediate-level directories.
24939
24940- bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
24941  Patch by Christophe Zeitouny.
24942
24943- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
24944
24945- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
24946  are not strings.  Patch by Michael Seifert.
24947
24948- bpo-8256: Fixed possible failing or crashing input() if attributes
24949  "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
24950  strings.
24951
24952- bpo-28692: Using non-integer value for selecting a plural form in gettext
24953  is now deprecated.
24954
24955- bpo-26121: Use C library implementation for math functions erf() and
24956  erfc().
24957
24958- bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino)
24959  using unsigned integers.
24960
24961- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
24962  big intables (objects that have __int__) as elements.
24963
24964- bpo-29645: Speed up importing the webbrowser module.
24965  webbrowser.register() is now thread-safe.
24966
24967- bpo-28231: The zipfile module now accepts path-like objects for external
24968  paths.
24969
24970- bpo-26915: index() and count() methods of collections.abc.Sequence now
24971  check identity before checking equality when do comparisons.
24972
24973- bpo-28682: Added support for bytes paths in os.fwalk().
24974
24975- bpo-29728: Add new :data:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12) constant.
24976  Patch by Nathaniel J. Smith.
24977
24978- bpo-29623: Allow use of path-like object as a single argument in
24979  ConfigParser.read(). Patch by David Ellis.
24980
24981- bpo-9303: Migrate sqlite3 module to _v2 API.  Patch by Aviv Palivoda.
24982
24983- bpo-28963: Fix out of bound iteration in
24984  asyncio.Future.remove_done_callback implemented in C.
24985
24986- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
24987  before all pipes are closed.
24988
24989- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to
24990  accept None argument as their pure Python implementation.
24991
24992- bpo-29703: Fix asyncio to support instantiation of new event loops in
24993  child processes.
24994
24995- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
24996  exception) to exception(s) raised in the dispatched methods. Patch by Petr
24997  Motejlek.
24998
24999- bpo-7769: Method register_function() of
25000  xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as
25001  a decorator.
25002
25003- bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
25004
25005- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
25006  PathLike objects.  Patch by Sayan Chowdhury.
25007
25008- bpo-28518: Start a transaction implicitly before a DML statement. Patch by
25009  Aviv Palivoda.
25010
25011- bpo-29742: get_extra_info() raises exception if get called on closed ssl
25012  transport. Patch by Nikolay Kim.
25013
25014- bpo-16285: urllib.parse.quote is now based on RFC 3986 and hence includes
25015  '~' in the set of characters that is not quoted by default. Patch by
25016  Christian Theune and Ratnadeep Debnath.
25017
25018- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
25019  longer affects a partial object after creation.
25020
25021- bpo-29110: Fix file object leak in aifc.open() when file is given as a
25022  filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
25023
25024- bpo-22807: Add uuid.SafeUUID and uuid.UUID.is_safe to relay information
25025  from the platform about whether generated UUIDs are generated with a
25026  multiprocessing safe method.
25027
25028- bpo-29576: Improve some deprecations in importlib. Some deprecated methods
25029  now emit DeprecationWarnings and have better descriptive messages.
25030
25031- bpo-29534: Fixed different behaviour of Decimal.from_float() for _decimal
25032  and _pydecimal. Thanks Andrew Nester.
25033
25034- bpo-10379: locale.format_string now supports the 'monetary' keyword
25035  argument, and locale.format is deprecated.
25036
25037- bpo-29851: importlib.reload() now raises ModuleNotFoundError if the module
25038  lacks a spec.
25039
25040- bpo-28556: Various updates to typing module: typing.Counter,
25041  typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
25042  Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
25043
25044- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
25045  3.6.0: check minimum and maximum years.
25046
25047- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
25048
25049- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
25050  match object. Based on patch by WGH.
25051
25052- bpo-29377: Add WrapperDescriptorType, MethodWrapperType, and
25053  MethodDescriptorType built-in types to types module. Original patch by
25054  Manuel Krebber.
25055
25056- bpo-29218: Unused install_misc command is now removed.  It has been
25057  documented as unused since 2000.  Patch by Eric N. Vander Weele.
25058
25059- bpo-29368: The extend() method is now called instead of the append()
25060  method when unpickle collections.deque and other list-like objects. This
25061  can speed up unpickling to 2 times.
25062
25063- bpo-29338: The help of a builtin or extension class now includes the
25064  constructor signature if __text_signature__ is provided for the class.
25065
25066- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
25067  to a stopped instead of terminated state (ex: when under ptrace).
25068
25069- bpo-29290: Fix a regression in argparse that help messages would wrap at
25070  non-breaking spaces.
25071
25072- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
25073
25074- bpo-29197: Removed deprecated function ntpath.splitunc().
25075
25076- bpo-29210: Removed support of deprecated argument "exclude" in
25077  tarfile.TarFile.add().
25078
25079- bpo-29219: Fixed infinite recursion in the repr of uninitialized
25080  ctypes.CDLL instances.
25081
25082- bpo-29192: Removed deprecated features in the http.cookies module.
25083
25084- bpo-29193: A format string argument for string.Formatter.format() is now
25085  positional-only.
25086
25087- bpo-29195: Removed support of deprecated undocumented keyword arguments in
25088  methods of regular expression objects.
25089
25090- bpo-28969: Fixed race condition in C implementation of
25091  functools.lru_cache. KeyError could be raised when cached function with
25092  full cache was simultaneously called from different threads with the same
25093  uncached arguments.
25094
25095- bpo-20804: The unittest.mock.sentinel attributes now preserve their
25096  identity when they are copied or pickled.
25097
25098- bpo-29142: In urllib.request, suffixes in no_proxy environment variable
25099  with leading dots could match related hostnames again (e.g. .b.c matches
25100  a.b.c). Patch by Milan Oberkirch.
25101
25102- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
25103  anymore. Patch written by Jiajun Huang.
25104
25105- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
25106  context. Patch by Sam Breese.
25107
25108- bpo-28985: Update authorizer constants in sqlite3 module. Patch by
25109  Dingyuan Wang.
25110
25111- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
25112
25113- bpo-13051: Fixed recursion errors in large or resized
25114  curses.textpad.Textbox.  Based on patch by Tycho Andersen.
25115
25116- bpo-9770: curses.ascii predicates now work correctly with negative
25117  integers.
25118
25119- bpo-28427: old keys should not remove new values from WeakValueDictionary
25120  when collecting from another thread.
25121
25122- bpo-28923: Remove editor artifacts from Tix.py.
25123
25124- bpo-28871: Fixed a crash when deallocate deep ElementTree.
25125
25126- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
25127  WeakValueDictionary.pop() when a GC collection happens in another thread.
25128
25129- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence
25130  that doesn't own its elements as limits.
25131
25132- bpo-16255: subprocess.Popen uses /system/bin/sh on Android as the shell,
25133  instead of /bin/sh.
25134
25135- bpo-28779: multiprocessing.set_forkserver_preload() would crash the
25136  forkserver process if a preloaded module instantiated some multiprocessing
25137  objects such as locks.
25138
25139- bpo-26937: The chown() method of the tarfile.TarFile class does not fail
25140  now when the grp module cannot be imported, as for example on Android
25141  platforms.
25142
25143- bpo-28847: dbm.dumb now supports reading read-only files and no longer
25144  writes the index file when it is not changed.  A deprecation warning is
25145  now emitted if the index file is missed and recreated in the 'r' and 'w'
25146  modes (will be an error in future Python releases).
25147
25148- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in
25149  re.sub() replacement templates regular expressions now are errors.
25150
25151- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call
25152  warnings.showwarning() if it was overridden inside the context manager.
25153
25154- bpo-27172: To assist with upgrades from 2.7, the previously documented
25155  deprecation of ``inspect.getfullargspec()`` has been reversed. This
25156  decision may be revisited again after the Python 2.7 branch is no longer
25157  officially supported.
25158
25159- bpo-28740: Add sys.getandroidapilevel(): return the build time API version
25160  of Android as an integer. Function only available on Android.
25161
25162- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and
25163  :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by
25164  Omar Sandoval.
25165
25166- bpo-28752: Restored the __reduce__() methods of datetime objects.
25167
25168- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created
25169  by re.compile(), become comparable (only x==y and x!=y operators). This
25170  change should fix the issue #18383: don't duplicate warning filters when
25171  the warnings module is reloaded (thing usually only done in unit tests).
25172
25173- bpo-20572: Remove the subprocess.Popen.wait endtime parameter.  It was
25174  deprecated in 3.4 and undocumented prior to that.
25175
25176- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
25177  from_buffer_copy() methods on abstract classes like Array.
25178
25179- bpo-28548: In the "http.server" module, parse the protocol version if
25180  possible, to avoid using HTTP 0.9 in some error responses.
25181
25182- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch
25183  by Vajrasky Kok
25184
25185- bpo-28563: Fixed possible DoS and arbitrary code execution when handle
25186  plural form selections in the gettext module.  The expression parser now
25187  supports exact syntax supported by GNU gettext.
25188
25189- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
25190  garbage collector is invoked in other thread.  Based on patch by Sebastian
25191  Cufre.
25192
25193- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
25194  given empty data twice.  Patch by Benjamin Fogle.
25195
25196- bpo-28549: Fixed segfault in curses's addch() with ncurses6.
25197
25198- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
25199  file with compression before trying to open it without compression.
25200  Otherwise it had 50% chance failed with ignore_zeros=True.
25201
25202- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
25203  browsers.  Based on patch by Oleg Broytman.
25204
25205- bpo-24241: The webbrowser in an X environment now prefers using the
25206  default browser directly. Also, the webbrowser register() function now has
25207  a documented 'preferred' argument, to specify browsers to be returned by
25208  get() with no arguments. Patch by David Steele
25209
25210- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
25211  by representing the scale as float value internally in Tk.  tkinter.IntVar
25212  now works if float value is set to underlying Tk variable.
25213
25214- bpo-28255: calendar.TextCalendar.prweek() no longer prints a space after a
25215  weeks's calendar.  calendar.TextCalendar.pryear() no longer prints
25216  redundant newline after a year's calendar.  Based on patch by Xiang Zhang.
25217
25218- bpo-28255: calendar.TextCalendar.prmonth() no longer prints a space at the
25219  start of new line after printing a month's calendar.  Patch by Xiang
25220  Zhang.
25221
25222- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
25223  Based on patch by Kaarle Ritvanen.
25224
25225- bpo-28353: os.fwalk() no longer fails on broken links.
25226
25227- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept
25228  non-None value is passed to it.send(val).
25229
25230- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
25231  for readability.
25232
25233- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
25234  workaround to Tix library bug.
25235
25236- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
25237
25238- bpo-25953: re.sub() now raises an error for invalid numerical group
25239  reference in replacement template even if the pattern is not found in the
25240  string.  Error message for invalid group reference now includes the group
25241  index and the position of the reference. Based on patch by SilentGhost.
25242
25243- bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of
25244  1, 10, 100,... for autoranging.
25245
25246- bpo-28115: Command-line interface of the zipfile module now uses argparse.
25247  Added support of long options.
25248
25249- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by
25250  Mariatta Wijaya.
25251
25252- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows.
25253
25254- bpo-23214: In the "io" module, the argument to BufferedReader and
25255  BytesIO's read1() methods is now optional and can be -1, matching the
25256  BufferedIOBase specification.
25257
25258- bpo-28480: Fix error building socket module when multithreading is
25259  disabled.
25260
25261- bpo-28240: timeit: remove ``-c/--clock`` and ``-t/--time`` command line
25262  options which were deprecated since Python 3.3.
25263
25264- bpo-28240: timeit now repeats the benchmarks 5 times instead of only 3 to
25265  make benchmarks more reliable.
25266
25267- bpo-28240: timeit autorange now uses a single loop iteration if the
25268  benchmark takes less than 10 seconds, instead of 10 iterations. "python3
25269  -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds instead of
25270  40 seconds.
25271
25272- Distutils.sdist now looks for README and setup.py files with case
25273  sensitivity. This behavior matches that found in Setuptools 6.0 and later.
25274  See `setuptools 100 <https://github.com/pypa/setuptools/issues/100>`_ for
25275  rationale.
25276
25277- bpo-24452: Make webbrowser support Chrome on Mac OS X. Patch by Ned
25278  Batchelder.
25279
25280- bpo-20766: Fix references leaked by pdb in the handling of SIGINT
25281  handlers.
25282
25283- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by
25284  Eryk Sun.
25285
25286- bpo-28317: The disassembler now decodes FORMAT_VALUE argument.
25287
25288- bpo-28380: unittest.mock Mock autospec functions now properly support
25289  assert_called, assert_not_called, and assert_called_once.
25290
25291- bpo-28229: lzma module now supports pathlib.
25292
25293- bpo-28321: Fixed writing non-BMP characters with binary format in
25294  plistlib.
25295
25296- bpo-28225: bz2 module now supports pathlib.  Initial patch by Ethan
25297  Furman.
25298
25299- bpo-28227: gzip now supports pathlib.  Patch by Ethan Furman.
25300
25301- bpo-28332: Deprecated silent truncations in socket.htons and socket.ntohs.
25302  Original patch by Oren Milman.
25303
25304- bpo-27358: Optimized merging var-keyword arguments and improved error
25305  message when passing a non-mapping as a var-keyword argument.
25306
25307- bpo-28257: Improved error message when passing a non-iterable as a
25308  var-positional argument.  Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
25309
25310- bpo-28322: Fixed possible crashes when unpickle itertools objects from
25311  incorrect pickle data.  Based on patch by John Leitch.
25312
25313- bpo-28228: imghdr now supports pathlib.
25314
25315- bpo-28226: compileall now supports pathlib.
25316
25317- bpo-28314: Fix function declaration (C flags) for the getiterator() method
25318  of xml.etree.ElementTree.Element.
25319
25320- bpo-28148: Stop using localtime() and gmtime() in the time module.
25321  Introduced platform independent _PyTime_localtime API that is similar to
25322  POSIX localtime_r, but available on all platforms.  Patch by Ed Schouten.
25323
25324- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
25325  9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
25326  that they don't call itermonthdates() which can cause datetime.date
25327  under/overflow.
25328
25329- bpo-28275: Fixed possible use after free in the decompress() methods of
25330  the LZMADecompressor and BZ2Decompressor classes. Original patch by John
25331  Leitch.
25332
25333- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
25334  if pass invalid string-like object as a name.  Patch by Xiang Zhang.
25335
25336- bpo-18844: random.choices() now has k as a keyword-only argument to
25337  improve the readability of common cases and come into line with the
25338  signature used in other languages.
25339
25340- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
25341  Patch by Madison May.
25342
25343- bpo-27611: Fixed support of default root window in the tkinter.tix module.
25344  Added the master parameter in the DisplayStyle constructor.
25345
25346- bpo-27348: In the traceback module, restore the formatting of exception
25347  messages like "Exception: None".  This fixes a regression introduced in
25348  3.5a2.
25349
25350- bpo-25651: Allow falsy values to be used for msg parameter of subTest().
25351
25352- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is
25353  interrupted by a signal and a signal handler raises a Python exception.
25354
25355- bpo-28200: Fix memory leak on Windows in the os module (fix
25356  path_converter() function).
25357
25358- bpo-25400: RobotFileParser now correctly returns default values for
25359  crawl_delay and request_rate.  Initial patch by Peter Wirtz.
25360
25361- bpo-27932: Prevent memory leak in win32_ver().
25362
25363- Fix UnboundLocalError in socket._sendfile_use_sendfile.
25364
25365- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
25366  os.stat().  Patch by Eryk Sun.
25367
25368- bpo-22493: Warning message emitted by using inline flags in the middle of
25369  regular expression now contains a (truncated) regex pattern. Patch by Tim
25370  Graham.
25371
25372- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
25373  empty bytestring is passed.
25374
25375- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
25376
25377- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
25378  Gergely Imreh and Markus Holtermann.
25379
25380- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings.
25381  Patch by Eryk Sun.
25382
25383- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
25384  binascii.a2b_qp().
25385
25386- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
25387  Kevin Conway.
25388
25389- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
25390  Seth Michael Larson.
25391
25392- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
25393  iceboy.
25394
25395- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
25396
25397- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
25398
25399- bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
25400  Patch by Mark Williams.
25401
25402- bpo-28325: Remove vestigial MacOS 9 macurl2path module and its tests.
25403
25404- bpo-28368: Refuse monitoring processes if the child watcher has no loop
25405  attached. Patch by Vincent Michel.
25406
25407- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
25408  add_writer, etc.
25409
25410- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
25411  Марк.
25412
25413- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
25414
25415- bpo-28372: Fix asyncio to support formatting of non-python coroutines.
25416
25417- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
25418  Марк.
25419
25420- bpo-27972: Prohibit Tasks to await on themselves.
25421
25422- bpo-24142: Reading a corrupt config file left configparser in an invalid
25423  state. Original patch by Florian Höch.
25424
25425- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract
25426  base classes to use keyword parameters in __init_subclass__. Patch by Nate
25427  Soares.
25428
25429- bpo-25532: inspect.unwrap() will now only try to unwrap an object
25430  sys.getrecursionlimit() times, to protect against objects which create a
25431  new object on every attribute access.
25432
25433- bpo-30177: path.resolve(strict=False) no longer cuts the path after the
25434  first element not present in the filesystem.  Patch by Antoine Pietri.
25435
25436Documentation
25437-------------
25438
25439- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and
25440  ZeroMQSocketHandler examples and adapt them to Python 3.
25441
25442- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
25443  documentation.
25444
25445- bpo-31128: Allow the pydoc server to bind to arbitrary hostnames.
25446
25447- bpo-30803: Clarify doc on truth value testing. Original patch by Peter
25448  Thomassen.
25449
25450- bpo-30176: Add missing attribute related constants in curses
25451  documentation.
25452
25453- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are
25454  now their respective type definitions, rather than the corresponding
25455  builtin function entries. Use :ref:`bytes <func-bytes>` and
25456  :ref:`bytearray <func-bytearray>` to reference the latter. In order to
25457  ensure this and future cross-reference updates are applied automatically,
25458  the daily documentation builds now disable the default output caching
25459  features in Sphinx.
25460
25461- bpo-26985: Add missing info of code object in inspect documentation.
25462
25463- bpo-19824: Improve the documentation for, and links to, template strings
25464  by emphasizing their utility for internationalization, and by clarifying
25465  some usage constraints. (See also: bpo-20314, bpo-12518)
25466
25467- bpo-28929: Link the documentation to its source file on GitHub.
25468
25469- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
25470  to aiosmtpd, a third-party asyncio-based replacement.
25471
25472- bpo-26355: Add canonical header link on each page to corresponding major
25473  version of the documentation. Patch by Matthias Bussonnier.
25474
25475- bpo-29349: Fix Python 2 syntax in code for building the documentation.
25476
25477- bpo-23722: The data model reference and the porting section in the 3.6
25478  What's New guide now cover the additional ``__classcell__`` handling
25479  needed for custom metaclasses to fully support :pep:`487` and
25480  zero-argument ``super()``.
25481
25482- bpo-28513: Documented command-line interface of zipfile.
25483
25484Tests
25485-----
25486
25487- bpo-29639: test.support.HOST is now "localhost", a new HOSTv4 constant has
25488  been added for your ``127.0.0.1`` needs, similar to the existing HOSTv6
25489  constant.
25490
25491- bpo-31320: Silence traceback in test_ssl
25492
25493- bpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols
25494  for SSLContext.
25495
25496- bpo-25674: Remove sha256.tbs-internet.com ssl test
25497
25498- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
25499  version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
25500
25501- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
25502  test suite using --use=all / -u all, exclude tzdata since it makes
25503  test_datetime too slow (15-20 min on some buildbots) which then times out
25504  on some buildbots. Fix also regrtest command line parser to allow passing
25505  -u extralargefile to run test_zipfile64.
25506
25507- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()`
25508  functions to the _testcapi module.
25509
25510- bpo-30357: test_thread: setUp() now uses support.threading_setup() and
25511  support.threading_cleanup() to wait until threads complete to avoid random
25512  side effects on following tests. Initial patch written by Grzegorz
25513  Grzywacz.
25514
25515- bpo-30197: Enhanced functions swap_attr() and swap_item() in the
25516  test.support module. They now work when delete replaced attribute or item
25517  inside the with statement.  The old value of the attribute or item (or
25518  None if it doesn't exist) now will be assigned to the target of the "as"
25519  clause, if there is one.
25520
25521- bpo-24932: Use proper command line parsing in _testembed
25522
25523- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line
25524  arguments.
25525
25526- bpo-28683: Fix the tests that bind() a unix socket and raise
25527  PermissionError on Android for a non-root user.
25528
25529- bpo-26936: Fix the test_socket failures on Android - getservbyname(),
25530  getservbyport() and getaddrinfo() are broken on some Android API levels.
25531
25532- bpo-28666: Now test.support.rmtree is able to remove unwritable or
25533  unreadable directories.
25534
25535- bpo-23839: Various caches now are cleared before running every test file.
25536
25537- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
25538  missing the effective gid.
25539
25540- bpo-28409: regrtest: fix the parser of command line arguments.
25541
25542- bpo-28217: Adds _testconsole module to test console input.
25543
25544- bpo-26939: Add the support.setswitchinterval() function to fix
25545  test_functools hanging on the Android armv7 qemu emulator.
25546
25547Build
25548-----
25549
25550- bpo-31354: Allow --with-lto to be used on all builds, not just `make
25551  profile-opt`.
25552
25553- bpo-31370: Remove support for building --without-threads. This option is
25554  not really useful anymore in the 21st century. Removing lots of
25555  conditional paths allows us to simplify the code base, including in
25556  difficult to maintain low-level internal code.
25557
25558- bpo-31341: Per :pep:`11`, support for the IRIX operating system was
25559  removed.
25560
25561- bpo-30854: Fix compile error when compiling --without-threads. Patch by
25562  Masayuki Yamamoto.
25563
25564- bpo-30687: Locate msbuild.exe on Windows when building rather than
25565  vcvarsall.bat
25566
25567- bpo-20210: Support the *disabled* marker in Setup files. Extension modules
25568  listed after this marker are not built at all, neither by the Makefile nor
25569  by setup.py.
25570
25571- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C
25572  ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies
25573  ``--with-assertions``.
25574
25575- bpo-28787: Fix out-of-tree builds of Python when configured with
25576  ``--with--dtrace``.
25577
25578- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
25579  ``make install`` and some other make targets when configured with
25580  ``--enable-optimizations``.
25581
25582- bpo-23404: Don't regenerate generated files based on file modification
25583  time anymore: the action is now explicit. Replace ``make touch`` with
25584  ``make regen-all``.
25585
25586- bpo-29643: Fix ``--enable-optimization`` didn't work.
25587
25588- bpo-27593: sys.version and the platform module python_build(),
25589  python_branch(), and python_revision() functions now use git information
25590  rather than hg when building from a repo.
25591
25592- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
25593
25594- bpo-27659: Prohibit implicit C function declarations: use
25595  ``-Werror=implicit-function-declaration`` when possible (GCC and Clang,
25596  but it depends on the compiler version). Patch written by Chi Hsuan Yen.
25597
25598- bpo-29384: Remove old Be OS helper scripts.
25599
25600- bpo-26851: Set Android compilation and link flags.
25601
25602- bpo-28768: Fix implicit declaration of function _setmode. Patch by
25603  Masayuki Yamamoto
25604
25605- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
25606
25607- bpo-23903: Added missed names to PC/python3.def.
25608
25609- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK
25610  macro is not defined in android-ndk-r13.
25611
25612- bpo-28538: Fix the compilation error that occurs because if_nameindex() is
25613  available on Android API level 24, but the if_nameindex structure is not
25614  defined.
25615
25616- bpo-20211: Do not add the directory for installing C header files and the
25617  directory for installing object code libraries to the cross compilation
25618  search paths. Original patch by Thomas Petazzoni.
25619
25620- bpo-28849: Do not define sys.implementation._multiarch on Android.
25621
25622- bpo-10656: Fix out-of-tree building on AIX.  Patch by Tristan Carel and
25623  Michael Haubenwallner.
25624
25625- bpo-26359: Rename --with-optimiations to --enable-optimizations.
25626
25627- bpo-28444: Fix missing extensions modules when cross compiling.
25628
25629- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2.
25630
25631- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
25632
25633- bpo-21124: Fix building the _struct module on Cygwin by passing ``NULL``
25634  instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT.  Patch by Masayuki
25635  Yamamoto.
25636
25637- bpo-13756: Fix building extensions modules on Cygwin.  Patch by Roumen
25638  Petrov, based on original patch by Jason Tishler.
25639
25640- bpo-21085: Add configure check for siginfo_t.si_band, which Cygwin does
25641  not provide. Patch by Masayuki Yamamoto with review and rebase by Erik
25642  Bray.
25643
25644- bpo-28258: Fixed build with Estonian locale (python-config and distclean
25645  targets in Makefile).  Patch by Arfrever Frehtes Taifersar Arahesis.
25646
25647- bpo-26661: setup.py now detects system libffi with multiarch wrapper.
25648
25649- bpo-27979: A full copy of libffi is no longer bundled for use when
25650  building _ctypes on non-OSX UNIX platforms.  An installed copy of libffi
25651  is now required when building _ctypes on such platforms.
25652
25653- bpo-15819: Remove redundant include search directory option for building
25654  outside the source tree.
25655
25656- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
25657  Patch by Gareth Rees.
25658
25659Windows
25660-------
25661
25662- bpo-31392: Update Windows build to use OpenSSL 1.1.0f
25663
25664- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows.
25665
25666- bpo-31358: zlib is no longer bundled in the CPython source, instead it is
25667  downloaded on demand just like bz2, lzma, OpenSSL, Tcl/Tk, and SQLite.
25668
25669- bpo-31340: Change to building with MSVC v141 (included with Visual Studio
25670  2017)
25671
25672- bpo-30581: os.cpu_count() now returns the correct number of processors on
25673  Windows when the number of logical processors is greater than 64.
25674
25675- bpo-30916: Pre-build OpenSSL, Tcl and Tk and include the binaries in the
25676  build.
25677
25678- bpo-30731: Add a missing xmlns to python.manifest so that it matches the
25679  schema.
25680
25681- bpo-30291: Allow requiring 64-bit interpreters from py.exe using -64
25682  suffix. Contributed by Steve (Gadget) Barnes.
25683
25684- bpo-30362: Adds list options (-0, -0p) to py.exe launcher. Contributed by
25685  Steve Barnes.
25686
25687- bpo-23451: Fix socket deprecation warnings in socketmodule.c. Patch by
25688  Segev Finer.
25689
25690- bpo-30450: The build process on Windows no longer depends on Subversion,
25691  instead pulling external code from GitHub via a Python script.  If Python
25692  3.6 is not found on the system (via ``py -3.6``), NuGet is used to
25693  download a copy of 32-bit Python.
25694
25695- bpo-29579: Removes readme.txt from the installer.
25696
25697- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
25698
25699- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default
25700
25701- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c
25702
25703- bpo-28402: Adds signed catalog files for stdlib on Windows.
25704
25705- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
25706  Sun)
25707
25708- bpo-28251: Improvements to help manuals on Windows.
25709
25710- bpo-28110: launcher.msi has different product codes between 32-bit and
25711  64-bit
25712
25713- bpo-28161: Opening CON for write access fails
25714
25715- bpo-28162: WindowsConsoleIO readall() fails if first line starts with
25716  Ctrl+Z
25717
25718- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
25719
25720- bpo-28164: _PyIO_get_console_type fails for various paths
25721
25722- bpo-28137: Renames Windows path file to ._pth
25723
25724- bpo-28138: Windows ._pth file should allow import site
25725
25726IDLE
25727----
25728
25729- bpo-31493: IDLE code context -- fix code update and font update timers.
25730  Canceling timers prevents a warning message when test_idle completes.
25731
25732- bpo-31488: IDLE - Update non-key options in former extension classes. When
25733  applying configdialog changes, call .reload for each feature class. Change
25734  ParenMatch so updated options affect existing instances attached to
25735  existing editor windows.
25736
25737- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace
25738  strips more than blank spaces.  Multiline string literals are not skipped.
25739
25740- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by
25741  default.
25742
25743- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
25744  update in the background in order to make live interaction and
25745  experimentation with tkinter applications much easier.
25746
25747- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an
25748  int entry is not the same as deleting and inserting because int('') will
25749  fail.
25750
25751- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and
25752  Help sections.
25753
25754- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
25755  Move some data and functions from the class to module level. Patch by
25756  Cheryl Sabella.
25757
25758- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog.
25759
25760- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About
25761  10 IDLE features were implemented as supposedly optional extensions. Their
25762  different behavior could be confusing or worse for users and not good for
25763  maintenance. Hence the conversion. The main difference for users is that
25764  user configurable key bindings for builtin features are now handled
25765  uniformly. Now, editing a binding in a keyset only affects its value in
25766  the keyset. All bindings are defined together in the system-specific
25767  default keysets in config-extensions.def. All custom keysets are saved as
25768  a whole in config-extension.cfg.  All take effect as soon as one clicks
25769  Apply or Ok. The affected events are '<<force-open-completions>>',
25770  '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>',
25771  '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and
25772  '<<zoom-height>>'.  Any (global) customizations made before 3.6.3 will not
25773  affect their keyset-specific customization after 3.6.3. and vice versa.
25774  Initial patch by Charles Wohlganger.
25775
25776- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by
25777  Cheryl Sabella.
25778
25779- bpo-31001: Add tests for configdialog highlight tab.  Patch by Cheryl
25780  Sabella.
25781
25782- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog.  The
25783  slightly modified tests continue to pass.  Patch by Cheryl Sabella.
25784
25785- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by
25786  Victor Stinner.
25787
25788- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
25789
25790- bpo-19903: IDLE: Calltips use `inspect.signature` instead of
25791  `inspect.getfullargspec`. This improves calltips for builtins converted to
25792  use Argument Clinic. Patch by Louie Lu.
25793
25794- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog.
25795  Update existing classes to match outline. Initial patch by Cheryl Sabella.
25796
25797- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly
25798  modified tests continue to pass. Patch by Cheryl Sabella.
25799
25800- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly
25801  modified tests continue to pass. Fix General tests. Patch mostly by Cheryl
25802  Sabella.
25803
25804- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan
25805  Reedy and Cheryl Sabella.
25806
25807- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping
25808  methods pertaining to each tab and the buttons will aid writing tests and
25809  improving the tabs and will enable splitting the groups into classes.
25810
25811- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance
25812  tracers manages pairs consisting of a tk variable and a callback function.
25813  When tracing is turned on, setting the variable calls the function.  Test
25814  coverage for the new class is 100%.
25815
25816- bpo-31003: IDLE: Add more tests for General tab.
25817
25818- bpo-30993: IDLE - Improve configdialog font page and tests. In
25819  configdialog: Document causal pathways in create_font_tab docstring.
25820  Simplify some attribute names. Move set_samples calls to var_changed_font
25821  (idea from Cheryl Sabella).  Move related functions to positions after the
25822  create widgets function. In test_configdialog: Fix test_font_set so not
25823  order dependent.  Fix renamed test_indent_scale so it tests the widget.
25824  Adjust tests for movement of set_samples call.  Add tests for load
25825  functions.  Put all font tests in one class and tab indent tests in
25826  another.  Except for two lines, these tests completely cover the related
25827  functions.
25828
25829- bpo-30981: IDLE -- Add more configdialog font page tests.
25830
25831- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog.
25832
25833- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from
25834  46% to 96%. Patch by Louie Lu.
25835
25836- bpo-30934: Document coverage details for idlelib tests. Add section to
25837  idlelib/idle-test/README.txt. Include check that branches are taken both
25838  ways. Exclude IDLE-specific code that does not run during unit tests.
25839
25840- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in
25841  docstrings This will facilitate improving the dialog and splitting up the
25842  class. Original patch by Cheryl Sabella.
25843
25844- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by
25845  Louie Lu.
25846
25847- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
25848
25849- bpo-30851: IDLE: Remove unused variables in configdialog.  One is a
25850  duplicate, one is set but cannot be altered by users. Patch by Cheryl
25851  Sabella.
25852
25853- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as
25854  well as mouse. Initial patch by Louie Lu.
25855
25856- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once.
25857
25858- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in
25859  config; test. * In config, put dump test code in a function; run it and
25860  unittest in   'if __name__ == '__main__'. * Add class config.ConfigChanges
25861  based on changes_class_v4.py on bpo issue. * Add class
25862  test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise
25863  configdialog to use ConfigChanges; see tracker msg297804. * Revise
25864  test_configdialog to match configdialog changes. * Remove configdialog
25865  functions unused or moved to ConfigChanges. Cheryl Sabella contributed
25866  parts of the patch.
25867
25868- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by
25869  Cheryl Sabella.
25870
25871- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
25872  tests. Patch by Cheryl Sabella.
25873
25874- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens'
25875  style to highlight both opener and closer. Make 'default' style, which is
25876  not default, a synonym for 'opener'. Make time-delay work the same with
25877  all styles. Add help for config dialog extensions tab, including help for
25878  parenmatch. Add new tests.  Original patch by Charles Wohlganger.
25879
25880- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella
25881
25882- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
25883  properly. Original patch by Saimadhav Heblikar.
25884
25885- bpo-29910: IDLE no longer deletes a character after commenting out a
25886  region by a key shortcut.  Add ``return 'break'`` for this and other
25887  potential conflicts between IDLE and default key bindings.
25888
25889- bpo-30728: Review and change idlelib.configdialog names. Lowercase method
25890  and attribute names. Replace 'colour' with 'color', expand overly cryptic
25891  names, delete unneeded underscores. Replace ``import *`` with specific
25892  imports. Patches by Cheryl Sabella.
25893
25894- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them
25895  with tk. Add tests for all 3 validation functions. Original patch by G
25896  Polo.  Tests added by Cheryl Sabella.
25897
25898- bpo-15786: Fix several problems with IDLE's autocompletion box. The
25899  following should now work: clicking on selection box items; using the
25900  scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no
25901  longer happen. Patch by Louie Lu.
25902
25903- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup
25904  no-connection message directs users to this section.
25905
25906- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and
25907  Terry Jan Reedy.
25908
25909- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
25910  Cheryl Sabella and Terry Jan Reedy.
25911
25912- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
25913  100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
25914
25915- bpo-30303: Add _utest option to textview; add new tests. Increase coverage
25916  to 100%. Patches by Louie Lu and Terry Jan Reedy.
25917
25918- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes).
25919
25920- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and
25921  augment description of the configuration system.
25922
25923Tools/Demos
25924-----------
25925
25926- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared
25927  builds now, too.  :pep:`523` introduced _PyEval_EvalFrameDefault which
25928  inlines PyEval_EvalFrameEx on non-debug shared builds.  This broke the
25929  ability to use py-bt, py-up, and a few other Python-specific gdb
25930  integrations. The problem is fixed by only looking for
25931  _PyEval_EvalFrameDefault frames in python-gdb.py.  Original patch by Bruno
25932  "Polaco" Penteado.
25933
25934- bpo-29748: Added the slice index converter in Argument Clinic.
25935
25936- bpo-24037: Argument Clinic now uses the converter `bool(accept={int})`
25937  rather than `int` for semantical booleans.  This avoids repeating the
25938  default value for Python and C and will help in converting to `bool` in
25939  future.
25940
25941- bpo-29367: python-gdb.py now supports also ``method-wrapper``
25942  (``wrapperobject``) objects.
25943
25944- bpo-28023: Fix python-gdb.py didn't support new dict implementation.
25945
25946- bpo-15369: The pybench and pystone microbenchmark have been removed from
25947  Tools. Please use the new Python benchmark suite
25948  https://github.com/python/pyperformance which is more reliable and
25949  includes a portable version of pybench working on Python 2 and Python 3.
25950
25951- bpo-28102: The zipfile module CLI now prints usage to stderr. Patch by
25952  Stephen J. Turnbull.
25953
25954C API
25955-----
25956
25957- bpo-31338: Added the ``Py_UNREACHABLE()`` macro for code paths which are
25958  never expected to be reached.  This and a few other useful macros are now
25959  documented in the C API manual.
25960
25961- bpo-30832: Remove own implementation for thread-local storage. CPython has
25962  provided the own implementation for thread-local storage (TLS) on
25963  Python/thread.c, it's used in the case which a platform has not supplied
25964  native TLS.  However, currently all supported platforms (Windows and
25965  pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS
25966  macro with unconditional in any case.
25967
25968- bpo-30708: PyUnicode_AsWideCharString() now raises a ValueError if the
25969  second argument is NULL and the wchar_t\* string contains null characters.
25970
25971- bpo-16500: Deprecate PyOS_AfterFork() and add PyOS_BeforeFork(),
25972  PyOS_AfterFork_Parent() and PyOS_AfterFork_Child().
25973
25974- bpo-6532: The type of results of PyThread_start_new_thread() and
25975  PyThread_get_thread_ident(), and the id parameter of
25976  PyThreadState_SetAsyncExc() changed from "long" to "unsigned long".
25977
25978- bpo-27867: Function PySlice_GetIndicesEx() is deprecated and replaced with
25979  a macro if Py_LIMITED_API is not set or set to the value between
25980  0x03050400 and 0x03060000 (not including) or 0x03060100 or higher.  Added
25981  functions PySlice_Unpack() and PySlice_AdjustIndices().
25982
25983- bpo-29083: Fixed the declaration of some public API functions.
25984  PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
25985  limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
25986  Py_BuildValue() were not available in limited API of version < 3.3 when
25987  PY_SSIZE_T_CLEAN is defined.
25988
25989- bpo-28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()
25990  is now of type ``const char *`` rather of ``char *``.
25991
25992- bpo-29058: All stable API extensions added after Python 3.2 are now
25993  available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
25994  the minimum Python version supporting this API.
25995
25996- bpo-28822: The index parameters *start* and *end* of PyUnicode_FindChar()
25997  are now adjusted to behave like ``str[start:end]``.
25998
25999- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
26000
26001- bpo-28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,
26002  PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of
26003  type ``const char *`` rather of ``char *``.
26004
26005- bpo-28748: Private variable _Py_PackageContext is now of type ``const char
26006  *`` rather of ``char *``.
26007
26008- bpo-19569: Compiler warnings are now emitted if use most of deprecated
26009  functions.
26010
26011- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
26012  PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
26013  PyUnicode_AsEncodedUnicode().
26014
26015
26016What's New in Python 3.6.6 final?
26017=================================
26018
26019*Release date: 2018-06-27*
26020
26021There were no new changes in version 3.6.6.
26022
26023
26024
26025What's New in Python 3.6.6 release candidate 1?
26026===============================================
26027
26028*Release date: 2018-06-11*
26029
26030Core and Builtins
26031-----------------
26032
26033- bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow()
26034  correctly
26035
26036- bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
26037  shutdown even when there was a custom handler set previously. Patch by
26038  Philipp Kerling.
26039
26040- bpo-33622: Fixed a leak when the garbage collector fails to add an object
26041  with the ``__del__`` method or referenced by it into the
26042  :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
26043  exception is set and preserves it.
26044
26045- bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
26046
26047- bpo-33391: Fix a leak in set_symmetric_difference().
26048
26049- bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
26050
26051- bpo-33231: Fix potential memory leak in ``normalizestring()``.
26052
26053- bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
26054  or ``__aexit__()`` return non-awaitable object.
26055
26056- bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
26057  when copying from key-sharing dict.
26058
26059- bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
26060
26061- bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in
26062  socketmodule on Windows.
26063
26064- bpo-21983: Fix a crash in `ctypes.cast()` in case the type argument is a
26065  ctypes structured data type. Patch by Eryk Sun and Oren Milman.
26066
26067Library
26068-------
26069
26070- bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
26071  Steve Weber.
26072
26073- bpo-33812: Datetime instance d with non-None tzinfo, but with
26074  d.tzinfo.utcoffset(d) returning None is now treated as naive by the
26075  astimezone() method.
26076
26077- bpo-30805: Avoid race condition with debug logging
26078
26079- bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
26080  operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
26081  performed on :class:`mmap.mmap` objects.  Patch by Zackery Spytz.
26082
26083- bpo-32684: Fix gather to propagate cancellation of itself even with
26084  return_exceptions.
26085
26086- bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
26087  asyncio.sslproto: start immediately the handshake instead of using
26088  call_soon(). Previously, data_received() could be called before the
26089  handshake started, causing the handshake to hang or fail.
26090
26091- bpo-31647: Fixed bug where calling write_eof() on a
26092  _SelectorSocketTransport after it's already closed raises AttributeError.
26093
26094- bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
26095
26096- bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
26097
26098- bpo-11874: Use a better regex when breaking usage into wrappable parts.
26099  Avoids bogus assertion errors from custom metavar strings.
26100
26101- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
26102  that prevented the cache of parsed strings from clearing after finishing
26103  the decoding. Based on patch by c-fos.
26104
26105- bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
26106  locations
26107
26108- bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
26109  Windows. Patch by Zvi Effron
26110
26111- bpo-26819: Fix race condition with `ReadTransport.resume_reading` in
26112  Windows proactor event loop.
26113
26114- bpo-28556: Minor fixes in typing module: add annotations to
26115  ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
26116  ``Generic.__new__``.  Original PRs by Paulius Šarka and Chad Dombrova.
26117
26118- bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
26119
26120- bpo-33422: Fix trailing quotation marks getting deleted when looking up
26121  byte/string literals on pydoc. Patch by Andrés Delfino.
26122
26123- bpo-33197: Update error message when constructing invalid
26124  inspect.Parameters Patch by Dong-hee Na.
26125
26126- bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
26127  object when it is called with a single argument.
26128
26129- bpo-33329: Fix multiprocessing regression on newer glibcs
26130
26131- bpo-991266: Fix quoting of the ``Comment`` attribute of
26132  :class:`http.cookies.SimpleCookie`.
26133
26134- bpo-33131: Upgrade bundled version of pip to 10.0.1.
26135
26136- bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
26137  object to a tree of tuples or lists with ``line_info=False`` and
26138  ``col_info=True``.
26139
26140- bpo-33263: Fix FD leak in `_SelectorSocketTransport`  Patch by Vlad
26141  Starostin.
26142
26143- bpo-33256: Fix display of ``<module>`` call in the html produced by
26144  ``cgitb.html()``. Patch by Stéphane Blondon.
26145
26146- bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
26147  sequences consistently even when called from subclasses without a
26148  ``getrandbits()`` implementation.
26149
26150- bpo-33224: Update difflib.mdiff() for :pep:`479`.  Convert an uncaught
26151  StopIteration in a generator into a return-statement.
26152
26153- bpo-33209: End framing at the end of C implementation of
26154  :func:`pickle.Pickler.dump`.
26155
26156- bpo-32861: The urllib.robotparser's ``__str__`` representation now
26157  includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
26158  Patch by Michael Lazar.
26159
26160- bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
26161  boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
26162  Khatri.
26163
26164- bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
26165
26166- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
26167  threads when calling mmap.mmap(), os.urandom(), and random.seed().  Patch
26168  by Nir Soffer.
26169
26170- bpo-27683: Fix a regression in :mod:`ipaddress` that result of
26171  :meth:`hosts` is empty when the network is constructed by a tuple
26172  containing an integer mask and only 1 bit left for addresses.
26173
26174- bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
26175  subprocess if another low descriptor is closed.
26176
26177- bpo-31908: Fix output of cover files for ``trace`` module command-line
26178  tool. Previously emitted cover files only when ``--missing`` option was
26179  used. Patch by Michael Selik.
26180
26181- bpo-31457: If nested log adapters are used, the inner ``process()``
26182  methods are no longer omitted.
26183
26184- bpo-16865: Support arrays >=2GiB in :mod:`ctypes`.  Patch by Segev Finer.
26185
26186- bpo-31238: pydoc: the stop() method of the private ServerThread class now
26187  waits until DocServer.serve_until_quit() completes and then explicitly
26188  sets its docserver attribute to None to break a reference cycle.
26189
26190Documentation
26191-------------
26192
26193- bpo-33503: Fix broken pypi link
26194
26195- bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
26196
26197- bpo-33378: Add Korean language switcher for https://docs.python.org/3/
26198
26199- bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
26200  just any value.
26201
26202- bpo-33201: Modernize documentation for writing C extension types.
26203
26204- bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
26205  ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
26206  missed in the document.
26207
26208- bpo-33126: Document PyBuffer_ToContiguous().
26209
26210- bpo-27212: Modify documentation for the :func:`islice` recipe to consume
26211  initial values up to the start index.
26212
26213- bpo-28247: Update :mod:`zipapp` documentation to describe how to make
26214  standalone applications.
26215
26216- bpo-18802: Documentation changes for ipaddress.  Patch by Jon Foster and
26217  Berker Peksag.
26218
26219- bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
26220  implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
26221
26222- bpo-8243: Add a note about curses.addch and curses.addstr exception
26223  behavior when writing outside a window, or pad.
26224
26225- bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
26226  flags for ssl.SSLContext.verify_mode.
26227
26228Tests
26229-----
26230
26231- bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
26232  might be due to running on ZFS.
26233
26234- bpo-19417: Add test_bdb.py.
26235
26236Build
26237-----
26238
26239- bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
26240  ``OPT``. This option emitted annoying warnings when building extension
26241  modules written in C++.
26242
26243- bpo-33614: Ensures module definition files for the stable ABI on Windows
26244  are correctly regenerated.
26245
26246- bpo-33522: Enable CI builds on Visual Studio Team Services at
26247  https://python.visualstudio.com/cpython
26248
26249- bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing
26250  warnings about function casts like casting to PyCFunction in method
26251  definition lists.
26252
26253- bpo-33394: Enable the verbose build for extension modules, when GNU make
26254  is passed macros on the command line.
26255
26256Windows
26257-------
26258
26259- bpo-33184: Update Windows installer to OpenSSL 1.0.2o.
26260
26261macOS
26262-----
26263
26264- bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o.
26265
26266IDLE
26267----
26268
26269- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
26270  Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
26271  unchanged, and a monitor resolution greater than 96 DPI, this should make
26272  text and lines sharper.  It should otherwise have no effect.
26273
26274- bpo-33768: Clicking on a context line moves that line to the top of the
26275  editor window.
26276
26277- bpo-33763: IDLE: Use read-only text widget for code context instead of
26278  label widget.
26279
26280- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
26281  and scrollbar slider moved text by a fixed number of pixels, resulting in
26282  partial lines at the top of the editor box.  The change also applies to
26283  the shell and grep output windows, but not to read-only text views.
26284
26285- bpo-33679: Enable theme-specific color configuration for Code Context. Use
26286  the Highlights tab to see the setting for built-in themes or add settings
26287  to custom themes.
26288
26289- bpo-33642: Display up to maxlines non-blank lines for Code Context. If
26290  there is no current context, show a single blank line.
26291
26292- bpo-33628: IDLE: Cleanup codecontext.py and its test.
26293
26294- bpo-33564: IDLE's code context now recognizes async as a block opener.
26295
26296- bpo-29706: IDLE now colors async and await as keywords in 3.6. They become
26297  full keywords in 3.7.
26298
26299- bpo-21474: Update word/identifier definition from ascii to unicode. In
26300  text and entry boxes, this affects selection by double-click, movement
26301  left/right by control-left/right, and deletion left/right by
26302  control-BACKSPACE/DEL.
26303
26304- bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
26305  prefix cannot be paired with either 'r' or 'f'. Consistently color as much
26306  of the prefix, starting at the right, as is valid. Revise and extend
26307  colorizer test.
26308
26309- bpo-32831: Add docstrings and tests for codecontext.
26310
26311Tools/Demos
26312-----------
26313
26314- bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
26315  docstrings and translatable strings, and rejects bytes literals and
26316  f-string expressions.
26317
26318- bpo-31920: Fixed handling directories as arguments in the ``pygettext``
26319  script. Based on patch by Oleg Krasnikov.
26320
26321- bpo-29673: Fix pystackv and pystack gdbinit macros.
26322
26323- bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
26324  automatic backup creation (files with ``~`` suffix).
26325
26326- bpo-31583: Fix 2to3 for using with --add-suffix option but without
26327  --output-dir option for relative path to files in current directory.
26328
26329C API
26330-----
26331
26332- bpo-32374: Document that m_traverse for multi-phase initialized modules
26333  can be called with m_state=NULL, and add a sanity check
26334
26335
26336What's New in Python 3.6.5 final?
26337=================================
26338
26339*Release date: 2018-03-28*
26340
26341Tests
26342-----
26343
26344- bpo-32872: Avoid regrtest compatibility issue with namespace packages.
26345
26346Build
26347-----
26348
26349- bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
26350
26351
26352What's New in Python 3.6.5 release candidate 1?
26353===============================================
26354
26355*Release date: 2018-03-13*
26356
26357Security
26358--------
26359
26360- bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
26361
26362- bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
26363  backtracking. These regexes formed potential DOS vectors (REDOS). They
26364  have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
26365  by Jamie Davis.
26366
26367Core and Builtins
26368-----------------
26369
26370- bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
26371
26372- bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
26373
26374- bpo-32889: Update Valgrind suppression list to account for the rename of
26375  ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
26376
26377- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
26378  over (next command) native coroutines. Patch by Pablo Galindo.
26379
26380- bpo-32685: Improve suggestion when the Python 2 form of print statement is
26381  either present on the same line as the header of a compound statement or
26382  else terminated by a semi-colon instead of a newline. Patch by Nitish
26383  Chandra.
26384
26385- bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
26386  write out-of-bound errors when using customized decode error handlers.
26387
26388- bpo-26163: Improved frozenset() hash to create more distinct hash values
26389  when faced with datasets containing many similar values.
26390
26391- bpo-27169: The ``__debug__`` constant is now optimized out at compile
26392  time. This fixes also bpo-22091.
26393
26394- bpo-32329: ``sys.flags.hash_randomization`` is now properly set to 0 when
26395  hash randomization is turned off by ``PYTHONHASHSEED=0``.
26396
26397- bpo-30416: The optimizer is now protected from spending much time doing
26398  complex calculations and consuming much memory for creating large
26399  constants in constant folding.
26400
26401- bpo-18533: ``repr()`` on a dict containing its own ``values()`` or
26402  ``items()`` no longer raises ``RecursionError``; OrderedDict similarly.
26403  Instead, use ``...``, as for other recursive structures.  Patch by Ben
26404  North.
26405
26406- bpo-32028: Leading whitespace is now correctly ignored when generating
26407  suggestions for converting Py2 print statements to Py3 builtin print
26408  function calls. Patch by Sanyam Khurana.
26409
26410- bpo-32137: The repr of deeply nested dict now raises a RecursionError
26411  instead of crashing due to a stack overflow.
26412
26413Library
26414-------
26415
26416- bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
26417  and ``**kwargs`` in function signatures.
26418
26419- bpo-31804: Avoid failing in multiprocessing.Process if the standard
26420  streams are closed or None at exit.
26421
26422- bpo-33037: Skip sending/receiving data after SSL transport closing.
26423
26424- bpo-30353: Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW.
26425
26426- bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
26427
26428- bpo-32969: Expose several missing constants in zlib and fix corresponding
26429  documentation.
26430
26431- bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
26432  by Joffrey Fuhrer.
26433
26434- bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
26435
26436- bpo-32922: dbm.open() now encodes filename with the filesystem encoding
26437  rather than default encoding.
26438
26439- bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
26440  syscall exists or not.
26441
26442- bpo-21060: Rewrite confusing message from setup.py upload from "No dist
26443  file created in earlier command" to the more helpful "Must create and
26444  upload files in one command".
26445
26446- bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
26447  :exc:`ValueError` instead of canceling the first scheduled function.
26448  Patch by Cheryl Sabella.
26449
26450- bpo-32852: Make sure sys.argv remains as a list when running trace.
26451
26452- bpo-32841: Fixed `asyncio.Condition` issue which silently ignored
26453  cancellation after notifying and cancelling a conditional lock. Patch by
26454  Bar Harel.
26455
26456- bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
26457  (Contributed by Oren Milman)
26458
26459- bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
26460  only the last field is quoted.  Patch by Jake Davis.
26461
26462- bpo-32394: socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version
26463  Windows during run-time.
26464
26465- bpo-32777: Fix a rare but potential pre-exec child process deadlock in
26466  subprocess on POSIX systems when marking file descriptors inheritable on
26467  exec in the child process.  This bug appears to have been introduced in
26468  3.4.
26469
26470- bpo-32647: The ctypes module used to depend on indirect linking for
26471  dlopen. The shared extension is now explicitly linked against libdl on
26472  platforms with dl.
26473
26474- bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
26475  and locking the same lock multiple times, without it being free. Patch by
26476  Bar Harel.
26477
26478- bpo-32727: Do not include name field in SMTP envelope from address. Patch
26479  by Stéphane Wirtel
26480
26481- bpo-27931: Fix email address header parsing error when the username is an
26482  empty quoted string. Patch by Xiang Zhang.
26483
26484- bpo-32304: distutils' upload command no longer corrupts tar files ending
26485  with a CR byte, and no longer tries to convert CR to CRLF in any of the
26486  upload text fields.
26487
26488- bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware
26489  address is encountered.
26490
26491- bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
26492  chunk is not found. Patch by Zackery Spytz.
26493
26494- bpo-32555: On FreeBSD and Solaris, os.strerror() now always decode the
26495  byte string from the current locale encoding, rather than using
26496  ASCII/surrogateescape in some cases.
26497
26498- bpo-32521: The nis module is now compatible with new libnsl and headers
26499  location.
26500
26501- bpo-32473: Improve ABCMeta._dump_registry() output readability
26502
26503- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
26504  library in nis module.
26505
26506- bpo-32228: Ensure that ``truncate()`` preserves the file position (as
26507  reported by ``tell()``) after writes longer than the buffer size.
26508
26509- bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on
26510  interpreter shutdown.
26511
26512- bpo-32185: The SSL module no longer sends IP addresses in SNI TLS
26513  extension on platforms with OpenSSL 1.0.2+ or inet_pton.
26514
26515- bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id
26516  (scope) to lower case for scoped IPv6 addresses in hostnames now.
26517
26518- bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary
26519  compatible with CRT v140.
26520
26521- bpo-32255: A single empty field is now always quoted when written into a
26522  CSV file. This allows to distinguish an empty row from a row consisting of
26523  a single empty field. Patch by Licht Takeuchi.
26524
26525- bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on
26526  platforms where ``chmod(..., follow_symlinks=False)`` is not supported.
26527  Patch by Anthony Sottile.
26528
26529- bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
26530  list'.
26531
26532- bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
26533
26534- bpo-31900: The :func:`locale.localeconv` function now sets temporarily the
26535  ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
26536  ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII
26537  or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the
26538  ``LC_CTYPE`` locale. This temporary change affects other threads. Same
26539  change for the :meth:`str.format` method when formatting a number
26540  (:class:`int`, :class:`float`, :class:`float` and subclasses) with the
26541  ``n`` type (ex: ``'{:n}'.format(1234)``).
26542
26543- bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now
26544  works even if the ``os`` module still is not imported.
26545
26546Documentation
26547-------------
26548
26549- bpo-17232: Clarify docs for -O and -OO.  Patch by Terry Reedy.
26550
26551- bpo-32800: Update link to w3c doc for xml default namespaces.
26552
26553- bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
26554  method raises :exc:`AttributeError`.
26555
26556- bpo-32614: Modify RE examples in documentation to use raw strings to
26557  prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
26558  the deprecation.
26559
26560- bpo-31972: Improve docstrings for `pathlib.PurePath` subclasses.
26561
26562- bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and
26563  their C-API counterparts regarding which type of events are received in
26564  each function. Patch by Pablo Galindo Salgado.
26565
26566Tests
26567-----
26568
26569- bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
26570  of ``KqueueSelector`` loop was not being closed.
26571
26572- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
26573
26574- bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core
26575  dump files when testing crashes. getrlimit() returns zero on success.
26576
26577- bpo-31518: Debian Unstable has disabled TLS 1.0 and 1.1 for
26578  SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or
26579  PROTOCOL_TLSv1_2 to make them pass on Debian.
26580
26581Build
26582-----
26583
26584- bpo-32635: Fix segfault of the crypt module when libxcrypt is provided
26585  instead of libcrypt at the system.
26586
26587Windows
26588-------
26589
26590- bpo-33016: Fix potential use of uninitialized memory in
26591  nt._getfinalpathname
26592
26593- bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
26594  directory is set to a UNC path.
26595
26596- bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
26597
26598- bpo-32409: Ensures activate.bat can handle Unicode contents.
26599
26600- bpo-32457: Improves handling of denormalized executable path when
26601  launching Python.
26602
26603- bpo-32370: Use the correct encoding for ipconfig output in the uuid
26604  module. Patch by Segev Finer.
26605
26606- bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
26607  treating the ``PrintNameOffset`` field of the reparse data buffer as a
26608  number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
26609
26610- bpo-32588: Create standalone _distutils_findvs module.
26611
26612macOS
26613-----
26614
26615- bpo-32726: Provide an additional, more modern macOS installer variant that
26616  supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied
26617  third-party libraries to OpenSSL 1.0.2n, XZ 5.2.3, and SQLite 3.22.0. The
26618  10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.8.
26619
26620IDLE
26621----
26622
26623- bpo-32984: Set ``__file__`` while running a startup file.  Like Python,
26624  IDLE optionally runs one startup file in the Shell window before
26625  presenting the first interactive input prompt.  For IDLE, ``-s`` runs a
26626  file named in environmental variable  :envvar:`IDLESTARTUP` or
26627  :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``.  Python sets
26628  ``__file__`` to the startup file name before running the file and unsets
26629  it before the first prompt.  IDLE now does the same when run normally,
26630  without the ``-n`` option.
26631
26632- bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
26633
26634- bpo-32916: Change ``str`` to ``code`` in pyparse.
26635
26636- bpo-32905: Remove unused code in pyparse module.
26637
26638- bpo-32874: Add tests for pyparse.
26639
26640- bpo-32837: Using the system and place-dependent default encoding for
26641  open() is a bad idea for IDLE's system and location-independent files.
26642
26643- bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
26644  test test_file_buttons() only looks at initial ascii-only lines, but
26645  failed on systems where open() defaults to 'ascii' because readline()
26646  internally reads and decodes far enough ahead to encounter a non-ascii
26647  character in CREDITS.txt.
26648
26649- bpo-32765: Update configdialog General tab docstring to add new widgets to
26650  the widget list.
26651
26652Tools/Demos
26653-----------
26654
26655- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
26656  pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
26657  lib2to3 work when run from a zipfile.
26658
26659- bpo-32222: Fix pygettext not extracting docstrings for functions with type
26660  annotated arguments. Patch by Toby Harradine.
26661
26662C API
26663-----
26664
26665- bpo-29084: Undocumented C API for OrderedDict has been excluded from the
26666  limited C API. It was added by mistake and actually never worked in the
26667  limited C API.
26668
26669
26670What's New in Python 3.6.4 final?
26671=================================
26672
26673*Release date: 2017-12-18*
26674
26675There were no new code changes in version 3.6.4 since v3.6.4rc1.
26676
26677
26678
26679What's New in Python 3.6.4 release candidate 1?
26680===============================================
26681
26682*Release date: 2017-12-05*
26683
26684Core and Builtins
26685-----------------
26686
26687- bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code
26688  object constructor based on freevars and cellvars, rather than needing to
26689  be set correctly by the caller. This ensures it will be cleared
26690  automatically when additional cell references are injected into a modified
26691  code object and function.
26692
26693- bpo-31949: Fixed several issues in printing tracebacks
26694  (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now
26695  suppresses printing tracebacks. Setting sys.tracebacklimit to None now
26696  causes using the default limit. Setting sys.tracebacklimit to an integer
26697  larger than LONG_MAX now means using the limit LONG_MAX rather than the
26698  default limit. Fixed integer overflows in the case of more than ``2**31``
26699  traceback items on Windows. Fixed output errors handling.
26700
26701- bpo-30696: Fix the interactive interpreter looping endlessly when no
26702  memory.
26703
26704- bpo-20047: Bytearray methods partition() and rpartition() now accept only
26705  bytes-like objects as separator, as documented.  In particular they now
26706  raise TypeError rather of returning a bogus result when an integer is
26707  passed as a separator.
26708
26709- bpo-31852: Fix a segmentation fault caused by a combination of the async
26710  soft keyword and continuation lines.
26711
26712- bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of
26713  ``__import__()`` or the ``__all__`` attribute of the module contain bytes
26714  instances.
26715
26716- bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in
26717  codecs.escape_decode() when decode an escaped non-ascii byte.
26718
26719- bpo-28603: Print the full context/cause chain of exceptions on interpreter
26720  exit, even if an exception in the chain is unhashable or compares equal to
26721  later ones. Patch by Zane Bitter.
26722
26723- bpo-31786: Fix timeout rounding in the select module to round correctly
26724  negative timeouts between -1.0 and 0.0. The functions now block waiting
26725  for events as expected. Previously, the call was incorrectly non-blocking.
26726  Patch by Pablo Galindo.
26727
26728- bpo-31642: Restored blocking "from package import module" by setting
26729  sys.modules["package.module"] to None.
26730
26731- bpo-31626: Fixed a bug in debug memory allocator.  There was a write to
26732  freed memory after shrinking a memory block.
26733
26734- bpo-31619: Fixed a ValueError when convert a string with large number of
26735  underscores to integer with binary base.
26736
26737- bpo-31592: Fixed an assertion failure in Python parser in case of a bad
26738  `unicodedata.normalize()`. Patch by Oren Milman.
26739
26740- bpo-31588: Raise a `TypeError` with a helpful error message when class
26741  creation fails due to a metaclass with a bad ``__prepare__()`` method.
26742  Patch by Oren Milman.
26743
26744- bpo-31566: Fix an assertion failure in `_warnings.warn()` in case of a bad
26745  ``__name__`` global. Patch by Oren Milman.
26746
26747- bpo-31505: Fix an assertion failure in `json`, in case
26748  `_json.make_encoder()` received a bad `encoder()` argument. Patch by Oren
26749  Milman.
26750
26751- bpo-31492: Fix assertion failures in case of failing to import from a
26752  module with a bad ``__name__`` attribute, and in case of failing to access
26753  an attribute of such a module. Patch by Oren Milman.
26754
26755- bpo-31490: Fix an assertion failure in `ctypes` class definition, in case
26756  the class has an attribute whose name is specified in ``_anonymous_`` but
26757  not in ``_fields_``. Patch by Oren Milman.
26758
26759- bpo-31478: Fix an assertion failure in `_random.Random.seed()` in case the
26760  argument has a bad ``__abs__()`` method. Patch by Oren Milman.
26761
26762- bpo-31315: Fix an assertion failure in imp.create_dynamic(), when
26763  spec.name is not a string. Patch by Oren Milman.
26764
26765- bpo-31311: Fix a crash in the ``__setstate__()`` method of
26766  `ctypes._CData`, in case of a bad ``__dict__``. Patch by Oren Milman.
26767
26768- bpo-31293: Fix crashes in true division and multiplication of a timedelta
26769  object by a float with a bad as_integer_ratio() method. Patch by Oren
26770  Milman.
26771
26772- bpo-31285: Fix an assertion failure in `warnings.warn_explicit`, when the
26773  return value of the received loader's get_source() has a bad splitlines()
26774  method. Patch by Oren Milman.
26775
26776- bpo-30817: `PyErr_PrintEx()` clears now the ignored exception that may be
26777  raised by `_PySys_SetObjectId()`, for example when no memory.
26778
26779Library
26780-------
26781
26782- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
26783  instances of generic classes, improve interaction of ``__init_subclass__``
26784  with generics. Original PRs by Ivan Levkivskyi.
26785
26786- bpo-27240: The header folding algorithm for the new email policies has
26787  been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182.  In
26788  particular, RFC2231 folding is now done correctly.
26789
26790- bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL
26791  when getting the file size. Fixed hang of all threads with inaccessible
26792  NFS server. Patch by Nir Soffer.
26793
26794- bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return
26795  ``None`` when the value of property is ``VT_EMPTY``.  Initial patch by
26796  Mark Mc Mahon.
26797
26798- bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the
26799  :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>`
26800  method. Initial patch by Robin Wellner.
26801
26802- bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception
26803  message when it couldn't open or create an MSI file.  Initial patch by
26804  William Tisäter.
26805
26806- bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n*
26807  characters/bytes for non-negative *n*. This makes it compatible with
26808  ``read()`` methods of other file-like objects.
26809
26810- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
26811  Identical objects will be saved only once. Equal references will be load
26812  as identical objects. Added support for saving and loading recursive data
26813  structures.
26814
26815- bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError
26816  pickleable.
26817
26818- bpo-32015: Fixed the looping of asyncio in the case of reconnection the
26819  socket during waiting async read/write from/to the socket.
26820
26821- bpo-32011: Restored support of loading marshal files with the TYPE_INT64
26822  code. These files can be produced in Python 2.7.
26823
26824- bpo-31970: Reduce performance overhead of asyncio debug mode.
26825
26826- bpo-9678: Fixed determining the MAC address in the uuid module: Using
26827  ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
26828  OpenBSD. Based on patch by Takayuki Shimizukawa.
26829
26830- bpo-30057: Fix potential missed signal in signal.signal().
26831
26832- bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian
26833  platforms. Patch by Jack O'Connor.
26834
26835- bpo-31927: Fixed compilation of the socket module on NetBSD 8.  Fixed
26836  assertion failure or reading arbitrary data when parse a AF_BLUETOOTH
26837  address on NetBSD and DragonFly BSD.
26838
26839- bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse()
26840  when the size of types chtype or mmask_t is less than the size of C long.
26841  curses.box() now accepts characters as arguments.  Based on patch by Steve
26842  Fink.
26843
26844- bpo-31897: plistlib now catches more errors when read binary plists and
26845  raises InvalidFileException instead of unexpected exceptions.
26846
26847- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
26848  by Masayuki Yamamoto.
26849
26850- bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and
26851  NetBSD. Fixed the comparison of the kqueue_event objects.
26852
26853- bpo-31891: Fixed building the curses module on NetBSD.
26854
26855- bpo-28416: Instances of pickle.Pickler subclass with the persistent_id()
26856  method and pickle.Unpickler subclass with the persistent_load() method no
26857  longer create reference cycles.
26858
26859- bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed
26860  or None.
26861
26862- bpo-31457: If nested log adapters are used, the inner ``process()``
26863  methods are no longer omitted.
26864
26865- bpo-31457: The ``manager`` property on LoggerAdapter objects is now
26866  properly settable.
26867
26868- bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire()
26869  and socket.socket.settimeout() to round correctly negative timeouts
26870  between -1.0 and 0.0. The functions now block waiting for events as
26871  expected. Previously, the call was incorrectly non-blocking. Patch by
26872  Pablo Galindo.
26873
26874- bpo-28603: traceback: Fix a TypeError that occurred during printing of
26875  exception tracebacks when either the current exception or an exception in
26876  its context/cause chain is unhashable. Patch by Zane Bitter.
26877
26878- bpo-30058: Fixed buffer overflow in select.kqueue.control().
26879
26880- bpo-31770: Prevent a crash when calling the ``__init__()`` method of a
26881  ``sqlite3.Cursor`` object more than once. Patch by Oren Milman.
26882
26883- bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII
26884  characters. Now it uses ``-i`` regular expression local flag to avoid
26885  non-ASCII characters.
26886
26887- bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the
26888  ``Cursor`` object is uninitialized. Patch by Oren Milman.
26889
26890- bpo-31752: Fix possible crash in timedelta constructor called with custom
26891  integers.
26892
26893- bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM
26894  exceptions.
26895
26896- bpo-31728: Prevent crashes in `_elementtree` due to unsafe cleanup of
26897  `Element.text` and `Element.tail`. Patch by Oren Milman.
26898
26899- bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get
26900  pollers timeout
26901
26902- bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in
26903  asyncio module. This method was previously modifying a wrong reference to
26904  the protocol.
26905
26906- bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split()
26907  when pass a string larger than 2 GiB.
26908
26909- bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo().
26910
26911- bpo-30806: Fix the string representation of a netrc object.
26912
26913- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
26914  earlier.
26915
26916- bpo-25351: Avoid venv activate failures with undefined variables
26917
26918- bpo-25532: inspect.unwrap() will now only try to unwrap an object
26919  sys.getrecursionlimit() times, to protect against objects which create a
26920  new object on every attribute access.
26921
26922- bpo-30347: Stop crashes when concurrently iterate over itertools.groupby()
26923  iterators.
26924
26925- bpo-31516: ``threading.current_thread()`` should not return a dummy thread
26926  at shutdown.
26927
26928- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
26929  bootstrapping has failed.
26930
26931- bpo-31482: ``random.seed()`` now works with bytes in version=1
26932
26933- bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for
26934  arbitrary negative timeouts on all OSes where it can only be a
26935  non-negative integer or -1. Patch by Riccardo Coccioli.
26936
26937- bpo-31310: multiprocessing's semaphore tracker should be launched again if
26938  crashed.
26939
26940- bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and
26941  other user interruptions. If it crashes, restart it when necessary.
26942
26943Documentation
26944-------------
26945
26946- bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket
26947  versionadded marker.
26948
26949- bpo-31537: Fix incorrect usage of ``get_history_length`` in readline
26950  documentation example code. Patch by Brad Smith.
26951
26952- bpo-30085: The operator functions without double underscores are preferred
26953  for clarity. The one with underscores are only kept for
26954  back-compatibility.
26955
26956Tests
26957-----
26958
26959- bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on
26960  APFS.
26961
26962- bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5.
26963  The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged
26964  into the kernel 4.5.
26965
26966- bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the
26967  names sample to always test the same files. It prevents false alarms when
26968  hunting reference leaks.
26969
26970- bpo-30695: Add the `set_nomemory(start, stop)` and `remove_mem_hooks()`
26971  functions to the _testcapi module.
26972
26973Build
26974-----
26975
26976- bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the
26977  sysroot paths when cross-compiling.
26978
26979- bpo-31957: Fixes Windows SDK version detection when building for Windows.
26980
26981- bpo-31609: Fixes quotes in PCbuild/clean.bat
26982
26983- bpo-31934: Abort the build when building out of a not clean source tree.
26984
26985- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when
26986  there was more than one function and/or method in a .c file with the same
26987  name.
26988
26989- bpo-28791: Update Windows builds to use SQLite 3.21.0.
26990
26991- bpo-28791: Update OS X installer to use SQLite 3.21.0.
26992
26993- bpo-22140: Prevent double substitution of prefix in python-config.sh.
26994
26995- bpo-31536: Avoid wholesale rebuild after `make regen-all` if nothing
26996  changed.
26997
26998Windows
26999-------
27000
27001- bpo-1102: Return ``None`` when ``View.Fetch()`` returns
27002  ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by
27003  Anthony Tuininga.
27004
27005- bpo-31944: Fixes Modify button in Apps and Features dialog.
27006
27007macOS
27008-----
27009
27010- bpo-31392: Update macOS installer to use OpenSSL 1.0.2m
27011
27012IDLE
27013----
27014
27015- bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event
27016  handling is driven by IDLE's run loop, a confusing and distracting
27017  queue.EMPTY traceback context is no longer added to tk event exception
27018  tracebacks.  The traceback is now the same as when event handling is
27019  driven by user code.  Patch based on a suggestion by Serhiy Storchaka.
27020
27021- bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet
27022  in configdialog was replaced by ttk.Notebook.
27023
27024- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
27025  mostly by Cheryl Sabella.
27026
27027- bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor
27028  and output windows only see an empty last prompt line.  This simplifies
27029  the code and fixes a minor bug when newline is inserted. Sys.ps1, if
27030  present, is read on Shell start-up, but is not set or changed.
27031
27032- bpo-31860: The font sample in the IDLE configuration dialog is now
27033  editable. Changes persist while IDLE remains open
27034
27035- bpo-31836: Test_code_module now passes if run after test_idle, which sets
27036  ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not.
27037  Test_code_module now properly tests both behaviors.  Ditto for ps2.
27038
27039- bpo-28603: Fix a TypeError that caused a shell restart when printing a
27040  traceback that includes an exception that is unhashable. Patch by Zane
27041  Bitter.
27042
27043- bpo-13802: Use non-Latin characters in the IDLE's Font settings sample.
27044  Even if one selects a font that defines a limited subset of the unicode
27045  Basic Multilingual Plane, tcl/tk will use other fonts that define a
27046  character. The expanded example give users of non-Latin characters a
27047  better idea of what they might see in IDLE's shell and editors. To make
27048  room for the expanded sample, frames on the Font tab are re-arranged. The
27049  Font/Tabs help explains a bit about the additions.
27050
27051- bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget
27052  instead of an flist with a root widget opens the option of creating a
27053  browser frame that is only part of a window.  Passing a full file name
27054  instead of pieces assumed to come from a .py file opens the possibility of
27055  browsing python files that do not end in .py.
27056
27057- bpo-31649: IDLE - Make _htest, _utest parameters keyword only.
27058
27059- bpo-31559: Remove test order dependence in idle_test.test_browser.
27060
27061- bpo-31459: Rename IDLE's module browser from Class Browser to Module
27062  Browser. The original module-level class and method browser became a
27063  module browser, with the addition of module-level functions, years ago.
27064  Nested classes and functions were added yesterday.  For
27065  back-compatibility, the virtual event <<open-class-browser>>, which
27066  appears on the Keys tab of the Settings dialog, is not changed. Patch by
27067  Cheryl Sabella.
27068
27069- bpo-31500: Default fonts now are scaled on HiDPI displays.
27070
27071- bpo-1612262: IDLE module browser now shows nested classes and functions.
27072  Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
27073  respectively.
27074
27075Tools/Demos
27076-----------
27077
27078- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
27079  remove the ``LOCALE`` option since it doesn't work with string patterns in
27080  Python 3. Patch by Christoph Sarnowski.
27081
27082C API
27083-----
27084
27085- bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in
27086  a non-Python thread before PyEval_InitThreads(), only call
27087  PyEval_InitThreads() after calling PyThreadState_New() to fix a crash.
27088
27089- bpo-31532: Fix memory corruption due to allocator mix in getpath.c between
27090  Py_GetPath() and Py_SetPath()
27091
27092- bpo-30697: The `PyExc_RecursionErrorInst` singleton is removed and
27093  `PyErr_NormalizeException()` does not use it anymore. This singleton is
27094  persistent and its members being never cleared may cause a segfault during
27095  finalization of the interpreter. See also issue #22898.
27096
27097
27098What's New in Python 3.6.3 final?
27099=================================
27100
27101*Release date: 2017-10-03*
27102
27103Library
27104-------
27105
27106- bpo-31641: Re-allow arbitrary iterables in
27107  `concurrent.futures.as_completed()`. Fixes regression in 3.6.3rc1.
27108
27109Build
27110-----
27111
27112- bpo-31662: Fix typos in Windows ``uploadrelease.bat`` script. Fix Windows
27113  Doc build issues in ``Doc/make.bat``.
27114
27115- bpo-31423: Fix building the PDF documentation with newer versions of
27116  Sphinx.
27117
27118
27119What's New in Python 3.6.3 release candidate 1?
27120===============================================
27121
27122*Release date: 2017-09-18*
27123
27124Security
27125--------
27126
27127- bpo-29781: SSLObject.version() now correctly returns None when handshake
27128  over BIO has not been performed yet.
27129
27130- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
27131  get security fixes.
27132
27133Core and Builtins
27134-----------------
27135
27136- bpo-31471: Fix an assertion failure in `subprocess.Popen()` on Windows, in
27137  case the env argument has a bad keys() method. Patch by Oren Milman.
27138
27139- bpo-31418: Fix an assertion failure in `PyErr_WriteUnraisable()` in case
27140  of an exception with a bad ``__module__`` attribute. Patch by Oren Milman.
27141
27142- bpo-31416: Fix assertion failures in case of a bad warnings.filters or
27143  warnings.defaultaction. Patch by Oren Milman.
27144
27145- bpo-31411: Raise a TypeError instead of SystemError in case
27146  warnings.onceregistry is not a dictionary. Patch by Oren Milman.
27147
27148- bpo-31373: Fix several possible instances of undefined behavior due to
27149  floating-point demotions.
27150
27151- bpo-30465: Location information (``lineno`` and ``col_offset``) in
27152  f-strings is now (mostly) correct.  This fixes tools like flake8 from
27153  showing warnings on the wrong line (typically the first line of the file).
27154
27155- bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev().
27156  GNU C libray plans to remove the functions from sys/types.h.
27157
27158- bpo-31291: Fix an assertion failure in `zipimport.zipimporter.get_data` on
27159  Windows, when the return value of ``pathname.replace('/','\\')`` isn't a
27160  string. Patch by Oren Milman.
27161
27162- bpo-31271: Fix an assertion failure in the write() method of
27163  `io.TextIOWrapper`, when the encoder doesn't return a bytes object. Patch
27164  by Oren Milman.
27165
27166- bpo-31243: Fix a crash in some methods of `io.TextIOWrapper`, when the
27167  decoder's state is invalid. Patch by Oren Milman.
27168
27169- bpo-30721: ``print`` now shows correct usage hint for using Python 2
27170  redirection syntax.  Patch by Sanyam Khurana.
27171
27172- bpo-31070: Fix a race condition in importlib _get_module_lock().
27173
27174- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
27175  doesn't call ``PyObject_GC_UnTrack()``.
27176
27177- bpo-31071: Avoid masking original TypeError in call with * unpacking when
27178  other arguments are passed.
27179
27180- bpo-30978: str.format_map() now passes key lookup exceptions through.
27181  Previously any exception was replaced with a KeyError exception.
27182
27183- bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
27184
27185- bpo-30876: Relative import from unloaded package now reimports the package
27186  instead of failing with SystemError.  Relative import from non-package now
27187  fails with ImportError rather than SystemError.
27188
27189- bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from
27190  signal handler, to avoid calling signal-unsafe functions. The tests I'm
27191  adding here fail without the rest of the patch, on Linux and OS X. This
27192  means our signal delivery logic had defects (some signals could be lost).
27193
27194- bpo-30765: Avoid blocking in pthread_mutex_lock() when
27195  PyThread_acquire_lock() is asked not to block.
27196
27197- bpo-31161: Make sure the 'Missing parentheses' syntax error message is
27198  only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
27199
27200- bpo-30814: Fixed a race condition when import a submodule from a package.
27201
27202- bpo-30597: ``print`` now shows expected input in custom error message when
27203  used as a Python 2 statement. Patch by Sanyam Khurana.
27204
27205Library
27206-------
27207
27208- bpo-31499: xml.etree: Fix a crash when a parser is part of a reference
27209  cycle.
27210
27211- bpo-28556: typing.get_type_hints now finds the right globalns for classes
27212  and modules by default (when no ``globalns`` was specified by the caller).
27213
27214- bpo-28556: Speed improvements to the ``typing`` module.  Original PRs by
27215  Ivan Levkivskyi and Mitar.
27216
27217- bpo-31544: The C accelerator module of ElementTree ignored exceptions
27218  raised when looking up TreeBuilder target methods in XMLParser().
27219
27220- bpo-31234: socket.create_connection() now fixes manually a reference
27221  cycle: clear the variable storing the last exception on success.
27222
27223- bpo-31457: LoggerAdapter objects can now be nested.
27224
27225- bpo-31400: Improves SSL error handling to avoid losing error numbers.
27226
27227- bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a
27228  context cannot be instantiated.
27229
27230- bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of
27231  data. This fixes support for all bytes-like object. It is also more
27232  efficient and avoids costly copies.
27233
27234- bpo-31178: Fix string concatenation bug in rare error path in the
27235  subprocess module
27236
27237- bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up
27238  to 10% faster.
27239
27240- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
27241  partial characters for UTF-8 input (libexpat bug 115):
27242  https://github.com/libexpat/libexpat/issues/115
27243
27244- bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
27245
27246- bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to
27247  have a non repr() based thread name by default when no thread_name_prefix
27248  is supplied. They will now identify themselves as
27249  "ThreadPoolExecutor-y_n".
27250
27251- bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash
27252  functions such as md5 are not available in the linked OpenSSL library.  As
27253  in some special FIPS-140 build environments.
27254
27255- bpo-27144: The ``map()`` and ``as_completed()`` iterators in
27256  ``concurrent.futures`` now avoid keeping a reference to yielded objects.
27257
27258- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
27259  types.
27260
27261- bpo-22536: The subprocess module now sets the filename when
27262  FileNotFoundError is raised on POSIX systems due to the executable or cwd
27263  not being found.
27264
27265- bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor
27266  now breaks a reference cycle between an exception object and the WorkItem
27267  object.
27268
27269- bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using
27270  sys.exc_info() in code handling exceptions.
27271
27272- bpo-30102: The ssl and hashlib modules now call
27273  OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function
27274  detects CPU features and enables optimizations on some CPU architectures
27275  such as POWER8. Patch is based on research from Gustavo Serra Scalet.
27276
27277- bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
27278
27279- bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu
27280  classes. Call the parent destroy() method even if the used attribute
27281  doesn't exist. The LabeledScale.destroy() method now also explicitly
27282  clears label and scale attributes to help the garbage collector to destroy
27283  all widgets.
27284
27285- bpo-31107: Fix `copyreg._slotnames()` mangled attribute calculation for
27286  classes whose name begins with an underscore. Patch by Shane Harvey.
27287
27288- bpo-31061: Fixed a crash when using asyncio and threads.
27289
27290- bpo-30502: Fix handling of long oids in ssl.  Based on patch by Christian
27291  Heimes.
27292
27293- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
27294  contains CR or LF. Patch by Dong-hee Na.
27295
27296- bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader
27297  in non-blocking mode if it succeeded to acquire the lock but the acquire
27298  took longer than the timeout.
27299
27300- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
27301  builtin functions.  Patch by Aaron Gallagher.
27302
27303- bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
27304
27305- bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across
27306  instances of ``OptionMenu``.
27307
27308- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
27309  thread completes, even if the thread was started by the same process which
27310  created the queue.
27311
27312- bpo-29854: Fix segfault in readline when using readline's history-size
27313  option.  Patch by Nir Soffer.
27314
27315- bpo-30319: socket.close() now ignores ECONNRESET error.
27316
27317- bpo-30828: Fix out of bounds write in
27318  `asyncio.CFuture.remove_done_callback()`.
27319
27320- bpo-30807: signal.setitimer() may disable the timer when passed a tiny
27321  value. Tiny values (such as 1e-6) are valid non-zero values for
27322  setitimer(), which is specified as taking microsecond-resolution
27323  intervals. However, on some platform, our conversion routine could convert
27324  1e-6 into a zero interval, therefore disabling the timer instead of
27325  (re-)scheduling it.
27326
27327- bpo-30441: Fix bug when modifying os.environ while iterating over it
27328
27329- bpo-30532: Fix email header value parser dropping folding white space in
27330  certain cases.
27331
27332- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
27333  with bytes-like argument.
27334
27335- bpo-30746: Prohibited the '=' character in environment variable names in
27336  ``os.putenv()`` and ``os.spawn*()``.
27337
27338- bpo-29755: Fixed the lgettext() family of functions in the gettext module.
27339  They now always return bytes.
27340
27341Documentation
27342-------------
27343
27344- bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and
27345  ZeroMQSocketHandler examples and adapt them to Python 3.
27346
27347- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
27348  documentation.
27349
27350- bpo-30803: Clarify doc on truth value testing. Original patch by Peter
27351  Thomassen.
27352
27353Tests
27354-----
27355
27356- bpo-31320: Silence traceback in test_ssl
27357
27358- bpo-25674: Remove sha256.tbs-internet.com ssl test
27359
27360- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
27361  version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
27362
27363- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
27364  test suite using --use=all / -u all, exclude tzdata since it makes
27365  test_datetime too slow (15-20 min on some buildbots) which then times out
27366  on some buildbots. Fix also regrtest command line parser to allow passing
27367  -u extralargefile to run test_zipfile64.
27368
27369Build
27370-----
27371
27372- bpo-30854: Fix compile error when compiling --without-threads. Patch by
27373  Masayuki Yamamoto.
27374
27375Windows
27376-------
27377
27378- bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows.
27379
27380- bpo-31340: Change to building with MSVC v141 (included with Visual Studio
27381  2017)
27382
27383- bpo-30581: os.cpu_count() now returns the correct number of processors on
27384  Windows when the number of logical processors is greater than 64.
27385
27386- bpo-30731: Add a missing xmlns to python.manifest so that it matches the
27387  schema.
27388
27389IDLE
27390----
27391
27392- bpo-31493: IDLE code context -- fix code update and font update timers.
27393  Canceling timers prevents a warning message when test_idle completes.
27394
27395- bpo-31488: IDLE - Update non-key options in former extension classes. When
27396  applying configdialog changes, call .reload for each feature class. Change
27397  ParenMatch so updated options affect existing instances attached to
27398  existing editor windows.
27399
27400- bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace
27401  strips more than blank spaces.  Multiline string literals are not skipped.
27402
27403- bpo-31480: IDLE - make tests pass with zzdummy extension disabled by
27404  default.
27405
27406- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
27407  update in the background in order to make live interaction and
27408  experimentation with tkinter applications much easier.
27409
27410- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an
27411  int entry is not the same as deleting and inserting because int('') will
27412  fail.
27413
27414- bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and
27415  Help sections.
27416
27417- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
27418  Move some data and functions from the class to module level. Patch by
27419  Cheryl Sabella.
27420
27421- bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog.
27422
27423- bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About
27424  10 IDLE features were implemented as supposedly optional extensions. Their
27425  different behavior could be confusing or worse for users and not good for
27426  maintenance. Hence the conversion. The main difference for users is that
27427  user configurable key bindings for builtin features are now handled
27428  uniformly. Now, editing a binding in a keyset only affects its value in
27429  the keyset. All bindings are defined together in the system-specific
27430  default keysets in config-extensions.def. All custom keysets are saved as
27431  a whole in config-extension.cfg.  All take effect as soon as one clicks
27432  Apply or Ok. The affected events are '<<force-open-completions>>',
27433  '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>',
27434  '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and
27435  '<<zoom-height>>'.  Any (global) customizations made before 3.6.3 will not
27436  affect their keyset-specific customization after 3.6.3. and vice versa.
27437  Initial patch by Charles Wohlganger.
27438
27439- bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by
27440  Cheryl Sabella.
27441
27442- bpo-31001: Add tests for configdialog highlight tab.  Patch by Cheryl
27443  Sabella.
27444
27445- bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog.  The
27446  slightly modified tests continue to pass.  Patch by Cheryl Sabella.
27447
27448- bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by
27449  Victor Stinner.
27450
27451- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
27452
27453- bpo-19903: IDLE: Calltips use `inspect.signature` instead of
27454  `inspect.getfullargspec`. This improves calltips for builtins converted to
27455  use Argument Clinic. Patch by Louie Lu.
27456
27457- bpo-31083: IDLE - Add an outline of a TabPage class in configdialog.
27458  Update existing classes to match outline. Initial patch by Cheryl Sabella.
27459
27460- bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly
27461  modified tests continue to pass. Patch by Cheryl Sabella.
27462
27463- bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly
27464  modified tests continue to pass. Fix General tests. Patch mostly by Cheryl
27465  Sabella.
27466
27467- bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan
27468  Reedy and Cheryl Sabella.
27469
27470- bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping
27471  methods pertaining to each tab and the buttons will aid writing tests and
27472  improving the tabs and will enable splitting the groups into classes.
27473
27474- bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance
27475  tracers manages pairs consisting of a tk variable and a callback function.
27476  When tracing is turned on, setting the variable calls the function.  Test
27477  coverage for the new class is 100%.
27478
27479- bpo-31003: IDLE: Add more tests for General tab.
27480
27481- bpo-30993: IDLE - Improve configdialog font page and tests. In
27482  configdialog: Document causal pathways in create_font_tab docstring.
27483  Simplify some attribute names. Move set_samples calls to var_changed_font
27484  (idea from Cheryl Sabella).  Move related functions to positions after the
27485  create widgets function. In test_configdialog: Fix test_font_set so not
27486  order dependent.  Fix renamed test_indent_scale so it tests the widget.
27487  Adjust tests for movement of set_samples call.  Add tests for load
27488  functions.  Put all font tests in one class and tab indent tests in
27489  another.  Except for two lines, these tests completely cover the related
27490  functions.
27491
27492- bpo-30981: IDLE -- Add more configdialog font page tests.
27493
27494- bpo-28523: IDLE: replace 'colour' with 'color' in configdialog.
27495
27496- bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from
27497  46% to 96%. Patch by Louie Lu.
27498
27499- bpo-30934: Document coverage details for idlelib tests. Add section to
27500  idlelib/idle-test/README.txt. Include check that branches are taken both
27501  ways. Exclude IDLE-specific code that does not run during unit tests.
27502
27503- bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in
27504  docstrings This will facilitate improving the dialog and splitting up the
27505  class. Original patch by Cheryl Sabella.
27506
27507- bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by
27508  Louie Lu.
27509
27510- bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
27511
27512- bpo-30851: IDLE: Remove unused variables in configdialog.  One is a
27513  duplicate, one is set but cannot be altered by users. Patch by Cheryl
27514  Sabella.
27515
27516- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as
27517  well as mouse. Initial patch by Louie Lu.
27518
27519- bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once.
27520
27521- bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in
27522  config; test. * In config, put dump test code in a function; run it and
27523  unittest in   'if __name__ == '__main__'. * Add class config.ConfigChanges
27524  based on changes_class_v4.py on bpo issue. * Add class
27525  test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise
27526  configdialog to use ConfigChanges; see tracker msg297804. * Revise
27527  test_configdialog to match configdialog changes. * Remove configdialog
27528  functions unused or moved to ConfigChanges. Cheryl Sabella contributed
27529  parts of the patch.
27530
27531- bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by
27532  Cheryl Sabella.
27533
27534- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
27535  tests. Patch by Cheryl Sabella.
27536
27537- bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens'
27538  style to highlight both opener and closer. Make 'default' style, which is
27539  not default, a synonym for 'opener'. Make time-delay work the same with
27540  all styles. Add help for config dialog extensions tab, including help for
27541  parenmatch. Add new tests.  Original patch by Charles Wohlganger.
27542
27543- bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella
27544
27545- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
27546  properly. Original patch by Saimadhav Heblikar.
27547
27548- bpo-29910: IDLE no longer deletes a character after commenting out a
27549  region by a key shortcut.  Add ``return 'break'`` for this and other
27550  potential conflicts between IDLE and default key bindings.
27551
27552- bpo-30728: Review and change idlelib.configdialog names. Lowercase method
27553  and attribute names. Replace 'colour' with 'color', expand overly cryptic
27554  names, delete unneeded underscores. Replace ``import *`` with specific
27555  imports. Patches by Cheryl Sabella.
27556
27557- bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them
27558  with tk. Add tests for all 3 validation functions. Original patch by G
27559  Polo.  Tests added by Cheryl Sabella.
27560
27561Tools/Demos
27562-----------
27563
27564- bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared
27565  builds now, too.  :pep:`523` introduced _PyEval_EvalFrameDefault which
27566  inlines PyEval_EvalFrameEx on non-debug shared builds.  This broke the
27567  ability to use py-bt, py-up, and a few other Python-specific gdb
27568  integrations. The problem is fixed by only looking for
27569  _PyEval_EvalFrameDefault frames in python-gdb.py.  Original patch by Bruno
27570  "Polaco" Penteado.
27571
27572
27573What's New in Python 3.6.2 final?
27574=================================
27575
27576*Release date: 2017-07-17*
27577
27578No changes since release candidate 2
27579
27580
27581
27582What's New in Python 3.6.2 release candidate 2?
27583===============================================
27584
27585*Release date: 2017-07-07*
27586
27587Security
27588--------
27589
27590- bpo-30730: Prevent environment variables injection in subprocess on
27591  Windows.  Prevent passing other environment variables and command
27592  arguments.
27593
27594- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
27595  security vulnerabilities including: CVE-2017-9233 (External entity
27596  infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
27597  CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
27598  CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
27599  CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
27600  impact Python, since Python already gets entropy from the OS to set the
27601  expat secret using ``XML_SetHashSalt()``.
27602
27603- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
27604  example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
27605  ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
27606  authentication (``login@host``).
27607
27608
27609What's New in Python 3.6.2 release candidate 1?
27610===============================================
27611
27612*Release date: 2017-06-17*
27613
27614Security
27615--------
27616
27617- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
27618  CVE-2016-0718 and CVE-2016-4472. See
27619  https://sourceforge.net/p/expat/bugs/537/ for more information.
27620
27621Core and Builtins
27622-----------------
27623
27624- bpo-30682: Removed a too-strict assertion that failed for certain
27625  f-strings, such as eval("f'\\\n'") and eval("f'\\\r'").
27626
27627- bpo-30604: Move co_extra_freefuncs to not be per-thread to avoid crashes
27628
27629- bpo-29104: Fixed parsing backslashes in f-strings.
27630
27631- bpo-27945: Fixed various segfaults with dict when input collections are
27632  mutated during searching, inserting or comparing.  Based on patches by
27633  Duane Griffin and Tim Mitchell.
27634
27635- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
27636  non-interned attribute names.  Based on patch by Eryk Sun.
27637
27638- bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the
27639  middle of resuming a chain of nested 'yield from' or 'await' calls, it's
27640  now correctly delivered to the innermost frame.
27641
27642- bpo-12414: sys.getsizeof() on a code object now returns the sizes which
27643  includes the code struct and sizes of objects which it references. Patch
27644  by Dong-hee Na.
27645
27646- bpo-29949: Fix memory usage regression of set and frozenset object.
27647
27648- bpo-29935: Fixed error messages in the index() method of tuple, list and
27649  deque when pass indices of wrong type.
27650
27651- bpo-29859: Show correct error messages when any of the pthread_* calls in
27652  thread_pthread.h fails.
27653
27654- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
27655  :exc:`OverflowError`.
27656
27657- bpo-29600: Fix wrapping coroutine return values in StopIteration.
27658
27659- bpo-28856: Fix an oversight that %b format for bytes should support
27660  objects follow the buffer protocol.
27661
27662- bpo-29714: Fix a regression that bytes format may fail when containing
27663  zero bytes inside.
27664
27665- bpo-29478: If max_line_length=None is specified while using the Compat32
27666  policy, it is no longer ignored.  Patch by Mircea Cosbuc.
27667
27668Library
27669-------
27670
27671- bpo-30616: Functional API of enum allows to create empty enums. Patched by
27672  Dong-hee Na
27673
27674- bpo-30038: Fix race condition between signal delivery and wakeup file
27675  descriptor. Patch by Nathaniel Smith.
27676
27677- bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings.
27678
27679- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
27680  reference cycle to not keep objects alive longer than expected.
27681
27682- bpo-30149: inspect.signature() now supports callables with
27683  variable-argument parameters wrapped with partialmethod. Patch by Dong-hee
27684  Na.
27685
27686- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases
27687  when a package is only shipped with bytecodes. Patch by Alexandru
27688  Ardelean.
27689
27690- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
27691  Patch by Sanjay Sundaresan.
27692
27693- bpo-30605: re.compile() no longer raises a BytesWarning when compiling a
27694  bytes instance with misplaced inline modifier.  Patch by Roy Williams.
27695
27696- bpo-24484: Avoid race condition in multiprocessing cleanup (#2159)
27697
27698- bpo-28994: The traceback no longer displayed for SystemExit raised in a
27699  callback registered by atexit.
27700
27701- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
27702  called.
27703
27704- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
27705  support for ContextManager on all versions. Original PRs by Jelle Zijlstra
27706  and Ivan Levkivskyi
27707
27708- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
27709  implementation. Patch by Michaël Sghaïer.
27710
27711- bpo-29743: Closing transport during handshake process leaks open socket.
27712  Patch by Nikolay Kim
27713
27714- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
27715  Sornay.
27716
27717- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
27718  EINVAL on stdin.write() if the child process is still running but closed
27719  the pipe.
27720
27721- bpo-29822: inspect.isabstract() now works during __init_subclass__.  Patch
27722  by Nate Soares.
27723
27724- bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract
27725  base classes to use keyword parameters in __init_subclass__. Patch by Nate
27726  Soares.
27727
27728- bpo-30557: faulthandler now correctly filters and displays exception codes
27729  on Windows
27730
27731- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
27732  handle IPv6 addresses.
27733
27734- bpo-29960: Preserve generator state when _random.Random.setstate() raises
27735  an exception. Patch by Bryan Olson.
27736
27737- bpo-30414: multiprocessing.Queue._feed background running thread do not
27738  break from main loop on exception.
27739
27740- bpo-30003: Fix handling escape characters in HZ codec.  Based on patch by
27741  Ma Lin.
27742
27743- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
27744  and *forkserver* start methods.
27745
27746- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
27747  (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
27748  This error occurs sometimes on SSL connections.
27749
27750- bpo-30375: Warnings emitted when compile a regular expression now always
27751  point to the line in the user code.  Previously they could point into
27752  inners of the re module if emitted from inside of groups or conditionals.
27753
27754- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
27755  coroutine and the coroutine returned without any more ``await``.
27756
27757- bpo-30266: contextlib.AbstractContextManager now supports
27758  anti-registration by setting __enter__ = None or __exit__ = None,
27759  following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
27760
27761- bpo-30298: Weaken the condition of deprecation warnings for inline
27762  modifiers. Now allowed several subsequential inline modifiers at the start
27763  of the pattern (e.g. ``'(?i)(?s)...'``).  In verbose mode whitespaces and
27764  comments now are allowed before and between inline modifiers (e.g. ``'(?x)
27765  (?i) (?s)...'``).
27766
27767- bpo-29990: Fix range checking in GB18030 decoder.  Original patch by Ma
27768  Lin.
27769
27770- bpo-26293: Change resulted because of zipfile breakage. (See also:
27771  bpo-29094)
27772
27773- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
27774  Misusing them could cause memory leaks or crashes.  Now scanner and
27775  encoder objects are completely initialized in the __new__ methods.
27776
27777- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
27778  when Ctrl-C is received.
27779
27780- bpo-28556: Various updates to typing module: add typing.NoReturn type, use
27781  WrapperDescriptorType, minor bug-fixes.  Original PRs by Jim
27782  Fasarakis-Hilliard and Ivan Levkivskyi.
27783
27784- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
27785
27786- bpo-30070: Fixed leaks and crashes in errors handling in the parser
27787  module.
27788
27789- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
27790  readline() or __next__() respectively return non-sizeable object. Fixed
27791  possible other errors caused by not checking results of PyObject_Size(),
27792  PySequence_Size(), or PyMapping_Size().
27793
27794- bpo-30017: Allowed calling the close() method of the zip entry writer
27795  object multiple times.  Writing to a closed writer now always produces a
27796  ValueError.
27797
27798- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
27799  is present.
27800
27801- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
27802  Patch by Armin Rigo.
27803
27804- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
27805  contextlib.contextmanager.  Patch by Siddharth Velankar.
27806
27807- bpo-29998: Pickling and copying ImportError now preserves name and path
27808  attributes.
27809
27810- bpo-29953: Fixed memory leaks in the replace() method of datetime and time
27811  objects when pass out of bound fold argument.
27812
27813- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
27814  long runs of empty iterables.
27815
27816- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
27817  and wrong types.
27818
27819- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
27820  exception at the very first of an iterable may swallow the exception or
27821  make the program hang. Patch by Davin Potts and Xiang Zhang.
27822
27823- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
27824  the OS gives priority to errors such as EACCES over EEXIST.
27825
27826- bpo-29861: Release references to tasks, their arguments and their results
27827  as soon as they are finished in multiprocessing.Pool.
27828
27829- bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
27830  Patch by Christophe Zeitouny.
27831
27832- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
27833
27834- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
27835  are not strings.  Patch by Michael Seifert.
27836
27837- bpo-29742: get_extra_info() raises exception if get called on closed ssl
27838  transport. Patch by Nikolay Kim.
27839
27840- bpo-8256: Fixed possible failing or crashing input() if attributes
27841  "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
27842  strings.
27843
27844- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
27845  big intables (objects that have __int__) as elements.  Patch by Oren
27846  Milman.
27847
27848- bpo-28231: The zipfile module now accepts path-like objects for external
27849  paths.
27850
27851- bpo-26915: index() and count() methods of collections.abc.Sequence now
27852  check identity before checking equality when do comparisons.
27853
27854- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
27855  exception) to exception(s) raised in the dispatched methods. Patch by Petr
27856  Motejlek.
27857
27858- bpo-30177: path.resolve(strict=False) no longer cuts the path after the
27859  first element not present in the filesystem.  Patch by Antoine Pietri.
27860
27861IDLE
27862----
27863
27864- bpo-15786: Fix several problems with IDLE's autocompletion box. The
27865  following should now work: clicking on selection box items; using the
27866  scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no
27867  longer happen. Patch by Louie Lu.
27868
27869- bpo-25514: Add doc subsubsection about IDLE failure to start. Popup
27870  no-connection message directs users to this section.
27871
27872- bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and
27873  Terry Jan Reedy.
27874
27875- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
27876  Cheryl Sabella and Terry Jan Reedy.
27877
27878- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
27879  100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
27880
27881- bpo-30303: Add _utest option to textview; add new tests. Increase coverage
27882  to 100%. Patches by Louie Lu and Terry Jan Reedy.
27883
27884C API
27885-----
27886
27887- bpo-27867: Function PySlice_GetIndicesEx() no longer replaced with a macro
27888  if Py_LIMITED_API is not set.
27889
27890Build
27891-----
27892
27893- bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C
27894  ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies
27895  ``--with-assertions``.
27896
27897- bpo-28787: Fix out-of-tree builds of Python when configured with
27898  ``--with--dtrace``.
27899
27900- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
27901  ``make install`` and some other make targets when configured with
27902  ``--enable-optimizations``.
27903
27904- bpo-23404: Don't regenerate generated files based on file modification
27905  time anymore: the action is now explicit. Replace ``make touch`` with
27906  ``make regen-all``.
27907
27908- bpo-29643: Fix ``--enable-optimization`` didn't work.
27909
27910Documentation
27911-------------
27912
27913- bpo-30176: Add missing attribute related constants in curses
27914  documentation.
27915
27916- bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are
27917  now their respective type definitions, rather than the corresponding
27918  builtin function entries. Use :ref:`bytes <func-bytes>` and
27919  :ref:`bytearray <func-bytearray>` to reference the latter. In order to
27920  ensure this and future cross-reference updates are applied automatically,
27921  the daily documentation builds now disable the default output caching
27922  features in Sphinx.
27923
27924- bpo-26985: Add missing info of code object in inspect documentation.
27925
27926Tools/Demos
27927-----------
27928
27929- bpo-29367: python-gdb.py now supports also ``method-wrapper``
27930  (``wrapperobject``) objects.
27931
27932Tests
27933-----
27934
27935- bpo-30357: test_thread: setUp() now uses support.threading_setup() and
27936  support.threading_cleanup() to wait until threads complete to avoid random
27937  side effects on following tests. Initial patch written by Grzegorz
27938  Grzywacz.
27939
27940- bpo-30197: Enhanced functions swap_attr() and swap_item() in the
27941  test.support module. They now work when delete replaced attribute or item
27942  inside the with statement.  The old value of the attribute or item (or
27943  None if it doesn't exist) now will be assigned to the target of the "as"
27944  clause, if there is one.
27945
27946Windows
27947-------
27948
27949- bpo-30687: Locate msbuild.exe on Windows when building rather than
27950  vcvarsall.bat
27951
27952- bpo-30450: The build process on Windows no longer depends on Subversion,
27953  instead pulling external code from GitHub via a Python script.  If Python
27954  3.6 is not found on the system (via ``py -3.6``), NuGet is used to
27955  download a copy of 32-bit Python.
27956
27957
27958What's New in Python 3.6.1 final?
27959=================================
27960
27961*Release date: 2017-03-21*
27962
27963Core and Builtins
27964-----------------
27965
27966- bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused
27967  a regression by revealing an inconsistency in how sys.path is initialized
27968  when executing ``__main__`` from a zipfile, directory, or other import
27969  location. The interpreter now consistently avoids ever adding the import
27970  location's parent directory to ``sys.path``, and ensures no other
27971  ``sys.path`` entries are inadvertently modified when inserting the import
27972  location named on the command line.
27973
27974Build
27975-----
27976
27977- bpo-27593: fix format of git information used in sys.version
27978
27979- Fix incompatible comment in python.h
27980
27981
27982What's New in Python 3.6.1 release candidate 1?
27983===============================================
27984
27985*Release date: 2017-03-04*
27986
27987Core and Builtins
27988-----------------
27989
27990- bpo-28893: Set correct __cause__ for errors about invalid awaitables
27991  returned from __aiter__ and __anext__.
27992
27993- bpo-29683: Fixes to memory allocation in _PyCode_SetExtra.  Patch by Brian
27994  Coleman.
27995
27996- bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It
27997  should raise TypeError when kwargs is not a dict.  But it might cause segv
27998  when args=NULL and kwargs is not a dict.
27999
28000- bpo-28598: Support __rmod__ for subclasses of str being called before
28001  str.__mod__. Patch by Martijn Pieters.
28002
28003- bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by
28004  Matthieu Dartiailh.
28005
28006- bpo-29602: Fix incorrect handling of signed zeros in complex constructor
28007  for complex subclasses and for inputs having a __complex__ method. Patch
28008  by Serhiy Storchaka.
28009
28010- bpo-29347: Fixed possibly dereferencing undefined pointers when creating
28011  weakref objects.
28012
28013- bpo-29438: Fixed use-after-free problem in key sharing dict.
28014
28015- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
28016
28017- bpo-29337: Fixed possible BytesWarning when compare the code objects.
28018  Warnings could be emitted at compile time.
28019
28020- bpo-29327: Fixed a crash when pass the iterable keyword argument to
28021  sorted().
28022
28023- bpo-29034: Fix memory leak and use-after-free in os module
28024  (path_converter).
28025
28026- bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
28027
28028- bpo-28932: Do not include <sys/random.h> if it does not exist.
28029
28030- bpo-25677: Correct the positioning of the syntax error caret for indented
28031  blocks. Based on patch by Michael Layzell.
28032
28033- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
28034  form.
28035
28036- bpo-26919: On Android, operating system data is now always encoded/decoded
28037  to/from UTF-8, instead of the locale encoding to avoid inconsistencies
28038  with os.fsencode() and os.fsdecode() which are already using UTF-8.
28039
28040- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
28041  bug triggerable by a monkey-patched len() function.
28042
28043- bpo-28739: f-string expressions are no longer accepted as docstrings and
28044  by ast.literal_eval() even if they do not include expressions.
28045
28046- bpo-28512: Fixed setting the offset attribute of SyntaxError by
28047  PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
28048
28049- bpo-28918: Fix the cross compilation of xxlimited when Python has been
28050  built with Py_DEBUG defined.
28051
28052- bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict.
28053  Improve speed of dict literal with constant keys up to 30%.
28054
28055Library
28056-------
28057
28058- bpo-29169: Update zlib to 1.2.11.
28059
28060- bpo-29623: Allow use of path-like object as a single argument in
28061  ConfigParser.read(). Patch by David Ellis.
28062
28063- bpo-28963: Fix out of bound iteration in
28064  asyncio.Future.remove_done_callback implemented in C.
28065
28066- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
28067  before all pipes are closed.
28068
28069- bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to
28070  accept None argument as their pure Python implementation.
28071
28072- bpo-29703: Fix asyncio to support instantiation of new event loops in
28073  child processes.
28074
28075- bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
28076
28077- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
28078  PathLike objects.  Patch by Sayan Chowdhury.
28079
28080- bpo-28518: Start a transaction implicitly before a DML statement. Patch by
28081  Aviv Palivoda.
28082
28083- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
28084  longer affects a partial object after creation.
28085
28086- bpo-29110: Fix file object leak in aifc.open() when file is given as a
28087  filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
28088
28089- bpo-28556: Various updates to typing module: typing.Counter,
28090  typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
28091  Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
28092
28093- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
28094  3.6.0: check minimum and maximum years.
28095
28096- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when
28097  used with a rare combination of multiprocessing and custom codecs.
28098
28099- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
28100
28101- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
28102  match object. Based on patch by WGH.
28103
28104- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
28105  to a stopped instead of terminated state (ex: when under ptrace).
28106
28107- bpo-29290: Fix a regression in argparse that help messages would wrap at
28108  non-breaking spaces.
28109
28110- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
28111
28112- bpo-29316: Restore the provisional status of typing module, add
28113  corresponding note to documentation. Patch by Ivan L.
28114
28115- bpo-29219: Fixed infinite recursion in the repr of uninitialized
28116  ctypes.CDLL instances.
28117
28118- bpo-29011: Fix an important omission by adding Deque to the typing module.
28119
28120- bpo-28969: Fixed race condition in C implementation of
28121  functools.lru_cache. KeyError could be raised when cached function with
28122  full cache was simultaneously called from different threads with the same
28123  uncached arguments.
28124
28125- bpo-29142: In urllib.request, suffixes in no_proxy environment variable
28126  with leading dots could match related hostnames again (e.g. .b.c matches
28127  a.b.c). Patch by Milan Oberkirch.
28128
28129- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
28130  anymore. Patch written by Jiajun Huang.
28131
28132- bpo-29203: functools.lru_cache() now respects :pep:`468` and preserves the
28133  order of keyword arguments.  f(a=1, b=2) is now cached separately from
28134  f(b=2, a=1) since both calls could potentially give different results.
28135
28136- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
28137  context. Patch by Sam Breese.
28138
28139- bpo-29094: Offsets in a ZIP file created with extern file object and modes
28140  "w" and "x" now are relative to the start of the file.
28141
28142- bpo-29085: Allow random.Random.seed() to use high quality OS randomness
28143  rather than the pid and time.
28144
28145- bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a
28146  negative input.  Patch by Brendan Donegan.
28147
28148- bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
28149
28150- bpo-13051: Fixed recursion errors in large or resized
28151  curses.textpad.Textbox.  Based on patch by Tycho Andersen.
28152
28153- bpo-29119: Fix weakrefs in the pure python version of
28154  collections.OrderedDict move_to_end() method. Contributed by Andra
28155  Bogildea.
28156
28157- bpo-9770: curses.ascii predicates now work correctly with negative
28158  integers.
28159
28160- bpo-28427: old keys should not remove new values from WeakValueDictionary
28161  when collecting from another thread.
28162
28163- bpo-28923: Remove editor artifacts from Tix.py.
28164
28165- bpo-29055: Neaten-up empty population error on random.choice() by
28166  suppressing the upstream exception.
28167
28168- bpo-28871: Fixed a crash when deallocate deep ElementTree.
28169
28170- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
28171  WeakValueDictionary.pop() when a GC collection happens in another thread.
28172
28173- bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence
28174  that doesn't own its elements as limits.
28175
28176- bpo-28779: multiprocessing.set_forkserver_preload() would crash the
28177  forkserver process if a preloaded module instantiated some multiprocessing
28178  objects such as locks.
28179
28180- bpo-28847: dbm.dumb now supports reading read-only files and no longer
28181  writes the index file when it is not changed.
28182
28183- bpo-26937: The chown() method of the tarfile.TarFile class does not fail
28184  now when the grp module cannot be imported, as for example on Android
28185  platforms.
28186
28187IDLE
28188----
28189
28190- bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes).
28191
28192- bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and
28193  augment description of the configuration system.
28194
28195Windows
28196-------
28197
28198- bpo-29579: Removes readme.txt from the installer
28199
28200- bpo-29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
28201
28202- bpo-28164: Correctly handle special console filenames (patch by Eryk Sun)
28203
28204- bpo-29409: Implement :pep:`529` for io.FileIO (Patch by Eryk Sun)
28205
28206- bpo-29392: Prevent crash when passing invalid arguments into msvcrt
28207  module.
28208
28209- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
28210
28211- bpo-28896: Deprecate WindowsRegistryFinder and disable it by default.
28212
28213C API
28214-----
28215
28216- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if
28217  Py_LIMITED_API is not set or set to the value between 0x03050400 and
28218  0x03060000 (not including) or 0x03060100 or higher.
28219
28220- bpo-29083: Fixed the declaration of some public API functions.
28221  PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
28222  limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
28223  Py_BuildValue() were not available in limited API of version < 3.3 when
28224  PY_SSIZE_T_CLEAN is defined.
28225
28226- bpo-29058: All stable API extensions added after Python 3.2 are now
28227  available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
28228  the minimum Python version supporting this API.
28229
28230Documentation
28231-------------
28232
28233- bpo-28929: Link the documentation to its source file on GitHub.
28234
28235- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
28236  to aiosmtpd, a third-party asyncio-based replacement.
28237
28238- bpo-26355: Add canonical header link on each page to corresponding major
28239  version of the documentation. Patch by Matthias Bussonnier.
28240
28241- bpo-29349: Fix Python 2 syntax in code for building the documentation.
28242
28243Tests
28244-----
28245
28246- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip
28247  some tests of select.poll when running on macOS due to unresolved issues
28248  with the underlying system poll function on some macOS versions.
28249
28250- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag,
28251  test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)``
28252  to determine the candidate encoding for the test regex (allowing it to
28253  correctly skip the test when the default locale encoding is a multi-byte
28254  encoding)
28255
28256- bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line
28257  arguments.
28258
28259- bpo-28683: Fix the tests that bind() a unix socket and raise
28260  PermissionError on Android for a non-root user.
28261
28262- bpo-26939: Add the support.setswitchinterval() function to fix
28263  test_functools hanging on the Android armv7 qemu emulator.
28264
28265Build
28266-----
28267
28268- bpo-27593: sys.version and the platform module python_build(),
28269  python_branch(), and python_revision() functions now use git information
28270  rather than hg when building from a repo.
28271
28272- bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
28273
28274- bpo-26851: Set Android compilation and link flags.
28275
28276- bpo-28768: Fix implicit declaration of function _setmode. Patch by
28277  Masayuki Yamamoto
28278
28279- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
28280
28281- bpo-23903: Added missed names to PC/python3.def.
28282
28283- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK
28284  macro is not defined in android-ndk-r13.
28285
28286- bpo-28538: Fix the compilation error that occurs because if_nameindex() is
28287  available on Android API level 24, but the if_nameindex structure is not
28288  defined.
28289
28290- bpo-20211: Do not add the directory for installing C header files and the
28291  directory for installing object code libraries to the cross compilation
28292  search paths. Original patch by Thomas Petazzoni.
28293
28294- bpo-28849: Do not define sys.implementation._multiarch on Android.
28295
28296
28297What's New in Python 3.6.0 final?
28298=================================
28299
28300*Release date: 2016-12-23*
28301
28302No changes since release candidate 2
28303
28304
28305
28306What's New in Python 3.6.0 release candidate 2?
28307===============================================
28308
28309*Release date: 2016-12-16*
28310
28311Core and Builtins
28312-----------------
28313
28314- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
28315  not convert combined table into split table. Patch written by INADA Naoki.
28316
28317- bpo-28990: Fix asyncio SSL hanging if connection is closed before
28318  handshake is completed. (Patch by HoHo-Ho)
28319
28320Tools/Demos
28321-----------
28322
28323- bpo-28770: Fix python-gdb.py for fastcalls.
28324
28325Windows
28326-------
28327
28328- bpo-28896: Deprecate WindowsRegistryFinder.
28329
28330Build
28331-----
28332
28333- bpo-28898: Prevent gdb build errors due to HAVE_LONG_LONG redefinition.
28334
28335
28336What's New in Python 3.6.0 release candidate 1?
28337===============================================
28338
28339*Release date: 2016-12-06*
28340
28341Core and Builtins
28342-----------------
28343
28344- bpo-23722: Rather than silently producing a class that doesn't support
28345  zero-argument ``super()`` in methods, failing to pass the new
28346  ``__classcell__`` namespace entry up to ``type.__new__`` now results in a
28347  ``DeprecationWarning`` and a class that supports zero-argument
28348  ``super()``.
28349
28350- bpo-28797: Modifying the class __dict__ inside the __set_name__ method of
28351  a descriptor that is used inside that class no longer prevents calling the
28352  __set_name__ method of other descriptors.
28353
28354- bpo-28782: Fix a bug in the implementation ``yield from`` when checking if
28355  the next instruction is YIELD_FROM. Regression introduced by WORDCODE
28356  (issue #26647).
28357
28358Library
28359-------
28360
28361- bpo-27030: Unknown escapes in re.sub() replacement template are allowed
28362  again.  But they still are deprecated and will be disabled in 3.7.
28363
28364- bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call
28365  warnings.showwarning() if it was overridden inside the context manager.
28366
28367- bpo-27172: To assist with upgrades from 2.7, the previously documented
28368  deprecation of ``inspect.getfullargspec()`` has been reversed. This
28369  decision may be revisited again after the Python 2.7 branch is no longer
28370  officially supported.
28371
28372- bpo-26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and
28373  :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by
28374  Omar Sandoval.
28375
28376- bpo-24142: Reading a corrupt config file left configparser in an invalid
28377  state. Original patch by Florian Höch.
28378
28379- bpo-28843: Fix asyncio C Task to handle exceptions __traceback__.
28380
28381C API
28382-----
28383
28384- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
28385
28386Documentation
28387-------------
28388
28389- bpo-23722: The data model reference and the porting section in the What's
28390  New guide now cover the additional ``__classcell__`` handling needed for
28391  custom metaclasses to fully support :pep:`487` and zero-argument
28392  ``super()``.
28393
28394Tools/Demos
28395-----------
28396
28397- bpo-28023: Fix python-gdb.py didn't support new dict implementation.
28398
28399
28400What's New in Python 3.6.0 beta 4?
28401==================================
28402
28403*Release date: 2016-11-21*
28404
28405Core and Builtins
28406-----------------
28407
28408- bpo-28532: Show sys.version when -V option is supplied twice.
28409
28410- bpo-27100: The with-statement now checks for __enter__ before it checks
28411  for __exit__. This gives less confusing error messages when both methods
28412  are missing. Patch by Jonathan Ellington.
28413
28414- bpo-28746: Fix the set_inheritable() file descriptor method on platforms
28415  that do not have the ioctl FIOCLEX and FIONCLEX commands.
28416
28417- bpo-26920: Fix not getting the locale's charset upon initializing the
28418  interpreter, on platforms that do not have langinfo.
28419
28420- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
28421  when decode astral characters.  Patch by Xiang Zhang.
28422
28423- bpo-19398: Extra slash no longer added to sys.path components in case of
28424  empty compile-time PYTHONPATH components.
28425
28426- bpo-28665: Improve speed of the STORE_DEREF opcode by 40%.
28427
28428- bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch
28429  by Xiang Zhang.
28430
28431- bpo-27243: Change PendingDeprecationWarning -> DeprecationWarning. As it
28432  was agreed in the issue, __aiter__ returning an awaitable should result in
28433  PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6.
28434
28435- bpo-26182: Fix a refleak in code that raises DeprecationWarning.
28436
28437- bpo-28721: Fix asynchronous generators aclose() and athrow() to handle
28438  StopAsyncIteration propagation properly.
28439
28440Library
28441-------
28442
28443- bpo-28752: Restored the __reduce__() methods of datetime objects.
28444
28445- bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created
28446  by re.compile(), become comparable (only x==y and x!=y operators). This
28447  change should fix the issue #18383: don't duplicate warning filters when
28448  the warnings module is reloaded (thing usually only done in unit tests).
28449
28450- bpo-20572: The subprocess.Popen.wait method's undocumented endtime
28451  parameter now raises a DeprecationWarning.
28452
28453- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
28454  from_buffer_copy() methods on abstract classes like Array.
28455
28456- bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch
28457  by Vajrasky Kok
28458
28459- bpo-28563: Fixed possible DoS and arbitrary code execution when handle
28460  plural form selections in the gettext module.  The expression parser now
28461  supports exact syntax supported by GNU gettext.
28462
28463- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
28464  garbage collector is invoked in other thread.  Based on patch by Sebastian
28465  Cufre.
28466
28467- bpo-28600: Optimize loop.call_soon.
28468
28469- bpo-28613: Fix get_event_loop() return the current loop if called from
28470  coroutines/callbacks.
28471
28472- bpo-28634: Fix asyncio.isfuture() to support unittest.Mock.
28473
28474- bpo-26081: Fix refleak in _asyncio.Future.__iter__().throw.
28475
28476- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin
28477  Mayfield.
28478
28479- bpo-28652: Make loop methods reject socket kinds they do not support.
28480
28481- bpo-28653: Fix a refleak in functools.lru_cache.
28482
28483- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
28484
28485- bpo-28704: Fix create_unix_server to support Path-like objects (PEP 519).
28486
28487- bpo-28720: Add collections.abc.AsyncGenerator.
28488
28489Documentation
28490-------------
28491
28492- bpo-28513: Documented command-line interface of zipfile.
28493
28494Tests
28495-----
28496
28497- bpo-28666: Now test.support.rmtree is able to remove unwritable or
28498  unreadable directories.
28499
28500- bpo-23839: Various caches now are cleared before running every test file.
28501
28502Build
28503-----
28504
28505- bpo-10656: Fix out-of-tree building on AIX.  Patch by Tristan Carel and
28506  Michael Haubenwallner.
28507
28508- bpo-26359: Rename --with-optimiations to --enable-optimizations.
28509
28510- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
28511  Patch by Gareth Rees.
28512
28513
28514What's New in Python 3.6.0 beta 3?
28515==================================
28516
28517*Release date: 2016-10-31*
28518
28519Core and Builtins
28520-----------------
28521
28522- bpo-28128: Deprecation warning for invalid str and byte escape sequences
28523  now prints better information about where the error occurs. Patch by
28524  Serhiy Storchaka and Eric Smith.
28525
28526- bpo-28509: dict.update() no longer allocate unnecessary large memory.
28527
28528- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
28529  build.
28530
28531- bpo-28517: Fixed of-by-one error in the peephole optimizer that caused
28532  keeping unreachable code.
28533
28534- bpo-28214: Improved exception reporting for problematic __set_name__
28535  attributes.
28536
28537- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
28538  loss in PyTraceBack_Here().
28539
28540- bpo-28471: Fix "Python memory allocator called without holding the GIL"
28541  crash in socket.setblocking.
28542
28543Library
28544-------
28545
28546- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
28547  given empty data twice.  Patch by Benjamin Fogle.
28548
28549- bpo-28549: Fixed segfault in curses's addch() with ncurses6.
28550
28551- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
28552  file with compression before trying to open it without compression.
28553  Otherwise it had 50% chance failed with ignore_zeros=True.
28554
28555- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
28556  browsers.  Based on patch by Oleg Broytman.
28557
28558- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
28559  by representing the scale as float value internally in Tk.  tkinter.IntVar
28560  now works if float value is set to underlying Tk variable.
28561
28562- bpo-18844: The various ways of specifying weights for random.choices() now
28563  produce the same result sequences.
28564
28565- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at
28566  the start of new line after printing a month's calendar.  Patch by Xiang
28567  Zhang.
28568
28569- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
28570  Based on patch by Kaarle Ritvanen.
28571
28572- bpo-28353: os.fwalk() no longer fails on broken links.
28573
28574- bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept
28575  non-None value is passed to it.send(val).
28576
28577- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
28578  for readability.
28579
28580- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
28581  workaround to Tix library bug.
28582
28583- bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
28584
28585- bpo-25953: re.sub() now raises an error for invalid numerical group
28586  reference in replacement template even if the pattern is not found in the
28587  string.  Error message for invalid group reference now includes the group
28588  index and the position of the reference. Based on patch by SilentGhost.
28589
28590- bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by
28591  Mariatta Wijaya.
28592
28593- bpo-28448: Fix C implemented asyncio.Future didn't work on Windows.
28594
28595- bpo-28480: Fix error building socket module when multithreading is
28596  disabled.
28597
28598- bpo-24452: Make webbrowser support Chrome on Mac OS X.
28599
28600- bpo-20766: Fix references leaked by pdb in the handling of SIGINT
28601  handlers.
28602
28603- bpo-28492: Fix how StopIteration exception is raised in _asyncio.Future.
28604
28605- bpo-28500: Fix asyncio to handle async gens GC from another thread.
28606
28607- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children
28608  are done. Patch by Johannes Ebke.
28609
28610- bpo-26796: Don't configure the number of workers for default threadpool
28611  executor. Initial patch by Hans Lawrenz.
28612
28613- bpo-28544: Implement asyncio.Task in C.
28614
28615Windows
28616-------
28617
28618- bpo-28522: Fixes mishandled buffer reallocation in getpathp.c
28619
28620Build
28621-----
28622
28623- bpo-28444: Fix missing extensions modules when cross compiling.
28624
28625- bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2.
28626
28627- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
28628
28629Tests
28630-----
28631
28632- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
28633  missing the effective gid.
28634
28635- bpo-28409: regrtest: fix the parser of command line arguments.
28636
28637
28638What's New in Python 3.6.0 beta 2?
28639==================================
28640
28641*Release date: 2016-10-10*
28642
28643Core and Builtins
28644-----------------
28645
28646- bpo-28183: Optimize and cleanup dict iteration.
28647
28648- bpo-26081: Added C implementation of asyncio.Future. Original patch by
28649  Yury Selivanov.
28650
28651- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
28652  Patch by Xiang Zhang.
28653
28654- bpo-28376: The type of long range iterator is now registered as Iterator.
28655  Patch by Oren Milman.
28656
28657- bpo-28376: Creating instances of range_iterator by calling range_iterator
28658  type now is deprecated.  Patch by Oren Milman.
28659
28660- bpo-28376: The constructor of range_iterator now checks that step is not
28661  0. Patch by Oren Milman.
28662
28663- bpo-26906: Resolving special methods of uninitialized type now causes
28664  implicit initialization of the type instead of a fail.
28665
28666- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
28667  patch by Niklas Koep.
28668
28669- bpo-24098: Fixed possible crash when AST is changed in process of
28670  compiling it.
28671
28672- bpo-28201: Dict reduces possibility of 2nd conflict in hash table when
28673  hashes have same lower bits.
28674
28675- bpo-28350: String constants with null character no longer interned.
28676
28677- bpo-26617: Fix crash when GC runs during weakref callbacks.
28678
28679- bpo-27942: String constants now interned recursively in tuples and
28680  frozensets.
28681
28682- bpo-21578: Fixed misleading error message when ImportError called with
28683  invalid keyword args.
28684
28685- bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch
28686  by Soumya Sharma.
28687
28688- bpo-28086: Single var-positional argument of tuple subtype was passed
28689  unscathed to the C-defined function.  Now it is converted to exact tuple.
28690
28691- bpo-28214: Now __set_name__ is looked up on the class instead of the
28692  instance.
28693
28694- bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
28695  syscall fails with EPERM, for example when blocked by SECCOMP.
28696
28697- bpo-28192: Don't import readline in isolated mode.
28698
28699- Upgrade internal unicode databases to Unicode version 9.0.0.
28700
28701- bpo-28131: Fix a regression in zipimport's compile_source().  zipimport
28702  should use the same optimization level as the interpreter.
28703
28704- bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
28705  optimize memcpy().
28706
28707- bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a
28708  "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
28709
28710- bpo-26182: Raise DeprecationWarning when async and await keywords are used
28711  as variable/attribute/class/function name.
28712
28713Library
28714-------
28715
28716- bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by
28717  Eryk Sun.
28718
28719- bpo-28317: The disassembler now decodes FORMAT_VALUE argument.
28720
28721- bpo-26293: Fixed writing ZIP files that starts not from the start of the
28722  file.  Offsets in ZIP file now are relative to the start of the archive in
28723  conforming to the specification.
28724
28725- bpo-28380: unittest.mock Mock autospec functions now properly support
28726  assert_called, assert_not_called, and assert_called_once.
28727
28728- bpo-27181: remove statistics.geometric_mean and defer until 3.7.
28729
28730- bpo-28229: lzma module now supports pathlib.
28731
28732- bpo-28321: Fixed writing non-BMP characters with binary format in
28733  plistlib.
28734
28735- bpo-28225: bz2 module now supports pathlib.  Initial patch by Ethan
28736  Furman.
28737
28738- bpo-28227: gzip now supports pathlib.  Patch by Ethan Furman.
28739
28740- bpo-27358: Optimized merging var-keyword arguments and improved error
28741  message when passing a non-mapping as a var-keyword argument.
28742
28743- bpo-28257: Improved error message when passing a non-iterable as a
28744  var-positional argument.  Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
28745
28746- bpo-28322: Fixed possible crashes when unpickle itertools objects from
28747  incorrect pickle data.  Based on patch by John Leitch.
28748
28749- bpo-28228: imghdr now supports pathlib.
28750
28751- bpo-28226: compileall now supports pathlib.
28752
28753- bpo-28314: Fix function declaration (C flags) for the getiterator() method
28754  of xml.etree.ElementTree.Element.
28755
28756- bpo-28148: Stop using localtime() and gmtime() in the time module.
28757  Introduced platform independent _PyTime_localtime API that is similar to
28758  POSIX localtime_r, but available on all platforms.  Patch by Ed Schouten.
28759
28760- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
28761  9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
28762  that they don't call itermonthdates() which can cause datetime.date
28763  under/overflow.
28764
28765- bpo-28275: Fixed possible use after free in the decompress() methods of
28766  the LZMADecompressor and BZ2Decompressor classes. Original patch by John
28767  Leitch.
28768
28769- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
28770  if pass invalid string-like object as a name.  Patch by Xiang Zhang.
28771
28772- bpo-18844: random.choices() now has k as a keyword-only argument to
28773  improve the readability of common cases and come into line with the
28774  signature used in other languages.
28775
28776- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
28777  Patch by Madison May.
28778
28779- bpo-27611: Fixed support of default root window in the tkinter.tix module.
28780  Added the master parameter in the DisplayStyle constructor.
28781
28782- bpo-27348: In the traceback module, restore the formatting of exception
28783  messages like "Exception: None".  This fixes a regression introduced in
28784  3.5a2.
28785
28786- bpo-25651: Allow falsy values to be used for msg parameter of subTest().
28787
28788- bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is
28789  interrupted by a signal and a signal handler raises a Python exception.
28790
28791- bpo-28200: Fix memory leak on Windows in the os module (fix
28792  path_converter() function).
28793
28794- bpo-25400: RobotFileParser now correctly returns default values for
28795  crawl_delay and request_rate.  Initial patch by Peter Wirtz.
28796
28797- bpo-27932: Prevent memory leak in win32_ver().
28798
28799- Fix UnboundLocalError in socket._sendfile_use_sendfile.
28800
28801- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
28802  os.stat().  Patch by Eryk Sun.
28803
28804- bpo-22493: Warning message emitted by using inline flags in the middle of
28805  regular expression now contains a (truncated) regex pattern. Patch by Tim
28806  Graham.
28807
28808- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
28809  empty bytestring is passed.
28810
28811- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
28812
28813- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
28814  Gergely Imreh and Markus Holtermann.
28815
28816- bpo-28114: Fix a crash in parse_envlist() when env contains byte strings.
28817  Patch by Eryk Sun.
28818
28819- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
28820  binascii.a2b_qp().
28821
28822- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
28823  Kevin Conway.
28824
28825- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
28826  Seth Michael Larson.
28827
28828- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
28829  iceboy.
28830
28831- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
28832
28833- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
28834
28835- bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
28836  Patch by Mark Williams.
28837
28838- bpo-28368: Refuse monitoring processes if the child watcher has no loop
28839  attached. Patch by Vincent Michel.
28840
28841- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
28842  add_writer, etc.
28843
28844- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
28845  Марк.
28846
28847- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
28848
28849- bpo-28372: Fix asyncio to support formatting of non-python coroutines.
28850
28851- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
28852  Марк.
28853
28854- bpo-27972: Prohibit Tasks to await on themselves.
28855
28856Windows
28857-------
28858
28859- bpo-28402: Adds signed catalog files for stdlib on Windows.
28860
28861- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
28862  Sun)
28863
28864- bpo-28251: Improvements to help manuals on Windows.
28865
28866- bpo-28110: launcher.msi has different product codes between 32-bit and
28867  64-bit
28868
28869- bpo-28161: Opening CON for write access fails
28870
28871- bpo-28162: WindowsConsoleIO readall() fails if first line starts with
28872  Ctrl+Z
28873
28874- bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
28875
28876- bpo-28164: _PyIO_get_console_type fails for various paths
28877
28878- bpo-28137: Renames Windows path file to ._pth
28879
28880- bpo-28138: Windows ._pth file should allow import site
28881
28882C API
28883-----
28884
28885- bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
28886  PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
28887  PyUnicode_AsEncodedUnicode().
28888
28889Build
28890-----
28891
28892- bpo-28258: Fixed build with Estonian locale (python-config and distclean
28893  targets in Makefile).  Patch by Arfrever Frehtes Taifersar Arahesis.
28894
28895- bpo-26661: setup.py now detects system libffi with multiarch wrapper.
28896
28897- bpo-15819: Remove redundant include search directory option for building
28898  outside the source tree.
28899
28900Tests
28901-----
28902
28903- bpo-28217: Adds _testconsole module to test console input.
28904
28905
28906What's New in Python 3.6.0 beta 1?
28907==================================
28908
28909*Release date: 2016-09-12*
28910
28911Core and Builtins
28912-----------------
28913
28914- bpo-23722: The __class__ cell used by zero-argument super() is now
28915  initialized from type.__new__ rather than __build_class__, so class
28916  methods relying on that will now work correctly when called from metaclass
28917  methods during class creation. Patch by Martin Teichmann.
28918
28919- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is
28920  compiled with NSMALLPOSINTS = 0.
28921
28922- bpo-27080: Implement formatting support for :pep:`515`.  Initial patch by
28923  Chris Angelico.
28924
28925- bpo-27199: In tarfile, expose copyfileobj bufsize to improve throughput.
28926  Patch by Jason Fried.
28927
28928- bpo-27948: In f-strings, only allow backslashes inside the braces (where
28929  the expressions are).  This is a breaking change from the 3.6 alpha
28930  releases, where backslashes are allowed anywhere in an f-string.  Also,
28931  require that expressions inside f-strings be enclosed within literal
28932  braces, and not escapes like ``f'\x7b"hi"\x7d'``.
28933
28934- bpo-28046: Remove platform-specific directories from sys.path.
28935
28936- bpo-28071: Add early-out for differencing from an empty set.
28937
28938- bpo-25758: Prevents zipimport from unnecessarily encoding a filename
28939  (patch by Eryk Sun)
28940
28941- bpo-25856: The __module__ attribute of extension classes and functions now
28942  is interned. This leads to more compact pickle data with protocol 4.
28943
28944- bpo-27213: Rework CALL_FUNCTION* opcodes to produce shorter and more
28945  efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka,
28946  reviewed by Serhiy Storchaka and Victor Stinner.
28947
28948- bpo-26331: Implement tokenizing support for :pep:`515`. Patch by Georg
28949  Brandl.
28950
28951- bpo-27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
28952  Patch by Ivan Levkivskyi.
28953
28954- bpo-28003: Implement :pep:`525` -- Asynchronous Generators.
28955
28956- bpo-27985: Implement :pep:`526` -- Syntax for Variable Annotations. Patch
28957  by Ivan Levkivskyi.
28958
28959- bpo-26058: Add a new private version to the builtin dict type, incremented
28960  at each dictionary creation and at each dictionary change. Implementation
28961  of the PEP 509.
28962
28963- bpo-27364: A backslash-character pair that is not a valid escape sequence
28964  now generates a DeprecationWarning.  Patch by Emanuel Barry.
28965
28966- bpo-27350: `dict` implementation is changed like PyPy. It is more compact
28967  and preserves insertion order. (Concept developed by Raymond Hettinger and
28968  patch by Inada Naoki.)
28969
28970- bpo-27911: Remove unnecessary error checks in
28971  ``exec_builtin_or_dynamic()``.
28972
28973- bpo-27078: Added BUILD_STRING opcode.  Optimized f-strings evaluation.
28974
28975- bpo-17884: Python now requires systems with inttypes.h and stdint.h
28976
28977- bpo-27961: Require platforms to support ``long long``. Python hasn't
28978  compiled without ``long long`` for years, so this is basically a
28979  formality.
28980
28981- bpo-27355: Removed support for Windows CE.  It was never finished, and
28982  Windows CE is no longer a relevant platform for Python.
28983
28984- Implement :pep:`523`.
28985
28986- bpo-27870: A left shift of zero by a large integer no longer attempts to
28987  allocate large amounts of memory.
28988
28989- bpo-25402: In int-to-decimal-string conversion, improve the estimate of
28990  the intermediate memory required, and remove an unnecessarily strict
28991  overflow check. Patch by Serhiy Storchaka.
28992
28993- bpo-27214: In long_invert, be more careful about modifying object returned
28994  by long_add, and remove an unnecessary check for small longs. Thanks Oren
28995  Milman for analysis and patch.
28996
28997- bpo-27506: Support passing the bytes/bytearray.translate() "delete"
28998  argument by keyword.
28999
29000- bpo-27812: Properly clear out a generator's frame's backreference to the
29001  generator to prevent crashes in frame.clear().
29002
29003- bpo-27811: Fix a crash when a coroutine that has not been awaited is
29004  finalized with warnings-as-errors enabled.
29005
29006- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
29007  use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
29008
29009- bpo-27792: The modulo operation applied to ``bool`` and other ``int``
29010  subclasses now always returns an ``int``. Previously the return type
29011  depended on the input values. Patch by Xiang Zhang.
29012
29013- bpo-26984: int() now always returns an instance of exact int.
29014
29015- bpo-25604: Fix a minor bug in integer true division; this bug could
29016  potentially have caused off-by-one-ulp results on platforms with
29017  unreliable ldexp implementations.
29018
29019- bpo-24254: Make class definition namespace ordered by default.
29020
29021- bpo-27662: Fix an overflow check in ``List_New``: the original code was
29022  checking against ``Py_SIZE_MAX`` instead of the correct upper bound of
29023  ``Py_SSIZE_T_MAX``. Patch by Xiang Zhang.
29024
29025- bpo-27782: Multi-phase extension module import now correctly allows the
29026  ``m_methods`` field to be used to add module level functions to instances
29027  of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
29028
29029- bpo-27936: The round() function accepted a second None argument for some
29030  types but not for others.  Fixed the inconsistency by accepting None for
29031  all numeric types.
29032
29033- bpo-27487: Warn if a submodule argument to "python -m" or
29034  runpy.run_module() is found in sys.modules after parent packages are
29035  imported, but before the submodule is executed.
29036
29037- bpo-27157: Make only type() itself accept the one-argument form. Patch by
29038  Eryk Sun and Emanuel Barry.
29039
29040- bpo-27558: Fix a SystemError in the implementation of "raise" statement.
29041  In a brand new thread, raise a RuntimeError since there is no active
29042  exception to reraise. Patch written by Xiang Zhang.
29043
29044- bpo-28008: Implement :pep:`530` -- asynchronous comprehensions.
29045
29046- bpo-27942: Fix memory leak in codeobject.c
29047
29048Library
29049-------
29050
29051- bpo-28732: Fix crash in os.spawnv() with no elements in args
29052
29053- bpo-28485: Always raise ValueError for negative
29054  compileall.compile_dir(workers=...) parameter, even when multithreading is
29055  unavailable.
29056
29057- bpo-28037: Use sqlite3_get_autocommit() instead of setting
29058  Connection->inTransaction manually.
29059
29060- bpo-25283: Attributes tm_gmtoff and tm_zone are now available on all
29061  platforms in the return values of time.localtime() and time.gmtime().
29062
29063- bpo-24454: Regular expression match object groups are now accessible using
29064  __getitem__. "mo[x]" is equivalent to "mo.group(x)".
29065
29066- bpo-10740: sqlite3 no longer implicitly commit an open transaction before
29067  DDL statements.
29068
29069- bpo-17941: Add a *module* parameter to collections.namedtuple().
29070
29071- bpo-22493: Inline flags now should be used only at the start of the
29072  regular expression. Deprecation warning is emitted if uses them in the
29073  middle of the regular expression.
29074
29075- bpo-26885: xmlrpc now supports unmarshalling additional data types used by
29076  Apache XML-RPC implementation for numerics and None.
29077
29078- bpo-28070: Fixed parsing inline verbose flag in regular expressions.
29079
29080- bpo-19500: Add client-side SSL session resumption to the ssl module.
29081
29082- bpo-28022: Deprecate ssl-related arguments in favor of SSLContext. The
29083  deprecation include manual creation of SSLSocket and certfile/keyfile (or
29084  similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib.
29085
29086- bpo-28043: SSLContext has improved default settings: OP_NO_SSLv2,
29087  OP_NO_SSLv3, OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE,
29088  OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE and HIGH ciphers without MD5.
29089
29090- bpo-24693: Changed some RuntimeError's in the zipfile module to more
29091  appropriate types. Improved some error messages and debugging output.
29092
29093- bpo-17909: ``json.load`` and ``json.loads`` now support binary input
29094  encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka.
29095
29096- bpo-27137: the pure Python fallback implementation of
29097  ``functools.partial`` now matches the behaviour of its accelerated C
29098  counterpart for subclassing, pickling and text representation purposes.
29099  Patch by Emanuel Barry and Serhiy Storchaka.
29100
29101- Fix possible integer overflows and crashes in the mmap module with unusual
29102  usage patterns.
29103
29104- bpo-1703178: Fix the ability to pass the --link-objects option to the
29105  distutils build_ext command.
29106
29107- bpo-28019: itertools.count() no longer rounds non-integer step in range
29108  between 1.0 and 2.0 to 1.
29109
29110- bpo-18401: Pdb now supports the 'readrc' keyword argument to control
29111  whether .pdbrc files should be read.  Patch by Martin Matusiak and Sam
29112  Kimbrel.
29113
29114- bpo-25969: Update the lib2to3 grammar to handle the unpacking
29115  generalizations added in 3.5.
29116
29117- bpo-14977: mailcap now respects the order of the lines in the mailcap
29118  files ("first match"), as required by RFC 1542.  Patch by Michael Lazar.
29119
29120- bpo-28082: Convert re flag constants to IntFlag.
29121
29122- bpo-28025: Convert all ssl module constants to IntEnum and IntFlags.
29123  SSLContext properties now return flags and enums.
29124
29125- bpo-23591: Add Flag, IntFlag, and auto() to enum module.
29126
29127- bpo-433028: Added support of modifier spans in regular expressions.
29128
29129- bpo-24594: Validates persist parameter when opening MSI database
29130
29131- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes
29132  (Patch by Duane Griffin.  Reviewed and approved by Stefan Behnel.)
29133
29134- bpo-28047: Fixed calculation of line length used for the base64 CTE in the
29135  new email policies.
29136
29137- bpo-27576: Fix call order in OrderedDict.__init__().
29138
29139- email.generator.DecodedGenerator now supports the policy keyword.
29140
29141- bpo-28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM,
29142  DLFCN, TYPES, CDIO, and STROPTS.
29143
29144- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by
29145  Claude Paroz.
29146
29147- bpo-24277: The new email API is no longer provisional, and the docs have
29148  been reorganized and rewritten to emphasize the new API.
29149
29150- bpo-22450: urllib now includes an ``Accept: */*`` header among the default
29151  headers. This makes the results of REST API requests more consistent and
29152  predictable especially when proxy servers are involved.
29153
29154- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
29155  between runs given the same Grammar.txt input regardless of the hash
29156  randomization setting.
29157
29158- bpo-28005: Allow ImportErrors in encoding implementation to propagate.
29159
29160- bpo-26667: Support path-like objects in importlib.util.
29161
29162- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
29163  in the "ctypes" and "array" modules.
29164
29165- bpo-22233: Break email header lines *only* on the RFC specified CR and LF
29166  characters, not on arbitrary unicode line breaks.  This also fixes a bug
29167  in HTTP header parsing.
29168
29169- bpo-27331: The email.mime classes now all accept an optional policy
29170  keyword.
29171
29172- bpo-27988: Fix email iter_attachments incorrect mutation of payload list.
29173
29174- bpo-16113: Add SHA-3 and SHAKE support to hashlib module.
29175
29176- Eliminate a tautological-pointer-compare warning in _scproxy.c.
29177
29178- bpo-27776: The :func:`os.urandom` function does now block on Linux 3.17
29179  and newer until the system urandom entropy pool is initialized to increase
29180  the security. This change is part of the :pep:`524`.
29181
29182- bpo-27778: Expose the Linux ``getrandom()`` syscall as a new
29183  :func:`os.getrandom` function. This change is part of the :pep:`524`.
29184
29185- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name
29186  fields in X.509 certs.
29187
29188- bpo-18844: Add random.choices().
29189
29190- bpo-25761: Improved error reporting about truncated pickle data in C
29191  implementation of unpickler.  UnpicklingError is now raised instead of
29192  AttributeError and ValueError in some cases.
29193
29194- bpo-26798: Add BLAKE2 (blake2b and blake2s) to hashlib.
29195
29196- bpo-26032: Optimized globbing in pathlib by using os.scandir(); it is now
29197  about 1.5--4 times faster.
29198
29199- bpo-25596: Optimized glob() and iglob() functions in the glob module; they
29200  are now about 3--6 times faster.
29201
29202- bpo-27928: Add scrypt (password-based key derivation function) to hashlib
29203  module (requires OpenSSL 1.1.0).
29204
29205- bpo-27850: Remove 3DES from ssl module's default cipher list to counter
29206  measure sweet32 attack (CVE-2016-2183).
29207
29208- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list.
29209  (Required OpenSSL 1.1.0 or LibreSSL).
29210
29211- bpo-25387: Check return value of winsound.MessageBeep.
29212
29213- bpo-27866: Add SSLContext.get_ciphers() method to get a list of all
29214  enabled ciphers.
29215
29216- bpo-27744: Add AF_ALG (Linux Kernel crypto) to socket module.
29217
29218- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0.
29219
29220- bpo-11620: Fix support for SND_MEMORY in winsound.PlaySound.  Based on a
29221  patch by Tim Lesher.
29222
29223- bpo-11734: Add support for IEEE 754 half-precision floats to the struct
29224  module. Based on a patch by Eli Stevens.
29225
29226- bpo-27919: Deprecated ``extra_path`` distribution option in distutils
29227  packaging.
29228
29229- bpo-23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to
29230  match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and
29231  ``cmath.nanj`` to match the format used by complex repr.
29232
29233- bpo-27842: The csv.DictReader now returns rows of type OrderedDict.
29234  (Contributed by Steve Holden.)
29235
29236- Remove support for passing a file descriptor to os.access. It never worked
29237  but previously didn't raise.
29238
29239- bpo-12885: Fix error when distutils encounters symlink.
29240
29241- bpo-27881: Fixed possible bugs when setting
29242  sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
29243
29244- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory
29245  creates not a cursor.  Patch by Xiang Zhang.
29246
29247- bpo-19884: Avoid spurious output on OS X with Gnu Readline.
29248
29249- bpo-27706: Restore deterministic behavior of random.Random().seed() for
29250  string seeds using seeding version 1.  Allows sequences of calls to
29251  random() to exactly match those obtained in Python 2. Patch by Nofar
29252  Schnider.
29253
29254- bpo-10513: Fix a regression in Connection.commit().  Statements should not
29255  be reset after a commit.
29256
29257- bpo-12319: Chunked transfer encoding support added to
29258  http.client.HTTPConnection requests.  The
29259  urllib.request.AbstractHTTPHandler class does not enforce a Content-Length
29260  header any more.  If a HTTP request has a file or iterable body, but no
29261  Content-Length header, the library now falls back to use chunked
29262  transfer-encoding.
29263
29264- A new version of typing.py from https://github.com/python/typing: -
29265  Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__
29266  (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove
29267  the dict constraint in ForwardRef._eval_type (upstream #252)
29268
29269- bpo-27832: Make ``_normalize`` parameter to ``Fraction`` constructor
29270  keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
29271
29272- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of
29273  negative exponent and negative base.
29274
29275- bpo-21718: cursor.description is now available for queries using CTEs.
29276
29277- bpo-27819: In distutils sdists, simply produce the "gztar" (gzipped tar
29278  format) distributions on all platforms unless "formats" is supplied.
29279
29280- bpo-2466: posixpath.ismount now correctly recognizes mount points which
29281  the user does not have permission to access.
29282
29283- bpo-9998: On Linux, ctypes.util.find_library now looks in LD_LIBRARY_PATH
29284  for shared libraries.
29285
29286- bpo-27573: exit message for code.interact is now configurable.
29287
29288- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to
29289  Paulo Andrade and Petr Viktorin for the analysis and patch.
29290
29291- bpo-6766: Distributed reference counting added to multiprocessing to
29292  support nesting of shared values / proxy objects.
29293
29294- bpo-21201: Improves readability of multiprocessing error message.  Thanks
29295  to Wojciech Walczak for patch.
29296
29297- asyncio: Add set_protocol / get_protocol to Transports.
29298
29299- bpo-27456: asyncio: Set TCP_NODELAY by default.
29300
29301IDLE
29302----
29303
29304- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger
29305  Serwy, updated by Bayard Randel.
29306
29307- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
29308
29309- bpo-27891: Consistently group and sort imports within idlelib modules.
29310
29311- bpo-17642: add larger font sizes for classroom projection.
29312
29313- Add version to title of IDLE help window.
29314
29315- bpo-25564: In section on IDLE -- console differences, mention that using
29316  exec means that __builtins__ is defined for each statement.
29317
29318- bpo-27821: Fix 3.6.0a3 regression that prevented custom key sets from
29319  being selected when no custom theme was defined.
29320
29321C API
29322-----
29323
29324- bpo-26900: Excluded underscored names and other private API from limited
29325  API.
29326
29327- bpo-26027: Add support for path-like objects in PyUnicode_FSConverter() &
29328  PyUnicode_FSDecoder().
29329
29330Tests
29331-----
29332
29333- bpo-27427: Additional tests for the math module. Patch by Francisco Couzo.
29334
29335- bpo-27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor
29336  libm implementation of tan.
29337
29338- bpo-26040: Improve test_math and test_cmath coverage and rigour. Patch by
29339  Jeff Allen.
29340
29341- bpo-27787: Call gc.collect() before checking each test for "dangling
29342  threads", since the dangling threads are weak references.
29343
29344Build
29345-----
29346
29347- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach)
29348
29349- bpo-27705: Update message in validate_ucrtbase.py
29350
29351- bpo-27976: Deprecate building _ctypes with the bundled copy of libffi on
29352  non-OSX UNIX platforms.
29353
29354- bpo-27983: Cause lack of llvm-profdata tool when using clang as required
29355  for PGO linking to be a configure time error rather than make time when
29356  ``--with-optimizations`` is enabled.  Also improve our ability to find the
29357  llvm-profdata tool on MacOS and some Linuxes.
29358
29359- bpo-21590: Support for DTrace and SystemTap probes.
29360
29361- bpo-26307: The profile-opt build now applies PGO to the built-in modules.
29362
29363- bpo-26359: Add the --with-optimizations flag to turn on LTO and PGO build
29364  support when available.
29365
29366- bpo-27917: Set platform triplets for Android builds.
29367
29368- bpo-25825: Update references to the $(LIBPL) installation path on AIX.
29369  This path was changed in 3.2a4.
29370
29371- Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
29372
29373- bpo-21122: Fix LTO builds on OS X.
29374
29375- bpo-17128: Build OS X installer with a private copy of OpenSSL. Also
29376  provide a sample Install Certificates command script to install a set of
29377  root certificates from the third-party certifi module.
29378
29379Tools/Demos
29380-----------
29381
29382- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the
29383  current "re" module, avoid invalid Python backslash escapes, and fix a bug
29384  parsing escaped C quote signs.
29385
29386Windows
29387-------
29388
29389- bpo-28065: Update xz dependency to 5.2.2 and build it from source.
29390
29391- bpo-25144: Ensures TargetDir is set before continuing with custom install.
29392
29393- bpo-1602: Windows console doesn't input or print Unicode (PEP 528)
29394
29395- bpo-27781: Change file system encoding on Windows to UTF-8 (PEP 529)
29396
29397- bpo-27731: Opt-out of MAX_PATH on Windows 10
29398
29399- bpo-6135: Adds encoding and errors parameters to subprocess.
29400
29401- bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec
29402  lookup.
29403
29404- bpo-27982: The functions of the winsound module now accept keyword
29405  arguments.
29406
29407- bpo-20366: Build full text search support into SQLite on Windows.
29408
29409- bpo-27756: Adds new icons for Python files and processes on Windows.
29410  Designs by Cherry Wang.
29411
29412- bpo-27883: Update sqlite to 3.14.1.0 on Windows.
29413
29414
29415What's New in Python 3.6.0 alpha 4?
29416===================================
29417
29418*Release date: 2016-08-15*
29419
29420Core and Builtins
29421-----------------
29422
29423- bpo-27704: Optimized creating bytes and bytearray from byte-like objects
29424  and iterables. Speed up to 3 times for short objects.  Original patch by
29425  Naoki Inada.
29426
29427- bpo-26823: Large sections of repeated lines in tracebacks are now
29428  abbreviated as "[Previous line repeated {count} more times]" by the
29429  builtin traceback rendering. Patch by Emanuel Barry.
29430
29431- bpo-27574: Decreased an overhead of parsing keyword arguments in functions
29432  implemented with using Argument Clinic.
29433
29434- bpo-22557: Now importing already imported modules is up to 2.5 times
29435  faster.
29436
29437- bpo-17596: Include <wincrypt.h> to help with Min GW building.
29438
29439- bpo-17599: On Windows, rename the privately defined REPARSE_DATA_BUFFER
29440  structure to avoid conflicting with the definition from Min GW.
29441
29442- bpo-27507: Add integer overflow check in bytearray.extend().  Patch by
29443  Xiang Zhang.
29444
29445- bpo-27581: Don't rely on wrapping for overflow check in
29446  PySequence_Tuple().  Patch by Xiang Zhang.
29447
29448- bpo-1621: Avoid signed integer overflow in list and tuple operations.
29449  Patch by Xiang Zhang.
29450
29451- bpo-27419: Standard __import__() no longer look up "__import__" in globals
29452  or builtins for importing submodules or "from import".  Fixed a crash if
29453  raise a warning about unabling to resolve package from __spec__ or
29454  __package__.
29455
29456- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows.
29457
29458- bpo-27514: Make having too many statically nested blocks a SyntaxError
29459  instead of SystemError.
29460
29461- bpo-27366: Implemented :pep:`487` (Simpler customization of class
29462  creation). Upon subclassing, the __init_subclass__ classmethod is called
29463  on the base class. Descriptors are initialized with __set_name__ after
29464  class creation.
29465
29466Library
29467-------
29468
29469- bpo-26027: Add :pep:`519`/__fspath__() support to the os and os.path
29470  modules. Includes code from Jelle Zijlstra. (See also: bpo-27524)
29471
29472- bpo-27598: Add Collections to collections.abc. Patch by Ivan Levkivskyi,
29473  docs by Neil Girdhar.
29474
29475- bpo-25958: Support "anti-registration" of special methods from various
29476  ABCs, like __hash__, __iter__ or __len__.  All these (and several more)
29477  can be set to None in an implementation class and the behavior will be as
29478  if the method is not defined at all. (Previously, this mechanism existed
29479  only for __hash__, to make mutable classes unhashable.)  Code contributed
29480  by Andrew Barnert and Ivan Levkivskyi.
29481
29482- bpo-16764: Support keyword arguments to zlib.decompress().  Patch by Xiang
29483  Zhang.
29484
29485- bpo-27736: Prevent segfault after interpreter re-initialization due to ref
29486  count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by
29487  Xiang Zhang.
29488
29489- bpo-25628: The *verbose* and *rename* parameters for
29490  collections.namedtuple are now keyword-only.
29491
29492- bpo-12345: Add mathematical constant tau to math and cmath. See also
29493  :pep:`628`.
29494
29495- bpo-26823: traceback.StackSummary.format now abbreviates large sections of
29496  repeated lines as "[Previous line repeated {count} more times]" (this
29497  change then further affects other traceback display operations in the
29498  module). Patch by Emanuel Barry.
29499
29500- bpo-27664: Add to concurrent.futures.thread.ThreadPoolExecutor() the
29501  ability to specify a thread name prefix.
29502
29503- bpo-27181: Add geometric_mean and harmonic_mean to statistics module.
29504
29505- bpo-27573: code.interact now prints an message when exiting.
29506
29507- bpo-6422: Add autorange method to timeit.Timer objects.
29508
29509- bpo-27773: Correct some memory management errors server_hostname in
29510  _ssl.wrap_socket().
29511
29512- bpo-26750: unittest.mock.create_autospec() now works properly for
29513  subclasses of property() and other data descriptors.  Removes the never
29514  publicly used, never documented unittest.mock.DescriptorTypes tuple.
29515
29516- bpo-26754: Undocumented support of general bytes-like objects as path in
29517  compile() and similar functions is now deprecated.
29518
29519- bpo-26800: Undocumented support of general bytes-like objects as paths in
29520  os functions is now deprecated.
29521
29522- bpo-26981: Add _order_ compatibility shim to enum.Enum for Python 2/3 code
29523  bases.
29524
29525- bpo-27661: Added tzinfo keyword argument to datetime.combine.
29526
29527- In the curses module, raise an error if window.getstr() or window.instr()
29528  is passed a negative value.
29529
29530- bpo-27783: Fix possible usage of uninitialized memory in
29531  operator.methodcaller.
29532
29533- bpo-27774: Fix possible Py_DECREF on unowned object in _sre.
29534
29535- bpo-27760: Fix possible integer overflow in binascii.b2a_qp.
29536
29537- bpo-27758: Fix possible integer overflow in the _csv module for large
29538  record lengths.
29539
29540- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
29541  HTTP_PROXY variable when REQUEST_METHOD environment is set, which
29542  indicates that the script is in CGI mode.
29543
29544- bpo-7063: Remove dead code from the "array" module's slice handling. Patch
29545  by Chuck.
29546
29547- bpo-27656: Do not assume sched.h defines any SCHED_* constants.
29548
29549- bpo-27130: In the "zlib" module, fix handling of large buffers (typically
29550  4 GiB) when compressing and decompressing.  Previously, inputs were
29551  limited to 4 GiB, and compression and decompression operations did not
29552  properly handle results of 4 GiB.
29553
29554- bpo-24773: Implemented :pep:`495` (Local Time Disambiguation).
29555
29556- Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select
29557  module.
29558
29559- bpo-27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select
29560  module.
29561
29562- bpo-1621: Avoid signed int negation overflow in the "audioop" module.
29563
29564- bpo-27533: Release GIL in nt._isdir
29565
29566- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original
29567  patch by Alexandre Vassalotti.
29568
29569- bpo-27522: Avoid an unintentional reference cycle in email.feedparser.
29570
29571- bpo-27512: Fix a segfault when os.fspath() called an __fspath__() method
29572  that raised an exception. Patch by Xiang Zhang.
29573
29574IDLE
29575----
29576
29577- bpo-27714: text_textview and test_autocomplete now pass when re-run in the
29578  same process.  This occurs when test_idle fails when run with the -w
29579  option but without -jn.  Fix warning from test_config.
29580
29581- bpo-27621: Put query response validation error messages in the query box
29582  itself instead of in a separate messagebox.  Redo tests to match. Add Mac
29583  OSX refinements. Original patch by Mark Roseman.
29584
29585- bpo-27620: Escape key now closes Query box as cancelled.
29586
29587- bpo-27609: IDLE: tab after initial whitespace should tab, not
29588  autocomplete. This fixes problem with writing docstrings at least twice
29589  indented.
29590
29591- bpo-27609: Explicitly return None when there are also non-None returns. In
29592  a few cases, reverse a condition and eliminate a return.
29593
29594- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports.
29595  Users must include the same imports required to run directly in Python.
29596
29597- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
29598  default key set depend on the platform. Add tests for the changes to the
29599  config module.
29600
29601- bpo-27452: add line counter and crc to IDLE configHandler test dump.
29602
29603Tests
29604-----
29605
29606- bpo-25805: Skip a test in test_pkgutil as needed that doesn't work when
29607  ``__name__ == __main__``. Patch by SilentGhost.
29608
29609- bpo-27472: Add test.support.unix_shell as the path to the default shell.
29610
29611- bpo-27369: In test_pyexpat, avoid testing an error message detail that
29612  changed in Expat 2.2.0.
29613
29614- bpo-27594: Prevent assertion error when running test_ast with coverage
29615  enabled: ensure code object has a valid first line number. Patch suggested
29616  by Ivan Levkivskyi.
29617
29618Windows
29619-------
29620
29621- bpo-27647: Update bundled Tcl/Tk to 8.6.6.
29622
29623- bpo-27610: Adds :pep:`514` metadata to Windows installer
29624
29625- bpo-27469: Adds a shell extension to the launcher so that drag and drop
29626  works correctly.
29627
29628- bpo-27309: Enables proper Windows styles in python[w].exe manifest.
29629
29630Build
29631-----
29632
29633- bpo-27713: Suppress spurious build warnings when updating importlib's
29634  bootstrap files. Patch by Xiang Zhang
29635
29636- bpo-25825: Correct the references to Modules/python.exp, which is required
29637  on AIX.  The references were accidentally changed in 3.5.0a1.
29638
29639- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi
29640  Hsuan Yen.
29641
29642- bpo-27641: The configure script now inserts comments into the makefile to
29643  prevent the pgen and _freeze_importlib executables from being
29644  cross-compiled.
29645
29646- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be
29647  used for file generation during the build.
29648
29649- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update
29650  FreedBSD version checks for the original ctype UTF-8 workaround.
29651
29652
29653What's New in Python 3.6.0 alpha 3?
29654===================================
29655
29656*Release date: 2016-07-11*
29657
29658Security
29659--------
29660
29661- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux.
29662  Truncate size to INT_MAX and loop until we collected enough random bytes,
29663  instead of casting a directly Py_ssize_t to int.
29664
29665- bpo-22636: Avoid shell injection problems with ctypes.util.find_library().
29666
29667Core and Builtins
29668-----------------
29669
29670- bpo-27473: Fixed possible integer overflow in bytes and bytearray
29671  concatenations. Patch by Xiang Zhang.
29672
29673- bpo-23034: The output of a special Python build with defined COUNT_ALLOCS,
29674  SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by  default.  It
29675  can be re-enabled using the "-X showalloccount" option.  It now outputs to
29676  stderr instead of stdout.
29677
29678- bpo-27443: __length_hint__() of bytearray iterators no longer return a
29679  negative integer for a resized bytearray.
29680
29681- bpo-27007: The fromhex() class methods of bytes and bytearray subclasses
29682  now return an instance of corresponding subclass.
29683
29684Library
29685-------
29686
29687- bpo-26844: Fix error message for imp.find_module() to refer to 'path'
29688  instead of 'name'. Patch by Lev Maximov.
29689
29690- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
29691  error about unclean EOF.
29692
29693- bpo-27466: Change time format returned by http.cookie.time2netscape,
29694  confirming the netscape cookie format and making it consistent with
29695  documentation.
29696
29697- bpo-21708: Deprecated dbm.dumb behavior that differs from common dbm
29698  behavior: creating a database in 'r' and 'w' modes and modifying a
29699  database in 'r' mode.
29700
29701- bpo-26721: Change the socketserver.StreamRequestHandler.wfile attribute to
29702  implement BufferedIOBase. In particular, the write() method no longer does
29703  partial writes.
29704
29705- bpo-22115: Added methods trace_add, trace_remove and trace_info in the
29706  tkinter.Variable class.  They replace old methods trace_variable, trace,
29707  trace_vdelete and trace_vinfo that use obsolete Tcl commands and might not
29708  work in future versions of Tcl.  Fixed old tracing methods:
29709  trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now
29710  always returns a list of pairs of strings, tracing in the "u" mode now
29711  works.
29712
29713- bpo-26243: Only the level argument to zlib.compress() is keyword argument
29714  now.  The first argument is positional-only.
29715
29716- bpo-27038: Expose the DirEntry type as os.DirEntry. Code patch by Jelle
29717  Zijlstra.
29718
29719- bpo-27186: Update os.fspath()/PyOS_FSPath() to check the return value of
29720  __fspath__() to be either str or bytes.
29721
29722- bpo-18726: All optional parameters of the dump(), dumps(), load() and
29723  loads() functions and JSONEncoder and JSONDecoder class constructors in
29724  the json module are now keyword-only.
29725
29726- bpo-27319: Methods selection_set(), selection_add(), selection_remove()
29727  and selection_toggle() of ttk.TreeView now allow passing multiple items as
29728  multiple arguments instead of passing them as a tuple.  Deprecated
29729  undocumented ability of calling the selection() method with arguments.
29730
29731- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and
29732  ispunct().
29733
29734- bpo-27294: Numerical state in the repr for Tkinter event objects is now
29735  represented as a combination of known flags.
29736
29737- bpo-27177: Match objects in the re module now support index-like objects
29738  as group indices.  Based on patches by Jeroen Demeyer and Xiang Zhang.
29739
29740- bpo-26754: Some functions (compile() etc) accepted a filename argument
29741  encoded as an iterable of integers. Now only strings and byte-like objects
29742  are accepted.
29743
29744- bpo-26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by
29745  Daniel Stokes.
29746
29747- bpo-27048: Prevents distutils failing on Windows when environment
29748  variables contain non-ASCII characters
29749
29750- bpo-27330: Fixed possible leaks in the ctypes module.
29751
29752- bpo-27238: Got rid of bare excepts in the turtle module.  Original patch
29753  by Jelle Zijlstra.
29754
29755- bpo-27122: When an exception is raised within the context being managed by
29756  a contextlib.ExitStack() and one of the exit stack generators catches and
29757  raises it in a chain, do not re-raise the original exception when exiting,
29758  let the new chained one through.  This avoids the :pep:`479` bug described
29759  in issue25782.
29760
29761- bpo-16864: sqlite3.Cursor.lastrowid now supports REPLACE statement.
29762  Initial patch by Alex LordThorsen.
29763
29764- bpo-26386: Fixed ttk.TreeView selection operations with item id's
29765  containing spaces.
29766
29767- bpo-8637: Honor a pager set by the env var MANPAGER (in preference to one
29768  set by the env var PAGER).
29769
29770- bpo-16182: Fix various functions in the "readline" module to use the
29771  locale encoding, and fix get_begidx() and get_endidx() to return code
29772  point indexes.
29773
29774- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton.
29775
29776IDLE
29777----
29778
29779- bpo-27477: IDLE search dialogs now use ttk widgets.
29780
29781- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
29782  default key set depend on the platform. Add tests for the changes to the
29783  config module.
29784
29785- bpo-27452: make command line "idle-test> python test_help.py" work.
29786  __file__ is relative when python is started in the file's directory.
29787
29788- bpo-27452: add line counter and crc to IDLE configHandler test dump.
29789
29790- bpo-27380: IDLE: add query.py with base Query dialog and ttk widgets.
29791  Module had subclasses SectionName, ModuleName, and HelpSource, which are
29792  used to get information from users by configdialog and file =>Load Module.
29793  Each subclass has itw own validity checks.  Using ModuleName allows users
29794  to edit bad module names instead of starting over. Add tests and delete
29795  the two files combined into the new one.
29796
29797- bpo-27372: Test_idle no longer changes the locale.
29798
29799- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
29800
29801- bpo-27245: IDLE: Cleanly delete custom themes and key bindings.
29802  Previously, when IDLE was started from a console or by import, a cascade
29803  of warnings was emitted. Patch by Serhiy Storchaka.
29804
29805- bpo-24137: Run IDLE, test_idle, and htest with tkinter default root
29806  disabled.  Fix code and tests that fail with this restriction.  Fix htests
29807  to not create a second and redundant root and mainloop.
29808
29809- bpo-27310: Fix IDLE.app failure to launch on OS X due to vestigial import.
29810
29811C API
29812-----
29813
29814- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
29815  an iterable of integers. Now only strings and byte-like objects are
29816  accepted.
29817
29818Build
29819-----
29820
29821- bpo-28066: Fix the logic that searches build directories for generated
29822  include files when building outside the source tree.
29823
29824- bpo-27442: Expose the Android API level that python was built against, in
29825  sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'.
29826
29827- bpo-27434: The interpreter that runs the cross-build, found in PATH, must
29828  now be of the same feature version (e.g. 3.6) as the source being built.
29829
29830- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h.
29831
29832- bpo-23968: Rename the platform directory from plat-$(MACHDEP) to
29833  plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from
29834  config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install
29835  the platform specific _sysconfigdata module into the platform directory
29836  and rename it to include the ABIFLAGS.
29837
29838- Don't use largefile support for GNU/Hurd.
29839
29840Tools/Demos
29841-----------
29842
29843- bpo-27332: Fixed the type of the first argument of module-level functions
29844  generated by Argument Clinic.  Patch by Petr Viktorin.
29845
29846- bpo-27418: Fixed Tools/importbench/importbench.py.
29847
29848Documentation
29849-------------
29850
29851- bpo-19489: Moved the search box from the sidebar to the header and footer
29852  of each page. Patch by Ammar Askar.
29853
29854- bpo-27285: Update documentation to reflect the deprecation of ``pyvenv``
29855  and normalize on the term "virtual environment". Patch by Steve Piercy.
29856
29857Tests
29858-----
29859
29860- bpo-27027: Added test.support.is_android that is True when this is an
29861  Android build.
29862
29863
29864What's New in Python 3.6.0 alpha 2?
29865===================================
29866
29867*Release date: 2016-06-13*
29868
29869Security
29870--------
29871
29872- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283.
29873
29874- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by
29875  Team Oststrom.
29876
29877- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with
29878  ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom
29879  entropy pool is not initialized yet. Patch written by Colm Buckley.
29880
29881Core and Builtins
29882-----------------
29883
29884- bpo-27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.
29885  Patch by Demur Rumed.
29886
29887- bpo-27190: Raise NotSupportedError if sqlite3 is older than 3.3.1. Patch
29888  by Dave Sawyer.
29889
29890- bpo-27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode.  Calling
29891  function with generalized unpacking (PEP 448) and conflicting keyword
29892  names could cause undefined behavior.
29893
29894- bpo-27140: Added BUILD_CONST_KEY_MAP opcode.
29895
29896- bpo-27186: Add support for os.PathLike objects to open() (part of
29897  :pep:`519`).
29898
29899- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a
29900  negative number without setting an exception.
29901
29902- bpo-26983: float() now always return an instance of exact float. The
29903  deprecation warning is emitted if __float__ returns an instance of a
29904  strict subclass of float.  In a future versions of Python this can be an
29905  error.
29906
29907- bpo-27097: Python interpreter is now about 7% faster due to optimized
29908  instruction decoding.  Based on patch by Demur Rumed.
29909
29910- bpo-26647: Python interpreter now uses 16-bit wordcode instead of
29911  bytecode. Patch by Demur Rumed.
29912
29913- bpo-23275: Allow assigning to an empty target list in round brackets: () =
29914  iterable.
29915
29916- bpo-27243: Update the __aiter__ protocol: instead of returning an
29917  awaitable that resolves to an asynchronous iterator, the asynchronous
29918  iterator should be returned directly.  Doing the former will trigger a
29919  PendingDeprecationWarning.
29920
29921Library
29922-------
29923
29924- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants
29925  exposed on the API which are not implemented on GNU/Hurd. They would not
29926  work at runtime anyway.
29927
29928- bpo-27025: Generated names for Tkinter widgets are now more meaningful and
29929  recognizable.
29930
29931- bpo-25455: Fixed crashes in repr of recursive ElementTree.Element and
29932  functools.partial objects.
29933
29934- bpo-27294: Improved repr for Tkinter event objects.
29935
29936- bpo-20508: Improve exception message of IPv{4,6}Network.__getitem__. Patch
29937  by Gareth Rees.
29938
29939- bpo-21386: Implement missing IPv4Address.is_global property.  It was
29940  documented since 07a5610bae9d.  Initial patch by Roger Luethi.
29941
29942- bpo-27029: Removed deprecated support of universal newlines mode from
29943  ZipFile.open().
29944
29945- bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in
29946  regular expressions now are errors.  The re.LOCALE flag now can be used
29947  only with bytes patterns.
29948
29949- bpo-27186: Add os.PathLike support to DirEntry (part of :pep:`519`).
29950  Initial patch by Jelle Zijlstra.
29951
29952- bpo-20900: distutils register command now decodes HTTP responses
29953  correctly.  Initial patch by ingrid.
29954
29955- bpo-27186: Add os.PathLike support to pathlib, removing its provisional
29956  status (part of PEP 519). Initial patch by Dusty Phillips.
29957
29958- bpo-27186: Add support for os.PathLike objects to os.fsencode() and
29959  os.fsdecode() (part of :pep:`519`).
29960
29961- bpo-27186: Introduce os.PathLike and os.fspath() (part of :pep:`519`).
29962
29963- A new version of typing.py provides several new classes and features:
29964  @overload outside stubs, Reversible, DefaultDict, Text, ContextManager,
29965  Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some
29966  of the new features are not yet implemented in mypy or other static
29967  analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable,
29968  AsyncIterator) have been added (in fact they made it into 3.5.1 but were
29969  never mentioned).
29970
29971- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from
29972  sending a message body for 205 Reset Content.  Also, don't send Content
29973  header fields in responses that don't have a body.  Patch by Susumu
29974  Koshiba.
29975
29976- bpo-21313: Fix the "platform" module to tolerate when sys.version contains
29977  truncated build information.
29978
29979- bpo-23883: Added missing APIs to __all__ to match the documented APIs for
29980  the following modules: cgi, mailbox, mimetypes, plistlib and smtpd.
29981  Patches by Jacek Kołodziej.
29982
29983- bpo-27164: In the zlib module, allow decompressing raw Deflate streams
29984  with a predefined zdict.  Based on patch by Xiang Zhang.
29985
29986- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely
29987  write data to the client.  Previously it could do partial writes and
29988  truncate data.  Also, wsgiref.handler.ServerHandler can now handle stdout
29989  doing partial writes, but this is deprecated.
29990
29991- bpo-21272: Use _sysconfigdata.py to initialize distutils.sysconfig.
29992
29993- bpo-19611: :mod:`inspect` now reports the implicit ``.0`` parameters
29994  generated by the compiler for comprehension and generator expression
29995  scopes as if they were positional-only parameters called ``implicit0``.
29996  Patch by Jelle Zijlstra.
29997
29998- bpo-26809: Add ``__all__`` to :mod:`string`.  Patch by Emanuel Barry.
29999
30000- bpo-26373: subprocess.Popen.communicate now correctly ignores
30001  BrokenPipeError when the child process dies before .communicate() is
30002  called in more/all circumstances.
30003
30004- signal, socket, and ssl module IntEnum constant name lookups now return a
30005  consistent name for values having multiple names.  Ex: signal.Signals(6)
30006  now refers to itself as signal.SIGALRM rather than flipping between that
30007  and signal.SIGIOT based on the interpreter's hash randomization seed.
30008
30009- bpo-27167: Clarify the subprocess.CalledProcessError error message text
30010  when the child process died due to a signal.
30011
30012- bpo-25931: Don't define socketserver.Forking* names on platforms such as
30013  Windows that do not support os.fork().
30014
30015- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch
30016  by Claudiu Popa.
30017
30018- bpo-26526: Replace custom parse tree validation in the parser module with
30019  a simple DFA validator.
30020
30021- bpo-27114: Fix SSLContext._load_windows_store_certs fails with
30022  PermissionError
30023
30024- bpo-18383: Avoid creating duplicate filters when using filterwarnings and
30025  simplefilter. Based on patch by Alex Shkop.
30026
30027- bpo-23026: winreg.QueryValueEx() now return an integer for REG_QWORD type.
30028
30029- bpo-26741: subprocess.Popen destructor now emits a ResourceWarning warning
30030  if the child process is still running.
30031
30032- bpo-27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to
30033  deserialize a lot of small objects.
30034
30035- bpo-21271: New keyword only parameters in reset_mock call.
30036
30037IDLE
30038----
30039
30040- bpo-5124: Paste with text selected now replaces the selection on X11. This
30041  matches how paste works on Windows, Mac, most modern Linux apps, and ttk
30042  widgets. Original patch by Serhiy Storchaka.
30043
30044- bpo-24750: Switch all scrollbars in IDLE to ttk versions. Where needed,
30045  minimal tests are added to cover changes.
30046
30047- bpo-24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now
30048  unneeded tk version tests and code for older versions. Add test for IDLE
30049  syntax colorizer.
30050
30051- bpo-27239: idlelib.macosx.isXyzTk functions initialize as needed.
30052
30053- bpo-27262: move Aqua unbinding code, which enable context menus, to
30054  macosx.
30055
30056- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is
30057  a private implementation of test.test_idle and tool for maintainers.
30058
30059- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These
30060  persisted after other warnings were suppressed in #20567. Apply Serhiy
30061  Storchaka's update_idletasks solution to four test files. Record this
30062  additional advice in idle_test/README.txt
30063
30064- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk
30065  warning messages from tests.  Apply advice to several IDLE tests.
30066
30067- bpo-24225: Update idlelib/README.txt with new file names and event
30068  handlers.
30069
30070- bpo-27156: Remove obsolete code not used by IDLE.
30071
30072- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
30073  code for configuring text widget colors to a new function.
30074
30075- bpo-24225: Rename many `idlelib/*.py` and `idle_test/test_*.py` files.
30076  Edit files to replace old names with new names when the old name referred
30077  to the module rather than the class it contained. See the issue and IDLE
30078  section in What's New in 3.6 for more.
30079
30080- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
30081  on Linux prevented the configuration dialog from opening.
30082
30083- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav
30084  Heblikar.
30085
30086- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
30087  Heblikar.
30088
30089- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
30090  Martínez.
30091
30092- bpo-21703: Add test for undo delegator.  Patch mostly by Saimadhav
30093  Heblikar .
30094
30095- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks.
30096
30097- bpo-23977: Add more asserts to test_delegator.
30098
30099Documentation
30100-------------
30101
30102- bpo-16484: Change the default PYTHONDOCS URL to "https:", and fix the
30103  resulting links to use lowercase.  Patch by Sean Rodman, test by Kaushik
30104  Nadikuditi.
30105
30106- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5.
30107
30108- bpo-22558: Add remaining doc links to source code for Python-coded
30109  modules. Patch by Yoni Lavi.
30110
30111Tests
30112-----
30113
30114- bpo-25285: regrtest now uses subprocesses when the -j1 command line option
30115  is used: each test file runs in a fresh child process. Before, the -j1
30116  option was ignored.
30117
30118- bpo-25285: Tools/buildbot/test.bat script now uses -j1 by default to run
30119  each test file in fresh child process.
30120
30121Windows
30122-------
30123
30124- bpo-27064: The py.exe launcher now defaults to Python 3. The Windows
30125  launcher ``py.exe`` no longer prefers an installed Python 2 version over
30126  Python 3 by default when used interactively.
30127
30128- bpo-17500: Remove unused and outdated icons. (See also:
30129  https://github.com/python/pythondotorg/issues/945)
30130
30131Build
30132-----
30133
30134- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds.  Patch by
30135  Xavier de Gaye.
30136
30137- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with
30138  OpenSSL 1.0.2h.
30139
30140C API
30141-----
30142
30143- bpo-27186: Add the PyOS_FSPath() function (part of :pep:`519`).
30144
30145- bpo-26282: PyArg_ParseTupleAndKeywords() now supports positional-only
30146  parameters.
30147
30148Tools/Demos
30149-----------
30150
30151- bpo-26282: Argument Clinic now supports positional-only and keyword
30152  parameters in the same function.
30153
30154
30155What's New in Python 3.6.0 alpha 1?
30156===================================
30157
30158*Release date: 2016-05-16*
30159
30160Security
30161--------
30162
30163- bpo-26657: Fix directory traversal vulnerability with http.server on
30164  Windows.  This fixes a regression that was introduced in 3.3.4rc1 and
30165  3.4.0rc1.  Based on patch by Philipp Hagemeister.
30166
30167- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is
30168  empty. Patch by Baji.
30169
30170- bpo-25939: On Windows open the cert store readonly in
30171  ssl.enum_certificates.
30172
30173Core and Builtins
30174-----------------
30175
30176- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by
30177  Xavier de Gaye.
30178
30179- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
30180  format unit.
30181
30182- bpo-26991: Fix possible refleak when creating a function with annotations.
30183
30184- bpo-27039: Fixed bytearray.remove() for values greater than 127.  Based on
30185  patch by Joe Jevnik.
30186
30187- bpo-23640: int.from_bytes() no longer bypasses constructors for
30188  subclasses.
30189
30190- bpo-27005: Optimized the float.fromhex() class method for exact float. It
30191  is now 2 times faster.
30192
30193- bpo-18531: Single var-keyword argument of dict subtype was passed
30194  unscathed to the C-defined function.  Now it is converted to exact dict.
30195
30196- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL
30197  pointer.
30198
30199- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for
30200  interpolation unintentionally added with move to Python 3. Behavior no
30201  longer does any interpolation in .pypirc files, matching behavior in
30202  Python 2.7 and Setuptools 19.0.
30203
30204- bpo-26249: Memory functions of the :c:func:`PyMem_Malloc` domain
30205  (:c:data:`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc allocator
30206  <pymalloc>` rather than system :c:func:`malloc`. Applications calling
30207  :c:func:`PyMem_Malloc` without holding the GIL can now crash: use
30208  ``PYTHONMALLOC=debug`` environment variable to validate the usage of
30209  memory allocators in your application.
30210
30211- bpo-26802: Optimize function calls only using unpacking like
30212  ``func(*tuple)`` (no other positional argument, no keyword): avoid copying
30213  the tuple. Patch written by Joe Jevnik.
30214
30215- bpo-26659: Make the builtin slice type support cycle collection.
30216
30217- bpo-26718: super.__init__ no longer leaks memory if called multiple times.
30218  NOTE: A direct call of super.__init__ is not endorsed!
30219
30220- bpo-27138: Fix the doc comment for FileFinder.find_spec().
30221
30222- bpo-27147: Mention :pep:`420` in the importlib docs.
30223
30224- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the
30225  error handler for stdin and stdout.
30226
30227- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes
30228  are generic sequence iterators, iterators of str, bytes, bytearray, list,
30229  tuple, set, frozenset, dict, OrderedDict, corresponding views and
30230  os.scandir() iterator.
30231
30232- bpo-26574: Optimize ``bytes.replace(b'', b'.')`` and
30233  ``bytearray.replace(b'', b'.')``. Patch written by Josh Snider.
30234
30235- bpo-26581: If coding cookie is specified multiple times on a line in
30236  Python source code file, only the first one is taken to account.
30237
30238- bpo-19711: Add tests for reloading namespace packages.
30239
30240- bpo-21099: Switch applicable importlib tests to use :pep:`451` API.
30241
30242- bpo-26563: Debug hooks on Python memory allocators now raise a fatal error
30243  if functions of the :c:func:`PyMem_Malloc` family are called without
30244  holding the GIL.
30245
30246- bpo-26564: On error, the debug hooks on Python memory allocators now use
30247  the :mod:`tracemalloc` module to get the traceback where a memory block
30248  was allocated.
30249
30250- bpo-26558: The debug hooks on Python memory allocator
30251  :c:func:`PyObject_Malloc` now detect when functions are called without
30252  holding the GIL.
30253
30254- bpo-26516: Add :envvar:`PYTHONMALLOC` environment variable to set the
30255  Python memory allocators and/or install debug hooks.
30256
30257- bpo-26516: The :c:func:`PyMem_SetupDebugHooks` function can now also be
30258  used on Python compiled in release mode.
30259
30260- bpo-26516: The :envvar:`PYTHONMALLOCSTATS` environment variable can now
30261  also be used on Python compiled in release mode. It now has no effect if
30262  set to an empty string.
30263
30264- bpo-26516: In debug mode, debug hooks are now also installed on Python
30265  memory allocators when Python is configured without pymalloc.
30266
30267- bpo-26464: Fix str.translate() when string is ASCII and first replacements
30268  removes character, but next replacement uses a non-ASCII character or a
30269  string longer than 1 character. Regression introduced in Python 3.5.0.
30270
30271- bpo-22836: Ensure exception reports from PyErr_Display() and
30272  PyErr_WriteUnraisable() are sensible even when formatting them produces
30273  secondary errors.  This affects the reports produced by
30274  sys.__excepthook__() and when __del__() raises an exception.
30275
30276- bpo-26302: Correct behavior to reject comma as a legal character for
30277  cookie names.
30278
30279- bpo-26136: Upgrade the warning when a generator raises StopIteration from
30280  PendingDeprecationWarning to DeprecationWarning.  Patch by Anish Shah.
30281
30282- bpo-26204: The compiler now ignores all constant statements: bytes, str,
30283  int, float, complex, name constants (None, False, True), Ellipsis and
30284  ast.Constant; not only str and int. For example, ``1.0`` is now ignored in
30285  ``def f(): 1.0``.
30286
30287- bpo-4806: Avoid masking the original TypeError exception when using star
30288  (``*``) unpacking in function calls.  Based on patch by Hagen Fürstenau
30289  and Daniel Urban.
30290
30291- bpo-26146: Add a new kind of AST node: ``ast.Constant``. It can be used by
30292  external AST optimizers, but the compiler does not emit directly such
30293  node.
30294
30295- bpo-23601: Sped-up allocation of dict key objects by using Python's small
30296  object allocator.  (Contributed by Julian Taylor.)
30297
30298- bpo-18018: Import raises ImportError instead of SystemError if a relative
30299  import is attempted without a known parent package.
30300
30301- bpo-25843: When compiling code, don't merge constants if they are equal
30302  but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
30303  1.0`` is now correctly compiled to two different functions: ``f1()``
30304  returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``float``), even if
30305  ``1`` and ``1.0`` are equal.
30306
30307- bpo-26107: The format of the ``co_lnotab`` attribute of code objects
30308  changes to support negative line number delta.
30309
30310- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get
30311  the current Python thread state, but don't issue a fatal error if it is
30312  NULL. This new function must be used instead of accessing directly the
30313  _PyThreadState_Current variable.  The variable is no more exposed since
30314  Python 3.5.1 to hide the exact implementation of atomic C types, to avoid
30315  compiler issues.
30316
30317- bpo-25791: If __package__ != __spec__.parent or if neither __package__ or
30318  __spec__ are defined then ImportWarning is raised.
30319
30320- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in
30321  _PyObject_GetState() due to regressions observed in Cython-based projects.
30322
30323- bpo-25961: Disallowed null characters in the type name.
30324
30325- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name
30326  starting with two underscores.
30327
30328- bpo-22995: Instances of extension types with a state that aren't
30329  subclasses of list or dict and haven't implemented any pickle-related
30330  methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or
30331  __getstate__), can no longer be pickled.  Including memoryview.
30332
30333- bpo-20440: Massive replacing unsafe attribute setting code with special
30334  macro Py_SETREF.
30335
30336- bpo-25766: Special method __bytes__() now works in str subclasses.
30337
30338- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
30339  This allows sys.getsize() to work correctly with their subclasses with
30340  __slots__ defined.
30341
30342- bpo-25709: Fixed problem with in-place string concatenation and utf-8
30343  cache.
30344
30345- bpo-5319: New Py_FinalizeEx() API allowing Python to set an exit status of
30346  120 on failure to flush buffered streams.
30347
30348- bpo-25485: telnetlib.Telnet is now a context manager.
30349
30350- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside
30351  __getattr__.
30352
30353- bpo-24731: Fixed crash on converting objects with special methods
30354  __bytes__, __trunc__, and __float__ returning instances of subclasses of
30355  bytes, int, and float to subclasses of bytes, int, and float
30356  correspondingly.
30357
30358- bpo-25630: Fix a possible segfault during argument parsing in functions
30359  that accept filesystem paths.
30360
30361- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess
30362  internals regarding how fds_to_pass were passed to the child.  The bug had
30363  no actual impact as subprocess.py already avoided it.
30364
30365- bpo-25388: Fixed tokenizer crash when processing undecodable source code
30366  with a null byte.
30367
30368- bpo-25462: The hash of the key now is calculated only once in most
30369  operations in C implementation of OrderedDict.
30370
30371- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now
30372  rejects builtin types with not defined __new__.
30373
30374- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec()
30375  and eval() are passed bytes-like objects.  These objects are not
30376  necessarily terminated by a null byte, but the functions assumed they
30377  were.
30378
30379- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
30380  when compiling AST from Python objects.
30381
30382- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
30383  was mutated by direct calls of dict methods.
30384
30385- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
30386  KeyError in C implementations as well as in Python implementation.
30387
30388- bpo-25395: Fixed crash when highly nested OrderedDict structures were
30389  garbage collected.
30390
30391- bpo-25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now
30392  between 2x and 3.5x faster.
30393
30394- bpo-25399: Optimize bytearray % args using the new private _PyBytesWriter
30395  API. Formatting is now between 2.5 and 5 times faster.
30396
30397- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new
30398  recursion limit is too low depending at the current recursion depth.
30399  Modify also the "lower-water mark" formula to make it monotonic. This mark
30400  is used to decide when the overflowed flag of the thread state is reset.
30401
30402- bpo-24402: Fix input() to prompt to the redirected stdout when
30403  sys.stdout.fileno() fails.
30404
30405- bpo-25349: Optimize bytes % args using the new private _PyBytesWriter API.
30406  Formatting is now up to 2 times faster.
30407
30408- bpo-24806: Prevent builtin types that are not allowed to be subclassed
30409  from being subclassed through multiple inheritance.
30410
30411- bpo-25301: The UTF-8 decoder is now up to 15 times as fast for error
30412  handlers: ``ignore``, ``replace`` and ``surrogateescape``.
30413
30414- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
30415
30416- bpo-25267: The UTF-8 encoder is now up to 75 times as fast for error
30417  handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``.
30418  Patch co-written with Serhiy Storchaka.
30419
30420- bpo-25280: Import trace messages emitted in verbose (-v) mode are no
30421  longer formatted twice.
30422
30423- bpo-25227: Optimize ASCII and latin1 encoders with the ``surrogateescape``
30424  error handler: the encoders are now up to 3 times as fast. Initial patch
30425  written by Serhiy Storchaka.
30426
30427- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
30428  function instead of the getentropy() function. The getentropy() function
30429  is blocking to generate very good quality entropy, os.urandom() doesn't
30430  need such high-quality entropy.
30431
30432- bpo-9232: Modify Python's grammar to allow trailing commas in the argument
30433  list of a function declaration.  For example, "def f(\*, a = 3,): pass" is
30434  now legal. Patch from Mark Dickinson.
30435
30436- bpo-24965: Implement :pep:`498` "Literal String Interpolation". This
30437  allows you to embed expressions inside f-strings, which are converted to
30438  normal strings at run time. Given x=3, then f'value={x}' == 'value=3'.
30439  Patch by Eric V. Smith.
30440
30441- bpo-26478: Fix semantic bugs when using binary operators with dictionary
30442  views and tuples.
30443
30444- bpo-26171: Fix possible integer overflow and heap corruption in
30445  zipimporter.get_data().
30446
30447- bpo-25660: Fix TAB key behaviour in REPL with readline.
30448
30449- bpo-26288: Optimize PyLong_AsDouble.
30450
30451- bpo-26289: Optimize floor and modulo division for single-digit longs.
30452  Microbenchmarks show 2-2.5x improvement.  Built-in 'divmod' function is
30453  now also ~10% faster. (See also: bpo-26315)
30454
30455- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more
30456  than once.
30457
30458Library
30459-------
30460
30461- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by
30462  SELinux and fails with EACCESS. The function now falls back to fcntl().
30463  Patch written by Michał Bednarski.
30464
30465- bpo-27014: Fix infinite recursion using typing.py.  Thanks to Kalle Tuure!
30466
30467- bpo-27031: Removed dummy methods in Tkinter widget classes: tk_menuBar()
30468  and tk_bindForTraversal().
30469
30470- bpo-14132: Fix urllib.request redirect handling when the target only has a
30471  query string.  Original fix by Ján Janech.
30472
30473- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes
30474  found in redirect target URLs.  Some servers send Location header fields
30475  with non-ASCII bytes, but "http.client" requires the request target to be
30476  ASCII-encodable, otherwise a UnicodeEncodeError is raised.  Based on patch
30477  by Christian Heimes.
30478
30479- bpo-27033: The default value of the decode_data parameter for
30480  smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False.
30481
30482- bpo-27034: Removed deprecated class asynchat.fifo.
30483
30484- bpo-26870: Added readline.set_auto_history(), which can stop entries being
30485  automatically added to the history list.  Based on patch by Tyler
30486  Crompton.
30487
30488- bpo-26039: zipfile.ZipFile.open() can now be used to write data into a ZIP
30489  file, as well as for extracting data.  Patch by Thomas Kluyver.
30490
30491- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch
30492  contributed by Chi Hsuan Yen.
30493
30494- bpo-22274: In the subprocess module, allow stderr to be redirected to
30495  stdout even when stdout is not redirected.  Patch by Akira Li.
30496
30497- bpo-26807: mock_open 'files' no longer error on readline at end of file.
30498  Patch from Yolanda Robla.
30499
30500- bpo-25745: Fixed leaking a userptr in curses panel destructor.
30501
30502- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper
30503  in statistics.pvariance.
30504
30505- bpo-26002: Use bisect in statistics.median instead of a linear search.
30506  Patch by Upendra Kuma.
30507
30508- bpo-25974: Make use of new Decimal.as_integer_ratio() method in statistics
30509  module. Patch by Stefan Krah.
30510
30511- bpo-26996: Add secrets module as described in :pep:`506`.
30512
30513- bpo-26881: The modulefinder module now supports extended opcode arguments.
30514
30515- bpo-23815: Fixed crashes related to directly created instances of types in
30516  _tkinter and curses.panel modules.
30517
30518- bpo-17765: weakref.ref() no longer silently ignores keyword arguments.
30519  Patch by Georg Brandl.
30520
30521- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags
30522  instead of silently return incorrect result.
30523
30524- bpo-26915: The __contains__ methods in the collections ABCs now check for
30525  identity before checking equality.  This better matches the behavior of
30526  the concrete classes, allows sensible handling of NaNs, and makes it
30527  easier to reason about container invariants.
30528
30529- bpo-26711: Fixed the comparison of plistlib.Data with other types.
30530
30531- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only
30532  occurs on SunOS when the ctypes implementation searches for the `crle`
30533  program.  Patch by Xiang Zhang.  Tested on SunOS by Kees Bos.
30534
30535- bpo-26864: In urllib.request, change the proxy bypass host checking
30536  against no_proxy to be case-insensitive, and to not match unrelated host
30537  names that happen to have a bypassed hostname as a suffix.  Patch by Xiang
30538  Zhang.
30539
30540- bpo-24902: Print server URL on http.server startup.  Initial patch by
30541  Felix Kaiser.
30542
30543- bpo-25788: fileinput.hook_encoded() now supports an "errors" argument for
30544  passing to open.  Original patch by Joseph Hackman.
30545
30546- bpo-26634: recursive_repr() now sets __qualname__ of wrapper.  Patch by
30547  Xiang Zhang.
30548
30549- bpo-26804: urllib.request will prefer lower_case proxy environment
30550  variables over UPPER_CASE or Mixed_Case ones. Patch contributed by
30551  Hans-Peter Jansen.
30552
30553- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified
30554  differing items (like bytes in the -b mode).  This affects
30555  assertListEqual() and assertTupleEqual().
30556
30557- bpo-26041: Remove "will be removed in Python 3.7" from deprecation
30558  messages of platform.dist() and platform.linux_distribution(). Patch by
30559  Kumaripaba Miyurusara Athukorala.
30560
30561- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer
30562  silently ignore keyword arguments.
30563
30564- bpo-26733: Disassembling a class now disassembles class and static
30565  methods. Patch by Xiang Zhang.
30566
30567- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch
30568  :exc:`AttributeError` instead of :exc:`NameError`. Patch written by
30569  Emanuel Barry.
30570
30571- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
30572  and link field limits for multibyte character encodings like utf-8.
30573
30574- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8.  Patch by
30575  Anthony Sottile.
30576
30577- bpo-26782: Add STARTUPINFO to subprocess.__all__ on Windows.
30578
30579- bpo-26404: Add context manager to socketserver.  Patch by Aviv Palivoda.
30580
30581- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
30582  more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
30583  1024 bytes per call.
30584
30585- bpo-26585: Eliminate http.server._quote_html() and use
30586  html.escape(quote=False).  Patch by Xiang Zhang.
30587
30588- bpo-26685: Raise OSError if closing a socket fails.
30589
30590- bpo-16329: Add .webm to mimetypes.types_map.  Patch by Giampaolo Rodola'.
30591
30592- bpo-13952: Add .csv to mimetypes.types_map.  Patch by Geoff Wilson.
30593
30594- bpo-26587: the site module now allows .pth files to specify files to be
30595  added to sys.path (e.g. zip files).
30596
30597- bpo-25609: Introduce contextlib.AbstractContextManager and
30598  typing.ContextManager.
30599
30600- bpo-26709: Fixed Y2038 problem in loading binary PLists.
30601
30602- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our
30603  own SIGWINCH handler.  Patch by Eric Price.
30604
30605- bpo-25951: Change SSLSocket.sendall() to return None, as explicitly
30606  documented for plain socket objects.  Patch by Aviv Palivoda.
30607
30608- bpo-26586: In http.server, respond with "413 Request header fields too
30609  large" if there are too many header fields to parse, rather than killing
30610  the connection and raising an unhandled exception.  Patch by Xiang Zhang.
30611
30612- bpo-26676: Added missing XMLPullParser to ElementTree.__all__.
30613
30614- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable()
30615  to always return False.
30616
30617- bpo-26492: Exhausted iterator of array.array now conforms with the
30618  behavior of iterators of other mutable sequences: it lefts exhausted even
30619  if iterated array is extended.
30620
30621- bpo-26641: doctest.DocFileTest and doctest.testfile() now support packages
30622  (module splitted into multiple directories) for the package parameter.
30623
30624- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of
30625  tuple (changeset 3603bae63c13 only works for classes) so we need to
30626  implement __ne__ ourselves.  Patch by Andrew Plummer.
30627
30628- bpo-26644: Raise ValueError rather than SystemError when a negative length
30629  is passed to SSLSocket.recv() or read().
30630
30631- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes
30632  instead of up to 1024.
30633
30634- bpo-26616: Fixed a bug in datetime.astimezone() method.
30635
30636- bpo-26637: The :mod:`importlib` module now emits an :exc:`ImportError`
30637  rather than a :exc:`TypeError` if :func:`__import__` is tried during the
30638  Python shutdown process but :data:`sys.path` is already cleared (set to
30639  ``None``).
30640
30641- bpo-21925: :func:`warnings.formatwarning` now catches exceptions when
30642  calling :func:`linecache.getline` and
30643  :func:`tracemalloc.get_object_traceback` to be able to log
30644  :exc:`ResourceWarning` emitted late during the Python shutdown process.
30645
30646- bpo-23848: On Windows, faulthandler.enable() now also installs an
30647  exception handler to dump the traceback of all Python threads on any
30648  Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
30649
30650- bpo-26530: Add C functions :c:func:`_PyTraceMalloc_Track` and
30651  :c:func:`_PyTraceMalloc_Untrack` to track memory blocks using the
30652  :mod:`tracemalloc` module. Add :c:func:`_PyTraceMalloc_GetTraceback` to
30653  get the traceback of an object.
30654
30655- bpo-26588: The _tracemalloc now supports tracing memory allocations of
30656  multiple address spaces (domains).
30657
30658- bpo-24266: Ctrl+C during Readline history search now cancels the search
30659  mode when compiled with Readline 7.
30660
30661- bpo-26590: Implement a safe finalizer for the _socket.socket type. It now
30662  releases the GIL to close the socket.
30663
30664- bpo-18787: spwd.getspnam() now raises a PermissionError if the user
30665  doesn't have privileges.
30666
30667- bpo-26560: Avoid potential ValueError in BaseHandler.start_response.
30668  Initial patch by Peter Inglesby.
30669
30670- bpo-26567: Add a new function :c:func:`PyErr_ResourceWarning` function to
30671  pass the destroyed object. Add a *source* attribute to
30672  :class:`warnings.WarningMessage`. Add warnings._showwarnmsg() which uses
30673  tracemalloc to get the traceback where source object was allocated.
30674
30675- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex`
30676  to support importing packages.
30677
30678- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline()
30679  and read1(). Based on patch by Silent Ghost. Also document that
30680  HTTPResponse now supports these methods.
30681
30682- bpo-25320: Handle sockets in directories unittest discovery is scanning.
30683  Patch from Victor van den Elzen.
30684
30685- bpo-16181: cookiejar.http2time() now returns None if year is higher than
30686  datetime.MAXYEAR.
30687
30688- bpo-26513: Fixes platform module detection of Windows Server
30689
30690- bpo-23718: Fixed parsing time in week 0 before Jan 1.  Original patch by
30691  Tamás Bence Gedai.
30692
30693- bpo-26323: Add Mock.assert_called() and Mock.assert_called_once() methods
30694  to unittest.mock. Patch written by Amit Saha.
30695
30696- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise
30697  NotImplementedError instead of ImportError.
30698
30699- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
30700
30701- bpo-15068: Got rid of excessive buffering in fileinput. The bufsize
30702  parameter is now deprecated and ignored.
30703
30704- bpo-19475: Added an optional argument timespec to the datetime isoformat()
30705  method to choose the precision of the time component.
30706
30707- bpo-2202: Fix UnboundLocalError in
30708  AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu
30709  Dupuy.
30710
30711- bpo-26167: Minimized overhead in copy.copy() and copy.deepcopy().
30712  Optimized copying and deepcopying bytearrays, NotImplemented, slices,
30713  short lists, tuples, dicts, sets.
30714
30715- bpo-25718: Fixed pickling and copying the accumulate() iterator with total
30716  is None.
30717
30718- bpo-26475: Fixed debugging output for regular expressions with the (?x)
30719  flag.
30720
30721- bpo-26482: Allowed pickling recursive dequeues.
30722
30723- bpo-26335: Make mmap.write() return the number of bytes written like other
30724  write methods.  Patch by Jakub Stasiak.
30725
30726- bpo-26457: Fixed the subnets() methods in IP network classes for the case
30727  when resulting prefix length is equal to maximal prefix length. Based on
30728  patch by Xiang Zhang.
30729
30730- bpo-26385: Remove the file if the internal open() call in
30731  NamedTemporaryFile() fails. Patch by Silent Ghost.
30732
30733- bpo-26402: Fix XML-RPC client to retry when the server shuts down a
30734  persistent connection.  This was a regression related to the new
30735  http.client.RemoteDisconnected exception in 3.5.0a4.
30736
30737- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with
30738  adobe=True.  Patch by Swati Jaiswal.
30739
30740- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader.
30741
30742- bpo-26367: importlib.__import__() raises ImportError like
30743  builtins.__import__() when ``level`` is specified but without an
30744  accompanying package specified.
30745
30746- bpo-26309: In the "socketserver" module, shut down the request (closing
30747  the connected socket) when verify_request() returns false.  Patch by Aviv
30748  Palivoda.
30749
30750- bpo-23430: Change the socketserver module to only catch exceptions raised
30751  from a request handler that are derived from Exception (instead of
30752  BaseException). Therefore SystemExit and KeyboardInterrupt no longer
30753  trigger the handle_error() method, and will now to stop a single-threaded
30754  server.
30755
30756- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth.
30757
30758- bpo-25994: Added the close() method and the support of the context manager
30759  protocol for the os.scandir() iterator.
30760
30761- bpo-23992: multiprocessing: make MapResult not fail-fast upon exception.
30762
30763- bpo-26243: Support keyword arguments to zlib.compress().  Patch by Aviv
30764  Palivoda.
30765
30766- bpo-26117: The os.scandir() iterator now closes file descriptor not only
30767  when the iteration is finished, but when it was failed with error.
30768
30769- bpo-25949: __dict__ for an OrderedDict instance is now created only when
30770  needed.
30771
30772- bpo-25911: Restored support of bytes paths in os.walk() on Windows.
30773
30774- bpo-26045: Add UTF-8 suggestion to error message when posting a
30775  non-Latin-1 string with http.client.
30776
30777- bpo-26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir().
30778  Patch by Thomas Kluyver.
30779
30780- bpo-12923: Reset FancyURLopener's redirect counter even if there is an
30781  exception. Based on patches by Brian Brazil and Daniel Rocco.
30782
30783- bpo-25945: Fixed a crash when unpickle the functools.partial object with
30784  wrong state. Fixed a leak in failed functools.partial constructor. "args"
30785  and "keywords" attributes of functools.partial have now always types tuple
30786  and dict correspondingly.
30787
30788- bpo-26202: copy.deepcopy() now correctly copies range() objects with
30789  non-atomic attributes.
30790
30791- bpo-23076: Path.glob() now raises a ValueError if it's called with an
30792  invalid pattern. Patch by Thomas Nyberg.
30793
30794- bpo-19883: Fixed possible integer overflows in zipimport.
30795
30796- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and
30797  gethostbyname_ex() functions of the socket module now decode the hostname
30798  from the ANSI code page rather than UTF-8.
30799
30800- bpo-26099: The site module now writes an error into stderr if
30801  sitecustomize module can be imported but executing the module raise an
30802  ImportError. Same change for usercustomize.
30803
30804- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
30805  encoding.
30806
30807- bpo-25935: Garbage collector now breaks reference loops with OrderedDict.
30808
30809- bpo-16620: Fixed AttributeError in msilib.Directory.glob().
30810
30811- bpo-26013: Added compatibility with broken protocol 2 pickles created in
30812  old Python 3 versions (3.4.3 and lower).
30813
30814- bpo-26129: Deprecated accepting non-integers in grp.getgrgid().
30815
30816- bpo-25850: Use cross-compilation by default for 64-bit Windows.
30817
30818- bpo-25822: Add docstrings to the fields of urllib.parse results. Patch
30819  contributed by Swati Jaiswal.
30820
30821- bpo-22642: Convert trace module option parsing mechanism to argparse.
30822  Patch contributed by SilentGhost.
30823
30824- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing
30825  before $() vars.
30826
30827- bpo-26069: Remove the deprecated apis in the trace module.
30828
30829- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore
30830  original values after patching. Patch contributed by Sean McCully.
30831
30832- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode
30833  option if it is safe to do so.
30834
30835- bpo-26012: Don't traverse into symlinks for ``**`` pattern in
30836  pathlib.Path.[r]glob().
30837
30838- bpo-24120: Ignore PermissionError when traversing a tree with
30839  pathlib.Path.[r]glob(). Patch by Ulrich Petri.
30840
30841- bpo-21815: Accept ] characters in the data portion of imap responses, in
30842  order to handle the flags with square brackets accepted and produced by
30843  servers such as gmail.
30844
30845- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
30846  attribute (restores backward compatibility).
30847
30848- bpo-25971: Optimized creating Fractions from floats by 2 times and from
30849  Decimals by 3 times.
30850
30851- bpo-25802: Document as deprecated the remaining implementations of
30852  importlib.abc.Loader.load_module().
30853
30854- bpo-25928: Add Decimal.as_integer_ratio().
30855
30856- bpo-25447: Copying the lru_cache() wrapper object now always works,
30857  independently from the type of the wrapped object (by returning the
30858  original object unchanged).
30859
30860- bpo-25768: Have the functions in compileall return booleans instead of
30861  ints and add proper documentation and tests for the return values.
30862
30863- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser.
30864
30865- bpo-25860: os.fwalk() no longer skips remaining directories when error
30866  occurs. Original patch by Samson Lee.
30867
30868- bpo-25914: Fixed and simplified OrderedDict.__sizeof__.
30869
30870- bpo-25869: Optimized deepcopying ElementTree; it is now 20 times faster.
30871
30872- bpo-25873: Optimized iterating ElementTree.  Iterating elements
30873  Element.iter() is now 40% faster, iterating text Element.itertext() is now
30874  up to 2.5 times faster.
30875
30876- bpo-25902: Fixed various refcount issues in ElementTree iteration.
30877
30878- bpo-22227: The TarFile iterator is reimplemented using generator. This
30879  implementation is simpler that using class.
30880
30881- bpo-25638: Optimized ElementTree.iterparse(); it is now 2x faster.
30882  Optimized ElementTree parsing; it is now 10% faster.
30883
30884- bpo-25761: Improved detecting errors in broken pickle data.
30885
30886- bpo-25717: Restore the previous behaviour of tolerating most fstat()
30887  errors when opening files.  This was a regression in 3.5a1, and stopped
30888  anonymous temporary files from working in special cases.
30889
30890- bpo-24903: Fix regression in number of arguments compileall accepts when
30891  '-d' is specified.  The check on the number of arguments has been dropped
30892  completely as it never worked correctly anyway.
30893
30894- bpo-25764: In the subprocess module, preserve any exception caused by
30895  fork() failure when preexec_fn is used.
30896
30897- bpo-25771: Tweak the exception message for importlib.util.resolve_name()
30898  when 'package' isn't specified but necessary.
30899
30900- bpo-6478: _strptime's regexp cache now is reset after changing timezone
30901  with time.tzset().
30902
30903- bpo-14285: When executing a package with the "python -m package" option,
30904  and package initialization fails, a proper traceback is now reported.  The
30905  "runpy" module now lets exceptions from package initialization pass back
30906  to the caller, rather than raising ImportError.
30907
30908- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
30909  ". . . is a package and cannot be directly executed" if the package could
30910  not even be initialized (e.g. due to a bad ``*.pyc`` file).
30911
30912- bpo-25177: Fixed problem with the mean of very small and very large
30913  numbers. As a side effect, statistics.mean and statistics.variance should
30914  be significantly faster.
30915
30916- bpo-25718: Fixed copying object with state with boolean value is false.
30917
30918- bpo-10131: Fixed deep copying of minidom documents.  Based on patch by
30919  Marian Ganisin.
30920
30921- bpo-7990: dir() on ElementTree.Element now lists properties: "tag",
30922  "text", "tail" and "attrib".  Original patch by Santoso Wijaya.
30923
30924- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
30925  invalid data including tuple instructions.
30926
30927- bpo-25663: In the Readline completer, avoid listing duplicate global
30928  names, and search the global namespace before searching builtins.
30929
30930- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error.
30931
30932- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data.
30933
30934- bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
30935
30936- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory
30937  entries.  Patch by Dingyuan Wang.
30938
30939- bpo-25626: Change three zlib functions to accept sizes that fit in
30940  Py_ssize_t, but internally cap those sizes to UINT_MAX.  This resolves a
30941  regression in 3.5 where GzipFile.read() failed to read chunks larger than
30942  2 or 4 GiB.  The change affects the zlib.Decompress.decompress()
30943  max_length parameter, the zlib.decompress() bufsize parameter, and the
30944  zlib.Decompress.flush() length parameter.
30945
30946- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
30947  when the OS gives priority to errors such as EACCES over EEXIST.
30948
30949- bpo-25593: Change semantics of EventLoop.stop() in asyncio.
30950
30951- bpo-6973: When we know a subprocess.Popen process has died, do not allow
30952  the send_signal(), terminate(), or kill() methods to do anything as they
30953  could potentially signal a different process.
30954
30955- bpo-23883: Added missing APIs to __all__ to match the documented APIs for
30956  the following modules: calendar, csv, enum, fileinput, ftplib, logging,
30957  optparse, tarfile, threading and wave.  Also added a
30958  test.support.check__all__() helper. Patches by Jacek Kołodziej, Mauro S.
30959  M. Rodrigues and Joel Taddei.
30960
30961- bpo-25590: In the Readline completer, only call getattr() once per
30962  attribute.  Also complete names of attributes such as properties and slots
30963  which are listed by dir() but not yet created on an instance.
30964
30965- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by
30966  wrapping a memoryview.  This was a regression made in 3.5a1.  Based on
30967  patch by Eryksun.
30968
30969- bpo-25584: Added "escape" to the __all__ list in the glob module.
30970
30971- bpo-25584: Fixed recursive glob() with patterns starting with ``**``.
30972
30973- bpo-25446: Fix regression in smtplib's AUTH LOGIN support.
30974
30975- bpo-18010: Fix the pydoc web server's module search function to handle
30976  exceptions from importing packages.
30977
30978- bpo-25554: Got rid of circular references in regular expression parsing.
30979
30980- bpo-18973: Command-line interface of the calendar module now uses argparse
30981  instead of optparse.
30982
30983- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at
30984  the end if the FileInput was opened with binary mode. Patch by Ryosuke
30985  Ito.
30986
30987- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties.
30988  Original patch by John Mark Vandenberg.
30989
30990- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4.
30991
30992- bpo-21827: Fixed textwrap.dedent() for the case when largest common
30993  whitespace is a substring of smallest leading whitespace. Based on patch
30994  by Robert Li.
30995
30996- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
30997  (by returning the original object unchanged).
30998
30999- bpo-25390: typing: Don't crash on Union[str, Pattern].
31000
31001- bpo-25441: asyncio: Raise error from drain() when socket is closed.
31002
31003- bpo-25410: Cleaned up and fixed minor bugs in C implementation of
31004  OrderedDict.
31005
31006- bpo-25411: Improved Unicode support in SMTPHandler through better use of
31007  the email package. Thanks to user simon04 for the patch.
31008
31009- Move the imp module from a PendingDeprecationWarning to
31010  DeprecationWarning.
31011
31012- bpo-25407: Remove mentions of the formatter module being removed in Python
31013  3.6.
31014
31015- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
31016  that caused segmentation fault or hang in iterating after moving several
31017  items to the start of ordered dict.
31018
31019- bpo-25382: pickletools.dis() now outputs implicit memo index for the
31020  MEMOIZE opcode.
31021
31022- bpo-25357: Add an optional newline parameter to binascii.b2a_base64().
31023  base64.b64encode() uses it to avoid a memory copy.
31024
31025- bpo-24164: Objects that need calling ``__new__`` with keyword arguments,
31026  can now be pickled using pickle protocols older than protocol version 4.
31027
31028- bpo-25364: zipfile now works in threads disabled builds.
31029
31030- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both
31031  decode_data and enable_SMTPUTF8 are set to true.
31032
31033- bpo-16099: RobotFileParser now supports Crawl-delay and Request-rate
31034  extensions.  Patch by Nikolay Bogoychev.
31035
31036- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when
31037  MSVC is not installed.
31038
31039- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in
31040  pickletools.opcodes.
31041
31042- bpo-23972: Updates asyncio datagram create method allowing reuseport and
31043  reuseaddr socket options to be set prior to binding the socket. Mirroring
31044  the existing asyncio create_server method the reuseaddr option for
31045  datagram sockets defaults to True if the O/S is 'posix' (except if the
31046  platform is Cygwin). Patch by Chris Laws.
31047
31048- bpo-25304: Add asyncio.run_coroutine_threadsafe().  This lets you submit a
31049  coroutine to a loop from another thread, returning a
31050  concurrent.futures.Future.  By Vincent Michel.
31051
31052- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
31053  first question mark (?) rather than the last. Patch from Xiang Zhang.
31054
31055- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query
31056  part of the URL as if it were a path. Patch from Xiang Zhang.
31057
31058- bpo-25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
31059  supported. Check if it is supported, it may not be supported on OpenBSD
31060  for example.
31061
31062- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong
31063  results in some cases.
31064
31065- bpo-25203: Failed readline.set_completer_delims() no longer left the
31066  module in inconsistent state.
31067
31068- bpo-25011: rlcompleter now omits private and special attribute names
31069  unless the prefix starts with underscores.
31070
31071- bpo-25209: rlcompleter now can add a space or a colon after completed
31072  keyword.
31073
31074- bpo-22241: timezone.utc name is now plain 'UTC', not 'UTC-00:00'.
31075
31076- bpo-23517: fromtimestamp() and utcfromtimestamp() methods of
31077  datetime.datetime now round microseconds to nearest with ties going to
31078  nearest even integer (ROUND_HALF_EVEN), as round(float), instead of
31079  rounding towards -Infinity (ROUND_FLOOR).
31080
31081- bpo-23552: Timeit now warns when there is substantial (4x) variance
31082  between best and worst times. Patch from Serhiy Storchaka.
31083
31084- bpo-24633: site-packages/README -> README.txt.
31085
31086- bpo-24879: help() and pydoc can now list named tuple fields in the order
31087  they were defined rather than alphabetically.  The ordering is determined
31088  by the _fields attribute if present.
31089
31090- bpo-24874: Improve speed of itertools.cycle() and make its pickle more
31091  compact.
31092
31093- Fix crash in itertools.cycle.__setstate__() when the first argument wasn't
31094  a list.
31095
31096- bpo-20059: urllib.parse raises ValueError on all invalid ports. Patch by
31097  Martin Panter.
31098
31099- bpo-24360: Improve __repr__ of argparse.Namespace() for invalid
31100  identifiers.  Patch by Matthias Bussonnier.
31101
31102- bpo-23426: run_setup was broken in distutils. Patch from Alexander
31103  Belopolsky.
31104
31105- bpo-13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
31106
31107- bpo-2091: open() accepted a 'U' mode string containing '+', but 'U' can
31108  only be used with 'r'. Patch from Jeff Balogh and John O'Connor.
31109
31110- bpo-8585: improved tests for zipimporter2. Patch from Mark Lawrence.
31111
31112- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
31113  Patch from Nicola Palumbo and Laurent De Buyst.
31114
31115- bpo-24426: Fast searching optimization in regular expressions now works
31116  for patterns that starts with capturing groups.  Fast searching
31117  optimization now can't be disabled at compile time.
31118
31119- bpo-23661: unittest.mock side_effects can now be exceptions again. This
31120  was a regression vs Python 3.4. Patch from Ignacio Rossi
31121
31122- bpo-13248: Remove deprecated inspect.getmoduleinfo function.
31123
31124- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer().
31125
31126- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating
31127  ssl.SSLContext.
31128
31129- bpo-25569: Fix memory leak in SSLSocket.getpeercert().
31130
31131- bpo-25471: Sockets returned from accept() shouldn't appear to be
31132  nonblocking.
31133
31134- bpo-25319: When threading.Event is reinitialized, the underlying condition
31135  should use a regular lock rather than a recursive lock.
31136
31137- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu
31138  Davis.
31139
31140- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк
31141  Коренберг.
31142
31143- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
31144  versions 10.5 or higher.  Original patch by A. Jesse Jiryu Davis.
31145
31146- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
31147  current versions of OpenBSD and NetBSD.  Patch by A. Jesse Jiryu Davis.
31148
31149- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input.
31150  Patch by Jack O'Connor.
31151
31152- bpo-27040: Add loop.get_exception_handler method
31153
31154- bpo-27041: asyncio: Add loop.create_future method
31155
31156IDLE
31157----
31158
31159- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav
31160  Heblikar.
31161
31162- In the 'IDLE-console differences' section of the IDLE doc, clarify how
31163  running with IDLE affects sys.modules and the standard streams.
31164
31165- bpo-25507: fix incorrect change in IOBinding that prevented printing.
31166  Augment IOBinding htest to include all major IOBinding functions.
31167
31168- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION
31169  MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode
31170  CREDITS.txt to utf-8 and open it with 'utf-8'.
31171
31172- bpo-15348: Stop the debugger engine (normally in a user process) before
31173  closing the debugger window (running in the IDLE process). This prevents
31174  the RuntimeErrors that were being caught and ignored.
31175
31176- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
31177  debugger is active (15347); b) closing the debugger with the [X] button
31178  (15348); and c) activating the debugger when already active (24455). The
31179  patch by Mark Roseman does this by making two changes. 1. Suspend and
31180  resume the gui.interaction method with the tcl vwait mechanism intended
31181  for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
31182  any existing interaction to terminate first.
31183
31184- Change 'The program' to 'Your program' in an IDLE 'kill program?' message
31185  to make it clearer that the program referred to is the currently running
31186  user program, not IDLE itself.
31187
31188- bpo-24750: Improve the appearance of the IDLE editor window status bar.
31189  Patch by Mark Roseman.
31190
31191- bpo-25313: Change the handling of new built-in text color themes to better
31192  address the compatibility problem introduced by the addition of IDLE Dark.
31193  Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
31194
31195- bpo-24782: Extension configuration is now a tab in the IDLE Preferences
31196  dialog rather than a separate dialog.  The former tabs are now a sorted
31197  list.  Patch by Mark Roseman.
31198
31199- bpo-22726: Re-activate the config dialog help button with some content
31200  about the other buttons and the new IDLE Dark theme.
31201
31202- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
31203  more or less IDLE Classic inverted, with a cobalt blue background.
31204  Strings, comments, keywords, ... are still green, red, orange, ... . To
31205  use it with IDLEs released before November 2015, hit the 'Save as New
31206  Custom Theme' button and enter a new name, such as 'Custom Dark'.  The
31207  custom theme will work with any IDLE release, and can be modified.
31208
31209- bpo-25224: README.txt is now an idlelib index for IDLE developers and
31210  curious users. The previous user content is now in the IDLE doc chapter.
31211  'IDLE' now means 'Integrated Development and Learning Environment'.
31212
31213- bpo-24820: Users can now set breakpoint colors in Settings -> Custom
31214  Highlighting. Original patch by Mark Roseman.
31215
31216- bpo-24972: Inactive selection background now matches active selection
31217  background, as configured by users, on all systems.  Found items are now
31218  always highlighted on Windows.  Initial patch by Mark Roseman.
31219
31220- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
31221  by a tk regression.  Initial patch by Mark Roseman.
31222
31223- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on
31224  Mac Aqua. Patch by Mark Roseman.
31225
31226- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
31227  Mark Roseman.
31228
31229- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac
31230  OSX, make them a 'sheet'.  Patch by Mark Roseman.
31231
31232- bpo-25198: Enhance the initial html viewer now used for Idle Help.
31233  Properly indent fixed-pitch text (patch by Mark Roseman). Give code
31234  snippet a very Sphinx-like light blueish-gray background. Re-use initial
31235  width and height set by users for shell and editor. When the Table of
31236  Contents (TOC) menu is used, put the section header at the top of the
31237  screen.
31238
31239- bpo-25225: Condense and rewrite Idle doc section on text colors.
31240
31241- bpo-21995: Explain some differences between IDLE and console Python.
31242
31243- bpo-22820: Explain need for *print* when running file from Idle editor.
31244
31245- bpo-25224: Doc: augment Idle feature list and no-subprocess section.
31246
31247- bpo-25219: Update doc for Idle command line options. Some were missing and
31248  notes were not correct.
31249
31250- bpo-24861: Most of idlelib is private and subject to change. Use
31251  idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
31252
31253- bpo-25199: Idle: add synchronization comments for future maintainers.
31254
31255- bpo-16893: Replace help.txt with help.html for Idle doc display. The new
31256  idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
31257  better than help.txt and will better document Idle as released. The
31258  tkinter html viewer that works for this file was written by Rose Roseman.
31259  The now unused EditorWindow.HelpDialog class and helt.txt file are
31260  deprecated.
31261
31262- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
31263
31264- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts).
31265
31266Documentation
31267-------------
31268
31269- bpo-26736: Used HTTPS for external links in the documentation if possible.
31270
31271- bpo-6953: Rework the Readline module documentation to group related
31272  functions together, and add more details such as what underlying Readline
31273  functions and variables are accessed.
31274
31275- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt.
31276
31277- bpo-24952: Clarify the default size argument of stack_size() in the
31278  "threading" and "_thread" modules. Patch from Mattip.
31279
31280- bpo-26014: Update 3.x packaging documentation: * "See also" links to the
31281  new docs are now provided in the legacy pages * links to setuptools
31282  documentation have been updated
31283
31284Tests
31285-----
31286
31287- bpo-21916: Added tests for the turtle module.  Patch by ingrid, Gregory
31288  Loyse and Jelle Zijlstra.
31289
31290- bpo-26295: When using "python3 -m test --testdir=TESTDIR", regrtest
31291  doesn't add "test." prefix to test module names.
31292
31293- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool)
31294  was untested.
31295
31296- bpo-26015: Added new tests for pickling iterators of mutable sequences.
31297
31298- bpo-26325: Added test.support.check_no_resource_warning() to check that no
31299  ResourceWarning is emitted.
31300
31301- bpo-25940: Changed test_ssl to use its internal local server more.  This
31302  avoids relying on svn.python.org, which recently changed root certificate.
31303
31304- bpo-25616: Tests for OrderedDict are extracted from test_collections into
31305  separate file test_ordered_dict.
31306
31307- bpo-25449: Added tests for OrderedDict subclasses.
31308
31309- bpo-25188: Add -P/--pgo to test.regrtest to suppress error output when
31310  running the test suite for the purposes of a PGO build. Initial patch by
31311  Alecsandru Patrascu.
31312
31313- bpo-22806: Add ``python -m test --list-tests`` command to list tests.
31314
31315- bpo-18174: ``python -m test --huntrleaks ...`` now also checks for leak of
31316  file descriptors. Patch written by Richard Oudkerk.
31317
31318- bpo-25260: Fix ``python -m test --coverage`` on Windows. Remove the list
31319  of ignored directories.
31320
31321- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass
31322  along to regrtest.py.  Previously there was a limit of 9.
31323
31324- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files
31325  cannot be written.
31326
31327Build
31328-----
31329
31330- bpo-21277: Don't try to link _ctypes with a ffi_convenience library.
31331
31332- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
31333  de Gaye.
31334
31335- bpo-26932: Fixed support of RTLD_* constants defined as enum values, not
31336  via macros (in particular on Android).  Patch by Chi Hsuan Yen.
31337
31338- bpo-22359: Disable the rules for running _freeze_importlib and pgen when
31339  cross-compiling.  The output of these programs is normally saved with the
31340  source code anyway, and is still regenerated when doing a native build.
31341  Patch by Xavier de Gaye.
31342
31343- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except
31344  on Mac OS X. Patch written by Chi Hsuan Yen.
31345
31346- bpo-25702: A --with-lto configure option has been added that will enable
31347  link time optimizations at build time during a make profile-opt. Some
31348  compilers and toolchains are known to not produce stable code when using
31349  LTO, be sure to test things thoroughly before relying on it. It can
31350  provide a few % speed up over profile-opt alone.
31351
31352- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old
31353  versions.
31354
31355- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a
31356  lower-level check for st_blocks in struct stat.
31357
31358- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
31359  Thiel.
31360
31361- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g.
31362
31363- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to
31364  ``PCbuild\build.bat`` for building with Profile-Guided Optimization.  The
31365  old ``PCbuild\build_pgo.bat`` script is removed.
31366
31367- bpo-25827: Add support for building with ICC to ``configure``, including a
31368  new ``--with-icc`` flag.
31369
31370- bpo-25696: Fix installation of Python on UNIX with make -j9.
31371
31372- bpo-24986: It is now possible to build Python on Windows without errors
31373  when external libraries are not available.
31374
31375- bpo-24421: Compile Modules/_math.c once, before building extensions.
31376  Previously it could fail to compile properly if the math and cmath builds
31377  were concurrent.
31378
31379- bpo-26465: Update OS X 10.5+ 32-bit-only installer to build and link with
31380  OpenSSL 1.0.2g.
31381
31382- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f.
31383
31384- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
31385
31386- bpo-24324: Do not enable unreachable code warnings when using gcc as the
31387  option does not work correctly in older versions of gcc and has been
31388  silently removed as of gcc-4.5.
31389
31390Windows
31391-------
31392
31393- bpo-27053: Updates make_zip.py to correctly generate library ZIP file.
31394
31395- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases
31396  that don't include the contents of the include directory (that is, 1.0.2e
31397  and later).
31398
31399- bpo-26071: bdist_wininst created binaries fail to start and find 32bit
31400  Python
31401
31402- bpo-26073: Update the list of magic numbers in launcher
31403
31404- bpo-26065: Excludes venv from library when generating embeddable distro.
31405
31406- bpo-25022: Removed very outdated PC/example_nt/ directory.
31407
31408Tools/Demos
31409-----------
31410
31411- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
31412  is loaded, but get C types on demand. The C types can change if
31413  python-gdb.py is loaded before the Python executable. Patch written by
31414  Thomas Ilsche.
31415
31416- bpo-26271: Fix the Freeze tool to properly use flags passed through
31417  configure. Patch by Daniel Shaulov.
31418
31419- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py.
31420  Patch by Guo Ci Teo.
31421
31422- bpo-26316: Fix variable name typo in Argument Clinic.
31423
31424- bpo-25440: Fix output of python-config --extension-suffix.
31425
31426- bpo-25154: The pyvenv script has been deprecated in favour of `python3 -m
31427  venv`.
31428
31429C API
31430-----
31431
31432- bpo-26312: SystemError is now raised in all programming bugs with using
31433  PyArg_ParseTupleAndKeywords().  RuntimeError did raised before in some
31434  programming bugs.
31435
31436- bpo-26198: ValueError is now raised instead of TypeError on buffer
31437  overflow in parsing "es#" and "et#" format units.  SystemError is now
31438  raised instead of TypeError on programmatical error in parsing format
31439  string.
31440
31441
31442What's New in Python 3.5.5 final?
31443=================================
31444
31445*Release date: 2018-02-04*
31446
31447There were no new changes in version 3.5.5.
31448
31449
31450
31451What's New in Python 3.5.5 release candidate 1?
31452===============================================
31453
31454*Release date: 2018-01-23*
31455
31456Security
31457--------
31458
31459- bpo-32551: The ``sys.path[0]`` initialization change for bpo-29139 caused
31460  a regression by revealing an inconsistency in how sys.path is initialized
31461  when executing ``__main__`` from a zipfile, directory, or other import
31462  location. This is considered a potential security issue, as it may lead to
31463  privileged processes unexpectedly loading code from user controlled
31464  directories in situations where that was not previously the case. The
31465  interpreter now consistently avoids ever adding the import location's
31466  parent directory to ``sys.path``, and ensures no other ``sys.path``
31467  entries are inadvertently modified when inserting the import location
31468  named on the command line. (Originally reported as bpo-29723 against
31469  Python 3.6rc1, but it was missed at the time that the then upcoming Python
31470  3.5.4 release would also be affected)
31471
31472- bpo-30657: Fixed possible integer overflow in PyBytes_DecodeEscape,
31473  CVE-2017-1000158. Original patch by Jay Bosamiya; rebased to Python 3 by
31474  Miro Hrončok.
31475
31476- bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
31477  get security fixes.
31478
31479Core and Builtins
31480-----------------
31481
31482- bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
31483  doesn't call ``PyObject_GC_UnTrack()``.
31484
31485Library
31486-------
31487
31488- bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
31489  Identical objects will be saved only once. Equal references will be load
31490  as identical objects. Added support for saving and loading recursive data
31491  structures.
31492
31493- bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
31494  partial characters for UTF-8 input (libexpat bug 115):
31495  https://github.com/libexpat/libexpat/issues/115
31496
31497
31498What's New in Python 3.5.4 final?
31499=================================
31500
31501*Release date: 2017-08-07*
31502
31503Library
31504-------
31505
31506- bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
31507  contains CR or LF. Patch by Dong-hee Na.
31508
31509
31510What's New in Python 3.5.4 release candidate 1?
31511===============================================
31512
31513*Release date: 2017-07-23*
31514
31515Security
31516--------
31517
31518- bpo-30730: Prevent environment variables injection in subprocess on
31519  Windows.  Prevent passing other environment variables and command
31520  arguments.
31521
31522- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
31523  security vulnerabilities including: CVE-2017-9233 (External entity
31524  infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
31525  CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
31526  CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
31527  CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
31528  impact Python, since Python already gets entropy from the OS to set the
31529  expat secret using ``XML_SetHashSalt()``.
31530
31531- bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
31532  example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
31533  ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
31534  authentication (``login@host``).
31535
31536- bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
31537  CVE-2016-0718 and CVE-2016-4472. See
31538  https://sourceforge.net/p/expat/bugs/537/ for more information.
31539
31540Core and Builtins
31541-----------------
31542
31543- bpo-30876: Relative import from unloaded package now reimports the package
31544  instead of failing with SystemError.  Relative import from non-package now
31545  fails with ImportError rather than SystemError.
31546
31547- bpo-30765: Avoid blocking in pthread_mutex_lock() when
31548  PyThread_acquire_lock() is asked not to block.
31549
31550- bpo-27945: Fixed various segfaults with dict when input collections are
31551  mutated during searching, inserting or comparing.  Based on patches by
31552  Duane Griffin and Tim Mitchell.
31553
31554- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
31555  non-interned attribute names.  Based on patch by Eryk Sun.
31556
31557- bpo-29935: Fixed error messages in the index() method of tuple, list and
31558  deque when pass indices of wrong type.
31559
31560- bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
31561  :exc:`OverflowError`.
31562
31563- bpo-29600: Fix wrapping coroutine return values in StopIteration.
31564
31565- bpo-29537: Restore runtime compatibility with bytecode files generated by
31566  CPython 3.5.0 to 3.5.2, and adjust the eval loop to avoid the problems
31567  that could be caused by the malformed variant of the
31568  BUILD_MAP_UNPACK_WITH_CALL opcode that they may contain. Patch by Petr
31569  Viktorin, Serhiy Storchaka, and Nick Coghlan.
31570
31571- bpo-28598: Support __rmod__ for subclasses of str being called before
31572  str.__mod__. Patch by Martijn Pieters.
31573
31574- bpo-29602: Fix incorrect handling of signed zeros in complex constructor
31575  for complex subclasses and for inputs having a __complex__ method. Patch
31576  by Serhiy Storchaka.
31577
31578- bpo-29347: Fixed possibly dereferencing undefined pointers when creating
31579  weakref objects.
31580
31581- bpo-29438: Fixed use-after-free problem in key sharing dict.
31582
31583- bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
31584
31585- bpo-29337: Fixed possible BytesWarning when compare the code objects.
31586  Warnings could be emitted at compile time.
31587
31588- bpo-29478: If max_line_length=None is specified while using the Compat32
31589  policy, it is no longer ignored.  Patch by Mircea Cosbuc.
31590
31591Library
31592-------
31593
31594- bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
31595  builtin functions.  Patch by Aaron Gallagher.
31596
31597- bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
31598
31599- bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
31600  thread completes, even if the thread was started by the same process which
31601  created the queue.
31602
31603- bpo-29854: Fix segfault in readline when using readline's history-size
31604  option.  Patch by Nir Soffer.
31605
31606- bpo-30807: signal.setitimer() may disable the timer when passed a tiny
31607  value. Tiny values (such as 1e-6) are valid non-zero values for
31608  setitimer(), which is specified as taking microsecond-resolution
31609  intervals. However, on some platform, our conversion routine could convert
31610  1e-6 into a zero interval, therefore disabling the timer instead of
31611  (re-)scheduling it.
31612
31613- bpo-30441: Fix bug when modifying os.environ while iterating over it
31614
31615- bpo-30532: Fix email header value parser dropping folding white space in
31616  certain cases.
31617
31618- bpo-29169: Update zlib to 1.2.11.
31619
31620- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
31621  with bytes-like argument.
31622
31623- bpo-30746: Prohibited the '=' character in environment variable names in
31624  ``os.putenv()`` and ``os.spawn*()``.
31625
31626- bpo-29755: Fixed the lgettext() family of functions in the gettext module.
31627  They now always return bytes.
31628
31629- bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases
31630  when a package is only shipped with bytecodes. Patch by Alexandru
31631  Ardelean.
31632
31633- bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
31634  reference cycle to not keep objects alive longer than expected.
31635
31636- bpo-30149: inspect.signature() now supports callables with
31637  variable-argument parameters wrapped with partialmethod. Patch by Dong-hee
31638  Na.
31639
31640- bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
31641  Patch by Sanjay Sundaresan.
31642
31643- bpo-24484: Avoid race condition in multiprocessing cleanup.
31644
31645- bpo-28994: The traceback no longer displayed for SystemExit raised in a
31646  callback registered by atexit.
31647
31648- bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
31649  called.
31650
31651- bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
31652  support for ContextManager on all versions. Original PRs by Jelle Zijlstra
31653  and Ivan Levkivskyi
31654
31655- bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
31656  implementation. Patch by Michaël Sghaïer.
31657
31658- bpo-29743: Closing transport during handshake process leaks open socket.
31659  Patch by Nikolay Kim
31660
31661- bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
31662  Sornay.
31663
31664- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
31665  EINVAL on stdin.write() if the child process is still running but closed
31666  the pipe.
31667
31668- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
31669  handle IPv6 addresses.
31670
31671- bpo-29960: Preserve generator state when _random.Random.setstate() raises
31672  an exception. Patch by Bryan Olson.
31673
31674- bpo-30414: multiprocessing.Queue._feed background running thread do not
31675  break from main loop on exception.
31676
31677- bpo-30003: Fix handling escape characters in HZ codec.  Based on patch by
31678  Ma Lin.
31679
31680- bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
31681  and *forkserver* start methods.
31682
31683- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
31684  (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
31685  This error occurs sometimes on SSL connections.
31686
31687- bpo-30375: Warnings emitted when compile a regular expression now always
31688  point to the line in the user code.  Previously they could point into
31689  inners of the re module if emitted from inside of groups or conditionals.
31690
31691- bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
31692  coroutine and the coroutine returned without any more ``await``.
31693
31694- bpo-29990: Fix range checking in GB18030 decoder.  Original patch by Ma
31695  Lin.
31696
31697- bpo-26293: Change resulted because of zipfile breakage. (See also:
31698  bpo-29094)
31699
31700- bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
31701  Misusing them could cause memory leaks or crashes.  Now scanner and
31702  encoder objects are completely initialized in the __new__ methods.
31703
31704- bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
31705  when Ctrl-C is received.
31706
31707- bpo-28556: Various updates to typing module: add typing.NoReturn type, use
31708  WrapperDescriptorType, minor bug-fixes.  Original PRs by Jim
31709  Fasarakis-Hilliard and Ivan Levkivskyi.
31710
31711- bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
31712
31713- bpo-30070: Fixed leaks and crashes in errors handling in the parser
31714  module.
31715
31716- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
31717  readline() or __next__() respectively return non-sizeable object. Fixed
31718  possible other errors caused by not checking results of PyObject_Size(),
31719  PySequence_Size(), or PyMapping_Size().
31720
31721- bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
31722  is present.
31723
31724- bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
31725  Patch by Armin Rigo.
31726
31727- bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
31728  contextlib.contextmanager.  Patch by Siddharth Velankar.
31729
31730- bpo-29998: Pickling and copying ImportError now preserves name and path
31731  attributes.
31732
31733- bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
31734  long runs of empty iterables.
31735
31736- bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
31737  and wrong types.
31738
31739- bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
31740  exception at the very first of an iterable may swallow the exception or
31741  make the program hang. Patch by Davin Potts and Xiang Zhang.
31742
31743- bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
31744  the OS gives priority to errors such as EACCES over EEXIST.
31745
31746- bpo-29861: Release references to tasks, their arguments and their results
31747  as soon as they are finished in multiprocessing.Pool.
31748
31749- bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
31750  Patch by Christophe Zeitouny.
31751
31752- bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
31753
31754- bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
31755  are not strings.  Patch by Michael Seifert.
31756
31757- bpo-29742: get_extra_info() raises exception if get called on closed ssl
31758  transport. Patch by Nikolay Kim.
31759
31760- bpo-8256: Fixed possible failing or crashing input() if attributes
31761  "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
31762  strings.
31763
31764- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
31765  big intables (objects that have __int__) as elements.  Patch by Oren
31766  Milman.
31767
31768- bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
31769  exception) to exception(s) raised in the dispatched methods. Patch by Petr
31770  Motejlek.
31771
31772- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
31773  before all pipes are closed.
31774
31775- bpo-29703: Fix asyncio to support instantiation of new event loops in
31776  child processes.
31777
31778- bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
31779
31780- bpo-29110: Fix file object leak in aifc.open() when file is given as a
31781  filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
31782
31783- bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
31784  anymore. Patch written by Jiajun Huang.
31785
31786- bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
31787  longer affects a partial object after creation.
31788
31789- bpo-28556: Various updates to typing module: typing.Counter,
31790  typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
31791  Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
31792
31793- bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
31794  3.6.0: check minimum and maximum years.
31795
31796- bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when
31797  used with a rare combination of multiprocessing and custom codecs.
31798
31799- bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
31800
31801- bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
31802  match object. Based on patch by WGH.
31803
31804- bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
31805  to a stopped instead of terminated state (ex: when under ptrace).
31806
31807- bpo-29290: Fix a regression in argparse that help messages would wrap at
31808  non-breaking spaces.
31809
31810- bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
31811
31812- bpo-29011: Fix an important omission by adding Deque to the typing module.
31813
31814- bpo-29219: Fixed infinite recursion in the repr of uninitialized
31815  ctypes.CDLL instances.
31816
31817- bpo-28969: Fixed race condition in C implementation of
31818  functools.lru_cache. KeyError could be raised when cached function with
31819  full cache was simultaneously called from different threads with the same
31820  uncached arguments.
31821
31822- bpo-29142: In urllib.request, suffixes in no_proxy environment variable
31823  with leading dots could match related hostnames again (e.g. .b.c matches
31824  a.b.c). Patch by Milan Oberkirch.
31825
31826Documentation
31827-------------
31828
31829- bpo-30176: Add missing attribute related constants in curses
31830  documentation.
31831
31832- bpo-26985: Add missing info of code object in inspect documentation.
31833
31834- bpo-28929: Link the documentation to its source file on GitHub.
31835
31836- bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
31837  to aiosmtpd, a third-party asyncio-based replacement.
31838
31839- bpo-26355: Add canonical header link on each page to corresponding major
31840  version of the documentation. Patch by Matthias Bussonnier.
31841
31842- bpo-29349: Fix Python 2 syntax in code for building the documentation.
31843
31844Tests
31845-----
31846
31847- bpo-30822: Fix regrtest command line parser to allow passing -u
31848  extralargefile to run test_zipfile64.
31849
31850- bpo-30383: regrtest: Enhance regrtest and backport features from the
31851  master branch. Add options: --coverage, --testdir, --list-tests (list test
31852  files, don't run them), --list-cases (list test identifiers, don't run
31853  them, :issue:`30523`), --matchfile (load a list of test filters from a
31854  text file, :issue:`30540`), --slowest (alias to --slow). Enhance output:
31855  add timestamp, test result, currently running tests, "Tests result: xxx"
31856  summary with total duration, etc. Fix reference leak hunting in regrtest,
31857  --huntrleaks: regrtest now warms up caches, create explicitly all internal
31858  singletons which are created on demand to prevent false positives when
31859  checking for reference leaks. (:issue:`30675`).
31860
31861- bpo-30357: test_thread: setUp() now uses support.threading_setup() and
31862  support.threading_cleanup() to wait until threads complete to avoid random
31863  side effects on following tests. Initial patch written by Grzegorz
31864  Grzywacz.
31865
31866- bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip
31867  some tests of select.poll when running on macOS due to unresolved issues
31868  with the underlying system poll function on some macOS versions.
31869
31870- bpo-30197: Enhanced functions swap_attr() and swap_item() in the
31871  test.support module. They now work when delete replaced attribute or item
31872  inside the with statement.  The old value of the attribute or item (or
31873  None if it doesn't exist) now will be assigned to the target of the "as"
31874  clause, if there is one.
31875
31876- bpo-29571: to match the behaviour of the ``re.LOCALE`` flag,
31877  test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)``
31878  to determine the candidate encoding for the test regex (allowing it to
31879  correctly skip the test when the default locale encoding is a multi-byte
31880  encoding)
31881
31882Build
31883-----
31884
31885- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
31886  ``make install`` and some other make targets when configured with
31887  ``--enable-optimizations``.
31888
31889- bpo-23404: Don't regenerate generated files based on file modification
31890  time anymore: the action is now explicit. Replace ``make touch`` with
31891  ``make regen-all``.
31892
31893- bpo-29643: Fix ``--enable-optimization`` didn't work.
31894
31895Windows
31896-------
31897
31898- bpo-30687: Locate msbuild.exe on Windows when building rather than
31899  vcvarsall.bat
31900
31901- bpo-29392: Prevent crash when passing invalid arguments into msvcrt
31902  module.
31903
31904C API
31905-----
31906
31907- bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if
31908  Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not
31909  including) or 0x03060100 or higher.
31910
31911- bpo-29083: Fixed the declaration of some public API functions.
31912  PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
31913  limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
31914  Py_BuildValue() were not available in limited API of version < 3.3 when
31915  PY_SSIZE_T_CLEAN is defined.
31916
31917
31918What's New in Python 3.5.3 final?
31919=================================
31920
31921*Release date: 2017-01-17*
31922
31923There were no code changes between 3.5.3rc1 and 3.5.3 final.
31924
31925
31926
31927What's New in Python 3.5.3 release candidate 1?
31928===============================================
31929
31930*Release date: 2017-01-02*
31931
31932Security
31933--------
31934
31935- bpo-27278: Fix os.urandom() implementation using getrandom() on Linux.
31936  Truncate size to INT_MAX and loop until we collected enough random bytes,
31937  instead of casting a directly Py_ssize_t to int.
31938
31939- bpo-22636: Avoid shell injection problems with ctypes.util.find_library().
31940
31941Core and Builtins
31942-----------------
31943
31944- bpo-29073: bytearray formatting no longer truncates on first null byte.
31945
31946- bpo-28932: Do not include <sys/random.h> if it does not exist.
31947
31948- bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
31949  not convert combined table into split table.
31950
31951- bpo-25677: Correct the positioning of the syntax error caret for indented
31952  blocks. Based on patch by Michael Layzell.
31953
31954- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
31955  form.
31956
31957- bpo-28512: Fixed setting the offset attribute of SyntaxError by
31958  PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
31959
31960- bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
31961  bug caused by a monkey-patched len() function.
31962
31963- bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
31964  when decode astral characters.  Patch by Xiang Zhang.
31965
31966- bpo-19398: Extra slash no longer added to sys.path components in case of
31967  empty compile-time PYTHONPATH components.
31968
31969- bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
31970  build.
31971
31972- bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
31973  loss in PyTraceBack_Here().
31974
31975- bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
31976  Patch by Xiang Zhang.
31977
31978- bpo-28376: The type of long range iterator is now registered as Iterator.
31979  Patch by Oren Milman.
31980
31981- bpo-28376: The constructor of range_iterator now checks that step is not
31982  0. Patch by Oren Milman.
31983
31984- bpo-26906: Resolving special methods of uninitialized type now causes
31985  implicit initialization of the type instead of a fail.
31986
31987- bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
31988  patch by Niklas Koep.
31989
31990- bpo-24098: Fixed possible crash when AST is changed in process of
31991  compiling it.
31992
31993- bpo-28350: String constants with null character no longer interned.
31994
31995- bpo-26617: Fix crash when GC runs during weakref callbacks.
31996
31997- bpo-27942: String constants now interned recursively in tuples and
31998  frozensets.
31999
32000- bpo-21578: Fixed misleading error message when ImportError called with
32001  invalid keyword args.
32002
32003- bpo-28203: Fix incorrect type in error message from ``complex(1.0,
32004  {2:3})``. Patch by Soumya Sharma.
32005
32006- bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
32007  syscall fails with EPERM, for example when blocked by SECCOMP.
32008
32009- bpo-28131: Fix a regression in zipimport's compile_source().  zipimport
32010  should use the same optimization level as the interpreter.
32011
32012- bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is
32013  compiled with NSMALLPOSINTS = 0.
32014
32015- bpo-25758: Prevents zipimport from unnecessarily encoding a filename
32016  (patch by Eryk Sun)
32017
32018- bpo-28189: dictitems_contains no longer swallows compare errors. (Patch by
32019  Xiang Zhang)
32020
32021- bpo-27812: Properly clear out a generator's frame's backreference to the
32022  generator to prevent crashes in frame.clear().
32023
32024- bpo-27811: Fix a crash when a coroutine that has not been awaited is
32025  finalized with warnings-as-errors enabled.
32026
32027- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
32028  use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
32029
32030- bpo-26020: set literal evaluation order did not match documented
32031  behaviour.
32032
32033- bpo-27782: Multi-phase extension module import now correctly allows the
32034  ``m_methods`` field to be used to add module level functions to instances
32035  of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
32036
32037- bpo-27936: The round() function accepted a second None argument for some
32038  types but not for others.  Fixed the inconsistency by accepting None for
32039  all numeric types.
32040
32041- bpo-27487: Warn if a submodule argument to "python -m" or
32042  runpy.run_module() is found in sys.modules after parent packages are
32043  imported, but before the submodule is executed.
32044
32045- bpo-27558: Fix a SystemError in the implementation of "raise" statement.
32046  In a brand new thread, raise a RuntimeError since there is no active
32047  exception to reraise. Patch written by Xiang Zhang.
32048
32049- bpo-27419: Standard __import__() no longer look up "__import__" in globals
32050  or builtins for importing submodules or "from import".  Fixed handling an
32051  error of non-string package name.
32052
32053- bpo-27083: Respect the PYTHONCASEOK environment variable under Windows.
32054
32055- bpo-27514: Make having too many statically nested blocks a SyntaxError
32056  instead of SystemError.
32057
32058- bpo-27473: Fixed possible integer overflow in bytes and bytearray
32059  concatenations. Patch by Xiang Zhang.
32060
32061- bpo-27507: Add integer overflow check in bytearray.extend().  Patch by
32062  Xiang Zhang.
32063
32064- bpo-27581: Don't rely on wrapping for overflow check in
32065  PySequence_Tuple().  Patch by Xiang Zhang.
32066
32067- bpo-27443: __length_hint__() of bytearray iterators no longer return a
32068  negative integer for a resized bytearray.
32069
32070- bpo-27942: Fix memory leak in codeobject.c
32071
32072Library
32073-------
32074
32075- bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
32076  context. Patch by Sam Breese.
32077
32078- bpo-29094: Offsets in a ZIP file created with extern file object and modes
32079  "w" and "x" now are relative to the start of the file.
32080
32081- bpo-13051: Fixed recursion errors in large or resized
32082  curses.textpad.Textbox.  Based on patch by Tycho Andersen.
32083
32084- bpo-29119: Fix weakrefs in the pure python version of
32085  collections.OrderedDict move_to_end() method. Contributed by Andra
32086  Bogildea.
32087
32088- bpo-9770: curses.ascii predicates now work correctly with negative
32089  integers.
32090
32091- bpo-28427: old keys should not remove new values from WeakValueDictionary
32092  when collecting from another thread.
32093
32094- bpo-28923: Remove editor artifacts from Tix.py.
32095
32096- bpo-28871: Fixed a crash when deallocate deep ElementTree.
32097
32098- bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
32099  WeakValueDictionary.pop() when a GC collection happens in another thread.
32100
32101- bpo-20191: Fixed a crash in resource.prlimit() when pass a sequence that
32102  doesn't own its elements as limits.
32103
32104- bpo-28779: multiprocessing.set_forkserver_preload() would crash the
32105  forkserver process if a preloaded module instantiated some multiprocessing
32106  objects such as locks.
32107
32108- bpo-28847: dbm.dumb now supports reading read-only files and no longer
32109  writes the index file when it is not changed.
32110
32111- bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
32112  from_buffer_copy() methods on abstract classes like Array.
32113
32114- bpo-28732: Fix crash in os.spawnv() with no elements in args
32115
32116- bpo-28485: Always raise ValueError for negative
32117  compileall.compile_dir(workers=...) parameter, even when multithreading is
32118  unavailable.
32119
32120- bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
32121  garbage collector is invoked in other thread.  Based on patch by Sebastian
32122  Cufre.
32123
32124- bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
32125  given empty data twice.  Patch by Benjamin Fogle.
32126
32127- bpo-28549: Fixed segfault in curses's addch() with ncurses6.
32128
32129- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
32130  file with compression before trying to open it without compression.
32131  Otherwise it had 50% chance failed with ignore_zeros=True.
32132
32133- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
32134  browsers.  Based on patch by Oleg Broytman.
32135
32136- bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
32137  by representing the scale as float value internally in Tk.  tkinter.IntVar
32138  now works if float value is set to underlying Tk variable.
32139
32140- bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at
32141  the start of new line after printing a month's calendar.  Patch by Xiang
32142  Zhang.
32143
32144- bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
32145  Based on patch by Kaarle Ritvanen.
32146
32147- bpo-28353: os.fwalk() no longer fails on broken links.
32148
32149- bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
32150  workaround to Tix library bug.
32151
32152- bpo-28488: shutil.make_archive() no longer add entry "./" to ZIP archive.
32153
32154- bpo-24452: Make webbrowser support Chrome on Mac OS X.
32155
32156- bpo-20766: Fix references leaked by pdb in the handling of SIGINT
32157  handlers.
32158
32159- bpo-26293: Fixed writing ZIP files that starts not from the start of the
32160  file.  Offsets in ZIP file now are relative to the start of the archive in
32161  conforming to the specification.
32162
32163- bpo-28321: Fixed writing non-BMP characters with binary format in
32164  plistlib.
32165
32166- bpo-28322: Fixed possible crashes when unpickle itertools objects from
32167  incorrect pickle data.  Based on patch by John Leitch.
32168
32169- Fix possible integer overflows and crashes in the mmap module with unusual
32170  usage patterns.
32171
32172- bpo-1703178: Fix the ability to pass the --link-objects option to the
32173  distutils build_ext command.
32174
32175- bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
32176  9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
32177  that they don't call itermonthdates() which can cause datetime.date
32178  under/overflow.
32179
32180- bpo-28275: Fixed possible use after free in the decompress() methods of
32181  the LZMADecompressor and BZ2Decompressor classes. Original patch by John
32182  Leitch.
32183
32184- bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
32185  if pass invalid string-like object as a name.  Patch by Xiang Zhang.
32186
32187- bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
32188  Patch by Madison May.
32189
32190- bpo-27611: Fixed support of default root window in the tkinter.tix module.
32191
32192- bpo-27348: In the traceback module, restore the formatting of exception
32193  messages like "Exception: None".  This fixes a regression introduced in
32194  3.5a2.
32195
32196- bpo-25651: Allow falsy values to be used for msg parameter of subTest().
32197
32198- bpo-27932: Prevent memory leak in win32_ver().
32199
32200- Fix UnboundLocalError in socket._sendfile_use_sendfile.
32201
32202- bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
32203  os.stat().  Patch by Eryk Sun.
32204
32205- bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
32206  empty bytestring is passed.
32207
32208- bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
32209
32210- bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
32211  Gergely Imreh and Markus Holtermann.
32212
32213- bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
32214  binascii.a2b_qp().
32215
32216- bpo-19003: m email.generator now replaces only ``\r`` and/or ``\n`` line
32217  endings, per the RFC, instead of all unicode line endings.
32218
32219- bpo-28019: itertools.count() no longer rounds non-integer step in range
32220  between 1.0 and 2.0 to 1.
32221
32222- bpo-25969: Update the lib2to3 grammar to handle the unpacking
32223  generalizations added in 3.5.
32224
32225- bpo-14977: mailcap now respects the order of the lines in the mailcap
32226  files ("first match"), as required by RFC 1542.  Patch by Michael Lazar.
32227
32228- bpo-24594: Validates persist parameter when opening MSI database
32229
32230- bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes
32231  (Patch by Duane Griffin.  Reviewed and approved by Stefan Behnel.)
32232
32233- bpo-28047: Fixed calculation of line length used for the base64 CTE in the
32234  new email policies.
32235
32236- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by
32237  Claude Paroz.
32238
32239- bpo-22450: urllib now includes an ``Accept: */*`` header among the default
32240  headers. This makes the results of REST API requests more consistent and
32241  predictable especially when proxy servers are involved.
32242
32243- lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
32244  between runs given the same Grammar.txt input regardless of the hash
32245  randomization setting.
32246
32247- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
32248  in the "ctypes" and "array" modules.
32249
32250- bpo-22233: Break email header lines *only* on the RFC specified CR and LF
32251  characters, not on arbitrary unicode line breaks.  This also fixes a bug
32252  in HTTP header parsing.
32253
32254- bpo-27988: Fix email iter_attachments incorrect mutation of payload list.
32255
32256- bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name
32257  fields in X.509 certs.
32258
32259- bpo-27850: Remove 3DES from ssl module's default cipher list to counter
32260  measure sweet32 attack (CVE-2016-2183).
32261
32262- bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list.
32263  (Required OpenSSL 1.1.0 or LibreSSL).
32264
32265- bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0.
32266
32267- Remove support for passing a file descriptor to os.access. It never worked
32268  but previously didn't raise.
32269
32270- bpo-12885: Fix error when distutils encounters symlink.
32271
32272- bpo-27881: Fixed possible bugs when setting
32273  sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
32274
32275- bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory
32276  creates not a cursor.  Patch by Xiang Zhang.
32277
32278- bpo-19884: Avoid spurious output on OS X with Gnu Readline.
32279
32280- bpo-27706: Restore deterministic behavior of random.Random().seed() for
32281  string seeds using seeding version 1.  Allows sequences of calls to
32282  random() to exactly match those obtained in Python 2. Patch by Nofar
32283  Schnider.
32284
32285- bpo-10513: Fix a regression in Connection.commit().  Statements should not
32286  be reset after a commit.
32287
32288- A new version of typing.py from https://github.com/python/typing:
32289  Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__
32290  (upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the
32291  dict constraint in ForwardRef._eval_type (upstream #252).
32292
32293- bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of
32294  negative exponent and negative base.
32295
32296- bpo-21718: cursor.description is now available for queries using CTEs.
32297
32298- bpo-2466: posixpath.ismount now correctly recognizes mount points which
32299  the user does not have permission to access.
32300
32301- bpo-27773: Correct some memory management errors server_hostname in
32302  _ssl.wrap_socket().
32303
32304- bpo-26750: unittest.mock.create_autospec() now works properly for
32305  subclasses of property() and other data descriptors.
32306
32307- In the curses module, raise an error if window.getstr() or window.instr()
32308  is passed a negative value.
32309
32310- bpo-27783: Fix possible usage of uninitialized memory in
32311  operator.methodcaller.
32312
32313- bpo-27774: Fix possible Py_DECREF on unowned object in _sre.
32314
32315- bpo-27760: Fix possible integer overflow in binascii.b2a_qp.
32316
32317- bpo-27758: Fix possible integer overflow in the _csv module for large
32318  record lengths.
32319
32320- bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
32321  HTTP_PROXY variable when REQUEST_METHOD environment is set, which
32322  indicates that the script is in CGI mode.
32323
32324- bpo-27656: Do not assume sched.h defines any SCHED_* constants.
32325
32326- bpo-27130: In the "zlib" module, fix handling of large buffers (typically
32327  4 GiB) when compressing and decompressing.  Previously, inputs were
32328  limited to 4 GiB, and compression and decompression operations did not
32329  properly handle results of 4 GiB.
32330
32331- bpo-27533: Release GIL in nt._isdir
32332
32333- bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original
32334  patch by Alexandre Vassalotti.
32335
32336- bpo-27522: Avoid an unintentional reference cycle in email.feedparser.
32337
32338- bpo-26844: Fix error message for imp.find_module() to refer to 'path'
32339  instead of 'name'. Patch by Lev Maximov.
32340
32341- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
32342  error about unclean EOF.
32343
32344- bpo-27466: Change time format returned by http.cookie.time2netscape,
32345  confirming the netscape cookie format and making it consistent with
32346  documentation.
32347
32348- bpo-26664: Fix activate.fish by removing mis-use of ``$``.
32349
32350- bpo-22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong
32351  mode no longer break tracing, trace_vinfo() now always returns a list of
32352  pairs of strings, tracing in the "u" mode now works.
32353
32354- Fix a scoping issue in importlib.util.LazyLoader which triggered an
32355  UnboundLocalError when lazy-loading a module that was already put into
32356  sys.modules.
32357
32358- bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and
32359  ispunct().
32360
32361- bpo-26754: Some functions (compile() etc) accepted a filename argument
32362  encoded as an iterable of integers. Now only strings and byte-like objects
32363  are accepted.
32364
32365- bpo-27048: Prevents distutils failing on Windows when environment
32366  variables contain non-ASCII characters
32367
32368- bpo-27330: Fixed possible leaks in the ctypes module.
32369
32370- bpo-27238: Got rid of bare excepts in the turtle module.  Original patch
32371  by Jelle Zijlstra.
32372
32373- bpo-27122: When an exception is raised within the context being managed by
32374  a contextlib.ExitStack() and one of the exit stack generators catches and
32375  raises it in a chain, do not re-raise the original exception when exiting,
32376  let the new chained one through.  This avoids the :pep:`479` bug described
32377  in issue25782.
32378
32379- bpo-26386: Fixed ttk.TreeView selection operations with item id's
32380  containing spaces.
32381
32382- bpo-16182: Fix various functions in the "readline" module to use the
32383  locale encoding, and fix get_begidx() and get_endidx() to return code
32384  point indexes.
32385
32386- bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton.
32387
32388- bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to
32389  Paulo Andrade and Petr Viktorin for the analysis and patch.
32390
32391- bpo-21201: Improves readability of multiprocessing error message.  Thanks
32392  to Wojciech Walczak for patch.
32393
32394- bpo-27456: asyncio: Set TCP_NODELAY by default.
32395
32396- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
32397  Kevin Conway.
32398
32399- bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
32400  Seth Michael Larson.
32401
32402- bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
32403  iceboy.
32404
32405- bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
32406
32407- bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
32408
32409- bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
32410  Patch by Mark Williams.
32411
32412- bpo-28368: Refuse monitoring processes if the child watcher has no loop
32413  attached. Patch by Vincent Michel.
32414
32415- bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
32416  add_writer, etc.
32417
32418- bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
32419  Марк.
32420
32421- bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
32422
32423- bpo-28372: Fix asyncio to support formatting of non-python coroutines.
32424
32425- bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
32426  Марк.
32427
32428- bpo-27972: Prohibit Tasks to await on themselves.
32429
32430- bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children
32431  are done. Patch by Johannes Ebke.
32432
32433- bpo-26796: Don't configure the number of workers for default threadpool
32434  executor. Initial patch by Hans Lawrenz.
32435
32436- bpo-28600: Optimize loop.call_soon().
32437
32438- bpo-28613: Fix get_event_loop() return the current loop if called from
32439  coroutines/callbacks.
32440
32441- bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin
32442  Mayfield.
32443
32444- bpo-28652: Make loop methods reject socket kinds they do not support.
32445
32446- bpo-28653: Fix a refleak in functools.lru_cache.
32447
32448- bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
32449
32450- bpo-24142: Reading a corrupt config file left the parser in an invalid
32451  state.  Original patch by Florian Höch.
32452
32453- bpo-28990: Fix SSL hanging if connection is closed before handshake
32454  completed. (Patch by HoHo-Ho)
32455
32456IDLE
32457----
32458
32459- bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger
32460  Serwy, updated by Bayard Randel.
32461
32462- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
32463
32464- Add version to title of IDLE help window.
32465
32466- bpo-25564: In section on IDLE -- console differences, mention that using
32467  exec means that __builtins__ is defined for each statement.
32468
32469- bpo-27714: text_textview and test_autocomplete now pass when re-run in the
32470  same process.  This occurs when test_idle fails when run with the -w
32471  option but without -jn.  Fix warning from test_config.
32472
32473- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports.
32474  Users must include the same imports required to run directly in Python.
32475
32476- bpo-27452: add line counter and crc to IDLE configHandler test dump.
32477
32478- bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
32479
32480- bpo-27245: IDLE: Cleanly delete custom themes and key bindings.
32481  Previously, when IDLE was started from a console or by import, a cascade
32482  of warnings was emitted. Patch by Serhiy Storchaka.
32483
32484C API
32485-----
32486
32487- bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
32488
32489- bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
32490  an iterable of integers. Now only strings and bytes-like objects are
32491  accepted.
32492
32493Documentation
32494-------------
32495
32496- bpo-28513: Documented command-line interface of zipfile.
32497
32498Tests
32499-----
32500
32501- bpo-28950: Disallow -j0 to be combined with -T/-l/-M in regrtest command
32502  line arguments.
32503
32504- bpo-28666: Now test.support.rmtree is able to remove unwritable or
32505  unreadable directories.
32506
32507- bpo-23839: Various caches now are cleared before running every test file.
32508
32509- bpo-28409: regrtest: fix the parser of command line arguments.
32510
32511- bpo-27787: Call gc.collect() before checking each test for "dangling
32512  threads", since the dangling threads are weak references.
32513
32514- bpo-27369: In test_pyexpat, avoid testing an error message detail that
32515  changed in Expat 2.2.0.
32516
32517Tools/Demos
32518-----------
32519
32520- bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the
32521  current "re" module, avoid invalid Python backslash escapes, and fix a bug
32522  parsing escaped C quote signs.
32523
32524- bpo-27332: Fixed the type of the first argument of module-level functions
32525  generated by Argument Clinic.  Patch by Petr Viktorin.
32526
32527- bpo-27418: Fixed Tools/importbench/importbench.py.
32528
32529Windows
32530-------
32531
32532- bpo-28251: Improvements to help manuals on Windows.
32533
32534- bpo-28110: launcher.msi has different product codes between 32-bit and
32535  64-bit
32536
32537- bpo-25144: Ensures TargetDir is set before continuing with custom install.
32538
32539- bpo-27469: Adds a shell extension to the launcher so that drag and drop
32540  works correctly.
32541
32542- bpo-27309: Enabled proper Windows styles in python[w].exe manifest.
32543
32544Build
32545-----
32546
32547- bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
32548
32549- bpo-23903: Added missed names to PC/python3.def.
32550
32551- bpo-10656: Fix out-of-tree building on AIX.  Patch by Tristan Carel and
32552  Michael Haubenwallner.
32553
32554- bpo-26359: Rename --with-optimiations to --enable-optimizations.
32555
32556- bpo-28444: Fix missing extensions modules when cross compiling.
32557
32558- bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
32559
32560- bpo-28258: Fixed build with Estonian locale (python-config and distclean
32561  targets in Makefile).  Patch by Arfrever Frehtes Taifersar Arahesis.
32562
32563- bpo-26661: setup.py now detects system libffi with multiarch wrapper.
32564
32565- bpo-28066: Fix the logic that searches build directories for generated
32566  include files when building outside the source tree.
32567
32568- bpo-15819: Remove redundant include search directory option for building
32569  outside the source tree.
32570
32571- bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach)
32572
32573- bpo-27705: Update message in validate_ucrtbase.py
32574
32575- bpo-27983: Cause lack of llvm-profdata tool when using clang as required
32576  for PGO linking to be a configure time error rather than make time when
32577  --with-optimizations is enabled.  Also improve our ability to find the
32578  llvm-profdata tool on MacOS and some Linuxes.
32579
32580- bpo-26307: The profile-opt build now applies PGO to the built-in modules.
32581
32582- bpo-26359: Add the --with-optimizations configure flag.
32583
32584- bpo-27713: Suppress spurious build warnings when updating importlib's
32585  bootstrap files. Patch by Xiang Zhang
32586
32587- bpo-25825: Correct the references to Modules/python.exp and ld_so_aix,
32588  which are required on AIX.  This updates references to an installation
32589  path that was changed in 3.2a4, and undoes changed references to the build
32590  tree that were made in 3.5.0a1.
32591
32592- bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi
32593  Hsuan Yen.
32594
32595- bpo-27641: The configure script now inserts comments into the makefile to
32596  prevent the pgen and _freeze_importlib executables from being
32597  cross-compiled.
32598
32599- bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be
32600  used for file generation during the build.
32601
32602- bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update
32603  FreedBSD version checks for the original ctype UTF-8 workaround.
32604
32605- bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
32606  Patch by Gareth Rees.
32607
32608
32609What's New in Python 3.5.2 final?
32610=================================
32611
32612*Release date: 2016-06-26*
32613
32614Core and Builtins
32615-----------------
32616
32617- bpo-26930: Update Windows builds to use OpenSSL 1.0.2h.
32618
32619Tests
32620-----
32621
32622- bpo-26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test.
32623
32624IDLE
32625----
32626
32627- bpo-27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2.
32628
32629
32630What's New in Python 3.5.2 release candidate 1?
32631===============================================
32632
32633*Release date: 2016-06-12*
32634
32635Security
32636--------
32637
32638- bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283.
32639
32640- Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by
32641  Team Oststrom
32642
32643- bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with
32644  ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom
32645  entropy pool is not initialized yet. Patch written by Colm Buckley.
32646
32647- bpo-26657: Fix directory traversal vulnerability with http.server on
32648  Windows.  This fixes a regression that was introduced in 3.3.4rc1 and
32649  3.4.0rc1.  Based on patch by Philipp Hagemeister.
32650
32651- bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is
32652  empty. Patch by Baji.
32653
32654- bpo-25939: On Windows open the cert store readonly in
32655  ssl.enum_certificates.
32656
32657Core and Builtins
32658-----------------
32659
32660- bpo-27066: Fixed SystemError if a custom opener (for open()) returns a
32661  negative number without setting an exception.
32662
32663- bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by
32664  Xavier de Gaye.
32665
32666- bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
32667  format unit.
32668
32669- bpo-26991: Fix possible refleak when creating a function with annotations.
32670
32671- bpo-27039: Fixed bytearray.remove() for values greater than 127.  Patch by
32672  Joe Jevnik.
32673
32674- bpo-23640: int.from_bytes() no longer bypasses constructors for
32675  subclasses.
32676
32677- bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL
32678  pointer.
32679
32680- bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for
32681  interpolation unintentionally added with move to Python 3. Behavior no
32682  longer does any interpolation in .pypirc files, matching behavior in
32683  Python 2.7 and Setuptools 19.0.
32684
32685- bpo-26659: Make the builtin slice type support cycle collection.
32686
32687- bpo-26718: super.__init__ no longer leaks memory if called multiple times.
32688  NOTE: A direct call of super.__init__ is not endorsed!
32689
32690- bpo-25339: PYTHONIOENCODING now has priority over locale in setting the
32691  error handler for stdin and stdout.
32692
32693- bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes
32694  are generic sequence iterators, iterators of str, bytes, bytearray, list,
32695  tuple, set, frozenset, dict, OrderedDict, corresponding views and
32696  os.scandir() iterator.
32697
32698- bpo-26581: If coding cookie is specified multiple times on a line in
32699  Python source code file, only the first one is taken to account.
32700
32701- bpo-26464: Fix str.translate() when string is ASCII and first replacements
32702  removes character, but next replacement uses a non-ASCII character or a
32703  string longer than 1 character. Regression introduced in Python 3.5.0.
32704
32705- bpo-22836: Ensure exception reports from PyErr_Display() and
32706  PyErr_WriteUnraisable() are sensible even when formatting them produces
32707  secondary errors.  This affects the reports produced by
32708  sys.__excepthook__() and when __del__() raises an exception.
32709
32710- bpo-26302: Correct behavior to reject comma as a legal character for
32711  cookie names.
32712
32713- bpo-4806: Avoid masking the original TypeError exception when using star
32714  (``*``) unpacking in function calls.  Based on patch by Hagen Fürstenau
32715  and Daniel Urban.
32716
32717- bpo-27138: Fix the doc comment for FileFinder.find_spec().
32718
32719- bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get
32720  the current Python thread state, but don't issue a fatal error if it is
32721  NULL. This new function must be used instead of accessing directly the
32722  _PyThreadState_Current variable.  The variable is no more exposed since
32723  Python 3.5.1 to hide the exact implementation of atomic C types, to avoid
32724  compiler issues.
32725
32726- bpo-26194: Deque.insert() gave odd results for bounded deques that had
32727  reached their maximum size.  Now an IndexError will be raised when
32728  attempting to insert into a full deque.
32729
32730- bpo-25843: When compiling code, don't merge constants if they are equal
32731  but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
32732  1.0`` is now correctly compiled to two different functions: ``f1()``
32733  returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``int``), even if
32734  ``1`` and ``1.0`` are equal.
32735
32736- bpo-22995: [UPDATE] Comment out the one of the pickleability tests in
32737  _PyObject_GetState() due to regressions observed in Cython-based projects.
32738
32739- bpo-25961: Disallowed null characters in the type name.
32740
32741- bpo-25973: Fix segfault when an invalid nonlocal statement binds a name
32742  starting with two underscores.
32743
32744- bpo-22995: Instances of extension types with a state that aren't
32745  subclasses of list or dict and haven't implemented any pickle-related
32746  methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or
32747  __getstate__), can no longer be pickled.  Including memoryview.
32748
32749- bpo-20440: Massive replacing unsafe attribute setting code with special
32750  macro Py_SETREF.
32751
32752- bpo-25766: Special method __bytes__() now works in str subclasses.
32753
32754- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
32755  This allows sys.getsize() to work correctly with their subclasses with
32756  __slots__ defined.
32757
32758- bpo-25709: Fixed problem with in-place string concatenation and utf-8
32759  cache.
32760
32761- bpo-27147: Mention :pep:`420` in the importlib docs.
32762
32763- bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside
32764  __getattr__.
32765
32766- bpo-24731: Fixed crash on converting objects with special methods
32767  __bytes__, __trunc__, and __float__ returning instances of subclasses of
32768  bytes, int, and float to subclasses of bytes, int, and float
32769  correspondingly.
32770
32771- bpo-26478: Fix semantic bugs when using binary operators with dictionary
32772  views and tuples.
32773
32774- bpo-26171: Fix possible integer overflow and heap corruption in
32775  zipimporter.get_data().
32776
32777- bpo-25660: Fix TAB key behaviour in REPL with readline.
32778
32779- bpo-25887: Raise a RuntimeError when a coroutine object is awaited more
32780  than once.
32781
32782- bpo-27243: Update the __aiter__ protocol: instead of returning an
32783  awaitable that resolves to an asynchronous iterator, the asynchronous
32784  iterator should be returned directly.  Doing the former will trigger a
32785  PendingDeprecationWarning.
32786
32787Library
32788-------
32789
32790- bpo-21386: Implement missing IPv4Address.is_global property.  It was
32791  documented since 07a5610bae9d.  Initial patch by Roger Luethi.
32792
32793- bpo-20900: distutils register command now decodes HTTP responses
32794  correctly.  Initial patch by ingrid.
32795
32796- A new version of typing.py provides several new classes and features:
32797  @overload outside stubs, Reversible, DefaultDict, Text, ContextManager,
32798  Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some
32799  of the new features are not yet implemented in mypy or other static
32800  analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable,
32801  AsyncIterator) have been added (in fact they made it into 3.5.1 but were
32802  never mentioned).
32803
32804- bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from
32805  sending a message body for 205 Reset Content.  Also, don't send Content
32806  header fields in responses that don't have a body.  Patch by Susumu
32807  Koshiba.
32808
32809- bpo-21313: Fix the "platform" module to tolerate when sys.version contains
32810  truncated build information.
32811
32812- bpo-27164: In the zlib module, allow decompressing raw Deflate streams
32813  with a predefined zdict.  Based on patch by Xiang Zhang.
32814
32815- bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely
32816  write data to the client.  Previously it could do partial writes and
32817  truncate data.  Also, wsgiref.handler.ServerHandler can now handle stdout
32818  doing partial writes, but this is deprecated.
32819
32820- bpo-26809: Add ``__all__`` to :mod:`string`.  Patch by Emanuel Barry.
32821
32822- bpo-26373: subprocess.Popen.communicate now correctly ignores
32823  BrokenPipeError when the child process dies before .communicate() is
32824  called in more/all circumstances.
32825
32826- bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch
32827  by Claudiu Popa.
32828
32829- bpo-27114: Fix SSLContext._load_windows_store_certs fails with
32830  PermissionError
32831
32832- bpo-18383: Avoid creating duplicate filters when using filterwarnings and
32833  simplefilter. Based on patch by Alex Shkop.
32834
32835- bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by
32836  SELinux and fails with EACCESS. The function now falls back to fcntl().
32837  Patch written by Michał Bednarski.
32838
32839- bpo-27014: Fix infinite recursion using typing.py.  Thanks to Kalle Tuure!
32840
32841- bpo-14132: Fix urllib.request redirect handling when the target only has a
32842  query string.  Original fix by Ján Janech.
32843
32844- bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes
32845  found in redirect target URLs.  Some servers send Location header fields
32846  with non-ASCII bytes, but "http.client" requires the request target to be
32847  ASCII-encodable, otherwise a UnicodeEncodeError is raised.  Based on patch
32848  by Christian Heimes.
32849
32850- bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch
32851  contributed by Chi Hsuan Yen.
32852
32853- bpo-22274: In the subprocess module, allow stderr to be redirected to
32854  stdout even when stdout is not redirected.  Patch by Akira Li.
32855
32856- bpo-26807: mock_open 'files' no longer error on readline at end of file.
32857  Patch from Yolanda Robla.
32858
32859- bpo-25745: Fixed leaking a userptr in curses panel destructor.
32860
32861- bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper
32862  in statistics.pvariance.
32863
32864- bpo-26881: The modulefinder module now supports extended opcode arguments.
32865
32866- bpo-23815: Fixed crashes related to directly created instances of types in
32867  _tkinter and curses.panel modules.
32868
32869- bpo-17765: weakref.ref() no longer silently ignores keyword arguments.
32870  Patch by Georg Brandl.
32871
32872- bpo-26873: xmlrpc now raises ResponseError on unsupported type tags
32873  instead of silently return incorrect result.
32874
32875- bpo-26711: Fixed the comparison of plistlib.Data with other types.
32876
32877- bpo-24114: Fix an uninitialized variable in `ctypes.util`. The bug only
32878  occurs on SunOS when the ctypes implementation searches for the `crle`
32879  program.  Patch by Xiang Zhang.  Tested on SunOS by Kees Bos.
32880
32881- bpo-26864: In urllib.request, change the proxy bypass host checking
32882  against no_proxy to be case-insensitive, and to not match unrelated host
32883  names that happen to have a bypassed hostname as a suffix.  Patch by Xiang
32884  Zhang.
32885
32886- bpo-26634: recursive_repr() now sets __qualname__ of wrapper.  Patch by
32887  Xiang Zhang.
32888
32889- bpo-26804: urllib.request will prefer lower_case proxy environment
32890  variables over UPPER_CASE or Mixed_Case ones. Patch contributed by
32891  Hans-Peter Jansen.
32892
32893- bpo-26837: assertSequenceEqual() now correctly outputs non-stringified
32894  differing items (like bytes in the -b mode).  This affects
32895  assertListEqual() and assertTupleEqual().
32896
32897- bpo-26041: Remove "will be removed in Python 3.7" from deprecation
32898  messages of platform.dist() and platform.linux_distribution(). Patch by
32899  Kumaripaba Miyurusara Athukorala.
32900
32901- bpo-26822: itemgetter, attrgetter and methodcaller objects no longer
32902  silently ignore keyword arguments.
32903
32904- bpo-26733: Disassembling a class now disassembles class and static
32905  methods. Patch by Xiang Zhang.
32906
32907- bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch
32908  :exc:`AttributeError` instead of :exc:`NameError`. Patch written by
32909  Emanuel Barry.
32910
32911- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
32912  and link field limits for multibyte character encodings like utf-8.
32913
32914- bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8.  Patch by
32915  Anthony Sottile.
32916
32917- bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
32918  more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
32919  1024 bytes per call.
32920
32921- bpo-16329: Add .webm to mimetypes.types_map.  Patch by Giampaolo Rodola'.
32922
32923- bpo-13952: Add .csv to mimetypes.types_map.  Patch by Geoff Wilson.
32924
32925- bpo-26709: Fixed Y2038 problem in loading binary PLists.
32926
32927- bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our
32928  own SIGWINCH handler.  Patch by Eric Price.
32929
32930- bpo-26586: In http.server, respond with "413 Request header fields too
32931  large" if there are too many header fields to parse, rather than killing
32932  the connection and raising an unhandled exception.  Patch by Xiang Zhang.
32933
32934- bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable()
32935  to always return False.
32936
32937- bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of
32938  tuple (changeset 3603bae63c13 only works for classes) so we need to
32939  implement __ne__ ourselves.  Patch by Andrew Plummer.
32940
32941- bpo-26644: Raise ValueError rather than SystemError when a negative length
32942  is passed to SSLSocket.recv() or read().
32943
32944- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes
32945  instead of up to 1024.
32946
32947- bpo-26616: Fixed a bug in datetime.astimezone() method.
32948
32949- bpo-21925: :func:`warnings.formatwarning` now catches exceptions on
32950  ``linecache.getline(...)`` to be able to log :exc:`ResourceWarning`
32951  emitted late during the Python shutdown process.
32952
32953- bpo-24266: Ctrl+C during Readline history search now cancels the search
32954  mode when compiled with Readline 7.
32955
32956- bpo-26560: Avoid potential ValueError in BaseHandler.start_response.
32957  Initial patch by Peter Inglesby.
32958
32959- bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex`
32960  to support importing packages.
32961
32962- bpo-26499: Account for remaining Content-Length in HTTPResponse.readline()
32963  and read1(). Based on patch by Silent Ghost. Also document that
32964  HTTPResponse now supports these methods.
32965
32966- bpo-25320: Handle sockets in directories unittest discovery is scanning.
32967  Patch from Victor van den Elzen.
32968
32969- bpo-16181: cookiejar.http2time() now returns None if year is higher than
32970  datetime.MAXYEAR.
32971
32972- bpo-26513: Fixes platform module detection of Windows Server
32973
32974- bpo-23718: Fixed parsing time in week 0 before Jan 1.  Original patch by
32975  Tamás Bence Gedai.
32976
32977- bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise
32978  NotImplementedError instead of ImportError.
32979
32980- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
32981
32982- bpo-15068: Got rid of excessive buffering in the fileinput module. The
32983  bufsize parameter is no longer used.
32984
32985- bpo-2202: Fix UnboundLocalError in
32986  AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu
32987  Dupuy.
32988
32989- bpo-25718: Fixed pickling and copying the accumulate() iterator with total
32990  is None.
32991
32992- bpo-26475: Fixed debugging output for regular expressions with the (?x)
32993  flag.
32994
32995- bpo-26457: Fixed the subnets() methods in IP network classes for the case
32996  when resulting prefix length is equal to maximal prefix length. Based on
32997  patch by Xiang Zhang.
32998
32999- bpo-26385: Remove the file if the internal open() call in
33000  NamedTemporaryFile() fails. Patch by Silent Ghost.
33001
33002- bpo-26402: Fix XML-RPC client to retry when the server shuts down a
33003  persistent connection.  This was a regression related to the new
33004  http.client.RemoteDisconnected exception in 3.5.0a4.
33005
33006- bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with
33007  adobe=True.  Patch by Swati Jaiswal.
33008
33009- bpo-26186: Remove an invalid type check in importlib.util.LazyLoader.
33010
33011- bpo-26367: importlib.__import__() raises SystemError like
33012  builtins.__import__() when ``level`` is specified but without an
33013  accompanying package specified.
33014
33015- bpo-26309: In the "socketserver" module, shut down the request (closing
33016  the connected socket) when verify_request() returns false.  Patch by Aviv
33017  Palivoda.
33018
33019- bpo-25995: os.walk() no longer uses FDs proportional to the tree depth.
33020
33021- bpo-26117: The os.scandir() iterator now closes file descriptor not only
33022  when the iteration is finished, but when it was failed with error.
33023
33024- bpo-25911: Restored support of bytes paths in os.walk() on Windows.
33025
33026- bpo-26045: Add UTF-8 suggestion to error message when posting a
33027  non-Latin-1 string with http.client.
33028
33029- bpo-12923: Reset FancyURLopener's redirect counter even if there is an
33030  exception. Based on patches by Brian Brazil and Daniel Rocco.
33031
33032- bpo-25945: Fixed a crash when unpickle the functools.partial object with
33033  wrong state. Fixed a leak in failed functools.partial constructor. "args"
33034  and "keywords" attributes of functools.partial have now always types tuple
33035  and dict correspondingly.
33036
33037- bpo-26202: copy.deepcopy() now correctly copies range() objects with
33038  non-atomic attributes.
33039
33040- bpo-23076: Path.glob() now raises a ValueError if it's called with an
33041  invalid pattern. Patch by Thomas Nyberg.
33042
33043- bpo-19883: Fixed possible integer overflows in zipimport.
33044
33045- bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and
33046  gethostbyname_ex() functions of the socket module now decode the hostname
33047  from the ANSI code page rather than UTF-8.
33048
33049- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
33050  encoding.
33051
33052- bpo-25935: Garbage collector now breaks reference loops with OrderedDict.
33053
33054- bpo-16620: Fixed AttributeError in msilib.Directory.glob().
33055
33056- bpo-26013: Added compatibility with broken protocol 2 pickles created in
33057  old Python 3 versions (3.4.3 and lower).
33058
33059- bpo-25850: Use cross-compilation by default for 64-bit Windows.
33060
33061- bpo-17633: Improve zipimport's support for namespace packages.
33062
33063- bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing
33064  before $() vars.
33065
33066- bpo-22138: Fix mock.patch behavior when patching descriptors. Restore
33067  original values after patching. Patch contributed by Sean McCully.
33068
33069- bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode
33070  option if it is safe to do so.
33071
33072- bpo-26012: Don't traverse into symlinks for ``**`` pattern in
33073  pathlib.Path.[r]glob().
33074
33075- bpo-24120: Ignore PermissionError when traversing a tree with
33076  pathlib.Path.[r]glob(). Patch by Ulrich Petri.
33077
33078- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
33079  attribute (restores backward compatibility).
33080
33081- bpo-25447: Copying the lru_cache() wrapper object now always works,
33082  independently from the type of the wrapped object (by returning the
33083  original object unchanged).
33084
33085- bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser.
33086
33087- bpo-25860: os.fwalk() no longer skips remaining directories when error
33088  occurs. Original patch by Samson Lee.
33089
33090- bpo-25914: Fixed and simplified OrderedDict.__sizeof__.
33091
33092- bpo-25902: Fixed various refcount issues in ElementTree iteration.
33093
33094- bpo-25717: Restore the previous behaviour of tolerating most fstat()
33095  errors when opening files.  This was a regression in 3.5a1, and stopped
33096  anonymous temporary files from working in special cases.
33097
33098- bpo-24903: Fix regression in number of arguments compileall accepts when
33099  '-d' is specified.  The check on the number of arguments has been dropped
33100  completely as it never worked correctly anyway.
33101
33102- bpo-25764: In the subprocess module, preserve any exception caused by
33103  fork() failure when preexec_fn is used.
33104
33105- bpo-6478: _strptime's regexp cache now is reset after changing timezone
33106  with time.tzset().
33107
33108- bpo-14285: When executing a package with the "python -m package" option,
33109  and package initialization fails, a proper traceback is now reported.  The
33110  "runpy" module now lets exceptions from package initialization pass back
33111  to the caller, rather than raising ImportError.
33112
33113- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
33114  ". . . is a package and cannot be directly executed" if the package could
33115  not even be initialized (e.g. due to a bad ``*.pyc`` file).
33116
33117- bpo-25177: Fixed problem with the mean of very small and very large
33118  numbers. As a side effect, statistics.mean and statistics.variance should
33119  be significantly faster.
33120
33121- bpo-25718: Fixed copying object with state with boolean value is false.
33122
33123- bpo-10131: Fixed deep copying of minidom documents.  Based on patch by
33124  Marian Ganisin.
33125
33126- bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
33127  invalid data including tuple instructions.
33128
33129- bpo-25663: In the Readline completer, avoid listing duplicate global
33130  names, and search the global namespace before searching builtins.
33131
33132- bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error.
33133
33134- bpo-23914: Fixed SystemError raised by unpickler on broken pickle data.
33135
33136- bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
33137
33138- bpo-25624: ZipFile now always writes a ZIP_STORED header for directory
33139  entries.  Patch by Dingyuan Wang.
33140
33141- Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu
33142  Davis.
33143
33144- bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк
33145  Коренберг.
33146
33147- bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
33148  versions 10.5 or higher.  Original patch by A. Jesse Jiryu Davis.
33149
33150- bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
33151  current versions of OpenBSD and NetBSD.  Patch by A. Jesse Jiryu Davis.
33152
33153- bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input.
33154  Patch by Jack O'Connor.
33155
33156- bpo-27040: Add loop.get_exception_handler method
33157
33158- bpo-27041: asyncio: Add loop.create_future method
33159
33160- bpo-27223: asyncio: Fix _read_ready and _write_ready to respect
33161  _conn_lost. Patch by Łukasz Langa.
33162
33163- bpo-22970: asyncio: Fix inconsistency cancelling Condition.wait. Patch by
33164  David Coles.
33165
33166IDLE
33167----
33168
33169- bpo-5124: Paste with text selected now replaces the selection on X11. This
33170  matches how paste works on Windows, Mac, most modern Linux apps, and ttk
33171  widgets. Original patch by Serhiy Storchaka.
33172
33173- bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is
33174  a private implementation of test.test_idle and tool for maintainers.
33175
33176- bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These
33177  persisted after other warnings were suppressed in #20567. Apply Serhiy
33178  Storchaka's update_idletasks solution to four test files. Record this
33179  additional advice in idle_test/README.txt
33180
33181- bpo-20567: Revise idle_test/README.txt with advice about avoiding tk
33182  warning messages from tests.  Apply advice to several IDLE tests.
33183
33184- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
33185  code for configuring text widget colors to a new function.
33186
33187- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
33188  on Linux prevented the configuration dialog from opening.
33189
33190- bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav
33191  Heblikar.
33192
33193- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
33194  Heblikar.
33195
33196- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
33197  Martínez.
33198
33199- bpo-21703: Add test for IDLE's undo delegator. Original patch by Saimadhav
33200  Heblikar .
33201
33202- bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks.
33203
33204- bpo-23977: Add more asserts to test_delegator.
33205
33206- bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav
33207  Heblikar.
33208
33209- In the 'IDLE-console differences' section of the IDLE doc, clarify how
33210  running with IDLE affects sys.modules and the standard streams.
33211
33212- bpo-25507: fix incorrect change in IOBinding that prevented printing.
33213  Augment IOBinding htest to include all major IOBinding functions.
33214
33215- bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION
33216  MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode
33217  CREDITS.txt to utf-8 and open it with 'utf-8'.
33218
33219Documentation
33220-------------
33221
33222- bpo-19489: Moved the search box from the sidebar to the header and footer
33223  of each page. Patch by Ammar Askar.
33224
33225- bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5.
33226
33227- bpo-26736: Used HTTPS for external links in the documentation if possible.
33228
33229- bpo-6953: Rework the Readline module documentation to group related
33230  functions together, and add more details such as what underlying Readline
33231  functions and variables are accessed.
33232
33233- bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt.
33234
33235- bpo-25500: Fix documentation to not claim that __import__ is searched for
33236  in the global scope.
33237
33238- bpo-26014: Update 3.x packaging documentation: * "See also" links to the
33239  new docs are now provided in the legacy pages * links to setuptools
33240  documentation have been updated
33241
33242Tests
33243-----
33244
33245- bpo-21916: Added tests for the turtle module.  Patch by ingrid, Gregory
33246  Loyse and Jelle Zijlstra.
33247
33248- bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool)
33249  was untested.
33250
33251- bpo-26015: Added new tests for pickling iterators of mutable sequences.
33252
33253- bpo-26325: Added test.support.check_no_resource_warning() to check that no
33254  ResourceWarning is emitted.
33255
33256- bpo-25940: Changed test_ssl to use self-signed.pythontest.net.  This
33257  avoids relying on svn.python.org, which recently changed root certificate.
33258
33259- bpo-25616: Tests for OrderedDict are extracted from test_collections into
33260  separate file test_ordered_dict.
33261
33262- bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files
33263  cannot be written.
33264
33265Build
33266-----
33267
33268- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
33269  de Gaye.
33270
33271- bpo-22359: Disable the rules for running _freeze_importlib and pgen when
33272  cross-compiling.  The output of these programs is normally saved with the
33273  source code anyway, and is still regenerated when doing a native build.
33274  Patch by Xavier de Gaye.
33275
33276- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds.  Patch by
33277  Xavier de Gaye.
33278
33279- bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except
33280  on Mac OS X. Patch written by Xavier de Gaye.
33281
33282- bpo-25702: A --with-lto configure option has been added that will enable
33283  link time optimizations at build time during a make profile-opt. Some
33284  compilers and toolchains are known to not produce stable code when using
33285  LTO, be sure to test things thoroughly before relying on it. It can
33286  provide a few % speed up over profile-opt alone.
33287
33288- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old
33289  versions.
33290
33291- bpo-17603: Avoid error about nonexistent fileblocks.o file by using a
33292  lower-level check for st_blocks in struct stat.
33293
33294- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
33295  Thiel.
33296
33297- bpo-26465: Update Windows builds to use OpenSSL 1.0.2g.
33298
33299- bpo-24421: Compile Modules/_math.c once, before building extensions.
33300  Previously it could fail to compile properly if the math and cmath builds
33301  were concurrent.
33302
33303- bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to
33304  ``PCbuild\build.bat`` for building with Profile-Guided Optimization.  The
33305  old ``PCbuild\build_pgo.bat`` script is now deprecated, and simply calls
33306  ``PCbuild\build.bat --pgo %*``.
33307
33308- bpo-25827: Add support for building with ICC to ``configure``, including a
33309  new ``--with-icc`` flag.
33310
33311- bpo-25696: Fix installation of Python on UNIX with make -j9.
33312
33313- bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with
33314  OpenSSL 1.0.2h.
33315
33316- bpo-26268: Update Windows builds to use OpenSSL 1.0.2f.
33317
33318- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
33319
33320- bpo-24324: Do not enable unreachable code warnings when using gcc as the
33321  option does not work correctly in older versions of gcc and has been
33322  silently removed as of gcc-4.5.
33323
33324Windows
33325-------
33326
33327- bpo-27053: Updates make_zip.py to correctly generate library ZIP file.
33328
33329- bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases
33330  that don't include the contents of the include directory (that is, 1.0.2e
33331  and later).
33332
33333- bpo-26071: bdist_wininst created binaries fail to start and find 32bit
33334  Python
33335
33336- bpo-26073: Update the list of magic numbers in launcher
33337
33338- bpo-26065: Excludes venv from library when generating embeddable distro.
33339
33340- bpo-17500: Remove unused and outdated icons. (See also:
33341  https://github.com/python/pythondotorg/issues/945)
33342
33343Tools/Demos
33344-----------
33345
33346- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
33347  is loaded, but get C types on demand. The C types can change if
33348  python-gdb.py is loaded before the Python executable. Patch written by
33349  Thomas Ilsche.
33350
33351- bpo-26271: Fix the Freeze tool to properly use flags passed through
33352  configure. Patch by Daniel Shaulov.
33353
33354- bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py.
33355  Patch by Guo Ci Teo.
33356
33357- bpo-26316: Fix variable name typo in Argument Clinic.
33358
33359
33360What's New in Python 3.5.1 final?
33361=================================
33362
33363*Release date: 2015-12-06*
33364
33365Core and Builtins
33366-----------------
33367
33368- bpo-25709: Fixed problem with in-place string concatenation and utf-8
33369  cache.
33370
33371Windows
33372-------
33373
33374- bpo-25715: Python 3.5.1 installer shows wrong upgrade path and incorrect
33375  logic for launcher detection.
33376
33377
33378What's New in Python 3.5.1 release candidate 1?
33379===============================================
33380
33381*Release date: 2015-11-22*
33382
33383Core and Builtins
33384-----------------
33385
33386- bpo-25630: Fix a possible segfault during argument parsing in functions
33387  that accept filesystem paths.
33388
33389- bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess
33390  internals regarding how fds_to_pass were passed to the child.  The bug had
33391  no actual impact as subprocess.py already avoided it.
33392
33393- bpo-25388: Fixed tokenizer crash when processing undecodable source code
33394  with a null byte.
33395
33396- bpo-25462: The hash of the key now is calculated only once in most
33397  operations in C implementation of OrderedDict.
33398
33399- bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now
33400  rejects builtin types with not defined __new__.
33401
33402- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
33403  when compiling AST from Python objects.
33404
33405- bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec()
33406  and eval() are passed bytes-like objects.  These objects are not
33407  necessarily terminated by a null byte, but the functions assumed they
33408  were.
33409
33410- bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
33411  was mutated by direct calls of dict methods.
33412
33413- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
33414  KeyError in C implementations as well as in Python implementation.
33415
33416- bpo-25395: Fixed crash when highly nested OrderedDict structures were
33417  garbage collected.
33418
33419- bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new
33420  recursion limit is too low depending at the current recursion depth.
33421  Modify also the "lower-water mark" formula to make it monotonic. This mark
33422  is used to decide when the overflowed flag of the thread state is reset.
33423
33424- bpo-24402: Fix input() to prompt to the redirected stdout when
33425  sys.stdout.fileno() fails.
33426
33427- bpo-24806: Prevent builtin types that are not allowed to be subclassed
33428  from being subclassed through multiple inheritance.
33429
33430- bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
33431
33432- bpo-25280: Import trace messages emitted in verbose (-v) mode are no
33433  longer formatted twice.
33434
33435- bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
33436  function instead of the getentropy() function. The getentropy() function
33437  is blocking to generate very good quality entropy, os.urandom() doesn't
33438  need such high-quality entropy.
33439
33440- bpo-25182: The stdprinter (used as sys.stderr before the io module is
33441  imported at startup) now uses the backslashreplace error handler.
33442
33443- bpo-25131: Make the line number and column offset of set/dict literals and
33444  comprehensions correspond to the opening brace.
33445
33446- bpo-25150: Hide the private _Py_atomic_xxx symbols from the public
33447  Python.h header to fix a compilation error with OpenMP.
33448  PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI
33449  incompatibilities.
33450
33451Library
33452-------
33453
33454- bpo-25626: Change three zlib functions to accept sizes that fit in
33455  Py_ssize_t, but internally cap those sizes to UINT_MAX.  This resolves a
33456  regression in 3.5 where GzipFile.read() failed to read chunks larger than
33457  2 or 4 GiB.  The change affects the zlib.Decompress.decompress()
33458  max_length parameter, the zlib.decompress() bufsize parameter, and the
33459  zlib.Decompress.flush() length parameter.
33460
33461- bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
33462  when the OS gives priority to errors such as EACCES over EEXIST.
33463
33464- bpo-25593: Change semantics of EventLoop.stop() in asyncio.
33465
33466- bpo-6973: When we know a subprocess.Popen process has died, do not allow
33467  the send_signal(), terminate(), or kill() methods to do anything as they
33468  could potentially signal a different process.
33469
33470- bpo-25590: In the Readline completer, only call getattr() once per
33471  attribute.
33472
33473- bpo-25498: Fix a crash when garbage-collecting ctypes objects created by
33474  wrapping a memoryview.  This was a regression made in 3.5a1.  Based on
33475  patch by Eryksun.
33476
33477- bpo-25584: Added "escape" to the __all__ list in the glob module.
33478
33479- bpo-25584: Fixed recursive glob() with patterns starting with ``**``.
33480
33481- bpo-25446: Fix regression in smtplib's AUTH LOGIN support.
33482
33483- bpo-18010: Fix the pydoc web server's module search function to handle
33484  exceptions from importing packages.
33485
33486- bpo-25554: Got rid of circular references in regular expression parsing.
33487
33488- bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at
33489  the end if the FileInput was opened with binary mode. Patch by Ryosuke
33490  Ito.
33491
33492- bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties.
33493  Original patch by John Mark Vandenberg.
33494
33495- bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4.
33496
33497- bpo-21827: Fixed textwrap.dedent() for the case when largest common
33498  whitespace is a substring of smallest leading whitespace. Based on patch
33499  by Robert Li.
33500
33501- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
33502  (by returning the original object unchanged).
33503
33504- bpo-25390: typing: Don't crash on Union[str, Pattern].
33505
33506- bpo-25441: asyncio: Raise error from drain() when socket is closed.
33507
33508- bpo-25410: Cleaned up and fixed minor bugs in C implementation of
33509  OrderedDict.
33510
33511- bpo-25411: Improved Unicode support in SMTPHandler through better use of
33512  the email package. Thanks to user simon04 for the patch.
33513
33514- bpo-25407: Remove mentions of the formatter module being removed in Python
33515  3.6.
33516
33517- bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
33518  that caused segmentation fault or hang in iterating after moving several
33519  items to the start of ordered dict.
33520
33521- bpo-25364: zipfile now works in threads disabled builds.
33522
33523- bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both
33524  decode_data and enable_SMTPUTF8 are set to true.
33525
33526- bpo-25316: distutils raises OSError instead of DistutilsPlatformError when
33527  MSVC is not installed.
33528
33529- bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in
33530  pickletools.opcodes.
33531
33532- bpo-23972: Updates asyncio datagram create method allowing reuseport and
33533  reuseaddr socket options to be set prior to binding the socket. Mirroring
33534  the existing asyncio create_server method the reuseaddr option for
33535  datagram sockets defaults to True if the O/S is 'posix' (except if the
33536  platform is Cygwin). Patch by Chris Laws.
33537
33538- bpo-25304: Add asyncio.run_coroutine_threadsafe().  This lets you submit a
33539  coroutine to a loop from another thread, returning a
33540  concurrent.futures.Future.  By Vincent Michel.
33541
33542- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
33543  first question mark (?) rather than the last. Patch from Xiang Zhang.
33544
33545- bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query
33546  part of the URL as if it were a path. Patch from Xiang Zhang.
33547
33548- bpo-24483: C implementation of functools.lru_cache() now calculates key's
33549  hash only once.
33550
33551- bpo-22958: Constructor and update method of weakref.WeakValueDictionary
33552  now accept the self and the dict keyword arguments.
33553
33554- bpo-22609: Constructor of collections.UserDict now accepts the self
33555  keyword argument.
33556
33557- bpo-25111: Fixed comparison of traceback.FrameSummary.
33558
33559- bpo-25262: Added support for BINBYTES8 opcode in Python implementation of
33560  unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
33561  opcodes no longer silently ignored on 32-bit platforms in C
33562  implementation.
33563
33564- bpo-25034: Fix string.Formatter problem with auto-numbering and nested
33565  format_specs. Patch by Anthon van der Neut.
33566
33567- bpo-25233: Rewrite the guts of asyncio.Queue and asyncio.Semaphore to be
33568  more understandable and correct.
33569
33570- bpo-25203: Failed readline.set_completer_delims() no longer left the
33571  module in inconsistent state.
33572
33573- bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong
33574  results in some cases.
33575
33576- bpo-23329: Allow the ssl module to be built with older versions of
33577  LibreSSL.
33578
33579- Prevent overflow in _Unpickler_Read.
33580
33581- bpo-25047: The XML encoding declaration written by Element Tree now
33582  respects the letter case given by the user. This restores the ability to
33583  write encoding names in uppercase like "UTF-8", which worked in Python 2.
33584
33585- bpo-25135: Make deque_clear() safer by emptying the deque before clearing.
33586  This helps avoid possible reentrancy issues.
33587
33588- bpo-19143: platform module now reads Windows version from kernel32.dll to
33589  avoid compatibility shims.
33590
33591- bpo-25092: Fix datetime.strftime() failure when errno was already set to
33592  EINVAL.
33593
33594- bpo-23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
33595  of datetime.datetime: microseconds are now rounded to nearest with ties
33596  going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding
33597  towards minus infinity (ROUND_FLOOR). It's important that these methods
33598  use the same rounding mode than datetime.timedelta to keep the property:
33599  (datetime(1970,1,1) + timedelta(seconds=t)) ==
33600  datetime.utcfromtimestamp(t). It also the rounding mode used by
33601  round(float) for example.
33602
33603- bpo-25155: Fix datetime.datetime.now() and datetime.datetime.utcnow() on
33604  Windows to support date after year 2038. It was a regression introduced in
33605  Python 3.5.0.
33606
33607- bpo-25108: Omitted internal frames in traceback functions print_stack(),
33608  format_stack(), and extract_stack() called without arguments.
33609
33610- bpo-25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
33611
33612- bpo-24684: socket.socket.getaddrinfo() now calls
33613  PyUnicode_AsEncodedString() instead of calling the encode() method of the
33614  host, to handle correctly custom string with an encode() method which
33615  doesn't return a byte string. The encoder of the IDNA codec is now called
33616  directly instead of calling the encode() method of the string.
33617
33618- bpo-25060: Correctly compute stack usage of the BUILD_MAP opcode.
33619
33620- bpo-24857: Comparing call_args to a long sequence now correctly returns a
33621  boolean result instead of raising an exception.  Patch by A Kaptur.
33622
33623- bpo-23144: Make sure that HTMLParser.feed() returns all the data, even
33624  when convert_charrefs is True.
33625
33626- bpo-24982: shutil.make_archive() with the "zip" format now adds entries
33627  for directories (including empty directories) in ZIP file.
33628
33629- bpo-25019: Fixed a crash caused by setting non-string key of expat parser.
33630  Based on patch by John Leitch.
33631
33632- bpo-16180: Exit pdb if file has syntax error, instead of trapping user in
33633  an infinite loop.  Patch by Xavier de Gaye.
33634
33635- bpo-24891: Fix a race condition at Python startup if the file descriptor
33636  of stdin (0), stdout (1) or stderr (2) is closed while Python is creating
33637  sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set
33638  to None if the creation of the object failed, instead of raising an
33639  OSError exception. Initial patch written by Marco Paolini.
33640
33641- bpo-24992: Fix error handling and a race condition (related to garbage
33642  collection) in collections.OrderedDict constructor.
33643
33644- bpo-24881: Fixed setting binary mode in Python implementation of FileIO on
33645  Windows and Cygwin.  Patch from Akira Li.
33646
33647- bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer().
33648
33649- bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating
33650  ssl.SSLContext.
33651
33652- bpo-25569: Fix memory leak in SSLSocket.getpeercert().
33653
33654- bpo-25471: Sockets returned from accept() shouldn't appear to be
33655  nonblocking.
33656
33657- bpo-25319: When threading.Event is reinitialized, the underlying condition
33658  should use a regular lock rather than a recursive lock.
33659
33660- bpo-21112: Fix regression in unittest.expectedFailure on subclasses. Patch
33661  from Berker Peksag.
33662
33663- bpo-24764: cgi.FieldStorage.read_multi() now ignores the Content-Length
33664  header in part headers. Patch written by Peter Landry and reviewed by
33665  Pierre Quentel.
33666
33667- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and
33668  Bryce Darling.
33669
33670- bpo-24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
33671
33672- bpo-21159: Improve message in
33673  configparser.InterpolationMissingOptionError. Patch from Łukasz Langa.
33674
33675- bpo-20362: Honour TestCase.longMessage correctly in assertRegex. Patch
33676  from Ilia Kurenkov.
33677
33678- bpo-23572: Fixed functools.singledispatch on classes with falsy
33679  metaclasses.  Patch by Ethan Furman.
33680
33681- asyncio: ensure_future() now accepts awaitable objects.
33682
33683IDLE
33684----
33685
33686- bpo-15348: Stop the debugger engine (normally in a user process) before
33687  closing the debugger window (running in the IDLE process). This prevents
33688  the RuntimeErrors that were being caught and ignored.
33689
33690- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
33691  debugger is active (15347); b) closing the debugger with the [X] button
33692  (15348); and c) activating the debugger when already active (24455). The
33693  patch by Mark Roseman does this by making two changes. 1. Suspend and
33694  resume the gui.interaction method with the tcl vwait mechanism intended
33695  for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
33696  any existing interaction to terminate first.
33697
33698- Change 'The program' to 'Your program' in an IDLE 'kill program?' message
33699  to make it clearer that the program referred to is the currently running
33700  user program, not IDLE itself.
33701
33702- bpo-24750: Improve the appearance of the IDLE editor window status bar.
33703  Patch by Mark Roseman.
33704
33705- bpo-25313: Change the handling of new built-in text color themes to better
33706  address the compatibility problem introduced by the addition of IDLE Dark.
33707  Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
33708
33709- bpo-24782: Extension configuration is now a tab in the IDLE Preferences
33710  dialog rather than a separate dialog.  The former tabs are now a sorted
33711  list.  Patch by Mark Roseman.
33712
33713- bpo-22726: Re-activate the config dialog help button with some content
33714  about the other buttons and the new IDLE Dark theme.
33715
33716- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
33717  more or less IDLE Classic inverted, with a cobalt blue background.
33718  Strings, comments, keywords, ... are still green, red, orange, ... . To
33719  use it with IDLEs released before November 2015, hit the 'Save as New
33720  Custom Theme' button and enter a new name, such as 'Custom Dark'.  The
33721  custom theme will work with any IDLE release, and can be modified.
33722
33723- bpo-25224: README.txt is now an idlelib index for IDLE developers and
33724  curious users. The previous user content is now in the IDLE doc chapter.
33725  'IDLE' now means 'Integrated Development and Learning Environment'.
33726
33727- bpo-24820: Users can now set breakpoint colors in Settings -> Custom
33728  Highlighting. Original patch by Mark Roseman.
33729
33730- bpo-24972: Inactive selection background now matches active selection
33731  background, as configured by users, on all systems.  Found items are now
33732  always highlighted on Windows.  Initial patch by Mark Roseman.
33733
33734- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
33735  by a tk regression.  Initial patch by Mark Roseman.
33736
33737- bpo-24988: Idle ScrolledList context menus (used in debugger) now work on
33738  Mac Aqua. Patch by Mark Roseman.
33739
33740- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
33741  Mark Roseman.
33742
33743- bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac
33744  OSX, make them a 'sheet'.  Patch by Mark Roseman.
33745
33746- bpo-25198: Enhance the initial html viewer now used for Idle Help.
33747  Properly indent fixed-pitch text (patch by Mark Roseman). Give code
33748  snippet a very Sphinx-like light blueish-gray background. Re-use initial
33749  width and height set by users for shell and editor. When the Table of
33750  Contents (TOC) menu is used, put the section header at the top of the
33751  screen.
33752
33753- bpo-25225: Condense and rewrite Idle doc section on text colors.
33754
33755- bpo-21995: Explain some differences between IDLE and console Python.
33756
33757- bpo-22820: Explain need for *print* when running file from Idle editor.
33758
33759- bpo-25224: Doc: augment Idle feature list and no-subprocess section.
33760
33761- bpo-25219: Update doc for Idle command line options. Some were missing and
33762  notes were not correct.
33763
33764- bpo-24861: Most of idlelib is private and subject to change. Use
33765  idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
33766
33767- bpo-25199: Idle: add synchronization comments for future maintainers.
33768
33769- bpo-16893: Replace help.txt with help.html for Idle doc display. The new
33770  idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
33771  better than help.txt and will better document Idle as released. The
33772  tkinter html viewer that works for this file was written by Mark Roseman.
33773  The now unused EditorWindow.HelpDialog class and helt.txt file are
33774  deprecated.
33775
33776- bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
33777
33778- bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts).
33779
33780Documentation
33781-------------
33782
33783- bpo-22558: Add remaining doc links to source code for Python-coded
33784  modules. Patch by Yoni Lavi.
33785
33786- bpo-12067: Rewrite Comparisons section in the Expressions chapter of the
33787  language reference. Some of the details of comparing mixed types were
33788  incorrect or ambiguous. NotImplemented is only relevant at a lower level
33789  than the Expressions chapter. Added details of comparing range() objects,
33790  and default behaviour and consistency suggestions for user-defined
33791  classes. Patch from Andy Maier.
33792
33793- bpo-24952: Clarify the default size argument of stack_size() in the
33794  "threading" and "_thread" modules. Patch from Mattip.
33795
33796- bpo-23725: Overhaul tempfile docs. Note deprecated status of mktemp. Patch
33797  from Zbigniew Jędrzejewski-Szmek.
33798
33799- bpo-24808: Update the types of some PyTypeObject fields.  Patch by Joseph
33800  Weston.
33801
33802- bpo-22812: Fix unittest discovery examples. Patch from Pam McA'Nulty.
33803
33804Tests
33805-----
33806
33807- bpo-25449: Added tests for OrderedDict subclasses.
33808
33809- bpo-25099: Make test_compileall not fail when an entry on sys.path cannot
33810  be written to (commonly seen in administrative installs on Windows).
33811
33812- bpo-23919: Prevents assert dialogs appearing in the test suite.
33813
33814- ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass
33815  along to regrtest.py.  Previously there was a limit of 9.
33816
33817Build
33818-----
33819
33820- bpo-24915: Add LLVM support for PGO builds and use the test suite to
33821  generate the profile data. Initial patch by Alecsandru Patrascu of Intel.
33822
33823- bpo-24910: Windows MSIs now have unique display names.
33824
33825- bpo-24986: It is now possible to build Python on Windows without errors
33826  when external libraries are not available.
33827
33828Windows
33829-------
33830
33831- bpo-25450: Updates shortcuts to start Python in installation directory.
33832
33833- bpo-25164: Changes default all-users install directory to match per-user
33834  directory.
33835
33836- bpo-25143: Improves installer error messages for unsupported platforms.
33837
33838- bpo-25163: Display correct directory in installer when using non-default
33839  settings.
33840
33841- bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build
33842
33843- bpo-25089: Adds logging to installer for case where launcher is not
33844  selected on upgrade.
33845
33846- bpo-25165: Windows uninstallation should not remove launcher if other
33847  versions remain
33848
33849- bpo-25112: py.exe launcher is missing icons
33850
33851- bpo-25102: Windows installer does not precompile for -O or -OO.
33852
33853- bpo-25081: Makes Back button in installer go back to upgrade page when
33854  upgrading.
33855
33856- bpo-25091: Increases font size of the installer.
33857
33858- bpo-25126: Clarifies that the non-web installer will download some
33859  components.
33860
33861- bpo-25213: Restores requestedExecutionLevel to manifest to disable UAC
33862  virtualization.
33863
33864- bpo-25022: Removed very outdated PC/example_nt/ directory.
33865
33866Tools/Demos
33867-----------
33868
33869- bpo-25440: Fix output of python-config --extension-suffix.
33870
33871
33872What's New in Python 3.5.0 final?
33873=================================
33874
33875*Release date: 2015-09-13*
33876
33877Build
33878-----
33879
33880- bpo-25071: Windows installer should not require TargetDir parameter when
33881  installing quietly.
33882
33883
33884What's New in Python 3.5.0 release candidate 4?
33885===============================================
33886
33887*Release date: 2015-09-09*
33888
33889Library
33890-------
33891
33892- bpo-25029: Fixes MemoryError in test_strptime.
33893
33894Build
33895-----
33896
33897- bpo-25027: Reverts partial-static build options and adds vcruntime140.dll
33898  to Windows installation.
33899
33900
33901What's New in Python 3.5.0 release candidate 3?
33902===============================================
33903
33904*Release date: 2015-09-07*
33905
33906Core and Builtins
33907-----------------
33908
33909- bpo-24305: Prevent import subsystem stack frames from being counted by the
33910  warnings.warn(stacklevel=) parameter.
33911
33912- bpo-24912: Prevent __class__ assignment to immutable built-in objects.
33913
33914- bpo-24975: Fix AST compilation for :pep:`448` syntax.
33915
33916Library
33917-------
33918
33919- bpo-24917: time_strftime() buffer over-read.
33920
33921- bpo-24748: To resolve a compatibility problem found with py2exe and
33922  pywin32, imp.load_dynamic() once again ignores previously loaded modules
33923  to support Python modules replacing themselves with extension modules.
33924  Patch by Petr Viktorin.
33925
33926- bpo-24635: Fixed a bug in typing.py where isinstance([], typing.Iterable)
33927  would return True once, then False on subsequent calls.
33928
33929- bpo-24989: Fixed buffer overread in BytesIO.readline() if a position is
33930  set beyond size.  Based on patch by John Leitch.
33931
33932- bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and
33933  Bryce Darling.
33934
33935
33936What's New in Python 3.5.0 release candidate 2?
33937===============================================
33938
33939*Release date: 2015-08-25*
33940
33941Core and Builtins
33942-----------------
33943
33944- bpo-24769: Interpreter now starts properly when dynamic loading is
33945  disabled.  Patch by Petr Viktorin.
33946
33947- bpo-21167: NAN operations are now handled correctly when python is
33948  compiled with ICC even if -fp-model strict is not specified.
33949
33950- bpo-24492: A "package" lacking a __name__ attribute when trying to perform
33951  a ``from .. import ...`` statement will trigger an ImportError instead of
33952  an AttributeError.
33953
33954Library
33955-------
33956
33957- bpo-24847: Removes vcruntime140.dll dependency from Tcl/Tk.
33958
33959- bpo-24839: platform._syscmd_ver raises DeprecationWarning
33960
33961- bpo-24867: Fix Task.get_stack() for 'async def' coroutines
33962
33963
33964What's New in Python 3.5.0 release candidate 1?
33965===============================================
33966
33967*Release date: 2015-08-09*
33968
33969Core and Builtins
33970-----------------
33971
33972- bpo-24667: Resize odict in all cases that the underlying dict resizes.
33973
33974Library
33975-------
33976
33977- bpo-24824: Signatures of codecs.encode() and codecs.decode() now are
33978  compatible with pydoc.
33979
33980- bpo-24634: Importing uuid should not try to load libc on Windows
33981
33982- bpo-24798: _msvccompiler.py doesn't properly support manifests
33983
33984- bpo-4395: Better testing and documentation of binary operators. Patch by
33985  Martin Panter.
33986
33987- bpo-23973: Update typing.py from GitHub repo.
33988
33989- bpo-23004: mock_open() now reads binary data correctly when the type of
33990  read_data is bytes.  Initial patch by Aaron Hill.
33991
33992- bpo-23888: Handle fractional time in cookie expiry. Patch by ssh.
33993
33994- bpo-23652: Make it possible to compile the select module against the libc
33995  headers from the Linux Standard Base, which do not include some EPOLL
33996  macros.  Patch by Matt Frank.
33997
33998- bpo-22932: Fix timezones in email.utils.formatdate. Patch from Dmitry
33999  Shachnev.
34000
34001- bpo-23779: imaplib raises TypeError if authenticator tries to abort. Patch
34002  from Craig Holmquist.
34003
34004- bpo-23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
34005  written by Matthieu Gautier.
34006
34007- bpo-23254: Document how to close the TCPServer listening socket. Patch
34008  from Martin Panter.
34009
34010- bpo-19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
34011
34012- bpo-17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
34013
34014- bpo-24791: Fix grammar regression for call syntax: 'g(\*a or b)'.
34015
34016IDLE
34017----
34018
34019- bpo-23672: Allow Idle to edit and run files with astral chars in name.
34020  Patch by Mohd Sanad Zaki Rizvi.
34021
34022- bpo-24745: Idle editor default font. Switch from Courier to
34023  platform-sensitive TkFixedFont.  This should not affect current customized
34024  font selections.  If there is a problem, edit
34025  $HOME/.idlerc/config-main.cfg and remove 'fontxxx' entries from [Editor
34026  Window].  Patch by Mark Roseman.
34027
34028- bpo-21192: Idle editor. When a file is run, put its name in the restart
34029  bar. Do not print false prompts. Original patch by Adnan Umer.
34030
34031- bpo-13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy.
34032
34033Documentation
34034-------------
34035
34036- bpo-24129: Clarify the reference documentation for name resolution. This
34037  includes removing the assumption that readers will be familiar with the
34038  name resolution scheme Python used prior to the introduction of lexical
34039  scoping for function namespaces. Patch by Ivan Levkivskyi.
34040
34041- bpo-20769: Improve reload() docs. Patch by Dorian Pula.
34042
34043- bpo-23589: Remove duplicate sentence from the FAQ.  Patch by Yongzhi Pan.
34044
34045- bpo-24729: Correct IO tutorial to match implementation regarding encoding
34046  parameter to open function.
34047
34048Tests
34049-----
34050
34051- bpo-24751: When running regrtest with the ``-w`` command line option, a
34052  test run is no longer marked as a failure if all tests succeed when
34053  re-run.
34054
34055
34056What's New in Python 3.5.0 beta 4?
34057==================================
34058
34059*Release date: 2015-07-26*
34060
34061Core and Builtins
34062-----------------
34063
34064- bpo-23573: Restored optimization of bytes.rfind() and bytearray.rfind()
34065  for single-byte argument on Linux.
34066
34067- bpo-24569: Make :pep:`448` dictionary evaluation more consistent.
34068
34069- bpo-24583: Fix crash when set is mutated while being updated.
34070
34071- bpo-24407: Fix crash when dict is mutated while being updated.
34072
34073- bpo-24619: New approach for tokenizing async/await. As a consequence, it
34074  is now possible to have one-line 'async def foo(): await ..' functions.
34075
34076- bpo-24687: Plug refleak on SyntaxError in function parameters annotations.
34077
34078- bpo-15944: memoryview: Allow arbitrary formats when casting to bytes.
34079  Patch by Martin Panter.
34080
34081Library
34082-------
34083
34084- bpo-23441: rcompleter now prints a tab character instead of displaying
34085  possible completions for an empty word.  Initial patch by Martin Sekera.
34086
34087- bpo-24683: Fixed crashes in _json functions called with arguments of
34088  inappropriate type.
34089
34090- bpo-21697: shutil.copytree() now correctly handles symbolic links that
34091  point to directories.  Patch by Eduardo Seabra and Thomas Kluyver.
34092
34093- bpo-14373: Fixed segmentation fault when gc.collect() is called during
34094  constructing lru_cache (C implementation).
34095
34096- bpo-24695: Fix a regression in traceback.print_exception().  If
34097  exc_traceback is None we shouldn't print a traceback header like described
34098  in the documentation.
34099
34100- bpo-24620: Random.setstate() now validates the value of state last
34101  element.
34102
34103- bpo-22485: Fixed an issue that caused `inspect.getsource` to return
34104  incorrect results on nested functions.
34105
34106- bpo-22153: Improve unittest docs. Patch from Martin Panter and evilzero.
34107
34108- bpo-24580: Symbolic group references to open group in re patterns now are
34109  explicitly forbidden as well as numeric group references.
34110
34111- bpo-24206: Fixed __eq__ and __ne__ methods of inspect classes.
34112
34113- bpo-24631: Fixed regression in the timeit module with multiline setup.
34114
34115- bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
34116  Patch from Nicola Palumbo and Laurent De Buyst.
34117
34118- bpo-23661: unittest.mock side_effects can now be exceptions again. This
34119  was a regression vs Python 3.4. Patch from Ignacio Rossi
34120
34121- bpo-24608: chunk.Chunk.read() now always returns bytes, not str.
34122
34123- bpo-18684: Fixed reading out of the buffer in the re module.
34124
34125- bpo-24259: tarfile now raises a ReadError if an archive is truncated
34126  inside a data segment.
34127
34128- bpo-15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
34129  initial-response argument to the SMTP AUTH command.
34130
34131- bpo-24669: Fix inspect.getsource() for 'async def' functions. Patch by Kai
34132  Groner.
34133
34134- bpo-24688: ast.get_docstring() for 'async def' functions.
34135
34136Build
34137-----
34138
34139- bpo-24603: Update Windows builds and OS X 10.5 installer to use OpenSSL
34140  1.0.2d.
34141
34142
34143What's New in Python 3.5.0 beta 3?
34144==================================
34145
34146*Release date: 2015-07-05*
34147
34148Core and Builtins
34149-----------------
34150
34151- bpo-24467: Fixed possible buffer over-read in bytearray. The bytearray
34152  object now always allocates place for trailing null byte and it's buffer
34153  now is always null-terminated.
34154
34155- Upgrade to Unicode 8.0.0.
34156
34157- bpo-24345: Add Py_tp_finalize slot for the stable ABI.
34158
34159- bpo-24400: Introduce a distinct type for :pep:`492` coroutines; add
34160  types.CoroutineType, inspect.getcoroutinestate,
34161  inspect.getcoroutinelocals; coroutines no longer use CO_GENERATOR flag;
34162  sys.set_coroutine_wrapper works only for 'async def' coroutines;
34163  inspect.iscoroutine no longer uses collections.abc.Coroutine, it's
34164  intended to test for pure 'async def' coroutines only; add new opcode:
34165  GET_YIELD_FROM_ITER; fix generators wrapper used in types.coroutine to be
34166  instance of collections.abc.Generator; collections.abc.Awaitable and
34167  collections.abc.Coroutine can no longer be used to detect generator-based
34168  coroutines--use inspect.isawaitable instead.
34169
34170- bpo-24450: Add gi_yieldfrom to generators and cr_await to coroutines.
34171  Contributed by Benno Leslie and Yury Selivanov.
34172
34173- bpo-19235: Add new RecursionError exception. Patch by Georg Brandl.
34174
34175Library
34176-------
34177
34178- bpo-21750: mock_open.read_data can now be read from each instance, as it
34179  could in Python 3.3.
34180
34181- bpo-24552: Fix use after free in an error case of the _pickle module.
34182
34183- bpo-24514: tarfile now tolerates number fields consisting of only
34184  whitespace.
34185
34186- bpo-19176: Fixed doctype() related bugs in C implementation of
34187  ElementTree. A deprecation warning no longer issued by XMLParser subclass
34188  with default doctype() method.  Direct call of doctype() now issues a
34189  warning.  Parser's doctype() now is not called if target's doctype() is
34190  called.  Based on patch by Martin Panter.
34191
34192- bpo-20387: Restore semantic round-trip correctness in tokenize/untokenize
34193  for tab-indented blocks.
34194
34195- bpo-24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()
34196  functions of the audioop module.
34197
34198- bpo-24336: The contextmanager decorator now works with functions with
34199  keyword arguments called "func" and "self".  Patch by Martin Panter.
34200
34201- bpo-24522: Fix possible integer overflow in json accelerator module.
34202
34203- bpo-24489: ensure a previously set C errno doesn't disturb cmath.polar().
34204
34205- bpo-24408: Fixed AttributeError in measure() and metrics() methods of
34206  tkinter.Font.
34207
34208- bpo-14373: C implementation of functools.lru_cache() now can be used with
34209  methods.
34210
34211- bpo-24347: Set KeyError if PyDict_GetItemWithError returns NULL.
34212
34213- bpo-24348: Drop superfluous incref/decref.
34214
34215- bpo-24359: Check for changed OrderedDict size during iteration.
34216
34217- bpo-24368: Support keyword arguments in OrderedDict methods.
34218
34219- bpo-24362: Simplify the C OrderedDict fast nodes resize logic.
34220
34221- bpo-24377: Fix a ref leak in OrderedDict.__repr__.
34222
34223- bpo-24369: Defend against key-changes during iteration.
34224
34225Tests
34226-----
34227
34228- bpo-24373: _testmultiphase and xxlimited now use tp_traverse and
34229  tp_finalize to avoid reference leaks encountered when combining tp_dealloc
34230  with PyType_FromSpec (see issue #16690 for details)
34231
34232Documentation
34233-------------
34234
34235- bpo-24458: Update documentation to cover multi-phase initialization for
34236  extension modules (PEP 489). Patch by Petr Viktorin.
34237
34238- bpo-24351: Clarify what is meant by "identifier" in the context of
34239  string.Template instances.
34240
34241Build
34242-----
34243
34244- bpo-24432: Update Windows builds and OS X 10.5 installer to use OpenSSL
34245  1.0.2c.
34246
34247
34248What's New in Python 3.5.0 beta 2?
34249==================================
34250
34251*Release date: 2015-05-31*
34252
34253Core and Builtins
34254-----------------
34255
34256- bpo-24284: The startswith and endswith methods of the str class no longer
34257  return True when finding the empty string and the indexes are completely
34258  out of range.
34259
34260- bpo-24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
34261  PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
34262  to check for and handle errors correctly.
34263
34264- bpo-24328: Fix importing one character extension modules.
34265
34266- bpo-11205: In dictionary displays, evaluate the key before the value.
34267
34268- bpo-24285: Fixed regression that prevented importing extension modules
34269  from inside packages. Patch by Petr Viktorin.
34270
34271Library
34272-------
34273
34274- bpo-23247: Fix a crash in the StreamWriter.reset() of CJK codecs.
34275
34276- bpo-24270: Add math.isclose() and cmath.isclose() functions as per
34277  :pep:`485`. Contributed by Chris Barker and Tal Einat.
34278
34279- bpo-5633: Fixed timeit when the statement is a string and the setup is
34280  not.
34281
34282- bpo-24326: Fixed audioop.ratecv() with non-default weightB argument.
34283  Original patch by David Moore.
34284
34285- bpo-16991: Add a C implementation of OrderedDict.
34286
34287- bpo-23934: Fix inspect.signature to fail correctly for builtin types
34288  lacking signature information.  Initial patch by James Powell.
34289
34290
34291What's New in Python 3.5.0 beta 1?
34292==================================
34293
34294*Release date: 2015-05-24*
34295
34296Core and Builtins
34297-----------------
34298
34299- bpo-24276: Fixed optimization of property descriptor getter.
34300
34301- bpo-24268: PEP 489: Multi-phase extension module initialization. Patch by
34302  Petr Viktorin.
34303
34304- bpo-23955: Add pyvenv.cfg option to suppress registry/environment lookup
34305  for generating sys.path on Windows.
34306
34307- bpo-24257: Fixed system error in the comparison of faked
34308  types.SimpleNamespace.
34309
34310- bpo-22939: Fixed integer overflow in iterator object.  Patch by Clement
34311  Rouault.
34312
34313- bpo-23985: Fix a possible buffer overrun when deleting a slice from the
34314  front of a bytearray and then appending some other bytes data.
34315
34316- bpo-24102: Fixed exception type checking in standard error handlers.
34317
34318- bpo-15027: The UTF-32 encoder is now 3x to 7x faster.
34319
34320- bpo-23290: Optimize set_merge() for cases where the target is empty.
34321  (Contributed by Serhiy Storchaka.)
34322
34323- bpo-2292: PEP 448: Additional Unpacking Generalizations.
34324
34325- bpo-24096: Make warnings.warn_explicit more robust against mutation of the
34326  warnings.filters list.
34327
34328- bpo-23996: Avoid a crash when a delegated generator raises an unnormalized
34329  StopIteration exception.  Patch by Stefan Behnel.
34330
34331- bpo-23910: Optimize property() getter calls.  Patch by Joe Jevnik.
34332
34333- bpo-23911: Move path-based importlib bootstrap code to a separate frozen
34334  module.
34335
34336- bpo-24192: Fix namespace package imports.
34337
34338- bpo-24022: Fix tokenizer crash when processing undecodable source code.
34339
34340- bpo-9951: Added a hex() method to bytes, bytearray, and memoryview.
34341
34342- bpo-22906: PEP 479: Change StopIteration handling inside generators.
34343
34344- bpo-24017: PEP 492: Coroutines with async and await syntax.
34345
34346Library
34347-------
34348
34349- bpo-14373: Added C implementation of functools.lru_cache().  Based on
34350  patches by Matt Joiner and Alexey Kachayev.
34351
34352- bpo-24230: The tempfile module now accepts bytes for prefix, suffix and
34353  dir parameters and returns bytes in such situations (matching the os
34354  module APIs).
34355
34356- bpo-22189: collections.UserString now supports __getnewargs__(),
34357  __rmod__(), casefold(), format_map(), isprintable(), and maketrans().
34358  Patch by Joe Jevnik.
34359
34360- bpo-24244: Prevents termination when an invalid format string is
34361  encountered on Windows in strftime.
34362
34363- bpo-23973: PEP 484: Add the typing module.
34364
34365- bpo-23086: The collections.abc.Sequence() abstract base class added
34366  *start* and *stop* parameters to the index() mixin. Patch by Devin
34367  Jeanpierre.
34368
34369- bpo-20035: Replaced the ``tkinter._fix`` module used for setting up the
34370  Tcl/Tk environment on Windows with a private function in the ``_tkinter``
34371  module that makes no permanent changes to the environment.
34372
34373- bpo-24257: Fixed segmentation fault in sqlite3.Row constructor with faked
34374  cursor type.
34375
34376- bpo-15836: assertRaises(), assertRaisesRegex(), assertWarns() and
34377  assertWarnsRegex() assertments now check the type of the first argument to
34378  prevent possible user error.  Based on patch by Daniel Wagner-Hall.
34379
34380- bpo-9858: Add missing method stubs to _io.RawIOBase.  Patch by Laura
34381  Rupprecht.
34382
34383- bpo-22955: attrgetter, itemgetter and methodcaller objects in the operator
34384  module now support pickling.  Added readable and evaluable repr for these
34385  objects. Based on patch by Josh Rosenberg.
34386
34387- bpo-22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again when
34388  a directory with the chosen name already exists on Windows as well as on
34389  Unix. tempfile.mkstemp() now fails early if parent directory is not valid
34390  (not exists or is a file) on Windows.
34391
34392- bpo-23780: Improved error message in os.path.join() with single argument.
34393
34394- bpo-6598: Increased time precision and random number range in
34395  email.utils.make_msgid() to strengthen the uniqueness of the message ID.
34396
34397- bpo-24091: Fixed various crashes in corner cases in C implementation of
34398  ElementTree.
34399
34400- bpo-21931: msilib.FCICreate() now raises TypeError in the case of a bad
34401  argument instead of a ValueError with a bogus FCI error number. Patch by
34402  Jeffrey Armstrong.
34403
34404- bpo-13866: *quote_via* argument added to urllib.parse.urlencode.
34405
34406- bpo-20098: New mangle_from policy option for email, default True for
34407  compat32, but False for all other policies.
34408
34409- bpo-24211: The email library now supports RFC 6532: it can generate
34410  headers using utf-8 instead of encoded words.
34411
34412- bpo-16314: Added support for the LZMA compression in distutils.
34413
34414- bpo-21804: poplib now supports RFC 6856 (UTF8).
34415
34416- bpo-18682: Optimized pprint functions for builtin scalar types.
34417
34418- bpo-22027: smtplib now supports RFC 6531 (SMTPUTF8).
34419
34420- bpo-23488: Random generator objects now consume 2x less memory on 64-bit.
34421
34422- bpo-1322: platform.dist() and platform.linux_distribution() functions are
34423  now deprecated.  Initial patch by Vajrasky Kok.
34424
34425- bpo-22486: Added the math.gcd() function.  The fractions.gcd() function
34426  now is deprecated.  Based on patch by Mark Dickinson.
34427
34428- bpo-24064: Property() docstrings are now writeable. (Patch by Berker
34429  Peksag.)
34430
34431- bpo-22681: Added support for the koi8_t encoding.
34432
34433- bpo-22682: Added support for the kz1048 encoding.
34434
34435- bpo-23796: peek and read1 methods of BufferedReader now raise ValueError
34436  if they called on a closed object. Patch by John Hergenroeder.
34437
34438- bpo-21795: smtpd now supports the 8BITMIME extension whenever the new
34439  *decode_data* constructor argument is set to False.
34440
34441- bpo-24155: optimize heapq.heapify() for better cache performance when
34442  heapifying large lists.
34443
34444- bpo-21800: imaplib now supports RFC 5161 (enable), RFC 6855
34445  (utf8/internationalized email) and automatically encodes non-ASCII
34446  usernames and passwords to UTF8.
34447
34448- bpo-20274: When calling a _sqlite.Connection, it now complains if passed
34449  any keyword arguments.  Previously it silently ignored them.
34450
34451- bpo-20274: Remove ignored and erroneous "kwargs" parameters from three
34452  METH_VARARGS methods on _sqlite.Connection.
34453
34454- bpo-24134: assertRaises(), assertRaisesRegex(), assertWarns() and
34455  assertWarnsRegex() checks now emits a deprecation warning when callable is
34456  None or keyword arguments except msg is passed in the context manager
34457  mode.
34458
34459- bpo-24018: Add a collections.abc.Generator abstract base class.
34460  Contributed by Stefan Behnel.
34461
34462- bpo-23880: Tkinter's getint() and getdouble() now support Tcl_Obj.
34463  Tkinter's getdouble() now supports any numbers (in particular int).
34464
34465- bpo-22619: Added negative limit support in the traceback module. Based on
34466  patch by Dmitry Kazakov.
34467
34468- bpo-24094: Fix possible crash in json.encode with poorly behaved dict
34469  subclasses.
34470
34471- bpo-9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes.
34472  Patch written by William Orr.
34473
34474- bpo-17445: add difflib.diff_bytes() to support comparison of byte strings
34475  (fixes a regression from Python 2).
34476
34477- bpo-23917: Fall back to sequential compilation when ProcessPoolExecutor
34478  doesn't exist. Patch by Claudiu Popa.
34479
34480- bpo-23008: Fixed resolving attributes with boolean value is False in
34481  pydoc.
34482
34483- Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't increment
34484  unfinished tasks (this bug was introduced when JoinableQueue was merged
34485  with Queue).
34486
34487- bpo-23908: os functions now reject paths with embedded null character on
34488  Windows instead of silently truncating them.
34489
34490- bpo-23728: binascii.crc_hqx() could return an integer outside of the range
34491  0-0xffff for empty data.
34492
34493- bpo-23887: urllib.error.HTTPError now has a proper repr() representation.
34494  Patch by Berker Peksag.
34495
34496- asyncio: New event loop APIs: set_task_factory() and get_task_factory().
34497
34498- asyncio: async() function is deprecated in favour of ensure_future().
34499
34500- bpo-24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore
34501  support new 'async with' syntax.  Contributed by Yury Selivanov.
34502
34503- bpo-24179: Support 'async for' for asyncio.StreamReader. Contributed by
34504  Yury Selivanov.
34505
34506- bpo-24184: Add AsyncIterator and AsyncIterable ABCs to collections.abc.
34507  Contributed by Yury Selivanov.
34508
34509- bpo-22547: Implement informative __repr__ for inspect.BoundArguments.
34510  Contributed by Yury Selivanov.
34511
34512- bpo-24190: Implement inspect.BoundArgument.apply_defaults() method.
34513  Contributed by Yury Selivanov.
34514
34515- bpo-20691: Add 'follow_wrapped' argument to
34516  inspect.Signature.from_callable() and inspect.signature(). Contributed by
34517  Yury Selivanov.
34518
34519- bpo-24248: Deprecate inspect.Signature.from_function() and
34520  inspect.Signature.from_builtin().
34521
34522- bpo-23898: Fix inspect.classify_class_attrs() to support attributes with
34523  overloaded __eq__ and __bool__.  Patch by Mike Bayer.
34524
34525- bpo-24298: Fix inspect.signature() to correctly unwrap wrappers around
34526  bound methods.
34527
34528IDLE
34529----
34530
34531- bpo-23184: remove unused names and imports in idlelib. Initial patch by Al
34532  Sweigart.
34533
34534Tests
34535-----
34536
34537- bpo-21520: test_zipfile no longer fails if the word 'bad' appears anywhere
34538  in the name of the current directory.
34539
34540- bpo-9517: Move script_helper into the support package. Patch by Christie
34541  Wilson.
34542
34543Documentation
34544-------------
34545
34546- bpo-22155: Add File Handlers subsection with createfilehandler to tkinter
34547  doc.  Remove obsolete example from FAQ.  Patch by Martin Panter.
34548
34549- bpo-24029: Document the name binding behavior for submodule imports.
34550
34551- bpo-24077: Fix typo in man page for -I command option: -s, not -S
34552
34553Tools/Demos
34554-----------
34555
34556- bpo-24000: Improved Argument Clinic's mapping of converters to legacy
34557  "format units". Updated the documentation to match.
34558
34559- bpo-24001: Argument Clinic converters now use accept={type} instead of
34560  types={'type'} to specify the types the converter accepts.
34561
34562- bpo-23330: h2py now supports arbitrary filenames in #include.
34563
34564- bpo-24031: make patchcheck now supports git checkouts, too.
34565
34566
34567What's New in Python 3.5.0 alpha 4?
34568===================================
34569
34570*Release date: 2015-04-19*
34571
34572Core and Builtins
34573-----------------
34574
34575- bpo-22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now
34576  include the architecture triplet in the extension name, to make it easy to
34577  test builds for different ABIs in the same working tree.  Under OS X, the
34578  extension name now includes :pep:`3149`-style information.
34579
34580- bpo-22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch
34581  courtesy of Joe Jevnik.
34582
34583- bpo-23731: Implement :pep:`488`: removal of .pyo files.
34584
34585- bpo-23726: Don't enable GC for user subclasses of non-GC types that don't
34586  add any new fields.  Patch by Eugene Toder.
34587
34588- bpo-23309: Avoid a deadlock at shutdown if a daemon thread is aborted
34589  while it is holding a lock to a buffered I/O object, and the main thread
34590  tries to use the same I/O object (typically stdout or stderr).  A fatal
34591  error is emitted instead.
34592
34593- bpo-22977: Fixed formatting Windows error messages on Wine. Patch by
34594  Martin Panter.
34595
34596- bpo-23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
34597  non-integer input.
34598
34599- bpo-24044: Fix possible null pointer dereference in list.sort in out of
34600  memory conditions.
34601
34602- bpo-21354: PyCFunction_New function is exposed by python DLL again.
34603
34604Library
34605-------
34606
34607- bpo-23840: tokenize.open() now closes the temporary binary file on error
34608  to fix a resource warning.
34609
34610- bpo-16914: new debuglevel 2 in smtplib adds timestamps to debug output.
34611
34612- bpo-7159: urllib.request now supports sending auth credentials
34613  automatically after the first 401.  This enhancement is a superset of the
34614  enhancement from issue #19494 and supersedes that change.
34615
34616- bpo-23703: Fix a regression in urljoin() introduced in 901e4e52b20a. Patch
34617  by Demian Brecht.
34618
34619- bpo-4254: Adds _curses.update_lines_cols().  Patch by Arnon Yaari
34620
34621- bpo-19933: Provide default argument for ndigits in round. Patch by
34622  Vajrasky Kok.
34623
34624- bpo-23193: Add a numeric_owner parameter to tarfile.TarFile.extract and
34625  tarfile.TarFile.extractall. Patch by Michael Vogt and Eric Smith.
34626
34627- bpo-23342: Add a subprocess.run() function than returns a CalledProcess
34628  instance for a more consistent API than the existing call* functions.
34629
34630- bpo-21217: inspect.getsourcelines() now tries to compute the start and end
34631  lines from the code object, fixing an issue when a lambda function is used
34632  as decorator argument. Patch by Thomas Ballinger and Allison Kaptur.
34633
34634- bpo-24521: Fix possible integer overflows in the pickle module.
34635
34636- bpo-22931: Allow '[' and ']' in cookie values.
34637
34638- The keywords attribute of functools.partial is now always a dictionary.
34639
34640- bpo-23811: Add missing newline to the PyCompileError error message. Patch
34641  by Alex Shkop.
34642
34643- bpo-21116: Avoid blowing memory when allocating a multiprocessing shared
34644  array that's larger than 50% of the available RAM.  Patch by Médéric
34645  Boquien.
34646
34647- bpo-22982: Improve BOM handling when seeking to multiple positions of a
34648  writable text file.
34649
34650- bpo-23464: Removed deprecated asyncio JoinableQueue.
34651
34652- bpo-23529: Limit the size of decompressed data when reading from GzipFile,
34653  BZ2File or LZMAFile.  This defeats denial of service attacks using
34654  compressed bombs (i.e. compressed payloads which decompress to a huge
34655  size).  Patch by Martin Panter and Nikolaus Rath.
34656
34657- bpo-21859: Added Python implementation of io.FileIO.
34658
34659- bpo-23865: close() methods in multiple modules now are idempotent and more
34660  robust at shutdown. If they need to release multiple resources, all are
34661  released even if errors occur.
34662
34663- bpo-23400: Raise same exception on both Python 2 and 3 if sem_open is not
34664  available. Patch by Davin Potts.
34665
34666- bpo-10838: The subprocess now module includes SubprocessError and
34667  TimeoutError in its list of exported names for the users wild enough to
34668  use ``from subprocess import *``.
34669
34670- bpo-23411: Added DefragResult, ParseResult, SplitResult,
34671  DefragResultBytes, ParseResultBytes, and SplitResultBytes to
34672  urllib.parse.__all__. Patch by Martin Panter.
34673
34674- bpo-23881: urllib.request.ftpwrapper constructor now closes the socket if
34675  the FTP connection failed to fix a ResourceWarning.
34676
34677- bpo-23853: :meth:`socket.socket.sendall` does no more reset the socket
34678  timeout each time data is sent successfully. The socket timeout is now the
34679  maximum total duration to send all data.
34680
34681- bpo-22721: An order of multiline pprint output of set or dict containing
34682  orderable and non-orderable elements no longer depends on iteration order
34683  of set or dict.
34684
34685- bpo-15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
34686  returns bool. tkinter.BooleanVar now validates input values (accepted
34687  bool, int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns
34688  bool.
34689
34690- bpo-10590: xml.sax.parseString() now supports string argument.
34691
34692- bpo-23338: Fixed formatting ctypes error messages on Cygwin. Patch by
34693  Makoto Kato.
34694
34695- bpo-15582: inspect.getdoc() now follows inheritance chains.
34696
34697- bpo-2175: SAX parsers now support a character stream of InputSource
34698  object.
34699
34700- bpo-16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
34701  arbitrary precision integers added in Tcl 8.5.
34702
34703- bpo-23834: Fix socket.sendto(), use the C Py_ssize_t type to store the
34704  result of sendto() instead of the C int type.
34705
34706- bpo-23618: :meth:`socket.socket.connect` now waits until the connection
34707  completes instead of raising :exc:`InterruptedError` if the connection is
34708  interrupted by signals, signal handlers don't raise an exception and the
34709  socket is blocking or has a timeout. :meth:`socket.socket.connect` still
34710  raise :exc:`InterruptedError` for non-blocking sockets.
34711
34712- bpo-21526: Tkinter now supports new boolean type in Tcl 8.5.
34713
34714- bpo-23836: Fix the faulthandler module to handle reentrant calls to its
34715  signal handlers.
34716
34717- bpo-23838: linecache now clears the cache and returns an empty result on
34718  MemoryError.
34719
34720- bpo-10395: Added os.path.commonpath(). Implemented in posixpath and
34721  ntpath. Based on patch by Rafik Draoui.
34722
34723- bpo-23611: Serializing more "lookupable" objects (such as unbound methods
34724  or nested classes) now are supported with pickle protocols < 4.
34725
34726- bpo-13583: sqlite3.Row now supports slice indexing.
34727
34728- bpo-18473: Fixed 2to3 and 3to2 compatible pickle mappings.  Fixed
34729  ambiguous reverse mappings.  Added many new mappings.  Import mapping is
34730  no longer applied to modules already mapped with full name mapping.
34731
34732- bpo-23485: select.select() is now retried automatically with the
34733  recomputed timeout when interrupted by a signal, except if the signal
34734  handler raises an exception. This change is part of the :pep:`475`.
34735
34736- bpo-23752: When built from an existing file descriptor, io.FileIO() now
34737  only calls fstat() once. Before fstat() was called twice, which was not
34738  necessary.
34739
34740- bpo-23704: collections.deque() objects now support __add__, __mul__, and
34741  __imul__().
34742
34743- bpo-23171: csv.Writer.writerow() now supports arbitrary iterables.
34744
34745- bpo-23745: The new email header parser now handles duplicate MIME
34746  parameter names without error, similar to how get_param behaves.
34747
34748- bpo-22117: Fix os.utime(), it now rounds the timestamp towards minus
34749  infinity (-inf) instead of rounding towards zero.
34750
34751- bpo-23310: Fix MagicMock's initializer to work with __methods__, just like
34752  configure_mock().  Patch by Kasia Jachim.
34753
34754Build
34755-----
34756
34757- bpo-23817: FreeBSD now uses "1.0" in the SOVERSION as other operating
34758  systems, instead of just "1".
34759
34760- bpo-23501: Argument Clinic now generates code into separate files by
34761  default.
34762
34763Tests
34764-----
34765
34766- bpo-23799: Added test.support.start_threads() for running and cleaning up
34767  multiple threads.
34768
34769- bpo-22390: test.regrtest now emits a warning if temporary files or
34770  directories are left after running a test.
34771
34772Tools/Demos
34773-----------
34774
34775- bpo-18128: pygettext now uses standard +NNNN format in the
34776  POT-Creation-Date header.
34777
34778- bpo-23935: Argument Clinic's understanding of format units accepting
34779  bytes, bytearrays, and buffers is now consistent with both the
34780  documentation and the implementation.
34781
34782- bpo-23944: Argument Clinic now wraps long impl prototypes at column 78.
34783
34784- bpo-20586: Argument Clinic now ensures that functions without docstrings
34785  have signatures.
34786
34787- bpo-23492: Argument Clinic now generates argument parsing code with
34788  PyArg_Parse instead of PyArg_ParseTuple if possible.
34789
34790- bpo-23500: Argument Clinic is now smarter about generating the "#ifndef"
34791  (empty) definition of the methoddef macro: it's only generated once, even
34792  if Argument Clinic processes the same symbol multiple times, and it's
34793  emitted at the end of all processing rather than immediately after the
34794  first use.
34795
34796C API
34797-----
34798
34799- bpo-23998: PyImport_ReInitLock() now checks for lock allocation error
34800
34801
34802What's New in Python 3.5.0 alpha 3?
34803===================================
34804
34805*Release date: 2015-03-28*
34806
34807Core and Builtins
34808-----------------
34809
34810- bpo-23573: Increased performance of string search operations (str.find,
34811  str.index, str.count, the in operator, str.split, str.partition) with
34812  arguments of different kinds (UCS1, UCS2, UCS4).
34813
34814- bpo-23753: Python doesn't support anymore platforms without stat() or
34815  fstat(), these functions are always required.
34816
34817- bpo-23681: The -b option now affects comparisons of bytes with int.
34818
34819- bpo-23632: Memoryviews now allow tuple indexing (including for
34820  multi-dimensional memoryviews).
34821
34822- bpo-23192: Fixed generator lambdas.  Patch by Bruno Cauet.
34823
34824- bpo-23629: Fix the default __sizeof__ implementation for variable-sized
34825  objects.
34826
34827Library
34828-------
34829
34830- bpo-14260: The groupindex attribute of regular expression pattern object
34831  now is non-modifiable mapping.
34832
34833- bpo-23792: Ignore KeyboardInterrupt when the pydoc pager is active. This
34834  mimics the behavior of the standard unix pagers, and prevents pipepager
34835  from shutting down while the pager itself is still running.
34836
34837- bpo-23775: pprint() of OrderedDict now outputs the same representation as
34838  repr().
34839
34840- bpo-23765: Removed IsBadStringPtr calls in ctypes
34841
34842- bpo-22364: Improved some re error messages using regex for hints.
34843
34844- bpo-23742: ntpath.expandvars() no longer loses unbalanced single quotes.
34845
34846- bpo-21717: The zipfile.ZipFile.open function now supports 'x' (exclusive
34847  creation) mode.
34848
34849- bpo-21802: The reader in BufferedRWPair now is closed even when closing
34850  writer failed in BufferedRWPair.close().
34851
34852- bpo-23622: Unknown escapes in regular expressions that consist of ``'\'``
34853  and ASCII letter now raise a deprecation warning and will be forbidden in
34854  Python 3.6.
34855
34856- bpo-23671: string.Template now allows specifying the "self" parameter as a
34857  keyword argument.  string.Formatter now allows specifying the "self" and
34858  the "format_string" parameters as keyword arguments.
34859
34860- bpo-23502: The pprint module now supports mapping proxies.
34861
34862- bpo-17530: pprint now wraps long bytes objects and bytearrays.
34863
34864- bpo-22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid
34865  of quadratic complexity in breaking long words.
34866
34867- bpo-4727: The copy module now uses pickle protocol 4 (PEP 3154) and
34868  supports copying of instances of classes whose __new__ method takes
34869  keyword-only arguments.
34870
34871- bpo-23491: Added a zipapp module to support creating executable zip file
34872  archives of Python code. Registered ".pyz" and ".pyzw" extensions on
34873  Windows for these archives (PEP 441).
34874
34875- bpo-23657: Avoid explicit checks for str in zipapp, adding support for
34876  pathlib.Path objects as arguments.
34877
34878- bpo-23688: Added support of arbitrary bytes-like objects and avoided
34879  unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch
34880  by Wolfgang Maier.
34881
34882- bpo-23252: Added support for writing ZIP files to unseekable streams.
34883
34884- bpo-23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes.
34885
34886- bpo-23539: If body is None, http.client.HTTPConnection.request now sets
34887  Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors
34888  from some web servers.
34889
34890- bpo-22351: The nntplib.NNTP constructor no longer leaves the connection
34891  and socket open until the garbage collector cleans them up.  Patch by
34892  Martin Panter.
34893
34894- bpo-23704: collections.deque() objects now support methods for index(),
34895  insert(), and copy().  This allows deques to be registered as a
34896  MutableSequence and it improves their substitutability for lists.
34897
34898- bpo-23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are
34899  now retried when interrupted by a signal not in the *sigset* parameter, if
34900  the signal handler does not raise an exception. signal.sigtimedwait()
34901  recomputes the timeout with a monotonic clock when it is retried.
34902
34903- bpo-23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and
34904  codecs, that accepted only read-only bytes-like object now accept writable
34905  bytes-like object too.
34906
34907- bpo-23646: If time.sleep() is interrupted by a signal, the sleep is now
34908  retried with the recomputed delay, except if the signal handler raises an
34909  exception (PEP 475).
34910
34911- bpo-23136: _strptime now uniformly handles all days in week 0, including
34912  Dec 30 of previous year.  Based on patch by Jim Carroll.
34913
34914- bpo-23700: Iterator of NamedTemporaryFile now keeps a reference to
34915  NamedTemporaryFile instance.  Patch by Bohuslav Kabrda.
34916
34917- bpo-22903: The fake test case created by unittest.loader when it fails
34918  importing a test module is now picklable.
34919
34920- bpo-22181: On Linux, os.urandom() now uses the new getrandom() syscall if
34921  available, syscall introduced in the Linux kernel 3.17. It is more
34922  reliable and more secure, because it avoids the need of a file descriptor
34923  and waits until the kernel has enough entropy.
34924
34925- bpo-2211: Updated the implementation of the http.cookies.Morsel class.
34926  Setting attributes key, value and coded_value directly now is deprecated.
34927  update() and setdefault() now transform and check keys.  Comparing for
34928  equality now takes into account attributes key, value and coded_value.
34929  copy() now returns a Morsel, not a dict.  repr() now contains all
34930  attributes. Optimized checking keys and quoting values.  Added new tests.
34931  Original patch by Demian Brecht.
34932
34933- bpo-18983: Allow selection of output units in timeit. Patch by Julian
34934  Gindi.
34935
34936- bpo-23631: Fix traceback.format_list when a traceback has been mutated.
34937
34938- bpo-23568: Add rdivmod support to MagicMock() objects. Patch by Håkan
34939  Lövdahl.
34940
34941- bpo-2052: Add charset parameter to HtmlDiff.make_file().
34942
34943- bpo-23668: Support os.truncate and os.ftruncate on Windows.
34944
34945- bpo-23138: Fixed parsing cookies with absent keys or values in cookiejar.
34946  Patch by Demian Brecht.
34947
34948- bpo-23051: multiprocessing.Pool methods imap() and imap_unordered() now
34949  handle exceptions raised by an iterator.  Patch by Alon Diamant and Davin
34950  Potts.
34951
34952- bpo-23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl.
34953
34954- bpo-23566: enable(), register(), dump_traceback() and
34955  dump_traceback_later() functions of faulthandler now accept file
34956  descriptors. Patch by Wei Wu.
34957
34958- bpo-22928: Disabled HTTP header injections in http.client. Original patch
34959  by Demian Brecht.
34960
34961- bpo-23615: Modules bz2, tarfile and tokenize now can be reloaded with
34962  imp.reload(). Patch by Thomas Kluyver.
34963
34964- bpo-23605: os.walk() now calls os.scandir() instead of os.listdir(). The
34965  usage of os.scandir() reduces the number of calls to os.stat(). Initial
34966  patch written by Ben Hoyt.
34967
34968Build
34969-----
34970
34971- bpo-23585: make patchcheck will ensure the interpreter is built.
34972
34973Tests
34974-----
34975
34976- bpo-23583: Added tests for standard IO streams in IDLE.
34977
34978- bpo-22289: Prevent test_urllib2net failures due to ftp connection timeout.
34979
34980Tools/Demos
34981-----------
34982
34983- bpo-22826: The result of open() in Tools/freeze/bkfile.py is now better
34984  compatible with regular files (in particular it now supports the context
34985  management protocol).
34986
34987
34988What's New in Python 3.5.0 alpha 2?
34989===================================
34990
34991*Release date: 2015-03-09*
34992
34993Core and Builtins
34994-----------------
34995
34996- bpo-23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError
34997  if a function returns a result and raises an exception. The SystemError is
34998  chained to the previous exception.
34999
35000Library
35001-------
35002
35003- bpo-22524: New os.scandir() function, part of the :pep:`471`:
35004  "os.scandir() function -- a better and faster directory iterator". Patch
35005  written by Ben Hoyt.
35006
35007- bpo-23103: Reduced the memory consumption of IPv4Address and IPv6Address.
35008
35009- bpo-21793: BaseHTTPRequestHandler again logs response code as numeric, not
35010  as stringified enum.  Patch by Demian Brecht.
35011
35012- bpo-23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST
35013  flag on certificate stores when it is available.
35014
35015- bpo-23576: Avoid stalling in SSL reads when EOF has been reached in the
35016  SSL layer but the underlying connection hasn't been closed.
35017
35018- bpo-23504: Added an __all__ to the types module.
35019
35020- bpo-23563: Optimized utility functions in urllib.parse.
35021
35022- bpo-7830: Flatten nested functools.partial.
35023
35024- bpo-20204: Added the __module__ attribute to _tkinter classes.
35025
35026- bpo-19980: Improved help() for non-recognized strings.  help('') now shows
35027  the help on str.  help('help') now shows the help on help(). Original
35028  patch by Mark Lawrence.
35029
35030- bpo-23521: Corrected pure python implementation of timedelta division.
35031  Eliminated OverflowError from ``timedelta * float`` for some floats;
35032  Corrected rounding in timedelta true division.
35033
35034- bpo-21619: Popen objects no longer leave a zombie after exit in the with
35035  statement if the pipe was broken.  Patch by Martin Panter.
35036
35037- bpo-22936: Make it possible to show local variables in tracebacks for both
35038  the traceback module and unittest.
35039
35040- bpo-15955: Add an option to limit the output size in bz2.decompress().
35041  Patch by Nikolaus Rath.
35042
35043- bpo-6639: Module-level turtle functions no longer raise TclError after
35044  closing the window.
35045
35046- bpo-814253: Group references and conditional group references now work in
35047  lookbehind assertions in regular expressions. (See also: bpo-9179)
35048
35049- bpo-23215: Multibyte codecs with custom error handlers that ignores errors
35050  consumed too much memory and raised SystemError or MemoryError. Original
35051  patch by Aleksi Torhamo.
35052
35053- bpo-5700: io.FileIO() called flush() after closing the file. flush() was
35054  not called in close() if closefd=False.
35055
35056- bpo-23374: Fixed pydoc failure with non-ASCII files when stdout encoding
35057  differs from file system encoding (e.g. on Mac OS).
35058
35059- bpo-23481: Remove RC4 from the SSL module's default cipher list.
35060
35061- bpo-21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty
35062  docstrings.
35063
35064- bpo-22885: Fixed arbitrary code execution vulnerability in the dbm.dumb
35065  module. Original patch by Claudiu Popa.
35066
35067- bpo-23239: ssl.match_hostname() now supports matching of IP addresses.
35068
35069- bpo-23146: Fix mishandling of absolute Windows paths with forward slashes
35070  in pathlib.
35071
35072- bpo-23096: Pickle representation of floats with protocol 0 now is the same
35073  for both Python and C implementations.
35074
35075- bpo-19105: pprint now more efficiently uses free space at the right.
35076
35077- bpo-14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by
35078  Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.
35079
35080- bpo-21717: tarfile.open() now supports 'x' (exclusive creation) mode.
35081
35082- bpo-23344: marshal.dumps() is now 20-25% faster on average.
35083
35084- bpo-20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on
35085  average.
35086
35087- bpo-23421: Fixed compression in tarfile CLI.  Patch by wdv4758h.
35088
35089- bpo-23367: Fix possible overflows in the unicodedata module.
35090
35091- bpo-23361: Fix possible overflow in Windows subprocess creation code.
35092
35093- logging.handlers.QueueListener now takes a respect_handler_level keyword
35094  argument which, if set to True, will pass messages to handlers taking
35095  handler levels into account.
35096
35097- bpo-19705: turtledemo now has a visual sorting algorithm demo.  Original
35098  patch from Jason Yeo.
35099
35100- bpo-23801: Fix issue where cgi.FieldStorage did not always ignore the
35101  entire preamble to a multipart body.
35102
35103Build
35104-----
35105
35106- bpo-23445: pydebug builds now use "gcc -Og" where possible, to make the
35107  resulting executable faster.
35108
35109- bpo-23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.
35110
35111C API
35112-----
35113
35114- bpo-20204: Deprecation warning is now raised for builtin types without the
35115  __module__ attribute.
35116
35117Windows
35118-------
35119
35120- bpo-23465: Implement :pep:`486` - Make the Python Launcher aware of
35121  virtual environments. Patch by Paul Moore.
35122
35123- bpo-23437: Make user scripts directory versioned on Windows. Patch by Paul
35124  Moore.
35125
35126
35127What's New in Python 3.5.0 alpha 1?
35128===================================
35129
35130*Release date: 2015-02-08*
35131
35132Core and Builtins
35133-----------------
35134
35135- bpo-23285: PEP 475 - EINTR handling.
35136
35137- bpo-22735: Fix many edge cases (including crashes) involving custom mro()
35138  implementations.
35139
35140- bpo-22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
35141  and PyObject_AsWriteBuffer().
35142
35143- bpo-21295: Revert some changes (issue #16795) to AST line numbers and
35144  column offsets that constituted a regression.
35145
35146- bpo-22986: Allow changing an object's __class__ between a dynamic type and
35147  static type in some cases.
35148
35149- bpo-15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and
35150  PyUnicode_EncodeCodePage() now raise an exception if the object is not a
35151  Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case
35152  on platforms other than Windows. Patch written by Campbell Barton.
35153
35154- bpo-21408: The default __ne__() now returns NotImplemented if __eq__()
35155  returned NotImplemented.  Original patch by Martin Panter.
35156
35157- bpo-23321: Fixed a crash in str.decode() when error handler returned
35158  replacement string longer than malformed input data.
35159
35160- bpo-22286: The "backslashreplace" error handlers now works with decoding
35161  and translating.
35162
35163- bpo-23253: Delay-load ShellExecute[AW] in os.startfile for reduced startup
35164  overhead on Windows.
35165
35166- bpo-22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for
35167  atomic memory access if available. Patch written by Vitor de Lima and
35168  Gustavo Temple.
35169
35170- bpo-20284: %-interpolation (aka printf) formatting added for bytes and
35171  bytearray.
35172
35173- bpo-23048: Fix jumping out of an infinite while loop in the pdb.
35174
35175- bpo-20335: bytes constructor now raises TypeError when encoding or errors
35176  is specified with non-string argument.  Based on patch by Renaud Blanch.
35177
35178- bpo-22834: If the current working directory ends up being set to a
35179  non-existent directory then import will no longer raise FileNotFoundError.
35180
35181- bpo-22869: Move the interpreter startup & shutdown code to a new dedicated
35182  pylifecycle.c module
35183
35184- bpo-22847: Improve method cache efficiency.
35185
35186- bpo-22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff
35187  bytes on a 32-bit platform.
35188
35189- bpo-22653: Fix an assertion failure in debug mode when doing a reentrant
35190  dict insertion in debug mode.
35191
35192- bpo-22643: Fix integer overflow in Unicode case operations (upper, lower,
35193  title, swapcase, casefold).
35194
35195- bpo-17636: Circular imports involving relative imports are now supported.
35196
35197- bpo-22604: Fix assertion error in debug mode when dividing a complex
35198  number by (nan+0j).
35199
35200- bpo-21052: Do not raise ImportWarning when sys.path_hooks or sys.meta_path
35201  are set to None.
35202
35203- bpo-16518: Use 'bytes-like object required' in error messages that
35204  previously used the far more cryptic "'x' does not support the buffer
35205  protocol.
35206
35207- bpo-22470: Fixed integer overflow issues in "backslashreplace",
35208  "xmlcharrefreplace", and "surrogatepass" error handlers.
35209
35210- bpo-22540: speed up `PyObject_IsInstance` and `PyObject_IsSubclass` in the
35211  common case that the second argument has metaclass `type`.
35212
35213- bpo-18711: Add a new `PyErr_FormatV` function, similar to `PyErr_Format`
35214  but accepting a `va_list` argument.
35215
35216- bpo-22520: Fix overflow checking when generating the repr of a unicode
35217  object.
35218
35219- bpo-22519: Fix overflow checking in PyBytes_Repr.
35220
35221- bpo-22518: Fix integer overflow issues in latin-1 encoding.
35222
35223- bpo-16324: _charset parameter of MIMEText now also accepts
35224  email.charset.Charset instances. Initial patch by Claude Paroz.
35225
35226- bpo-1764286: Fix inspect.getsource() to support decorated functions. Patch
35227  by Claudiu Popa.
35228
35229- bpo-18554: os.__all__ includes posix functions.
35230
35231- bpo-21391: Use os.path.abspath in the shutil module.
35232
35233- bpo-11471: avoid generating a JUMP_FORWARD instruction at the end of an
35234  if-block if there is no else-clause.  Original patch by Eugene Toder.
35235
35236- bpo-22215: Now ValueError is raised instead of TypeError when str or bytes
35237  argument contains not permitted null character or byte.
35238
35239- bpo-22258: Fix the internal function set_inheritable() on Illumos. This
35240  platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails
35241  with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable()
35242  now falls back to the slower ``fcntl()`` (``F_GETFD`` and then
35243  ``F_SETFD``).
35244
35245- bpo-21389: Displaying the __qualname__ of the underlying function in the
35246  repr of a bound method.
35247
35248- bpo-22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM
35249  and returns -1 (error) on integer overflow.
35250
35251- bpo-20184: Argument Clinic based signature introspection added for 30 of
35252  the builtin functions.
35253
35254- bpo-22116: C functions and methods (of the 'builtin_function_or_method'
35255  type) can now be weakref'ed.  Patch by Wei Wu.
35256
35257- bpo-22077: Improve index error messages for bytearrays, bytes, lists, and
35258  tuples by adding 'or slices'. Added ', not <typename>' for bytearrays.
35259  Original patch by Claudiu Popa.
35260
35261- bpo-20179: Apply Argument Clinic to bytes and bytearray. Patch by Tal
35262  Einat.
35263
35264- bpo-22082: Clear interned strings in slotdefs.
35265
35266- Upgrade Unicode database to Unicode 7.0.0.
35267
35268- bpo-21897: Fix a crash with the f_locals attribute with closure variables
35269  when frame.clear() has been called.
35270
35271- bpo-21205: Add a new ``__qualname__`` attribute to generator, the
35272  qualified name, and use it in the representation of a generator
35273  (``repr(gen)``). The default name of the generator (``__name__``
35274  attribute) is now get from the function instead of the code. Use
35275  ``gen.gi_code.co_name`` to get the name of the code.
35276
35277- bpo-21669: With the aid of heuristics in SyntaxError.__init__, the parser
35278  now attempts to generate more meaningful (or at least more search engine
35279  friendly) error messages when "exec" and "print" are used as statements.
35280
35281- bpo-21642: In the conditional if-else expression, allow an integer written
35282  with no space between itself and the ``else`` keyword (e.g. ``True if
35283  42else False``) to be valid syntax.
35284
35285- bpo-21523: Fix over-pessimistic computation of the stack effect of some
35286  opcodes in the compiler.  This also fixes a quadratic compilation time
35287  issue noticeable when compiling code with a large number of "and" and "or"
35288  operators.
35289
35290- bpo-21418: Fix a crash in the builtin function super() when called without
35291  argument and without current frame (ex: embedded Python).
35292
35293- bpo-21425: Fix flushing of standard streams in the interactive
35294  interpreter.
35295
35296- bpo-21435: In rare cases, when running finalizers on objects in cyclic
35297  trash a bad pointer dereference could occur due to a subtle flaw in
35298  internal iteration logic.
35299
35300- bpo-21377: PyBytes_Concat() now tries to concatenate in-place when the
35301  first argument has a reference count of 1.  Patch by Nikolaus Rath.
35302
35303- bpo-20355: -W command line options now have higher priority than the
35304  PYTHONWARNINGS environment variable.  Patch by Arfrever.
35305
35306- bpo-21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.
35307
35308- bpo-20904: Support setting FPU precision on m68k.
35309
35310- bpo-21209: Fix sending tuples to custom generator objects with the yield
35311  from syntax.
35312
35313- bpo-21193: pow(a, b, c) now raises ValueError rather than TypeError when b
35314  is negative. Patch by Josh Rosenberg.
35315
35316- bpo-21176: PEP 465: Add the '@' operator for matrix multiplication.
35317
35318- bpo-21134: Fix segfault when str is called on an uninitialized
35319  UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
35320
35321- bpo-19537: Fix PyUnicode_DATA() alignment under m68k.  Patch by Andreas
35322  Schwab.
35323
35324- bpo-20929: Add a type cast to avoid shifting a negative number.
35325
35326- bpo-20731: Properly position in source code files even if they are opened
35327  in text mode. Patch by Serhiy Storchaka.
35328
35329- bpo-20637: Key-sharing now also works for instance dictionaries of
35330  subclasses.  Patch by Peter Ingebretson.
35331
35332- bpo-8297: Attributes missing from modules now include the module name in
35333  the error text.  Original patch by ysj.ray.
35334
35335- bpo-19995: %c, %o, %x, and %X now raise TypeError on non-integer input.
35336
35337- bpo-19655: The ASDL parser - used by the build process to generate code
35338  for managing the Python AST in C - was rewritten. The new parser is self
35339  contained and does not require to carry long the spark.py parser-generator
35340  library; spark.py was removed from the source base.
35341
35342- bpo-12546: Allow ``\x00`` to be used as a fill character when using str,
35343  int, float, and complex __format__ methods.
35344
35345- bpo-20480: Add ipaddress.reverse_pointer. Patch by Leon Weber.
35346
35347- bpo-13598: Modify string.Formatter to support auto-numbering of
35348  replacement fields. It now matches the behavior of str.format() in this
35349  regard. Patches by Phil Elson and Ramchandra Apte.
35350
35351- bpo-8931: Make alternate formatting ('#') for type 'c' raise an exception.
35352  In versions prior to 3.5, '#' with 'c' had no effect. Now specifying it is
35353  an error. Patch by Torsten Landschoff.
35354
35355- bpo-23165: Perform overflow checks before allocating memory in the
35356  _Py_char2wchar function.
35357
35358Library
35359-------
35360
35361- bpo-23399: pyvenv creates relative symlinks where possible.
35362
35363- bpo-20289: cgi.FieldStorage() now supports the context management
35364  protocol.
35365
35366- bpo-13128: Print response headers for CONNECT requests when debuglevel >
35367  0. Patch by Demian Brecht.
35368
35369- bpo-15381: Optimized io.BytesIO to make less allocations and copyings.
35370
35371- bpo-22818: Splitting on a pattern that could match an empty string now
35372  raises a warning.  Patterns that can only match empty strings are now
35373  rejected.
35374
35375- bpo-23099: Closing io.BytesIO with exported buffer is rejected now to
35376  prevent corrupting exported buffer.
35377
35378- bpo-23326: Removed __ne__ implementations.  Since fixing default __ne__
35379  implementation in issue #21408 they are redundant.
35380
35381- bpo-23363: Fix possible overflow in itertools.permutations.
35382
35383- bpo-23364: Fix possible overflow in itertools.product.
35384
35385- bpo-23366: Fixed possible integer overflow in itertools.combinations.
35386
35387- bpo-23369: Fixed possible integer overflow in
35388  _json.encode_basestring_ascii.
35389
35390- bpo-23353: Fix the exception handling of generators in
35391  PyEval_EvalFrameEx(). At entry, save or swap the exception state even if
35392  PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception
35393  state is now always restored or swapped, not only if why is WHY_YIELD or
35394  WHY_RETURN. Patch co-written with Antoine Pitrou.
35395
35396- bpo-14099: Restored support of writing ZIP files to tellable but
35397  non-seekable streams.
35398
35399- bpo-14099: Writing to ZipFile and reading multiple ZipExtFiles is
35400  threadsafe now.
35401
35402- bpo-19361: JSON decoder now raises JSONDecodeError instead of ValueError.
35403
35404- bpo-18518: timeit now rejects statements which can't be compiled outside a
35405  function or a loop (e.g. "return" or "break").
35406
35407- bpo-23094: Fixed readline with frames in Python implementation of pickle.
35408
35409- bpo-23268: Fixed bugs in the comparison of ipaddress classes.
35410
35411- bpo-21408: Removed incorrect implementations of __ne__() which didn't
35412  returned NotImplemented if __eq__() returned NotImplemented.  The default
35413  __ne__() now works correctly.
35414
35415- bpo-19996: :class:`email.feedparser.FeedParser` now handles (malformed)
35416  headers with no key rather than assuming the body has started.
35417
35418- bpo-20188: Support Application-Layer Protocol Negotiation (ALPN) in the
35419  ssl module.
35420
35421- bpo-23133: Pickling of ipaddress objects now produces more compact and
35422  portable representation.
35423
35424- bpo-23248: Update ssl error codes from latest OpenSSL git master.
35425
35426- bpo-23266: Much faster implementation of ipaddress.collapse_addresses()
35427  when there are many non-consecutive addresses.
35428
35429- bpo-23098: 64-bit dev_t is now supported in the os module.
35430
35431- bpo-21817: When an exception is raised in a task submitted to a
35432  ProcessPoolExecutor, the remote traceback is now displayed in the parent
35433  process.  Patch by Claudiu Popa.
35434
35435- bpo-15955: Add an option to limit output size when decompressing LZMA
35436  data.  Patch by Nikolaus Rath and Martin Panter.
35437
35438- bpo-23250: In the http.cookies module, capitalize "HttpOnly" and "Secure"
35439  as they are written in the standard.
35440
35441- bpo-23063: In the distutils' check command, fix parsing of reST with code
35442  or code-block directives.
35443
35444- bpo-23209: selectors.BaseSelector.get_key() now raises a RuntimeError if
35445  the selector is closed. And selectors.BaseSelector.close() now clears its
35446  internal reference to the selector mapping to break a reference cycle.
35447  Initial patch written by Martin Richard. (See also: bpo-23225)
35448
35449- bpo-17911: Provide a way to seed the linecache for a PEP-302 module
35450  without actually loading the code.
35451
35452- bpo-17911: Provide a new object API for traceback, including the ability
35453  to not lookup lines at all until the traceback is actually rendered,
35454  without any trace of the original objects being kept alive.
35455
35456- bpo-19777: Provide a home() classmethod on Path objects.  Contributed by
35457  Victor Salgado and Mayank Tripathi.
35458
35459- bpo-23206: Make ``json.dumps(..., ensure_ascii=False)`` as fast as the
35460  default case of ``ensure_ascii=True``.  Patch by Naoki Inada.
35461
35462- bpo-23185: Add math.inf and math.nan constants.
35463
35464- bpo-23186: Add ssl.SSLObject.shared_ciphers() and
35465  ssl.SSLSocket.shared_ciphers() to fetch the client's list ciphers sent at
35466  handshake.
35467
35468- bpo-23143: Remove compatibility with OpenSSLs older than 0.9.8.
35469
35470- bpo-23132: Improve performance and introspection support of comparison
35471  methods created by functool.total_ordering.
35472
35473- bpo-19776: Add an expanduser() method on Path objects.
35474
35475- bpo-23112: Fix SimpleHTTPServer to correctly carry the query string and
35476  fragment when it redirects to add a trailing slash.
35477
35478- bpo-21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK,
35479  HTTPStatus.NOT_FOUND). Patch by Demian Brecht.
35480
35481- bpo-23093: In the io, module allow more operations to work on detached
35482  streams.
35483
35484- bpo-23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
35485  version.
35486
35487- bpo-22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
35488  instead of reading /dev/urandom, to get pseudo-random bytes.
35489
35490- bpo-19104: pprint now produces evaluable output for wrapped strings.
35491
35492- bpo-23071: Added missing names to codecs.__all__.  Patch by Martin Panter.
35493
35494- bpo-22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
35495  opcode if possible.
35496
35497- bpo-15513: Added a __sizeof__ implementation for pickle classes.
35498
35499- bpo-19858: pickletools.optimize() now aware of the MEMOIZE opcode, can
35500  produce more compact result and no longer produces invalid output if input
35501  data contains MEMOIZE opcodes together with PUT or BINPUT opcodes.
35502
35503- bpo-22095: Fixed HTTPConnection.set_tunnel with default port.  The port
35504  value in the host header was set to "None".  Patch by Demian Brecht.
35505
35506- bpo-23016: A warning no longer produces an AttributeError when the program
35507  is run with pythonw.exe.
35508
35509- bpo-21775: shutil.copytree(): fix crash when copying to VFAT. An exception
35510  handler assumed that OSError objects always have a 'winerror' attribute.
35511  That is not the case, so the exception handler itself raised
35512  AttributeError when run on Linux (and, presumably, any other non-Windows
35513  OS). Patch by Greg Ward.
35514
35515- bpo-1218234: Fix inspect.getsource() to load updated source of reloaded
35516  module. Initial patch by Berker Peksag.
35517
35518- bpo-21740: Support wrapped callables in doctest. Patch by Claudiu Popa.
35519
35520- bpo-23009: Make sure selectors.EpollSelector.select() works when no FD is
35521  registered.
35522
35523- bpo-22959: In the constructor of http.client.HTTPSConnection, prefer the
35524  context's check_hostname attribute over the *check_hostname* parameter.
35525
35526- bpo-22696: Add function :func:`sys.is_finalizing` to know about
35527  interpreter shutdown.
35528
35529- bpo-16043: Add a default limit for the amount of data
35530  xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753.
35531
35532- bpo-14099: ZipFile.open() no longer reopen the underlying file.  Objects
35533  returned by ZipFile.open() can now operate independently of the ZipFile
35534  even if the ZipFile was created by passing in a file-like object as the
35535  first argument to the constructor.
35536
35537- bpo-22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked
35538  to compile a source file containing multiple dots in the source file name.
35539
35540- bpo-21971: Update turtledemo doc and add module to the index.
35541
35542- bpo-21032: Fixed socket leak if HTTPConnection.getresponse() fails.
35543  Original patch by Martin Panter.
35544
35545- bpo-22407: Deprecated the use of re.LOCALE flag with str patterns or
35546  re.ASCII. It was newer worked.
35547
35548- bpo-22902: The "ip" command is now used on Linux to determine MAC address
35549  in uuid.getnode().  Pach by Bruno Cauet.
35550
35551- bpo-22960: Add a context argument to xmlrpclib.ServerProxy constructor.
35552
35553- bpo-22389: Add contextlib.redirect_stderr().
35554
35555- bpo-21356: Make ssl.RAND_egd() optional to support LibreSSL. The
35556  availability of the function is checked during the compilation. Patch
35557  written by Bernard Spil.
35558
35559- bpo-22915: SAX parser now supports files opened with file descriptor or
35560  bytes path.
35561
35562- bpo-22609: Constructors and update methods of mapping classes in the
35563  collections module now accept the self keyword argument.
35564
35565- bpo-22940: Add readline.append_history_file.
35566
35567- bpo-19676: Added the "namereplace" error handler.
35568
35569- bpo-22788: Add *context* parameter to logging.handlers.HTTPHandler.
35570
35571- bpo-22921: Allow SSLContext to take the *hostname* parameter even if
35572  OpenSSL doesn't support SNI.
35573
35574- bpo-22894: TestCase.subTest() would cause the test suite to be stopped
35575  when in failfast mode, even in the absence of failures.
35576
35577- bpo-22796: HTTP cookie parsing is now stricter, in order to protect
35578  against potential injection attacks.
35579
35580- bpo-22370: Windows detection in pathlib is now more robust.
35581
35582- bpo-22841: Reject coroutines in asyncio add_signal_handler(). Patch by
35583  Ludovic.Gasc.
35584
35585- bpo-19494: Added urllib.request.HTTPBasicPriorAuthHandler. Patch by Matej
35586  Cepl.
35587
35588- bpo-22578: Added attributes to the re.error class.
35589
35590- bpo-22849: Fix possible double free in the io.TextIOWrapper constructor.
35591
35592- bpo-12728: Different Unicode characters having the same uppercase but
35593  different lowercase are now matched in case-insensitive regular
35594  expressions.
35595
35596- bpo-22821: Fixed fcntl() with integer argument on 64-bit big-endian
35597  platforms.
35598
35599- bpo-21650: Add an `--sort-keys` option to json.tool CLI.
35600
35601- bpo-22824: Updated reprlib output format for sets to use set literals.
35602  Patch contributed by Berker Peksag.
35603
35604- bpo-22824: Updated reprlib output format for arrays to display empty
35605  arrays without an unnecessary empty list.  Suggested by Serhiy Storchaka.
35606
35607- bpo-22406: Fixed the uu_codec codec incorrectly ported to 3.x. Based on
35608  patch by Martin Panter.
35609
35610- bpo-17293: uuid.getnode() now determines MAC address on AIX using netstat.
35611  Based on patch by Aivars Kalvāns.
35612
35613- bpo-22769: Fixed ttk.Treeview.tag_has() when called without arguments.
35614
35615- bpo-22417: Verify certificates by default in httplib (PEP 476).
35616
35617- bpo-22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
35618  and above. Patch by Tim Graham.
35619
35620- bpo-22776: Brought excluded code into the scope of a try block in
35621  SysLogHandler.emit().
35622
35623- bpo-22665: Add missing get_terminal_size and SameFileError to
35624  shutil.__all__.
35625
35626- bpo-6623: Remove deprecated Netrc class in the ftplib module. Patch by
35627  Matt Chaput.
35628
35629- bpo-17381: Fixed handling of case-insensitive ranges in regular
35630  expressions.
35631
35632- bpo-22410: Module level functions in the re module now cache compiled
35633  locale-dependent regular expressions taking into account the locale.
35634
35635- bpo-22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) now
35636  return False when the underlying stat call raises NotADirectoryError.
35637
35638- bpo-8876: distutils now falls back to copying files when hard linking
35639  doesn't work. This allows use with special filesystems such as VirtualBox
35640  shared folders.
35641
35642- bpo-22217: Implemented reprs of classes in the zipfile module.
35643
35644- bpo-22457: Honour load_tests in the start_dir of discovery.
35645
35646- bpo-18216: gettext now raises an error when a .mo file has an unsupported
35647  major version number.  Patch by Aaron Hill.
35648
35649- bpo-13918: Provide a locale.delocalize() function which can remove
35650  locale-specific number formatting from a string representing a number,
35651  without then converting it to a specific type.  Patch by Cédric Krier.
35652
35653- bpo-22676: Make the pickling of global objects which don't have a
35654  __module__ attribute less slow.
35655
35656- bpo-18853: Fixed ResourceWarning in shlex.__nain__.
35657
35658- bpo-9351: Defaults set with set_defaults on an argparse subparser are no
35659  longer ignored when also set on the parent parser.
35660
35661- bpo-7559: unittest test loading ImportErrors are reported as import errors
35662  with their import exception rather than as attribute errors after the
35663  import has already failed.
35664
35665- bpo-19746: Make it possible to examine the errors from unittest discovery
35666  without executing the test suite. The new `errors` attribute on TestLoader
35667  exposes these non-fatal errors encountered during discovery.
35668
35669- bpo-21991: Make email.headerregistry's header 'params' attributes be
35670  read-only (MappingProxyType).  Previously the dictionary was modifiable
35671  but a new one was created on each access of the attribute.
35672
35673- bpo-22638: SSLv3 is now disabled throughout the standard library. It can
35674  still be enabled by instantiating a SSLContext manually.
35675
35676- bpo-22641: In asyncio, the default SSL context for client connections is
35677  now created using ssl.create_default_context(), for stronger security.
35678
35679- bpo-17401: Include closefd in io.FileIO repr.
35680
35681- bpo-21338: Add silent mode for compileall. quiet parameters of
35682  compile_{dir, file, path} functions now have a multilevel value. Also, -q
35683  option of the CLI now have a multilevel value. Patch by Thomas Kluyver.
35684
35685- bpo-20152: Convert the array and cmath modules to Argument Clinic.
35686
35687- bpo-18643: Add socket.socketpair() on Windows.
35688
35689- bpo-22435: Fix a file descriptor leak when socketserver bind fails.
35690
35691- bpo-13096: Fixed segfault in CTypes POINTER handling of large values.
35692
35693- bpo-11694: Raise ConversionError in xdrlib as documented.  Patch by Filip
35694  Gruszczyński and Claudiu Popa.
35695
35696- bpo-19380: Optimized parsing of regular expressions.
35697
35698- bpo-1519638: Now unmatched groups are replaced with empty strings in
35699  re.sub() and re.subn().
35700
35701- bpo-18615: sndhdr.what/whathdr now return a namedtuple.
35702
35703- bpo-22462: Fix pyexpat's creation of a dummy frame to make it appear in
35704  exception tracebacks.
35705
35706- bpo-21965: Add support for in-memory SSL to the ssl module.  Patch by
35707  Geert Jansen.
35708
35709- bpo-21173: Fix len() on a WeakKeyDictionary when .clear() was called with
35710  an iterator alive.
35711
35712- bpo-11866: Eliminated race condition in the computation of names for new
35713  threads.
35714
35715- bpo-21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is
35716  mutated while iterating.  Patch by Olivier Grisel.
35717
35718- bpo-11271: concurrent.futures.Executor.map() now takes a *chunksize*
35719  argument to allow batching of tasks in child processes and improve
35720  performance of ProcessPoolExecutor.  Patch by Dan O'Reilly.
35721
35722- bpo-21883: os.path.join() and os.path.relpath() now raise a TypeError with
35723  more helpful error message for unsupported or mismatched types of
35724  arguments.
35725
35726- bpo-22219: The zipfile module CLI now adds entries for directories
35727  (including empty directories) in ZIP file.
35728
35729- bpo-22449: In the ssl.SSLContext.load_default_certs, consult the
35730  environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows.
35731
35732- bpo-22508: The email.__version__ variable has been removed; the email code
35733  is no longer shipped separately from the stdlib, and __version__ hasn't
35734  been updated in several releases.
35735
35736- bpo-20076: Added non derived UTF-8 aliases to locale aliases table.
35737
35738- bpo-20079: Added locales supported in glibc 2.18 to locale alias table.
35739
35740- bpo-20218: Added convenience methods read_text/write_text and read_bytes/
35741  write_bytes to pathlib.Path objects.
35742
35743- bpo-22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
35744  os.posix_fallocate() because their prototypes in system headers are wrong.
35745
35746- bpo-22517: When an io.BufferedRWPair object is deallocated, clear its
35747  weakrefs.
35748
35749- bpo-22437: Number of capturing groups in regular expression is no longer
35750  limited by 100.
35751
35752- bpo-17442: InteractiveInterpreter now displays the full chained traceback
35753  in its showtraceback method, to match the built in interactive
35754  interpreter.
35755
35756- bpo-23392: Added tests for marshal C API that works with FILE*.
35757
35758- bpo-10510: distutils register and upload methods now use HTML standards
35759  compliant CRLF line endings.
35760
35761- bpo-9850: Fixed macpath.join() for empty first component.  Patch by Oleg
35762  Oshmyan.
35763
35764- bpo-5309: distutils' build and build_ext commands now accept a ``-j``
35765  option to enable parallel building of extension modules.
35766
35767- bpo-22448: Improve canceled timer handles cleanup to prevent unbound
35768  memory usage. Patch by Joshua Moore-Oliva.
35769
35770- bpo-22427: TemporaryDirectory no longer attempts to clean up twice when
35771  used in the with statement in generator.
35772
35773- bpo-22362: Forbidden ambiguous octal escapes out of range 0-0o377 in
35774  regular expressions.
35775
35776- bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS
35777  directory attributes.
35778
35779- bpo-21866: ZipFile.close() no longer writes ZIP64 central directory
35780  records if allowZip64 is false.
35781
35782- bpo-22278: Fix urljoin problem with relative urls, a regression observed
35783  after changes to issue22118 were submitted.
35784
35785- bpo-22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
35786  module. Removed trailing spaces in debugging output.
35787
35788- bpo-22423: Unhandled exception in thread no longer causes unhandled
35789  AttributeError when sys.stderr is None.
35790
35791- bpo-21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line
35792  buffering, rather than block buffering.  Patch by Akira Li.
35793
35794- bpo-21091: Fix API bug: email.message.EmailMessage.is_attachment is now a
35795  method.
35796
35797- bpo-21079: Fix email.message.EmailMessage.is_attachment to return the
35798  correct result when the header has parameters as well as a value.
35799
35800- bpo-22247: Add NNTPError to nntplib.__all__.
35801
35802- bpo-22366: urllib.request.urlopen will accept a context object
35803  (SSLContext) as an argument which will then be used for HTTPS connection.
35804  Patch by Alex Gaynor.
35805
35806- bpo-4180: The warnings registries are now reset when the filters are
35807  modified.
35808
35809- bpo-22419: Limit the length of incoming HTTP request in wsgiref server to
35810  65536 bytes and send a 414 error code for higher lengths. Patch
35811  contributed by Devin Cook.
35812
35813- Lax cookie parsing in http.cookies could be a security issue when combined
35814  with non-standard cookie handling in some web browsers.  Reported by
35815  Sergey Bobrov.
35816
35817- bpo-20537: logging methods now accept an exception instance as well as a
35818  Boolean value or exception tuple. Thanks to Yury Selivanov for the patch.
35819
35820- bpo-22384: An exception in Tkinter callback no longer crashes the program
35821  when it is run with pythonw.exe.
35822
35823- bpo-22168: Prevent turtle AttributeError with non-default Canvas on OS X.
35824
35825- bpo-21147: sqlite3 now raises an exception if the request contains a null
35826  character instead of truncating it.  Based on patch by Victor Stinner.
35827
35828- bpo-13968: The glob module now supports recursive search in subdirectories
35829  using the ``**`` pattern.
35830
35831- bpo-21951: Fixed a crash in Tkinter on AIX when called Tcl command with
35832  empty string or tuple argument.
35833
35834- bpo-21951: Tkinter now most likely raises MemoryError instead of crash if
35835  the memory allocation fails.
35836
35837- bpo-22338: Fix a crash in the json module on memory allocation failure.
35838
35839- bpo-12410: imaplib.IMAP4 now supports the context management protocol.
35840  Original patch by Tarek Ziadé.
35841
35842- bpo-21270: We now override tuple methods in mock.call objects so that they
35843  can be used as normal call attributes.
35844
35845- bpo-16662: load_tests() is now unconditionally run when it is present in a
35846  package's __init__.py.  TestLoader.loadTestsFromModule() still accepts
35847  use_load_tests, but it is deprecated and ignored.  A new keyword-only
35848  attribute `pattern` is added and documented.  Patch given by Robert
35849  Collins, tweaked by Barry Warsaw.
35850
35851- bpo-22226: First letter no longer is stripped from the "status" key in the
35852  result of Treeview.heading().
35853
35854- bpo-19524: Fixed resource leak in the HTTP connection when an invalid
35855  response is received.  Patch by Martin Panter.
35856
35857- bpo-20421: Add a .version() method to SSL sockets exposing the actual
35858  protocol version in use.
35859
35860- bpo-19546: configparser exceptions no longer expose implementation
35861  details. Chained KeyErrors are removed, which leads to cleaner tracebacks.
35862  Patch by Claudiu Popa.
35863
35864- bpo-22051: turtledemo no longer reloads examples to re-run them.
35865  Initialization of variables and gui setup should be done in main(), which
35866  is called each time a demo is run, but not on import.
35867
35868- bpo-21933: Turtledemo users can change the code font size with a menu
35869  selection or control(command) '-' or '+' or control-mousewheel. Original
35870  patch by Lita Cho.
35871
35872- bpo-21597: The separator between the turtledemo text pane and the drawing
35873  canvas can now be grabbed and dragged with a mouse.  The code text pane
35874  can be widened to easily view or copy the full width of the text.  The
35875  canvas can be widened on small screens.  Original patches by Jan Kanis and
35876  Lita Cho.
35877
35878- bpo-18132: Turtledemo buttons no longer disappear when the window is
35879  shrunk.  Original patches by Jan Kanis and Lita Cho.
35880
35881- bpo-22043: time.monotonic() is now always available.
35882  ``threading.Lock.acquire()``, ``threading.RLock.acquire()`` and socket
35883  operations now use a monotonic clock, instead of the system clock, when a
35884  timeout is used.
35885
35886- bpo-21527: Add a default number of workers to ThreadPoolExecutor equal to
35887  5 times the number of CPUs.  Patch by Claudiu Popa.
35888
35889- bpo-22216: smtplib now resets its state more completely after a quit.  The
35890  most obvious consequence of the previous behavior was a STARTTLS failure
35891  during a connect/starttls/quit/connect/starttls sequence.
35892
35893- bpo-22098: ctypes' BigEndianStructure and LittleEndianStructure now define
35894  an empty __slots__ so that subclasses don't always get an instance dict.
35895  Patch by Claudiu Popa.
35896
35897- bpo-22185: Fix an occasional RuntimeError in threading.Condition.wait()
35898  caused by mutation of the waiters queue without holding the lock.  Patch
35899  by Doug Zongker.
35900
35901- bpo-22287: On UNIX, _PyTime_gettimeofday() now uses
35902  clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now
35903  depends on the librt library on Solaris and on Linux (only with glibc
35904  older than 2.17).
35905
35906- bpo-22182: Use e.args to unpack exceptions correctly in
35907  distutils.file_util.move_file. Patch by Claudiu Popa.
35908
35909- The webbrowser module now uses subprocess's start_new_session=True rather
35910  than a potentially risky preexec_fn=os.setsid call.
35911
35912- bpo-22042: signal.set_wakeup_fd(fd) now raises an exception if the file
35913  descriptor is in blocking mode.
35914
35915- bpo-16808: inspect.stack() now returns a named tuple instead of a tuple.
35916  Patch by Daniel Shahaf.
35917
35918- bpo-22236: Fixed Tkinter images copying operations in NoDefaultRoot mode.
35919
35920- bpo-2527: Add a *globals* argument to timeit functions, in order to
35921  override the globals namespace in which the timed code is executed. Patch
35922  by Ben Roberts.
35923
35924- bpo-22118: Switch urllib.parse to use RFC 3986 semantics for the
35925  resolution of relative URLs, rather than RFCs 1808 and 2396. Patch by
35926  Demian Brecht.
35927
35928- bpo-21549: Added the "members" parameter to TarFile.list().
35929
35930- bpo-19628: Allow compileall recursion depth to be specified with a -r
35931  option.
35932
35933- bpo-15696: Add a __sizeof__ implementation for mmap objects on Windows.
35934
35935- bpo-22068: Avoided reference loops with Variables and Fonts in Tkinter.
35936
35937- bpo-22165: SimpleHTTPRequestHandler now supports undecodable file names.
35938
35939- bpo-15381: Optimized line reading in io.BytesIO.
35940
35941- bpo-8797: Raise HTTPError on failed Basic Authentication immediately.
35942  Initial patch by Sam Bull.
35943
35944- bpo-20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() in
35945  the mailbox module.
35946
35947- bpo-21448: Changed FeedParser feed() to avoid O(N\ :sup:`2`) behavior when
35948  parsing long line. Original patch by Raymond Hettinger.
35949
35950- bpo-22184: The functools LRU Cache decorator factory now gives an earlier
35951  and clearer error message when the user forgets the required parameters.
35952
35953- bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
35954  AIX.  Based on patch by Delhallt.
35955
35956- bpo-21725: Added support for RFC 6531 (SMTPUTF8) in smtpd.
35957
35958- bpo-22176: Update the ctypes module's libffi to v3.1.  This release adds
35959  support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
35960  architectures.
35961
35962- bpo-5411: Added support for the "xztar" format in the shutil module.
35963
35964- bpo-21121: Don't force 3rd party C extensions to be built with
35965  -Werror=declaration-after-statement.
35966
35967- bpo-21975: Fixed crash when using uninitialized sqlite3.Row (in particular
35968  when unpickling pickled sqlite3.Row).  sqlite3.Row is now initialized in
35969  the __new__() method.
35970
35971- bpo-20170: Convert posixmodule to use Argument Clinic.
35972
35973- bpo-21539: Add an *exists_ok* argument to `Pathlib.mkdir()` to mimic
35974  `mkdir -p` and `os.makedirs()` functionality.  When true, ignore
35975  FileExistsErrors.  Patch by Berker Peksag.
35976
35977- bpo-22127: Bypass IDNA for pure-ASCII host names in the socket module (in
35978  particular for numeric IPs).
35979
35980- bpo-21047: set the default value for the *convert_charrefs* argument of
35981  HTMLParser to True.  Patch by Berker Peksag.
35982
35983- Add an __all__ to html.entities.
35984
35985- bpo-15114: the strict mode and argument of HTMLParser, HTMLParser.error,
35986  and the HTMLParserError exception have been removed.
35987
35988- bpo-22085: Dropped support of Tk 8.3 in Tkinter.
35989
35990- bpo-21580: Now Tkinter correctly handles bytes arguments passed to Tk. In
35991  particular this allows initializing images from binary data.
35992
35993- bpo-22003: When initialized from a bytes object, io.BytesIO() now defers
35994  making a copy until it is mutated, improving performance and memory use on
35995  some use cases. Patch by David Wilson.
35996
35997- bpo-22018: On Windows, signal.set_wakeup_fd() now also supports sockets. A
35998  side effect is that Python depends to the WinSock library.
35999
36000- bpo-22054: Add os.get_blocking() and os.set_blocking() functions to get
36001  and set the blocking mode of a file descriptor (False if the O_NONBLOCK
36002  flag is set, True otherwise). These functions are not available on
36003  Windows.
36004
36005- bpo-17172: Make turtledemo start as active on OS X even when run with
36006  subprocess. Patch by Lita Cho.
36007
36008- bpo-21704: Fix build error for _multiprocessing when semaphores are not
36009  available. Patch by Arfrever Frehtes Taifersar Arahesis.
36010
36011- bpo-20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic. Patch
36012  by Vajrasky Kok.
36013
36014- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
36015  on closed socket. repr(socket.socket) already works fine.
36016
36017- bpo-22033: Reprs of most Python implemented classes now contain actual
36018  class name instead of hardcoded one.
36019
36020- bpo-21947: The dis module can now disassemble generator-iterator objects
36021  based on their gi_code attribute. Patch by Clement Rouault.
36022
36023- bpo-16133: The asynchat.async_chat.handle_read() method now ignores
36024  BlockingIOError exceptions.
36025
36026- bpo-22044: Fixed premature DECREF in call_tzinfo_method. Patch by Tom
36027  Flanagan.
36028
36029- bpo-19884: readline: Disable the meta modifier key if stdout is not a
36030  terminal to not write the ANSI sequence ``"\033[1034h"`` into stdout. This
36031  sequence is used on some terminal (ex: TERM=xterm-256color") to enable
36032  support of 8 bit characters.
36033
36034- bpo-4350: Removed a number of out-of-dated and non-working for a long time
36035  Tkinter methods.
36036
36037- bpo-6167: Scrollbar.activate() now returns the name of active element if
36038  the argument is not specified.  Scrollbar.set() now always accepts only 2
36039  arguments.
36040
36041- bpo-15275: Clean up and speed up the ntpath module.
36042
36043- bpo-21888: plistlib's load() and loads() now work if the fmt parameter is
36044  specified.
36045
36046- bpo-22032: __qualname__ instead of __name__ is now always used to format
36047  fully qualified class names of Python implemented classes.
36048
36049- bpo-22031: Reprs now always use hexadecimal format with the "0x" prefix
36050  when contain an id in form " at 0x...".
36051
36052- bpo-22018: signal.set_wakeup_fd() now raises an OSError instead of a
36053  ValueError on ``fstat()`` failure.
36054
36055- bpo-21044: tarfile.open() now handles fileobj with an integer 'name'
36056  attribute.  Based on patch by Antoine Pietri.
36057
36058- bpo-21966: Respect -q command-line option when code module is ran.
36059
36060- bpo-19076: Don't pass the redundant 'file' argument to self.error().
36061
36062- bpo-16382: Improve exception message of warnings.warn() for bad category.
36063  Initial patch by Phil Elson.
36064
36065- bpo-21932: os.read() now uses a :c:func:`Py_ssize_t` type instead of
36066  :c:expr:`int` for the size to support reading more than 2 GB at once. On
36067  Windows, the size is truncated to INT_MAX. As any call to os.read(), the
36068  OS may read less bytes than the number of requested bytes.
36069
36070- bpo-21942: Fixed source file viewing in pydoc's server mode on Windows.
36071
36072- bpo-11259: asynchat.async_chat().set_terminator() now raises a ValueError
36073  if the number of received bytes is negative.
36074
36075- bpo-12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
36076  get a bytes string
36077
36078- bpo-21707: Add missing kwonlyargcount argument to
36079  ModuleFinder.replace_paths_in_code().
36080
36081- bpo-20639: calling Path.with_suffix('') allows removing the suffix again.
36082  Patch by July Tikhonov.
36083
36084- bpo-21714: Disallow the construction of invalid paths using
36085  Path.with_name().  Original patch by Antony Lee.
36086
36087- bpo-15014: Added 'auth' method to smtplib to make implementing auth
36088  mechanisms simpler, and used it internally in the login method.
36089
36090- bpo-21151: Fixed a segfault in the winreg module when ``None`` is passed
36091  as a ``REG_BINARY`` value to SetValueEx.  Patch by John Ehresman.
36092
36093- bpo-21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
36094  it ignored I/O errors if at least the first C call read() succeed.
36095
36096- bpo-5800: headers parameter of wsgiref.headers.Headers is now optional.
36097  Initial patch by Pablo Torres Navarrete and SilentGhost.
36098
36099- bpo-21781: ssl.RAND_add() now supports strings longer than 2 GB.
36100
36101- bpo-21679: Prevent extraneous fstat() calls during open().  Patch by
36102  Bohuslav Kabrda.
36103
36104- bpo-21863: cProfile now displays the module name of C extension functions,
36105  in addition to their own name.
36106
36107- bpo-11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
36108  object is destroyed. The destructor now closes the file if needed. The
36109  close() method can now be called twice: the second call does nothing.
36110
36111- bpo-21858: Better handling of Python exceptions in the sqlite3 module.
36112
36113- bpo-21476: Make sure the email.parser.BytesParser TextIOWrapper is
36114  discarded after parsing, so the input file isn't unexpectedly closed.
36115
36116- bpo-20295: imghdr now recognizes OpenEXR format images.
36117
36118- bpo-21729: Used the "with" statement in the dbm.dumb module to ensure
36119  files closing. Patch by Claudiu Popa.
36120
36121- bpo-21491: socketserver: Fix a race condition in child processes reaping.
36122
36123- bpo-21719: Added the ``st_file_attributes`` field to os.stat_result on
36124  Windows.
36125
36126- bpo-21832: Require named tuple inputs to be exact strings.
36127
36128- bpo-21722: The distutils "upload" command now exits with a non-zero return
36129  code when uploading fails.  Patch by Martin Dengler.
36130
36131- bpo-21723: asyncio.Queue: support any type of number (ex: float) for the
36132  maximum size. Patch written by Vajrasky Kok.
36133
36134- bpo-21711: support for "site-python" directories has now been removed from
36135  the site module (it was deprecated in 3.4).
36136
36137- bpo-17552: new socket.sendfile() method allowing a file to be sent over a
36138  socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo
36139  Rodola'.
36140
36141- bpo-18039: dbm.dump.open() now always creates a new database when the flag
36142  has the value 'n'.  Patch by Claudiu Popa.
36143
36144- bpo-21326: Add a new is_closed() method to asyncio.BaseEventLoop.
36145  run_forever() and run_until_complete() methods of asyncio.BaseEventLoop
36146  now raise an exception if the event loop was closed.
36147
36148- bpo-21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
36149  before checking for a CGI script at that path.
36150
36151- bpo-21310: Fixed possible resource leak in failed open().
36152
36153- bpo-21256: Printout of keyword args should be in deterministic order in a
36154  mock function call. This will help to write better doctests.
36155
36156- bpo-21677: Fixed chaining nonnormalized exceptions in io close() methods.
36157
36158- bpo-11709: Fix the pydoc.help function to not fail when sys.stdin is not a
36159  valid file.
36160
36161- bpo-21515: tempfile.TemporaryFile now uses os.O_TMPFILE flag is available.
36162
36163- bpo-13223: Fix pydoc.writedoc so that the HTML documentation for methods
36164  that use 'self' in the example code is generated correctly.
36165
36166- bpo-21463: In urllib.request, fix pruning of the FTP cache.
36167
36168- bpo-21618: The subprocess module could fail to close open fds that were
36169  inherited by the calling process and already higher than POSIX resource
36170  limits would otherwise allow.  On systems with a functioning /proc/self/fd
36171  or /dev/fd interface the max is now ignored and all fds are closed.
36172
36173- bpo-20383: Introduce importlib.util.module_from_spec() as the preferred
36174  way to create a new module.
36175
36176- bpo-21552: Fixed possible integer overflow of too long string lengths in
36177  the tkinter module on 64-bit platforms.
36178
36179- bpo-14315: The zipfile module now ignores extra fields in the central
36180  directory that are too short to be parsed instead of letting a
36181  struct.unpack error bubble up as this "bad data" appears in many real
36182  world zip files in the wild and is ignored by other zip tools.
36183
36184- bpo-13742: Added "key" and "reverse" parameters to heapq.merge(). (First
36185  draft of patch contributed by Simon Sapin.)
36186
36187- bpo-21402: tkinter.ttk now works when default root window is not set.
36188
36189- bpo-3015: _tkinter.create() now creates tkapp object with wantobject=1 by
36190  default.
36191
36192- bpo-10203: sqlite3.Row now truly supports sequence protocol.  In
36193  particular it supports reverse() and negative indices.  Original patch by
36194  Claudiu Popa.
36195
36196- bpo-18807: If copying (no symlinks) specified for a venv, then the python
36197  interpreter aliases (python, python3) are now created by copying rather
36198  than symlinking.
36199
36200- bpo-20197: Added support for the WebP image type in the imghdr module.
36201  Patch by Fabrice Aneche and Claudiu Popa.
36202
36203- bpo-21513: Speedup some properties of IP addresses (IPv4Address,
36204  IPv6Address) such as .is_private or .is_multicast.
36205
36206- bpo-21137: Improve the repr for threading.Lock() and its variants by
36207  showing the "locked" or "unlocked" status.  Patch by Berker Peksag.
36208
36209- bpo-21538: The plistlib module now supports loading of binary plist files
36210  when reference or offset size is not a power of two.
36211
36212- bpo-21455: Add a default backlog to socket.listen().
36213
36214- bpo-21525: Most Tkinter methods which accepted tuples now accept lists
36215  too.
36216
36217- bpo-22166: With the assistance of a new internal _codecs._forget_codec
36218  helping function, test_codecs now clears the encoding caches to avoid the
36219  appearance of a reference leak
36220
36221- bpo-22236: Tkinter tests now don't reuse default root window.  New root
36222  window is created for every test class.
36223
36224- bpo-10744: Fix :pep:`3118` format strings on ctypes objects with a
36225  nontrivial shape.
36226
36227- bpo-20826: Optimize ipaddress.collapse_addresses().
36228
36229- bpo-21487: Optimize ipaddress.summarize_address_range() and
36230  ipaddress.{IPv4Network,IPv6Network}.subnets().
36231
36232- bpo-21486: Optimize parsing of netmasks in ipaddress.IPv4Network and
36233  ipaddress.IPv6Network.
36234
36235- bpo-13916: Disallowed the surrogatepass error handler for non UTF-\*
36236  encodings.
36237
36238- bpo-20998: Fixed re.fullmatch() of repeated single character pattern with
36239  ignore case. Original patch by Matthew Barnett.
36240
36241- bpo-21075: fileinput.FileInput now reads bytes from standard stream if
36242  binary mode is specified.  Patch by Sam Kimbrel.
36243
36244- bpo-19775: Add a samefile() method to pathlib Path objects.  Initial patch
36245  by Vajrasky Kok.
36246
36247- bpo-21226: Set up modules properly in PyImport_ExecCodeModuleObject (and
36248  friends).
36249
36250- bpo-21398: Fix a unicode error in the pydoc pager when the documentation
36251  contains characters not encodable to the stdout encoding.
36252
36253- bpo-16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an
36254  (address, netmask) tuple argument, so as to easily construct network
36255  objects from existing addresses.
36256
36257- bpo-21156: importlib.abc.InspectLoader.source_to_code() is now a
36258  staticmethod.
36259
36260- bpo-21424: Simplified and optimized heaqp.nlargest() and nmsmallest() to
36261  make fewer tuple comparisons.
36262
36263- bpo-21396: Fix TextIOWrapper(..., write_through=True) to not force a
36264  flush() on the underlying binary stream.  Patch by akira.
36265
36266- bpo-18314: Unlink now removes junctions on Windows. Patch by Kim Gräsman
36267
36268- bpo-21088: Bugfix for curses.window.addch() regression in 3.4.0. In
36269  porting to Argument Clinic, the first two arguments were reversed.
36270
36271- bpo-21407: _decimal: The module now supports function signatures.
36272
36273- bpo-10650: Remove the non-standard 'watchexp' parameter from the
36274  Decimal.quantize() method in the Python version.  It had never been
36275  present in the C version.
36276
36277- bpo-21469: Reduced the risk of false positives in robotparser by checking
36278  to make sure that robots.txt has been read or does not exist prior to
36279  returning True in can_fetch().
36280
36281- bpo-19414: Have the OrderedDict mark deleted links as unusable. This gives
36282  an early failure if the link is deleted during iteration.
36283
36284- bpo-21421: Add __slots__ to the MappingViews ABC. Patch by Josh Rosenberg.
36285
36286- bpo-21101: Eliminate double hashing in the C speed-up code for
36287  collections.Counter().
36288
36289- bpo-21321: itertools.islice() now releases the reference to the source
36290  iterator when the slice is exhausted.  Patch by Anton Afanasyev.
36291
36292- bpo-21057: TextIOWrapper now allows the underlying binary stream's read()
36293  or read1() method to return an arbitrary bytes-like object (such as a
36294  memoryview). Patch by Nikolaus Rath.
36295
36296- bpo-20951: SSLSocket.send() now raises either SSLWantReadError or
36297  SSLWantWriteError on a non-blocking socket if the operation would block.
36298  Previously, it would return 0.  Patch by Nikolaus Rath.
36299
36300- bpo-13248: removed previously deprecated asyncore.dispatcher __getattr__
36301  cheap inheritance hack.
36302
36303- bpo-9815: assertRaises now tries to clear references to local variables in
36304  the exception's traceback.
36305
36306- bpo-19940: ssl.cert_time_to_seconds() now interprets the given time string
36307  in the UTC timezone (as specified in RFC 5280), not the local timezone.
36308
36309- bpo-13204: Calling sys.flags.__new__ would crash the interpreter, now it
36310  raises a TypeError.
36311
36312- bpo-19385: Make operations on a closed dbm.dumb database always raise the
36313  same exception.
36314
36315- bpo-21207: Detect when the os.urandom cached fd has been closed or
36316  replaced, and open it anew.
36317
36318- bpo-21291: subprocess's Popen.wait() is now thread safe so that multiple
36319  threads may be calling wait() or poll() on a Popen instance at the same
36320  time without losing the Popen.returncode value.
36321
36322- bpo-21127: Path objects can now be instantiated from str subclass
36323  instances (such as ``numpy.str_``).
36324
36325- bpo-15002: urllib.response object to use _TemporaryFileWrapper (and
36326  _TemporaryFileCloser) facility. Provides a better way to handle file
36327  descriptor close. Patch contributed by Christian Theune.
36328
36329- bpo-12220: mindom now raises a custom ValueError indicating it doesn't
36330  support spaces in URIs instead of letting a 'split' ValueError bubble up.
36331
36332- bpo-21068: The ssl.PROTOCOL* constants are now enum members.
36333
36334- bpo-21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.
36335
36336- bpo-21262: New method assert_not_called for Mock. It raises AssertionError
36337  if the mock has been called.
36338
36339- bpo-21238: New keyword argument `unsafe` to Mock. It raises
36340  `AttributeError` incase of an attribute startswith assert or assret.
36341
36342- bpo-20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not
36343  PROTOCOL_SSLv3, for maximum compatibility.
36344
36345- bpo-21239: patch.stopall() didn't work deterministically when the same
36346  name was patched more than once.
36347
36348- bpo-21203: Updated fileConfig and dictConfig to remove inconsistencies.
36349  Thanks to Jure Koren for the patch.
36350
36351- bpo-21222: Passing name keyword argument to mock.create_autospec now
36352  works.
36353
36354- bpo-21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
36355
36356- bpo-17498: Some SMTP servers disconnect after certain errors, violating
36357  strict RFC conformance.  Instead of losing the error code when we issue
36358  the subsequent RSET, smtplib now returns the error code and defers raising
36359  the SMTPServerDisconnected error until the next command is issued.
36360
36361- bpo-17826: setting an iterable side_effect on a mock function created by
36362  create_autospec now works. Patch by Kushal Das.
36363
36364- bpo-7776: Fix ``Host:`` header and reconnection when using
36365  http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
36366
36367- bpo-20968: unittest.mock.MagicMock now supports division. Patch by
36368  Johannes Baiter.
36369
36370- bpo-21529: Fix arbitrary memory access in JSONDecoder.raw_decode with a
36371  negative second parameter. Bug reported by Guido Vranken. (See also:
36372  CVE-2014-4616)
36373
36374- bpo-21169: getpass now handles non-ascii characters that the input stream
36375  encoding cannot encode by re-encoding using the replace error handler.
36376
36377- bpo-21171: Fixed undocumented filter API of the rot13 codec. Patch by
36378  Berker Peksag.
36379
36380- bpo-20539: Improved math.factorial error message for large positive inputs
36381  and changed exception type (OverflowError -> ValueError) for large
36382  negative inputs.
36383
36384- bpo-21172: isinstance check relaxed from dict to collections.Mapping.
36385
36386- bpo-21155: asyncio.EventLoop.create_unix_server() now raises a ValueError
36387  if path and sock are specified at the same time.
36388
36389- bpo-21136: Avoid unnecessary normalization of Fractions resulting from
36390  power and other operations.  Patch by Raymond Hettinger.
36391
36392- bpo-17621: Introduce importlib.util.LazyLoader.
36393
36394- bpo-21076: signal module constants were turned into enums. Patch by
36395  Giampaolo Rodola'.
36396
36397- bpo-20636: Improved the repr of Tkinter widgets.
36398
36399- bpo-19505: The items, keys, and values views of OrderedDict now support
36400  reverse iteration using reversed().
36401
36402- bpo-21149: Improved thread-safety in logging cleanup during interpreter
36403  shutdown. Thanks to Devin Jeanpierre for the patch.
36404
36405- bpo-21058: Fix a leak of file descriptor in
36406  :func:`tempfile.NamedTemporaryFile`, close the file descriptor if
36407  :func:`io.open` fails
36408
36409- bpo-21200: Return None from pkgutil.get_loader() when __spec__ is missing.
36410
36411- bpo-21013: Enhance ssl.create_default_context() when used for server side
36412  sockets to provide better security by default.
36413
36414- bpo-20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a
36415  TypeError if the second argument is not a string or compiled regex.
36416
36417- bpo-20633: Replace relative import by absolute import.
36418
36419- bpo-20980: Stop wrapping exception when using ThreadPool.
36420
36421- bpo-21082: In os.makedirs, do not set the process-wide umask. Note this
36422  changes behavior of makedirs when exist_ok=True.
36423
36424- bpo-20990: Fix issues found by pyflakes for multiprocessing.
36425
36426- bpo-21015: SSL contexts will now automatically select an elliptic curve
36427  for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise default to
36428  "prime256v1".
36429
36430- bpo-21000: Improve the command-line interface of json.tool.
36431
36432- bpo-20995: Enhance default ciphers used by the ssl module to enable better
36433  security and prioritize perfect forward secrecy.
36434
36435- bpo-20884: Don't assume that __file__ is defined on importlib.__init__.
36436
36437- bpo-21499: Ignore __builtins__ in several test_importlib.test_api tests.
36438
36439- bpo-20627: xmlrpc.client.ServerProxy is now a context manager.
36440
36441- bpo-19165: The formatter module now raises DeprecationWarning instead of
36442  PendingDeprecationWarning.
36443
36444- bpo-13936: Remove the ability of datetime.time instances to be considered
36445  false in boolean contexts.
36446
36447- bpo-18931: selectors module now supports /dev/poll on Solaris. Patch by
36448  Giampaolo Rodola'.
36449
36450- bpo-19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),
36451  :py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the
36452  ``surrogateescape`` error handler, instead of the ``strict`` error
36453  handler.
36454
36455- bpo-20574: Implement incremental decoder for cp65001 code (Windows code
36456  page 65001, Microsoft UTF-8).
36457
36458- bpo-20879: Delay the initialization of encoding and decoding tables for
36459  base32, ascii85 and base85 codecs in the base64 module, and delay the
36460  initialization of the unquote_to_bytes() table of the urllib.parse module,
36461  to not waste memory if these modules are not used.
36462
36463- bpo-19157: Include the broadcast address in the usuable hosts for IPv6 in
36464  ipaddress.
36465
36466- bpo-11599: When an external command (e.g. compiler) fails, distutils now
36467  prints out the whole command line (instead of just the command name) if
36468  the environment variable DISTUTILS_DEBUG is set.
36469
36470- bpo-4931: distutils should not produce unhelpful "error: None" messages
36471  anymore. distutils.util.grok_environment_error is kept but doc-deprecated.
36472
36473- bpo-20875: Prevent possible gzip "'read' is not defined" NameError. Patch
36474  by Claudiu Popa.
36475
36476- bpo-11558: ``email.message.Message.attach`` now returns a more useful
36477  error message if ``attach`` is called on a message for which
36478  ``is_multipart`` is False.
36479
36480- bpo-20283: RE pattern methods now accept the string keyword parameters as
36481  documented. The pattern and source keyword parameters are left as
36482  deprecated aliases.
36483
36484- bpo-20778: Fix modulefinder to work with bytecode-only modules.
36485
36486- bpo-20791: copy.copy() now doesn't make a copy when the input is a bytes
36487  object. Initial patch by Peter Otten.
36488
36489- bpo-19748: On AIX, time.mktime() now raises an OverflowError for year
36490  outsize range [1902; 2037].
36491
36492- bpo-19573: inspect.signature: Use enum for parameter kind constants.
36493
36494- bpo-20726: inspect.signature: Make Signature and Parameter picklable.
36495
36496- bpo-17373: Add inspect.Signature.from_callable method.
36497
36498- bpo-20378: Improve repr of inspect.Signature and inspect.Parameter.
36499
36500- bpo-20816: Fix inspect.getcallargs() to raise correct TypeError for
36501  missing keyword-only arguments. Patch by Jeremiah Lowin.
36502
36503- bpo-20817: Fix inspect.getcallargs() to fail correctly if more than 3
36504  arguments are missing. Patch by Jeremiah Lowin.
36505
36506- bpo-6676: Ensure a meaningful exception is raised when attempting to parse
36507  more than one XML document per pyexpat xmlparser instance. (Original
36508  patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested
36509  wording by David Gutteridge)
36510
36511- bpo-21117: Fix inspect.signature to better support functools.partial. Due
36512  to the specifics of functools.partial implementation,
36513  positional-or-keyword arguments passed as keyword arguments become
36514  keyword-only.
36515
36516- bpo-20334: inspect.Signature and inspect.Parameter are now hashable.
36517  Thanks to Antony Lee for bug reports and suggestions.
36518
36519- bpo-15916: doctest.DocTestSuite returns an empty unittest.TestSuite
36520  instead of raising ValueError if it finds no tests
36521
36522- bpo-21209: Fix asyncio.tasks.CoroWrapper to workaround a bug in yield-from
36523  implementation in CPythons prior to 3.4.1.
36524
36525- asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream
36526  issue #163).
36527
36528- bpo-21311: Avoid exception in _osx_support with non-standard compiler
36529  configurations. Patch by John Szakmeister.
36530
36531- bpo-11571: Ensure that the turtle window becomes the topmost window when
36532  launched on OS X.
36533
36534- bpo-21801: Validate that __signature__ is None or an instance of
36535  Signature.
36536
36537- bpo-21923: Prevent AttributeError in
36538  distutils.sysconfig.customize_compiler due to possible uninitialized
36539  _config_vars.
36540
36541- bpo-21323: Fix http.server to again handle scripts in CGI subdirectories,
36542  broken by the fix for security issue #19435.  Patch by Zach Byrne.
36543
36544- bpo-22733: Fix ffi_prep_args not zero-extending argument values correctly
36545  on 64-bit Windows.
36546
36547- bpo-23302: Default to TCP_NODELAY=1 upon establishing an HTTPConnection.
36548  Removed use of hard-coded MSS as it's an optimization that's no longer
36549  needed with Nagle disabled.
36550
36551IDLE
36552----
36553
36554- bpo-20577: Configuration of the max line length for the FormatParagraph
36555  extension has been moved from the General tab of the Idle preferences
36556  dialog to the FormatParagraph tab of the Config Extensions dialog. Patch
36557  by Tal Einat.
36558
36559- bpo-16893: Update Idle doc chapter to match current Idle and add new
36560  information.
36561
36562- bpo-3068: Add Idle extension configuration dialog to Options menu. Changes
36563  are written to HOME/.idlerc/config-extensions.cfg. Original patch by Tal
36564  Einat.
36565
36566- bpo-16233: A module browser (File : Class Browser, Alt+C) requires an
36567  editor window with a filename.  When Class Browser is requested otherwise,
36568  from a shell, output window, or 'Untitled' editor, Idle no longer displays
36569  an error box. It now pops up an Open Module box (Alt+M). If a valid name
36570  is entered and a module is opened, a corresponding browser is also opened.
36571
36572- bpo-4832: Save As to type Python files automatically adds .py to the name
36573  you enter (even if your system does not display it).  Some systems
36574  automatically add .txt when type is Text files.
36575
36576- bpo-21986: Code objects are not normally pickled by the pickle module. To
36577  match this, they are no longer pickled when running under Idle.
36578
36579- bpo-17390: Adjust Editor window title; remove 'Python', move version to
36580  end.
36581
36582- bpo-14105: Idle debugger breakpoints no longer disappear when inserting or
36583  deleting lines.
36584
36585- bpo-17172: Turtledemo can now be run from Idle. Currently, the entry is on
36586  the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita
36587  Cho.
36588
36589- bpo-21765: Add support for non-ascii identifiers to HyperParser.
36590
36591- bpo-21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav
36592  Heblikar.
36593
36594- bpo-18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
36595
36596- bpo-21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
36597
36598- bpo-21686: add unittest for HyperParser. Original patch by Saimadhav
36599  Heblikar.
36600
36601- bpo-12387: Add missing upper(lower)case versions of default Windows key
36602  bindings for Idle so Caps Lock does not disable them. Patch by Roger
36603  Serwy.
36604
36605- bpo-21695: Closing a Find-in-files output window while the search is still
36606  in progress no longer closes Idle.
36607
36608- bpo-18910: Add unittest for textView. Patch by Phil Webster.
36609
36610- bpo-18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
36611
36612- bpo-18409: Add unittest for AutoComplete. Patch by Phil Webster.
36613
36614- bpo-21477: htest.py - Improve framework, complete set of tests. Patches by
36615  Saimadhav Heblikar
36616
36617- bpo-18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
36618  consolidating and improving human-validated tests of Idle. Change other
36619  files as needed to work with htest.  Running the module as __main__ runs
36620  all tests.
36621
36622- bpo-21139: Change default paragraph width to 72, the :pep:`8`
36623  recommendation.
36624
36625- bpo-21284: Paragraph reformat test passes after user changes reformat
36626  width.
36627
36628- bpo-17654: Ensure IDLE menus are customized properly on OS X for
36629  non-framework builds and for all variants of Tk.
36630
36631- bpo-23180: Rename IDLE "Windows" menu item to "Window". Patch by Al
36632  Sweigart.
36633
36634Build
36635-----
36636
36637- bpo-15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the
36638  configure script.
36639
36640- bpo-22935: Allow the ssl module to be compiled if openssl doesn't support
36641  SSL 3.
36642
36643- bpo-22592: Drop support of the Borland C compiler to build Python. The
36644  distutils module still supports it to build extensions.
36645
36646- bpo-22591: Drop support of MS-DOS, especially of the DJGPP compiler
36647  (MS-DOS port of GCC).
36648
36649- bpo-16537: Check whether self.extensions is empty in setup.py. Patch by
36650  Jonathan Hosmer.
36651
36652- bpo-22359: Remove incorrect uses of recursive make.  Patch by Jonas
36653  Wagner.
36654
36655- bpo-21958: Define HAVE_ROUND when building with Visual Studio 2013 and
36656  above.  Patch by Zachary Turner.
36657
36658- bpo-18093: the programs that embed the CPython runtime are now in a
36659  separate "Programs" directory, rather than being kept in the Modules
36660  directory.
36661
36662- bpo-15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
36663  now display special message when and only when there are failures.
36664
36665- bpo-21141: The Windows build process no longer attempts to find Perl,
36666  instead relying on OpenSSL source being configured and ready to build.
36667  The ``PCbuild\build_ssl.py`` script has been re-written and re-named to
36668  ``PCbuild\prepare_ssl.py``, and takes care of configuring OpenSSL source
36669  for both 32 and 64 bit platforms.  OpenSSL sources obtained from
36670  svn.python.org will always be pre-configured and ready to build.
36671
36672- bpo-21037: Add a build option to enable AddressSanitizer support.
36673
36674- bpo-19962: The Windows build process now creates "python.bat" in the root
36675  of the source tree, which passes all arguments through to the most
36676  recently built interpreter.
36677
36678- bpo-21285: Refactor and fix curses configure check to always search in a
36679  ncursesw directory.
36680
36681- bpo-15234: For BerkeleyDB and Sqlite, only add the found library and
36682  include directories if they aren't already being searched. This avoids an
36683  explicit runtime library dependency.
36684
36685- bpo-17861: Tools/scripts/generate_opcode_h.py automatically regenerates
36686  Include/opcode.h from Lib/opcode.py if the latter gets any change.
36687
36688- bpo-20644: OS X installer build support for documentation build changes in
36689  3.4.1: assume externally supplied sphinx-build is available in /usr/bin.
36690
36691- bpo-20022: Eliminate use of deprecated bundlebuilder in OS X builds.
36692
36693- bpo-15968: Incorporated Tcl, Tk, and Tix builds into the Windows build
36694  solution.
36695
36696- bpo-17095: Fix Modules/Setup *shared* support.
36697
36698- bpo-21811: Anticipated fixes to support OS X versions > 10.9.
36699
36700- bpo-21166: Prevent possible segfaults and other random failures of python
36701  --generate-posix-vars in pybuilddir.txt build target.
36702
36703- bpo-18096: Fix library order returned by python-config.
36704
36705- bpo-17219: Add library build dir for Python extension cross-builds.
36706
36707- bpo-22919: Windows build updated to support VC 14.0 (Visual Studio 2015),
36708  which will be used for the official release.
36709
36710- bpo-21236: Build _msi.pyd with cabinet.lib instead of fci.lib
36711
36712- bpo-17128: Use private version of OpenSSL for OS X 10.5+ installer.
36713
36714C API
36715-----
36716
36717- bpo-14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo(),
36718  bytearray_getbuffer(), bytesiobuf_getbuffer() and array_buffer_getbuf().
36719  All functions now raise BufferError in that case.
36720
36721- bpo-22445: PyBuffer_IsContiguous() now implements precise contiguity
36722  tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation
36723  flag.  Previously the function reported false negatives for corner cases.
36724
36725- bpo-22079: PyType_Ready() now checks that statically allocated type has no
36726  dynamically allocated bases.
36727
36728- bpo-22453: Removed non-documented macro PyObject_REPR().
36729
36730- bpo-18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`,
36731  rename ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document
36732  these functions.
36733
36734- bpo-21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),
36735  PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) is now using
36736  ``calloc()`` instead of ``malloc()`` for large objects which is faster and
36737  use less memory.
36738
36739- bpo-20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to
36740  match what importlib does; this affects _frozen_importlib as well as any
36741  module loaded using imp.init_frozen().
36742
36743Documentation
36744-------------
36745
36746- bpo-19548: Update the codecs module documentation to better cover the
36747  distinction between text encodings and other codecs, together with other
36748  clarifications. Patch by Martin Panter.
36749
36750- bpo-22394: Doc/Makefile now supports ``make venv PYTHON=../python`` to
36751  create a venv for generating the documentation, e.g., ``make html
36752  PYTHON=venv/bin/python3``.
36753
36754- bpo-21514: The documentation of the json module now refers to new JSON RFC
36755  7159 instead of obsoleted RFC 4627.
36756
36757- bpo-21777: The binary sequence methods on bytes and bytearray are now
36758  documented explicitly, rather than assuming users will be able to derive
36759  the expected behaviour from the behaviour of the corresponding str
36760  methods.
36761
36762- bpo-6916: undocument deprecated asynchat.fifo class.
36763
36764- bpo-17386: Expanded functionality of the ``Doc/make.bat`` script to make
36765  it much more comparable to ``Doc/Makefile``.
36766
36767- bpo-21312: Update the thread_foobar.h template file to include newer
36768  threading APIs. Patch by Jack McCracken.
36769
36770- bpo-21043: Remove the recommendation for specific CA organizations and to
36771  mention the ability to load the OS certificates.
36772
36773- bpo-20765: Add missing documentation for PurePath.with_name() and
36774  PurePath.with_suffix().
36775
36776- bpo-19407: New package installation and distribution guides based on the
36777  Python Packaging Authority tools. Existing guides have been retained as
36778  legacy links from the distutils docs, as they still contain some required
36779  reference material for tool developers that isn't recorded anywhere else.
36780
36781- bpo-19697: Document cases where __main__.__spec__ is None.
36782
36783Tests
36784-----
36785
36786- bpo-18982: Add tests for CLI of the calendar module.
36787
36788- bpo-19548: Added some additional checks to test_codecs to ensure that
36789  statements in the updated documentation remain accurate. Patch by Martin
36790  Panter.
36791
36792- bpo-22838: All test_re tests now work with unittest test discovery.
36793
36794- bpo-22173: Update lib2to3 tests to use unittest test discovery.
36795
36796- bpo-16000: Convert test_curses to use unittest.
36797
36798- bpo-21456: Skip two tests in test_urllib2net.py if _ssl module not
36799  present. Patch by Remi Pointel.
36800
36801- bpo-20746: Fix test_pdb to run in refleak mode (-R).  Patch by Xavier de
36802  Gaye.
36803
36804- bpo-22060: test_ctypes has been somewhat cleaned up and simplified; it now
36805  uses unittest test discovery to find its tests.
36806
36807- bpo-22104: regrtest.py no longer holds a reference to the suite of tests
36808  loaded from test modules that don't define test_main().
36809
36810- bpo-22111: Assorted cleanups in test_imaplib.  Patch by Milan Oberkirch.
36811
36812- bpo-22002: Added ``load_package_tests`` function to test.support and used
36813  it to implement/augment test discovery in test_asyncio, test_email,
36814  test_importlib, test_json, and test_tools.
36815
36816- bpo-21976: Fix test_ssl to accept LibreSSL version strings.  Thanks to
36817  William Orr.
36818
36819- bpo-21918: Converted test_tools from a module to a package containing
36820  separate test files for each tested script.
36821
36822- bpo-9554: Use modern unittest features in test_argparse. Initial patch by
36823  Denver Coneybeare and Radu Voicilas.
36824
36825- bpo-20155: Changed HTTP method names in failing tests in test_httpservers
36826  so that packet filtering software (specifically Windows Base Filtering
36827  Engine) does not interfere with the transaction semantics expected by the
36828  tests.
36829
36830- bpo-19493: Refactored the ctypes test package to skip tests explicitly
36831  rather than silently.
36832
36833- bpo-18492: All resources are now allowed when tests are not run by
36834  regrtest.py.
36835
36836- bpo-21634: Fix pystone micro-benchmark: use floor division instead of true
36837  division to benchmark integers instead of floating point numbers. Set
36838  pystone version to 1.2. Patch written by Lennart Regebro.
36839
36840- bpo-21605: Added tests for Tkinter images.
36841
36842- bpo-21493: Added test for ntpath.expanduser().  Original patch by Claudiu
36843  Popa.
36844
36845- bpo-19925: Added tests for the spwd module. Original patch by Vajrasky
36846  Kok.
36847
36848- bpo-21522: Added Tkinter tests for Listbox.itemconfigure(),
36849  PanedWindow.paneconfigure(), and Menu.entryconfigure().
36850
36851- bpo-17756: Fix test_code test when run from the installed location.
36852
36853- bpo-17752: Fix distutils tests when run from the installed location.
36854
36855- bpo-18604: Consolidated checks for GUI availability.  All platforms now at
36856  least check whether Tk can be instantiated when the GUI resource is
36857  requested.
36858
36859- bpo-21275: Fix a socket test on KFreeBSD.
36860
36861- bpo-21223: Pass test_site/test_startup_imports when some of the extensions
36862  are built as builtins.
36863
36864- bpo-20635: Added tests for Tk geometry managers.
36865
36866- Add test case for freeze.
36867
36868- bpo-20743: Fix a reference leak in test_tcl.
36869
36870- bpo-21097: Move test_namespace_pkgs into test_importlib.
36871
36872- bpo-21503: Use test_both() consistently in test_importlib.
36873
36874- bpo-20939: Avoid various network test failures due to new redirect of
36875  http://www.python.org/ to https://www.python.org: use
36876  http://www.example.com instead.
36877
36878- bpo-20668: asyncio tests no longer rely on tests.txt file. (Patch by
36879  Vajrasky Kok)
36880
36881- bpo-21093: Prevent failures of ctypes test_macholib on OS X if a copy of
36882  libz exists in $HOME/lib or /usr/local/lib.
36883
36884- bpo-22770: Prevent some Tk segfaults on OS X when running gui tests.
36885
36886- bpo-23211: Workaround test_logging failure on some OS X 10.6 systems.
36887
36888- bpo-23345: Prevent test_ssl failures with large OpenSSL patch level values
36889  (like 0.9.8zc).
36890
36891Tools/Demos
36892-----------
36893
36894- bpo-22314: pydoc now works when the LINES environment variable is set.
36895
36896- bpo-22615: Argument Clinic now supports the "type" argument for the int
36897  converter. This permits using the int converter with enums and typedefs.
36898
36899- bpo-20076: The makelocalealias.py script no longer ignores UTF-8 mapping.
36900
36901- bpo-20079: The makelocalealias.py script now can parse the SUPPORTED file
36902  from glibc sources and supports command line options for source paths.
36903
36904- bpo-22201: Command-line interface of the zipfile module now correctly
36905  extracts ZIP files with directory entries.  Patch by Ryan Wilson.
36906
36907- bpo-22120: For functions using an unsigned integer return converter,
36908  Argument Clinic now generates a cast to that type for the comparison to -1
36909  in the generated code.  (This suppresses a compilation warning.)
36910
36911- bpo-18974: Tools/scripts/diff.py now uses argparse instead of optparse.
36912
36913- bpo-21906: Make Tools/scripts/md5sum.py work in Python 3. Patch by Zachary
36914  Ware.
36915
36916- bpo-21629: Fix Argument Clinic's "--converters" feature.
36917
36918- Add support for ``yield from`` to 2to3.
36919
36920- Add support for the :pep:`465` matrix multiplication operator to 2to3.
36921
36922- bpo-16047: Fix module exception list and __file__ handling in freeze.
36923  Patch by Meador Inge.
36924
36925- bpo-11824: Consider ABI tags in freeze. Patch by Meador Inge.
36926
36927- bpo-20535: PYTHONWARNING no longer affects the run_tests.py script. Patch
36928  by Arfrever Frehtes Taifersar Arahesis.
36929
36930Windows
36931-------
36932
36933- bpo-23260: Update Windows installer
36934
36935- The bundled version of Tcl/Tk has been updated to 8.6.3.  The most visible
36936  result of this change is the addition of new native file dialogs when
36937  running on Windows Vista or newer.  See Tcl/Tk's TIP 432 for more
36938  information.  Also, this version of Tcl/Tk includes support for Windows
36939  10.
36940
36941- bpo-17896: The Windows build scripts now expect external library sources
36942  to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
36943
36944- bpo-17717: The Windows build scripts now use a copy of NASM pulled from
36945  svn.python.org to build OpenSSL.
36946
36947- bpo-21907: Improved the batch scripts provided for building Python.
36948
36949- bpo-22644: The bundled version of OpenSSL has been updated to 1.0.1j.
36950
36951- bpo-10747: Use versioned labels in the Windows start menu. Patch by Olive
36952  Kilburn.
36953
36954- bpo-22980: .pyd files with a version and platform tag (for example,
36955  ".cp35-win32.pyd") will now be loaded in preference to those without tags.
36956
36957
36958**(For information about older versions, consult the HISTORY file.)**
36959